ItemSelectable, Serializable, ButtonModel, ActionButtonModelpublic class ActionRepeatableButtonModel extends DefaultButtonModel implements ActionButtonModel
ActionButtonModel interface and repeated invocation of action
listeners on mouse rollover. This is the default core action model set on
JCommandButtons.| Modifier and Type | Field | Description |
|---|---|---|
protected Timer |
autoRepeatTimer |
Timer for the auto-repeat action mode.
|
protected boolean |
toFireActionOnPress |
Indication whether the action is fired on mouse press (as opposed to
mouse release).
|
actionCommand, ARMED, changeEvent, ENABLED, group, listenerList, mnemonic, PRESSED, ROLLOVER, SELECTED, stateMask| Constructor | Description |
|---|---|
ActionRepeatableButtonModel(JCommandButton commandButton) |
Creates a new button model.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
isFireActionOnPress() |
Returns indication whether the associated actions should be fired on
mouse press instead of mouse release.
|
void |
setFireActionOnPress(boolean toFireActionOnPress) |
Sets indication whether the associated actions should be fired on mouse
press instead of mouse release.
|
void |
setPressed(boolean b) |
|
void |
setRollover(boolean b) |
addActionListener, addChangeListener, addItemListener, getActionCommand, getGroup, getMnemonic, isArmed, isEnabled, isPressed, isRollover, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setSelectedaddActionListener, addChangeListener, addItemListener, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getActionListeners, getChangeListeners, getGroup, getItemListeners, getListeners, getMnemonic, getSelectedObjects, isArmed, isEnabled, isPressed, isRollover, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setSelectedgetSelectedObjectsprotected Timer autoRepeatTimer
protected boolean toFireActionOnPress
public ActionRepeatableButtonModel(JCommandButton commandButton)
commandButton - The associated command button.public void setPressed(boolean b)
setPressed in interface ButtonModelsetPressed in class DefaultButtonModelpublic void setRollover(boolean b)
setRollover in interface ButtonModelsetRollover in class DefaultButtonModelpublic boolean isFireActionOnPress()
ActionButtonModelisFireActionOnPress in interface ActionButtonModeltrue if the associated actions are fired on mouse
press, false if the associated actions are fired on
mouse release.public void setFireActionOnPress(boolean toFireActionOnPress)
ActionButtonModelsetFireActionOnPress in interface ActionButtonModeltoFireActionOnPress - if true, the associated actions will be fired on
mouse press, otherwise the associated actions will be fired on
mouse release.