sky.monome.behavior
Class AbstractRadio<T extends AbstractRadio.AbstractRadioGroup<?,T>>

java.lang.Object
  extended by sky.monome.behavior.StaticBehavior
      extended by sky.monome.behavior.Member<T>
          extended by sky.monome.behavior.AbstractRadio<T>
Type Parameters:
T - Type of the associated radio group.
All Implemented Interfaces:
Behavior
Direct Known Subclasses:
OptionalRadio, Radio, SequencerRadio

public abstract class AbstractRadio<T extends AbstractRadio.AbstractRadioGroup<?,T>>
extends Member<T>

Behavior that creates mutual selections/unselections, like radio fields in a form. A radio behavior is associated to a radio group. The radio group is responsible for ensuring the unity of the selection inside the group.

Author:
PJ Skyman

Nested Class Summary
static class AbstractRadio.AbstractRadioGroup<T extends AbstractRadio<G>,G extends AbstractRadio.AbstractRadioGroup<T,G>>
          Radio group which is responsible for the permanent exclusivity of the last pressed radio button.
 
Nested classes/interfaces inherited from class sky.monome.behavior.Member
Member.Group<M extends Member<G>,G extends Member.Group<M,G>>
 
Field Summary
protected  T radioGroup
          Deprecated. Since SkyMonome v1.1, this field is not used anymore. Please use the field group instead.
 
Fields inherited from class sky.monome.behavior.Member
group
 
Fields inherited from class sky.monome.behavior.StaticBehavior
ledButtonCouple
 
Constructor Summary
AbstractRadio(T radioGroup)
          Constructs a radio behavior associated to the specified radio group.
 
Method Summary
 T getGroup()
          Deprecated. With a radio, it is recommended to use the getRadioGroup() method instead of this one.
 T getRadioGroup()
          Returns the radio group associated to this radio behavior.
protected  void off()
          Sets the led state of the registered led/button couple off.
 
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
 
Methods inherited from interface sky.monome.behavior.Behavior
init, notify
 

Field Detail

radioGroup

@Deprecated
protected final T extends AbstractRadio.AbstractRadioGroup<?,T> radioGroup
Deprecated. Since SkyMonome v1.1, this field is not used anymore. Please use the field group instead.
Associated radio group.

Constructor Detail

AbstractRadio

public AbstractRadio(T radioGroup)
Constructs a radio behavior associated to the specified radio group.

Parameters:
radioGroup - Radio group that will be associated to this radio behavior.
Method Detail

off

protected void off()
            throws MonomeException
Sets the led state of the registered led/button couple off. This method should only be called by radio groups when a radio button is pressed.

Throws:
MonomeException - When the led state can't be modified.

getRadioGroup

public T getRadioGroup()
Returns the radio group associated to this radio behavior.

Returns:
The radio group associated to this radio behavior.

getGroup

@Deprecated
public T getGroup()
Deprecated. With a radio, it is recommended to use the getRadioGroup() method instead of this one.

Returns the group associated to this member behavior.

Overrides:
getGroup in class Member<T extends AbstractRadio.AbstractRadioGroup<?,T>>
Returns:
The group associated to this member behavior.