com.sas.visuals
Class ToggleButtonModel

com.sas.visuals.ToggleButtonModel
All Implemented Interfaces:
ActionSource, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.ViewInterface, ButtonModelInterface, MultipleValueEventSourceInterface, java.awt.ItemSelectable, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.util.EventListener

public class ToggleButtonModel

ToggleButtonModel is a subclass of DefaultButtonModel. The ToggleButtonModel sets the selected state to its opposite after the mouse button is pressed and then released if the armed property is true.

Notes:


See Also:
ToggleButton, DefaultButtonModel, Serialized Form

Field Summary
protected  ToggleButton button
           
 
Fields inherited from class com.sas.visuals.DefaultButtonModel
actionCommand, actionListenerList, armed, disabled, itemListenerList, keyAccelerator, nextState, pressed, prevState, rollover, selected, selectionGroup, state, stateCount
 
Constructor Summary
ToggleButtonModel(ToggleButton btn)
          Constructor requires a ToggleButton object to select if the selectionGroup is not null.
 
Method Summary
 ToggleButton getButton()
          Get the button to be selected by the selectionGroup if one is set on the model.
 void setButton(ToggleButton btn)
          Set the button to be selected by the selectionGroup if one is set on the model.
 void setPressed(boolean p)
          Set the pressed state.
 
Methods inherited from class com.sas.visuals.DefaultButtonModel
addActionListener, addItemListener, getActionCommand, getKeyAccelerator, getNextState, getPrevState, getSelectedObjects, getSelectionGroup, getState, getStateCount, isArmed, isDisabled, isPressed, isRollover, isSelected, removeActionListener, removeItemListener, setActionCommand, setArmed, setDefaultValues, setDisabled, setKeyAccelerator, setRollover, setSelected, setSelectionGroup, setState
 

Field Detail

button

protected ToggleButton button
Constructor Detail

ToggleButtonModel

public ToggleButtonModel(ToggleButton btn)
Constructor requires a ToggleButton object to select if the selectionGroup is not null.

Method Detail

getButton

public ToggleButton getButton()
Get the button to be selected by the selectionGroup if one is set on the model.

Returns:
a ToggleButton button
See Also:
setButton(com.sas.visuals.ToggleButton)

setButton

public void setButton(ToggleButton btn)
Set the button to be selected by the selectionGroup if one is set on the model.

Parameters:
btn - a ToggleButton button
See Also:
getButton()

setPressed

public void setPressed(boolean p)
Set the pressed state. If set to false after being true and the model armed state is true, the selected state is also set to the opposite of what it currently is.

Specified by:
setPressed in interface ButtonModelInterface
Overrides:
setPressed in class DefaultButtonModel
Parameters:
p - the pressed state
See Also:
DefaultButtonModel.isPressed()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.