sky.monome.behavior
Class OptionalRadio
java.lang.Object
sky.monome.behavior.StaticBehavior
sky.monome.behavior.Member<T>
sky.monome.behavior.AbstractRadio<OptionalRadio.OptionalRadioGroup>
sky.monome.behavior.OptionalRadio
- All Implemented Interfaces:
- Behavior
public class OptionalRadio
- extends AbstractRadio<OptionalRadio.OptionalRadioGroup>
Behavior that creates mutual selections/unselections, like radio fields in a form.
An OptionalRadio
is associated to a OptionalRadioGroup
.
The OptionalRadioGroup
is responsible for ensuring the unity of the selection inside the group,
but you can deselect all radios by pressing on the currently selected one.
- Author:
- PJ Skyman
Nested Class Summary |
static class |
OptionalRadio.OptionalRadioGroup
Optional radio group which is responsible for the permanent exclusivity of the last pressed optional radio button. |
Fields inherited from class sky.monome.behavior.Member |
group |
Method Summary |
void |
init()
Initializes this optional radio behavior and the registered led/button couple. |
void |
notify(ButtonEvent.ButtonAction buttonAction)
Notifies this optional radio behavior that an action on the button is performed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptionalRadio
public OptionalRadio(OptionalRadio.OptionalRadioGroup optionalRadioGroup)
- Constructs an optional radio behavior associated to the specified optional radio group.
- Parameters:
optionalRadioGroup
- Optional radio group that will be associated to this optional radio behavior.
notify
public void notify(ButtonEvent.ButtonAction buttonAction)
throws MonomeException
- Notifies this optional radio behavior that an action on the button is performed.
- Parameters:
buttonAction
- Button action that is performed.
- Throws:
MonomeException
- When a led state can't be modified.
init
public void init()
throws MonomeException
- Initializes this optional radio behavior and the registered led/button couple.
Only led/button couples should call this method, and should call it only one time.
- Throws:
MonomeException
- When the initialization of this behavior and the registered led/button couple was not possible.