|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.visuals.DefaultButtonModel
public class DefaultButtonModel
DefaultButtonModel is an implementation of the ButtonModelInterface interface
that holds the state information for a specific button and sends out the Action
and Item events that the button forwards to its listeners.
DefaultButtonListener
,
BaseButton
,
ButtonListenerInterface
,
Serialized FormField Summary | |
---|---|
protected java.lang.String |
actionCommand
|
protected java.awt.event.ActionListener |
actionListenerList
|
protected boolean |
armed
|
protected boolean |
disabled
|
protected java.awt.event.ItemListener |
itemListenerList
|
protected char |
keyAccelerator
|
protected int |
nextState
|
protected boolean |
pressed
|
protected int |
prevState
|
protected boolean |
rollover
|
protected boolean |
selected
|
protected SelectionGroupInterface |
selectionGroup
|
protected int |
state
|
protected int |
stateCount
|
Constructor Summary | |
---|---|
DefaultButtonModel()
Default Constructor |
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
Adds the specified action listener to receive action events from this buttonModel. |
void |
addItemListener(java.awt.event.ItemListener listener)
Adds the specified item listener to receive item events from this buttonModel. |
java.lang.String |
getActionCommand()
Get the ActionCommand used when an ActionEvent is sent |
char |
getKeyAccelerator()
Get the key that is used to trigger the button. |
int |
getNextState()
Get the next state of the ButtonModel if it has multiple states. |
int |
getPrevState()
Get the prev state of the ButtonModel if it has multiple states. |
java.lang.Object[] |
getSelectedObjects()
Get the selected objects. |
SelectionGroupInterface |
getSelectionGroup()
Get the SelectionGroupInterface object used to provide a single selection behavior of a group of buttons. |
int |
getState()
Get the state of the buttonModel. |
int |
getStateCount()
Get the number of possible states for the buttonModel. |
boolean |
isArmed()
Return if the button is armed. |
boolean |
isDisabled()
Return if the button is disabled. |
boolean |
isPressed()
Return if the button is pressed. |
boolean |
isRollover()
Return if the button is rollover. |
boolean |
isSelected()
Return if the button is selected. |
void |
removeActionListener(java.awt.event.ActionListener l)
Removes the specified action listener so that it no longer receives action events from this buttonModel. |
void |
removeItemListener(java.awt.event.ItemListener l)
Removes the specified item listener so that it no longer receives item events from this buttonModel. |
void |
setActionCommand(java.lang.String cmd)
Set the ActionCommand used when an ActionEvent is sent |
void |
setArmed(boolean a)
Set the button armed state. |
void |
setDefaultValues()
Set the default internal values for the AnimationIconView. |
void |
setDisabled(boolean d)
Set the button disabled state. |
void |
setKeyAccelerator(char key)
Set the key that is used to trigger the button. |
void |
setPressed(boolean p)
Set the button pressed state. |
void |
setRollover(boolean r)
Set the button rollover state. |
void |
setSelected(boolean s)
Set the button selected state. |
void |
setSelectionGroup(SelectionGroupInterface group)
Set the selectionGroup used to provide singleSelection behavior to a group of buttons. |
void |
setState(int s)
Set the state of the button. |
Field Detail |
---|
protected java.lang.String actionCommand
protected char keyAccelerator
protected int nextState
protected int prevState
protected SelectionGroupInterface selectionGroup
protected int state
protected int stateCount
protected boolean armed
protected boolean disabled
protected boolean rollover
protected boolean pressed
protected boolean selected
protected transient java.awt.event.ActionListener actionListenerList
protected transient java.awt.event.ItemListener itemListenerList
Constructor Detail |
---|
public DefaultButtonModel()
Method Detail |
---|
public void addActionListener(java.awt.event.ActionListener listener)
addActionListener
in interface ActionSource
listener
- an object which handles ActionEvent events
the listener is not added a second time if it already exists
in the list of listeners for this event.ActionListener
,
removeActionListener(java.awt.event.ActionListener)
public void addItemListener(java.awt.event.ItemListener listener)
addItemListener
in interface java.awt.ItemSelectable
ItemListener
,
removeItemListener(java.awt.event.ItemListener)
public java.lang.String getActionCommand()
getActionCommand
in interface ButtonModelInterface
setActionCommand(java.lang.String)
,
ActionEvent
public char getKeyAccelerator()
getKeyAccelerator
in interface ButtonModelInterface
setKeyAccelerator(char)
public int getNextState()
getNextState
in interface ButtonModelInterface
public int getPrevState()
getPrevState
in interface ButtonModelInterface
public SelectionGroupInterface getSelectionGroup()
getSelectionGroup
in interface ButtonModelInterface
setSelectionGroup(com.sas.visuals.SelectionGroupInterface)
public java.lang.Object[] getSelectedObjects()
getSelectedObjects
in interface java.awt.ItemSelectable
ItemSelectable
public int getState()
getState
in interface ButtonModelInterface
setState(int)
public int getStateCount()
getStateCount
in interface ButtonModelInterface
public boolean isArmed()
isArmed
in interface ButtonModelInterface
setArmed(boolean)
public boolean isDisabled()
isDisabled
in interface ButtonModelInterface
setDisabled(boolean)
public boolean isRollover()
isRollover
in interface ButtonModelInterface
setRollover(boolean)
public boolean isPressed()
isPressed
in interface ButtonModelInterface
setPressed(boolean)
public boolean isSelected()
isSelected
in interface ButtonModelInterface
setSelected(boolean)
public void removeActionListener(java.awt.event.ActionListener l)
removeActionListener
in interface ActionSource
l
- an object which handles ActionEvent eventsActionListener
,
addActionListener(java.awt.event.ActionListener)
public void removeItemListener(java.awt.event.ItemListener l)
removeItemListener
in interface java.awt.ItemSelectable
ItemListener
,
addItemListener(java.awt.event.ItemListener)
public void setActionCommand(java.lang.String cmd)
setActionCommand
in interface ButtonModelInterface
getActionCommand()
,
ActionEvent
public void setArmed(boolean a)
setArmed
in interface ButtonModelInterface
armed
- true if armed, false otherwise.isArmed()
public void setDefaultValues()
setDefaultValues
in interface com.sas.ComponentInterface
setDefaultValues
in class com.sas.Component
ComponentInterface.setDefaultValues()
public void setDisabled(boolean d)
setDisabled
in interface ButtonModelInterface
disabled
- true if disabled, false otherwise.isDisabled()
public void setKeyAccelerator(char key)
setKeyAccelerator
in interface ButtonModelInterface
getKeyAccelerator()
public void setPressed(boolean p)
setPressed
in interface ButtonModelInterface
pressed
- true if pressed, false otherwise.isPressed()
public void setRollover(boolean r)
setRollover
in interface ButtonModelInterface
rollover
- true if rollover, false otherwise.isRollover()
public void setSelected(boolean s)
setSelected
in interface ButtonModelInterface
selected
- true if selected, false otherwise.isSelected()
,
ItemSelectable
public void setSelectionGroup(SelectionGroupInterface group)
setSelectionGroup
in interface ButtonModelInterface
selectionGroup
- selectionGroup to add button to.getSelectionGroup()
public void setState(int s)
setState
in interface ButtonModelInterface
state
- the button stategetState()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |