Class ActionRepeatableButtonModel
java.lang.Object
javax.swing.DefaultButtonModel
org.pushingpixels.flamingo.api.common.model.ActionRepeatableButtonModel
- All Implemented Interfaces:
ItemSelectable
,Serializable
,ButtonModel
,ActionButtonModel
Extension of the default button model that supports the
ActionButtonModel
interface and repeated invocation of action
listeners on mouse rollover. This is the default core action model set on
JCommandButton
s.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Timer
Timer for the auto-repeat action mode.protected boolean
Indication whether the action is fired on mouse press (as opposed to mouse release).Fields inherited from class javax.swing.DefaultButtonModel
actionCommand, ARMED, changeEvent, ENABLED, group, listenerList, mnemonic, PRESSED, ROLLOVER, SELECTED, stateMask
-
Constructor Summary
ConstructorsConstructorDescriptionActionRepeatableButtonModel
(JCommandButton commandButton) Creates a new button model. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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) Methods inherited from class javax.swing.DefaultButtonModel
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.swing.ButtonModel
addActionListener, addChangeListener, addItemListener, getActionCommand, getGroup, getMnemonic, isArmed, isEnabled, isPressed, isRollover, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setSelected
Methods inherited from interface java.awt.ItemSelectable
getSelectedObjects
-
Field Details
-
autoRepeatTimer
Timer for the auto-repeat action mode. -
toFireActionOnPress
protected boolean toFireActionOnPressIndication whether the action is fired on mouse press (as opposed to mouse release).
-
-
Constructor Details
-
ActionRepeatableButtonModel
Creates a new button model.- Parameters:
commandButton
- The associated command button.
-
-
Method Details
-
setPressed
public void setPressed(boolean b) - Specified by:
setPressed
in interfaceButtonModel
- Overrides:
setPressed
in classDefaultButtonModel
-
setRollover
public void setRollover(boolean b) - Specified by:
setRollover
in interfaceButtonModel
- Overrides:
setRollover
in classDefaultButtonModel
-
isFireActionOnPress
public boolean isFireActionOnPress()Description copied from interface:ActionButtonModel
Returns indication whether the associated actions should be fired on mouse press instead of mouse release.- Specified by:
isFireActionOnPress
in interfaceActionButtonModel
- Returns:
true
if the associated actions are fired on mouse press,false
if the associated actions are fired on mouse release.
-
setFireActionOnPress
public void setFireActionOnPress(boolean toFireActionOnPress) Description copied from interface:ActionButtonModel
Sets indication whether the associated actions should be fired on mouse press instead of mouse release.- Specified by:
setFireActionOnPress
in interfaceActionButtonModel
- Parameters:
toFireActionOnPress
- iftrue
, the associated actions will be fired on mouse press, otherwise the associated actions will be fired on mouse release.
-