public class ActionRepeatableButtonModel extends javax.swing.DefaultButtonModel implements ActionButtonModel
ActionButtonModel
interface and repeated invocation of action
listeners on mouse rollover. This is the default core action model set on
JCommandButton
s.Modifier and Type | Field and Description |
---|---|
protected javax.swing.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).
|
Constructor and Description |
---|
ActionRepeatableButtonModel(JCommandButton commandButton)
Creates a new button model.
|
Modifier and Type | Method and 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, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getActionListeners, getChangeListeners, getGroup, getItemListeners, getListeners, getMnemonic, getSelectedObjects, isArmed, isEnabled, isPressed, isRollover, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setSelected
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addActionListener, addChangeListener, addItemListener, getActionCommand, getMnemonic, isArmed, isEnabled, isPressed, isRollover, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setSelected
protected javax.swing.Timer autoRepeatTimer
protected boolean toFireActionOnPress
public ActionRepeatableButtonModel(JCommandButton commandButton)
commandButton
- The associated command button.public void setPressed(boolean b)
setPressed
in interface javax.swing.ButtonModel
setPressed
in class javax.swing.DefaultButtonModel
public void setRollover(boolean b)
setRollover
in interface javax.swing.ButtonModel
setRollover
in class javax.swing.DefaultButtonModel
public boolean isFireActionOnPress()
ActionButtonModel
isFireActionOnPress
in interface ActionButtonModel
true
if the associated actions are fired on mouse
press, false
if the associated actions are fired on
mouse release.public void setFireActionOnPress(boolean toFireActionOnPress)
ActionButtonModel
setFireActionOnPress
in interface ActionButtonModel
toFireActionOnPress
- if true
, the associated actions will be fired on
mouse press, otherwise the associated actions will be fired on
mouse release.