sky.monome.event.sequencer
Interface SequencerComponent<S extends SequencerComponent<S,B>,B extends ButtonManager<B>>

Type Parameters:
S - Type of sequencer components that implement this interface.
B - Type of button managers that are used by sequencer components that implement this interface.
All Known Subinterfaces:
Sequencer<S,B>
All Known Implementing Classes:
MultiSequencerGroup.SpecificSequencerGroup, SequencerGroup, SequencerPageSwitcher, SequencerPageSwitcher.SequencerPage

public interface SequencerComponent<S extends SequencerComponent<S,B>,B extends ButtonManager<B>>

Component of a sequencer, or sequencer itself (so it also implements Sequencer interface, which extends SequencerComponent). A sequencer component can have registered listeners to listen to sequencer events.

Author:
PJ Skyman

Method Summary
 void addSequencerListener(SequencerListener<S,B> sequencerListener)
          Adds the specified sequencer listener to the list of sequencer listeners.
 void fireStepChanged(S sequencerComponent, int activeStepNumber)
          Invoked when a step change occurs.
<T extends ButtonManager<?>>
T
getButtonManager(java.lang.Class<T> clazz, int number)
          Deprecated. Since this interface is parametrized, it is recommended to use getButtonManager(int) instead.
 B getButtonManager(int number)
          Returns the button manager of this sequencer component at the specified step number.
 B[] getButtonManagers()
          Returns an array of all button managers of this sequencer component.
<T extends ButtonManager<?>>
T[]
getButtonManagers(java.lang.Class<T> clazz)
          Deprecated. Since this interface is parametrized, it is recommended to use getButtonManagers() instead.
 SequencerListener<S,B>[] getSequencerListeners()
          Returns an array of all sequencer listeners.
 void removeSequencerListener(SequencerListener<S,B> sequencerListener)
          Removes the specified sequencer listener from the list of sequencer listeners.
 

Method Detail

addSequencerListener


void addSequencerListener(SequencerListener<S,B> sequencerListener)
Adds the specified sequencer listener to the list of sequencer listeners.

Parameters:
sequencerListener - Sequencer listener to add to the list of sequencer listeners.

removeSequencerListener


void removeSequencerListener(SequencerListener<S,B> sequencerListener)
Removes the specified sequencer listener from the list of sequencer listeners.

Parameters:
sequencerListener - Sequencer listener to remove from the list of sequencer listeners.

getSequencerListeners


SequencerListener<S,B>[] getSequencerListeners()
Returns an array of all sequencer listeners.

Returns:
An array of all sequencer listeners.

fireStepChanged


void fireStepChanged(S sequencerComponent,

                     int activeStepNumber)
Invoked when a step change occurs.

Parameters:
sequencerComponent - Sequencer component that triggered the sequencer event.

getButtonManagers


@Deprecated

<T extends ButtonManager<?>> T[] getButtonManagers(java.lang.Class<T> clazz)
Deprecated. Since this interface is parametrized, it is recommended to use getButtonManagers() instead.

Returns an array of all button managers of this sequencer component. Returned button managers are typed to the specified type.

Type Parameters:
T - Desired type for button managers. It should be a subclass of ButtonManager.
Parameters:
clazz - Class object that specify the return type for button managers.
Returns:
An array of all button managers of this sequencer component.
Throws:
java.lang.ClassCastException - When button managers can't be typed to the specified type.

getButtonManagers


B[] getButtonManagers()
Returns an array of all button managers of this sequencer component. Returned button managers are typed to the type defined by the class that implements this parametrized interface.

Returns:
An array of all button managers of this sequencer component.
Since:
SkyMonome v1.1

getButtonManager


@Deprecated

<T extends ButtonManager<?>> T getButtonManager(java.lang.Class<T> clazz,

                                                           int number)
Deprecated. Since this interface is parametrized, it is recommended to use getButtonManager(int) instead.

Returns the button manager of this sequencer component at the specified step number. The returned button manager is typed to the specified type.

Type Parameters:
T - Desired type for the button manager. It should be a subclass of ButtonManager.
Parameters:
clazz - Class object that specify the return type for the button manager.
number - Number of the button manager needed.
Returns:
The button manager of this sequencer component at the specified step number.
Throws:
java.lang.ClassCastException - When the button manager can't be typed to the specified type.

getButtonManager


B getButtonManager(int number)
Returns the button manager of this sequencer component at the specified step number. The returned button manager is typed to the type defined by the class that implements this parametrized interface.

Parameters:
number - Number of the button manager needed.
Returns:
The button manager of this sequencer component at the specified step number.
Since:
SkyMonome v1.1