~tapaal-contributor/tapaal/autodetect-lens-check2

« back to all changes in this revision

Viewing changes to src/net/tapaal/swinghelpers/ToggleButtonWithoutText.java

  • Committer: Jiri Srba
  • Date: 2020-08-24 09:50:07 UTC
  • mfrom: (1071.5.13 game-shortcut)
  • Revision ID: srba.jiri@gmail.com-20200824095007-94smlnnaod0sbr6r
merged in lp:~tapaal-contributor/tapaal/game-shortcuts adding shortcuts U/E/L for drawing uncontrolalble and urgent transitions

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package net.tapaal.swinghelpers;
2
2
 
3
3
import javax.swing.*;
 
4
import java.awt.*;
4
5
 
5
6
/**
6
7
 * A JToggleButton that without any text
9
10
 
10
11
    public ToggleButtonWithoutText(Action a) {
11
12
        super(a);
12
 
        if (a.getValue(Action.SMALL_ICON) != null) {
13
 
            // toggle buttons like to have images *and* text, nasty
14
 
            setText(null);
 
13
        if (a.getValue(Action.SMALL_ICON) == null) {
 
14
            setVisible(false);
15
15
        }
 
16
        setText(null);
 
17
 
16
18
        this.setRequestFocusEnabled(false);
17
19
    }
18
20