|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.action.input.robot.AbstractControl net.jinx.action.input.robot.ButtonControl net.jinx.action.input.robot.ToggleButtonControl
public abstract class ToggleButtonControl
ToggleButtonControl is an extension of ButtonControl that when pressed
flip-flops back and forth from on to off and back again. The act of pressing
it changes it's on/off state.
API Stability: Alpha.
Field Summary |
---|
Fields inherited from interface net.jinx.action.input.robot.Control |
---|
TYPE_AXIS, TYPE_BUTTON, TYPE_SLIDER, TYPE_TOGGLE |
Constructor Summary | |
---|---|
protected |
ToggleButtonControl(java.lang.String name,
boolean toggled)
Constructs a new ToggleButtonControl with the given name. |
Method Summary | |
---|---|
int |
getType()
Overriden to return Control.TYPE_TOGGLE. |
boolean |
isOn()
Returns the result of isToggled(). |
boolean |
isToggled()
Determines whether or not this ToggleButtonControl is currently toggled. |
protected void |
pressed()
Calls toggle(). |
protected void |
released()
Does nothing. |
void |
setToggled(boolean toggled)
Sets the state of this ToggleButtonControl. |
void |
toggle()
Triggers a state change for this ToggleButtonControl. |
protected abstract void |
toggled()
Called when this ToggleButtonControl has changed state. |
Methods inherited from class net.jinx.action.input.robot.ButtonControl |
---|
isPressed, setValue, valueChange |
Methods inherited from class net.jinx.action.input.robot.AbstractControl |
---|
getName, getValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ToggleButtonControl(java.lang.String name, boolean toggled)
name
- the name to use for this Control.toggled
- the initial state.Method Detail |
---|
public boolean isOn()
isOn
in class ButtonControl
public void setToggled(boolean toggled)
toggled
- the new state.public boolean isToggled()
public void toggle()
protected void pressed()
pressed
in class ButtonControl
protected void released()
released
in class ButtonControl
public int getType()
getType
in interface Control
getType
in class AbstractControl
protected abstract void toggled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |