Interface org.aswing.ButtonModel

Description

State Model for buttons. This model is used for check boxes and radio buttons, which are special kinds of buttons, as well as for normal buttons. For check boxes and radio buttons, pressing the mouse selects the button.

In use, a UI will invoke setSelected when a mouse click occurs over a check box or radio button.

Method Index

addChangeListener(), addSelectionListener(), isEnabled(), isPressed(), isReleased(), isRollOver(), isSelected(), setEnabled(), setGroup(), setPressed(), setReleased(), setRollOver(), setSelected()

Inherited from IEventDispatcher

Method Detail

addChangeListener

public function addChangeListener(func:Function, obj:Object):Object

Add a listener to listen the Model's change event.

When the button's state changed, the state is all about:

  • enabled
  • rollOver
  • pressed
  • released
  • selected

onStateChanged Event{source:ButtonModel}

Return

the listener added.

See Also

addSelectionListener

public function addSelectionListener(func:Function, obj:Object):Object

Add a listener to listen the Model's selection change event. When the button's selection changed, fired when diselected or selected.
onSelectionChanged Event{source:ButtonModel}

Return

the listener added.

See Also

isEnabled

public function isEnabled():Boolean

Indicates if the button can be selected or pressed by an input device (such as a mouse pointer).

isRollOver

public function isRollOver():Boolean

Indicates that the mouse is over the button.

isPressed

public function isPressed():Boolean

Indicates that the button has been pressed the and not be released yet.

This is not same as Java Swing's, this is some like Java Swing's Armed

isReleased

public function isReleased():Boolean

Indicates if button has been released. This is some like java Swing's pressed when released inside.

isSelected

public function isSelected():Boolean

Indicates if the button has been selected.

setEnabled

public function setEnabled(b:Boolean):Void

Enables or disables the button.

setRollOver

public function setRollOver(b:Boolean):Void

Sets or clears the button's rollover state.

setPressed

public function setPressed(b:Boolean):Void

Sets the button to being pressed or unpressed.

setReleased

public function setReleased(b:Boolean):Void

Sets the button to released or unreleased.

setSelected

public function setSelected(b:Boolean):Void

Selects or deselects the button.

setGroup

public function setGroup(group:ButtonGroup):Void

Identifies the group this button belongs to -- needed for radio buttons, which are mutually exclusive within their group.

Parameters

groupthe ButtonGroup this button belongs to