|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.draw2d.ButtonModel
A model for buttons containing several properties, including enabled, pressed, selected, rollover enabled and mouseover.
Field Summary | |
protected String |
actionName
The name of the action associated with this button. |
protected static int |
ARMED_FLAG
Flags for button states. |
static String |
ARMED_PROPERTY
Deprecated. This property will soon disappear since it is simply defined by (isPressed() & isRollover()) |
static int |
DEFAULT_FIRING_BEHAVIOR
Action performed events are not fired until the mouse button is released. |
protected static int |
ENABLED_FLAG
Flags for button states. |
static String |
ENABLED_PROPERTY
Enabled property |
protected org.eclipse.draw2d.ButtonStateTransitionListener |
firingBehavior
Listens to button state transitions and fires action performed events based on the desired behavior ( DEFAULT_FIRING_BEHAVIOR or REPEAT_FIRING_BEHAVIOR ). |
protected ButtonGroup |
group
The ButtonGroup this button belongs to (if any). |
protected static int |
MAX_FLAG
Flags for button states. |
protected static int |
MOUSEOVER_FLAG
Flags for button states. |
static String |
MOUSEOVER_PROPERTY
Mouseover property |
protected static int |
PRESSED_FLAG
Flags for button states. |
static String |
PRESSED_PROPERTY
Pressed property |
static int |
REPEAT_FIRING_BEHAVIOR
Action performed events fire repeatedly until the mouse button is released. |
protected static int |
ROLLOVER_ENABLED_FLAG
Flags for button states. |
static String |
ROLLOVER_ENABLED_PROPERTY
Rollover Enabled property |
protected static int |
SELECTED_FLAG
Flags for button states. |
static String |
SELECTED_PROPERTY
Selected property |
Constructor Summary | |
ButtonModel()
|
Method Summary | |
void |
addActionListener(ActionListener listener)
Registers the given listener as an ActionListener. |
void |
addChangeListener(ChangeListener listener)
Registers the given listener as a ChangeListener. |
void |
addStateTransitionListener(org.eclipse.draw2d.ButtonStateTransitionListener listener)
Registers the given listener as a ButtonStateTransitionListener. |
protected void |
fireActionPerformed()
Notifies any ActionListeners on this ButtonModel that an action has been performed. |
protected void |
fireCanceled()
Notifies any listening ButtonStateTransitionListener that the pressed state of this button has been cancelled. |
protected void |
firePressed()
Notifies any listening ButtonStateTransitionListener that this button has been pressed. |
protected void |
fireReleased()
Notifies any listening ButtonStateTransitionListener that this button has been released. |
protected void |
fireResume()
Notifies any listening ButtonStateTransitionListeners that this button has resumed activity. |
protected void |
fireStateChanged(String property)
Notifies any listening ChangeListeners that this button's state has changed. |
protected void |
fireSuspend()
Notifies any listening ButtonStateTransitionListeners that this button has suspended activity. |
ButtonGroup |
getGroup()
Returns the group to which this model belongs. |
Object |
getUserData()
Returns an object representing user data. |
protected void |
installFiringBehavior()
Sets the firing behavior for this button. |
boolean |
isArmed()
Returns true if this button is armed. |
boolean |
isEnabled()
Returns true if this button is enabled. |
boolean |
isMouseOver()
Returns true if the mouse is over this button. |
boolean |
isPressed()
Returns true if this button is pressed. |
boolean |
isSelected()
Returns the selection state of this model. |
void |
removeActionListener(ActionListener listener)
Removes the given ActionListener. |
void |
removeChangeListener(ChangeListener listener)
Removes the given ChangeListener. |
void |
removeStateTransitionListener(org.eclipse.draw2d.ButtonStateTransitionListener listener)
Removes the given ButtonStateTransitionListener. |
void |
setArmed(boolean value)
Sets this button to be armed. |
void |
setEnabled(boolean value)
Sets this button to be enabled. |
void |
setFiringBehavior(int type)
Sets the firing behavior for this button. |
void |
setGroup(ButtonGroup bg)
Sets the ButtonGroup to which this model belongs to. |
void |
setMouseOver(boolean value)
Sets the mouseover property of this button. |
void |
setPressed(boolean value)
Sets the pressed property of this button. |
void |
setSelected(boolean value)
Sets this button to be selected. |
void |
setUserData(Object data)
Sets user data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String ENABLED_PROPERTY
public static final String PRESSED_PROPERTY
public static final String SELECTED_PROPERTY
public static final String ROLLOVER_ENABLED_PROPERTY
public static final String MOUSEOVER_PROPERTY
public static final String ARMED_PROPERTY
protected static final int ARMED_FLAG
protected static final int PRESSED_FLAG
protected static final int MOUSEOVER_FLAG
protected static final int SELECTED_FLAG
protected static final int ENABLED_FLAG
protected static final int ROLLOVER_ENABLED_FLAG
protected static final int MAX_FLAG
public static final int DEFAULT_FIRING_BEHAVIOR
public static final int REPEAT_FIRING_BEHAVIOR
protected String actionName
protected ButtonGroup group
protected org.eclipse.draw2d.ButtonStateTransitionListener firingBehavior
DEFAULT_FIRING_BEHAVIOR
or REPEAT_FIRING_BEHAVIOR
).
Constructor Detail |
public ButtonModel()
Method Detail |
public void addActionListener(ActionListener listener)
listener
- The ActionListener to addpublic void addChangeListener(ChangeListener listener)
listener
- The ChangeListener to addpublic void addStateTransitionListener(org.eclipse.draw2d.ButtonStateTransitionListener listener)
listener
- The ButtonStateTransitionListener to addprotected void fireActionPerformed()
protected void fireCanceled()
protected void firePressed()
protected void fireReleased()
protected void fireResume()
protected void fireStateChanged(String property)
property
- The name of the property that changedprotected void fireSuspend()
public ButtonGroup getGroup()
public Object getUserData()
protected void installFiringBehavior()
public boolean isArmed()
true
if this button is armed. If a button is armed, it will fire
an ActionPerformed when released.
true
if this button is armedpublic boolean isEnabled()
true
if this button is enabled.
true
if this button is enabledpublic boolean isMouseOver()
true
if the mouse is over this button.
true
if the mouse is over this buttonpublic boolean isPressed()
true
if this button is pressed.
true
if this button is pressedpublic boolean isSelected()
true
if this button is selectedpublic void removeActionListener(ActionListener listener)
listener
- The ActionListener to removepublic void removeChangeListener(ChangeListener listener)
listener
- The ChangeListener to removepublic void removeStateTransitionListener(org.eclipse.draw2d.ButtonStateTransitionListener listener)
listener
- The ButtonStateTransitionListener to removepublic void setArmed(boolean value)
value
- The armed statepublic void setEnabled(boolean value)
value
- The enabled statepublic void setFiringBehavior(int type)
DEFAULT_FIRING_BEHAVIOR
is the
default behavior, where action performed events are not fired until the mouse button is
released. REPEAT_FIRING_BEHAVIOR
causes action performed events to fire
repeatedly until the mouse button is released.
type
- The firing behavior typepublic void setGroup(ButtonGroup bg)
bg
- The group to which this model belongs.public void setMouseOver(boolean value)
value
- The value the mouseover property will be set topublic void setPressed(boolean value)
value
- The value the pressed property will be set topublic void setSelected(boolean value)
value
- The value the selected property will be set topublic void setUserData(Object data)
data
- The user data
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |