|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sky.monome.behavior.DynamicBehavior
public abstract class DynamicBehavior
Behavior that can make animation in time, like blinking effect.
All subclasses of this class should start the internal thread at the initialization by calling
DynamicBehavior.startThread()
method.
Behavior.init()
Nested Class Summary | |
---|---|
static class |
DynamicBehavior.DynamicBehaviorType
Type of dynamicity. |
Field Summary | |
---|---|
protected DynamicBehavior.DynamicBehaviorType |
dynamicBehaviorType
Type of dynamicity. |
protected LedButtonCouple |
ledButtonCouple
Registered led/button couple. |
protected java.lang.Thread |
thread
Thread that is responsible for animate this behavior. |
Constructor Summary | |
---|---|
DynamicBehavior(DynamicBehavior.DynamicBehaviorType dynamicBehaviorType)
Constructs a dynamic behavior with the specified type of dynamicity. |
Method Summary | |
---|---|
abstract void |
action()
Invoked when the behavior must execute its perpetual or one-time action. |
LedButtonCouple |
getLedButtonCouple()
Returns the led/button couple registered with this behavior. |
void |
setLedButtonCouple(LedButtonCouple ledButtonCouple)
Modifies the led/button couple registered with this behavior. |
protected void |
startThread()
Starts the activity of this dynamic behavior. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface sky.monome.behavior.Behavior |
---|
init, notify |
Field Detail |
---|
protected final DynamicBehavior.DynamicBehaviorType dynamicBehaviorType
protected LedButtonCouple ledButtonCouple
protected final java.lang.Thread thread
Constructor Detail |
---|
public DynamicBehavior(DynamicBehavior.DynamicBehaviorType dynamicBehaviorType)
dynamicBehaviorType
- Type of dynamicity to adopt in this behavior.Method Detail |
---|
public abstract void action() throws java.lang.InterruptedException, MonomeException
java.lang.InterruptedException
- When the virtual machine stops while a sleep operation.
MonomeException
- When the action can't be executed without any error.
Typically, led state modifications can raise this exception.public LedButtonCouple getLedButtonCouple()
getLedButtonCouple
in interface Behavior
public void setLedButtonCouple(LedButtonCouple ledButtonCouple) throws MonomeException
MonomeException
is raised.
setLedButtonCouple
in interface Behavior
ledButtonCouple
- New led/button couple to register with this behavior.
MonomeException
- When this behavior is already registered with a led/button couple when this method is called.protected void startThread()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |