org.pushingpixels.flamingo.api.common.model
Class ActionToggleButtonModel

java.lang.Object
  extended by javax.swing.DefaultButtonModel
      extended by javax.swing.JToggleButton.ToggleButtonModel
          extended by org.pushingpixels.flamingo.api.common.model.ActionToggleButtonModel
All Implemented Interfaces:
ItemSelectable, Serializable, ButtonModel, ActionButtonModel

public class ActionToggleButtonModel
extends JToggleButton.ToggleButtonModel
implements ActionButtonModel

Extension of the default toggle button model that supports the ActionButtonModel interface. This is the default core action model set on JCommandToggleButtons.

See Also:
Serialized Form

Field Summary
protected  boolean toFireActionOnPress
          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
ActionToggleButtonModel(boolean toFireActionOnPress)
          Creates a new model.
 
Method Summary
 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)
           
 
Methods inherited from class javax.swing.JToggleButton.ToggleButtonModel
isSelected, setSelected
 
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, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setRollover
 
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, getMnemonic, isArmed, isEnabled, isPressed, isRollover, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setRollover, setSelected
 
Methods inherited from interface java.awt.ItemSelectable
getSelectedObjects
 

Field Detail

toFireActionOnPress

protected boolean toFireActionOnPress
Indication whether the action is fired on mouse press (as opposed to mouse release).

Constructor Detail

ActionToggleButtonModel

public ActionToggleButtonModel(boolean toFireActionOnPress)
Creates a new model.

Parameters:
toFireActionOnPress - If true, the action will be fired on mouse press, if false, the action will be fired on mouse release.
Method Detail

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 interface ActionButtonModel
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 interface ActionButtonModel
Parameters:
toFireActionOnPress - if true, the associated actions will be fired on mouse press, otherwise the associated actions will be fired on mouse release.

setPressed

public void setPressed(boolean b)
Specified by:
setPressed in interface ButtonModel
Overrides:
setPressed in class JToggleButton.ToggleButtonModel