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


java.lang.Object

  extended by sky.monome.behavior.Member.Group<T,G>

      extended by sky.monome.behavior.AbstractRadio.AbstractRadioGroup<T,G>

Type Parameters:
T - Type of radio behaviors that this radio group will contain.
G - Type of radio group that extends this abstract radio group.
All Implemented Interfaces:
ButtonManager<G>
Direct Known Subclasses:
OptionalRadio.OptionalRadioGroup, Radio.RadioGroup, SequencerRadio.SequencerRadioGroup
Enclosing class:
AbstractRadio<T extends AbstractRadio.AbstractRadioGroup<?,T>>

public abstract static class AbstractRadio.AbstractRadioGroup<T extends AbstractRadio<G>,G extends AbstractRadio.AbstractRadioGroup<T,G>>
extends Member.Group<T,G>

Radio group which is responsible for the permanent exclusivity of the last pressed radio button.

Author:
PJ Skyman

Field Summary
protected  SynchronizedList<T> radios
          Deprecated. Since SkyMonome v1.1, this field is not used anymore. Please use the field members instead.
 
Fields inherited from class sky.monome.behavior.Member.Group
eventListenerList, members
 
Constructor Summary
AbstractRadio.AbstractRadioGroup()
          Constructs a radio group.
 
Method Summary
protected  void addMember(T member)
          Deprecated. With a radio group, it is recommended to use the addRadio(T) method instead of this one.
protected abstract  void addRadio(T radio)
          Adds the specified radio behavior to the list of associated radio behaviors.
 T getActiveRadio()
          Returns the currently selected radio behavior, or null if none is selected.
 int getRadiosNumber()
          Returns the number of associated radio behaviors.
 void initRadio(T radio)
          Initializes the specified radio behavior in the context of this radio group.
protected  void notify(T radio)
          Notifies that the specified radio behavior is itself notified (the led/button couple notified its behavior).
protected  void notify(T member, ButtonEvent.ButtonAction buttonAction)
          Deprecated. With a radio group, it is recommended to use the notify(T) method instead of this one, because radio groups are notified only with button press actions.
 
Methods inherited from class sky.monome.behavior.Member.Group
addButtonListener, fireButtonActionned, getButtonListeners, getMembersNumber, removeButtonListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radios


@Deprecated

protected final SynchronizedList<T extends AbstractRadio<G>> radios
Deprecated. Since SkyMonome v1.1, this field is not used anymore. Please use the field members instead.
List of all radio behaviors associated with this radio group.

Constructor Detail

AbstractRadio.AbstractRadioGroup


public AbstractRadio.AbstractRadioGroup()
Constructs a radio group.

Method Detail

getActiveRadio


public T getActiveRadio()
Returns the currently selected radio behavior, or null if none is selected.

Returns:
The currently selected radio behavior, or null if none is selected.

addRadio


protected abstract void addRadio(T radio)

                          throws MonomeException
Adds the specified radio behavior to the list of associated radio behaviors.

Parameters:
radio - Radio behavior to add to the list of associated radio behaviors.
Throws:
MonomeException - In special cases, when a led state can't be initialized.

addMember


@Deprecated

protected void addMember(T member)

                  throws MonomeException
Deprecated. With a radio group, it is recommended to use the addRadio(T) method instead of this one.

Adds the specified member behavior to the list of associated member behaviors.

Specified by:
addMember in class Member.Group<T extends AbstractRadio<G>,G extends AbstractRadio.AbstractRadioGroup<T,G>>
Parameters:
member - Member behavior to add to the list of associated member behaviors.
Throws:
MonomeException - In special cases, when a led state can't be initialized.
Since:
SkyMonome v1.1

getRadiosNumber


public int getRadiosNumber()
Returns the number of associated radio behaviors.

Returns:
The number of associated radio behaviors.
Since:
SkyMonome v1.1

notify


protected void notify(T radio)

               throws MonomeException
Notifies that the specified radio behavior is itself notified (the led/button couple notified its behavior).

Parameters:
radio - Radio behavior that notifies this radio group.
Throws:
MonomeException - When a led state can't be modified.

notify


@Deprecated

protected void notify(T member,

                                 ButtonEvent.ButtonAction buttonAction)

               throws MonomeException
Deprecated. With a radio group, it is recommended to use the notify(T) method instead of this one, because radio groups are notified only with button press actions.

Notifies that the specified member behavior is itself notified (the led/button couple notified its behavior).

Specified by:
notify in class Member.Group<T extends AbstractRadio<G>,G extends AbstractRadio.AbstractRadioGroup<T,G>>
Parameters:
member - Member behavior that notifies this group.
buttonAction - Button action associated to this notification.
Throws:
MonomeException - When a led state can't be modified.
Since:
SkyMonome v1.1

initRadio


public void initRadio(T radio)

               throws MonomeException
Initializes the specified radio behavior in the context of this radio group.

Parameters:
radio - Radio behavior that must be initialized.
Throws:
MonomeException - When a led state can't be modified.