|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sky.monome.behavior.StaticBehavior sky.monome.behavior.Toggle
public class Toggle
Toggle behavior. This behavior change its state by pressing the button, in a bistable manner.
Nested Class Summary | |
---|---|
static class |
Toggle.ToggleType
Type of behavior. |
Field Summary | |
---|---|
protected boolean |
on
Indicates if the state of this behavior is actually on. |
protected Toggle.ToggleType |
toggleType
Type of behavior. |
Fields inherited from class sky.monome.behavior.StaticBehavior |
---|
ledButtonCouple |
Constructor Summary | |
---|---|
Toggle()
Constructs a toggle behavior with the default type ToggleType.INITIALIZED_OFF . |
|
Toggle(Toggle.ToggleType toggleType)
Constructs a toggle behavior with the specified type. |
Method Summary | |
---|---|
void |
init()
Initializes this behavior and the registered led/button couple. |
boolean |
isOn()
Indicates if this toggle is currently on. |
void |
notify(ButtonEvent.ButtonAction buttonAction)
Notifies this behavior that an action on the button is performed. |
Methods inherited from class sky.monome.behavior.StaticBehavior |
---|
getLedButtonCouple, setLedButtonCouple |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean on
protected final Toggle.ToggleType toggleType
Constructor Detail |
---|
public Toggle()
ToggleType.INITIALIZED_OFF
.
public Toggle(Toggle.ToggleType toggleType)
toggleType
- Type of behavior to adopt.Method Detail |
---|
public void notify(ButtonEvent.ButtonAction buttonAction) throws MonomeException
buttonAction
- Button action that is performed.
MonomeException
- When the led state can't be modified.public boolean isOn()
true
if this toggle is currently on, false
otherwise.public void init()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |