72 protected EventListenerList listenerList = new EventListenerList(); 73 74 // controls the usage of the MenuItem.disabledAreNavigable UIDefaults 75 // property in the setArmed() method 76 private boolean menuItem = false; 77 78 /** 79 * Constructs a <code>DefaultButtonModel</code>. 80 * 81 */ 82 public DefaultButtonModel() { 83 stateMask = 0; 84 setEnabled(true); 85 } 86 87 /** 88 * Identifies the "armed" bit in the bitmask, which 89 * indicates partial commitment towards choosing/triggering 90 * the button. 91 */ 92 public final static int ARMED = 1 << 0; 93 94 /** 95 * Identifies the "selected" bit in the bitmask, which 96 * indicates that the button has been selected. Only needed for 97 * certain types of buttons - such as radio button or check box. 98 */ 99 public final static int SELECTED = 1 << 1; 100 101 /** 102 * Identifies the "pressed" bit in the bitmask, which 103 * indicates that the button is pressed. 104 */ 105 public final static int PRESSED = 1 << 2; 106 107 /** 108 * Identifies the "enabled" bit in the bitmask, which 109 * indicates that the button can be selected by 110 * an input device (such as a mouse pointer). 111 */ 112 public final static int ENABLED = 1 << 3; 113 114 /** 115 * Identifies the "rollover" bit in the bitmask, which 116 * indicates that the mouse is over the button. 117 */ 118 public final static int ROLLOVER = 1 << 4; 119 120 /** 121 * {@inheritDoc} 122 */ 123 public void setActionCommand(String actionCommand) { 124 this.actionCommand = actionCommand; 125 } 126 127 /** 128 * {@inheritDoc} 129 */ 130 public String getActionCommand() { 131 return actionCommand; 132 } 133 134 /** 135 * {@inheritDoc} 136 */ 137 public boolean isArmed() { 138 return (stateMask & ARMED) != 0; | 72 protected EventListenerList listenerList = new EventListenerList(); 73 74 // controls the usage of the MenuItem.disabledAreNavigable UIDefaults 75 // property in the setArmed() method 76 private boolean menuItem = false; 77 78 /** 79 * Constructs a <code>DefaultButtonModel</code>. 80 * 81 */ 82 public DefaultButtonModel() { 83 stateMask = 0; 84 setEnabled(true); 85 } 86 87 /** 88 * Identifies the "armed" bit in the bitmask, which 89 * indicates partial commitment towards choosing/triggering 90 * the button. 91 */ 92 public static final int ARMED = 1 << 0; 93 94 /** 95 * Identifies the "selected" bit in the bitmask, which 96 * indicates that the button has been selected. Only needed for 97 * certain types of buttons - such as radio button or check box. 98 */ 99 public static final int SELECTED = 1 << 1; 100 101 /** 102 * Identifies the "pressed" bit in the bitmask, which 103 * indicates that the button is pressed. 104 */ 105 public static final int PRESSED = 1 << 2; 106 107 /** 108 * Identifies the "enabled" bit in the bitmask, which 109 * indicates that the button can be selected by 110 * an input device (such as a mouse pointer). 111 */ 112 public static final int ENABLED = 1 << 3; 113 114 /** 115 * Identifies the "rollover" bit in the bitmask, which 116 * indicates that the mouse is over the button. 117 */ 118 public static final int ROLLOVER = 1 << 4; 119 120 /** 121 * {@inheritDoc} 122 */ 123 public void setActionCommand(String actionCommand) { 124 this.actionCommand = actionCommand; 125 } 126 127 /** 128 * {@inheritDoc} 129 */ 130 public String getActionCommand() { 131 return actionCommand; 132 } 133 134 /** 135 * {@inheritDoc} 136 */ 137 public boolean isArmed() { 138 return (stateMask & ARMED) != 0; |