| Package | org.aswing |
| Interface | public interface ButtonModel |
| Implementors | DefaultButtonModel |
In use, a UI will invoke setSelected when a mouse
click occurs over a check box or radio button. It will invoke
setArmedsetPressedsetArmed(false) will tell the button not to fire
when it sees setPressed. (If the mouse travels
back in, the button will be rearmed.)
Buttons always fire programmatic=false InteractiveEvent.
| Method | Defined by | ||
|---|---|---|---|
|
addActionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Adds a listener to listen the Model's act event.
| ButtonModel | ||
|
addSelectionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a listener to listen the Model's selection change event.
| ButtonModel | ||
|
addStateListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Adds a listener to listen the Model's state change event.
| ButtonModel | ||
|
isArmed():Boolean
Indicates partial commitment towards pressing the button.
| ButtonModel | ||
|
isEnabled():Boolean
Indicates if the button can be selected or pressed by an input device (such as a mouse pointer).
| ButtonModel | ||
|
isPressed():Boolean
Indicates if button has been pressed.
| ButtonModel | ||
|
isRollOver():Boolean
Indicates that the mouse is over the button.
| ButtonModel | ||
|
isSelected():Boolean
Indicates if the button has been selected.
| ButtonModel | ||
|
removeActionListener(listener:Function):void
Removes a action listener.
| ButtonModel | ||
|
removeSelectionListener(listener:Function):void
Removes a selection listener.
| ButtonModel | ||
|
removeStateListener(listener:Function):void
Removes a state listener.
| ButtonModel | ||
|
setArmed(b:Boolean):void
Marks the button as "armed".
| ButtonModel | ||
|
setEnabled(b:Boolean):void
Enables or disables the button.
| ButtonModel | ||
|
setGroup(group:ButtonGroup):void
Identifies the group this button belongs to --
needed for radio buttons, which are mutually
exclusive within their group.
| ButtonModel | ||
|
setPressed(b:Boolean):void
Sets the button to being pressed or unpressed.
| ButtonModel | ||
|
setRollOver(b:Boolean):void
Sets or clears the button's rollover state
| ButtonModel | ||
|
setSelected(b:Boolean):void
Selects or deselects the button.
| ButtonModel | ||
| addActionListener | () | method |
public function addActionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):voidAdds a listener to listen the Model's act event. When the button model's armed and pressed to fire this event.
Parameterslistener:Function — the listener
|
|
priority:int (default = 0) — the priority
|
|
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak.
|
See also
| addSelectionListener | () | method |
public function addSelectionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):voidAdd a listener to listen the Model's selection change event. When the button's selection changed, fired when diselected or selected.
Parameterslistener:Function — the listener
|
|
priority:int (default = 0) — the priority
|
|
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak.
|
See also
| addStateListener | () | method |
public function addStateListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):voidAdds a listener to listen the Model's state change event.
When the button's state changed, the state is all about:
Buttons always fire programmatic=false InteractiveEvent.
listener:Function — the listener
|
|
priority:int (default = 0) — the priority
|
|
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak.
|
See also
| isArmed | () | method |
public function isArmed():BooleanIndicates partial commitment towards pressing the button.
Note, this is similar to AS2 version's both pressed and rollover.
ReturnsBoolean — true if the button is armed, and ready to be pressed
|
| isEnabled | () | method |
public function isEnabled():BooleanIndicates if the button can be selected or pressed by an input device (such as a mouse pointer).
ReturnsBoolean — true if the button is enabled, and therefore selectable (or pressable)
|
| isPressed | () | method |
public function isPressed():BooleanIndicates if button has been pressed.
ReturnsBoolean — true if the button has been pressed
|
| isRollOver | () | method |
public function isRollOver():BooleanIndicates that the mouse is over the button.
ReturnsBoolean — true if the mouse is over the button
|
| isSelected | () | method |
public function isSelected():BooleanIndicates if the button has been selected.
ReturnsBoolean |
| removeActionListener | () | method |
public function removeActionListener(listener:Function):voidRemoves a action listener.
Parameterslistener:Function — the listener to be removed.
|
See also
| removeSelectionListener | () | method |
public function removeSelectionListener(listener:Function):voidRemoves a selection listener.
Parameterslistener:Function — the listener to be removed.
|
See also
| removeStateListener | () | method |
public function removeStateListener(listener:Function):voidRemoves a state listener.
Parameterslistener:Function — the listener to be removed.
|
See also
| setArmed | () | method |
public function setArmed(b:Boolean):voidMarks the button as "armed". If the mouse button is released while it is over this item, the button's action event fires. If the mouse button is released elsewhere, the event does not fire and the button is disarmed.
Parametersb:Boolean — true to arm the button so it can be selected
|
| setEnabled | () | method |
public function setEnabled(b:Boolean):voidEnables or disables the button.
Parametersb:Boolean |
| setGroup | () | method |
public function setGroup(group:ButtonGroup):voidIdentifies the group this button belongs to -- needed for radio buttons, which are mutually exclusive within their group.
Parametersgroup:ButtonGroup — the ButtonGroup this button belongs to
|
| setPressed | () | method |
public function setPressed(b:Boolean):voidSets the button to being pressed or unpressed.
Parametersb:Boolean |
| setRollOver | () | method |
public function setRollOver(b:Boolean):voidSets or clears the button's rollover state
Parametersb:Boolean — true to turn on rollover
|
See also
| setSelected | () | method |
public function setSelected(b:Boolean):voidSelects or deselects the button.
Parametersb:Boolean — true selects the button,
false deselects the button.
|