sky.monome.event.button
Class FilteredButtonListener<B extends ButtonManager<B>>

java.lang.Object
  extended by sky.monome.event.GenericListenerWithArguments
      extended by sky.monome.event.button.ButtonListenerWithArguments<B>
          extended by sky.monome.event.button.FilteredButtonListener<B>
Type Parameters:
B - Type of button manager that is used with button listeners.
All Implemented Interfaces:
java.util.EventListener, ButtonListener<B>

public abstract class FilteredButtonListener<B extends ButtonManager<B>>
extends ButtonListenerWithArguments<B>

Filtered button listener. This is a special implementation of the ButtonListener interface that is specialized in basic filtering of button actions. Implementations of this abstract class will be notified only when the filter value is met.

Since:
SkyMonome v1.2
Author:
PJ Skyman

Field Summary
 
Fields inherited from class sky.monome.event.GenericListenerWithArguments
arguments
 
Constructor Summary
FilteredButtonListener(ButtonEvent.ButtonAction buttonActionFilter, java.lang.Object... arguments)
          Constructs a filtered button listener with specified arguments and the specified filter value.
FilteredButtonListener(java.lang.Object... arguments)
          Constructs a filtered button listener with specified arguments.
 
Method Summary
 void buttonActionned(ButtonEvent<B> buttonEvent)
          Invoked when a button actionning occurs.
abstract  void filteredButtonActionned(ButtonEvent<B> buttonEvent)
          Invoked when a filtered actionning occurs.
 ButtonEvent.ButtonAction getButtonActionFilter()
          Returns the filter value that will must be met in order to notify implementations of this abstract class that a button has been actionned.
 void setButtonActionFilter(ButtonEvent.ButtonAction buttonActionFilter)
          Modifies the filter value that will must be met in order to notify implementations of this abstract class that a button has been actionned.
 
Methods inherited from class sky.monome.event.GenericListenerWithArguments
getArgument, getArgument, getArguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilteredButtonListener

public FilteredButtonListener(java.lang.Object... arguments)
Constructs a filtered button listener with specified arguments. The default value for the filter is ButtonAction.BUTTON_PUSHED.

Parameters:
arguments - Arguments which can be used in the filteredButtonActionned(ButtonEvent) method. These arguments are optional. The presence of these arguments is due to this class which extends ButtonListenerWithArguments.

FilteredButtonListener

public FilteredButtonListener(ButtonEvent.ButtonAction buttonActionFilter,
                              java.lang.Object... arguments)
Constructs a filtered button listener with specified arguments and the specified filter value.

Parameters:
buttonActionFilter - Filter value that will must be met in order to notify implementations of this abstract class that a button has been actionned.
arguments - Arguments which can be used in the filteredButtonActionned(ButtonEvent) method. These arguments are optional. The presence of these arguments is due to this class which extends ButtonListenerWithArguments.
Method Detail

getButtonActionFilter

public ButtonEvent.ButtonAction getButtonActionFilter()
Returns the filter value that will must be met in order to notify implementations of this abstract class that a button has been actionned.

Returns:
The filter value that will must be met in order to notify implementations of this abstract class that a button has been actionned.

setButtonActionFilter

public void setButtonActionFilter(ButtonEvent.ButtonAction buttonActionFilter)
Modifies the filter value that will must be met in order to notify implementations of this abstract class that a button has been actionned.

Parameters:
buttonActionFilter - New filter value that will must be met in order to notify implementations of this abstract class that a button has been actionned.

buttonActionned

public void buttonActionned(ButtonEvent<B> buttonEvent)
Invoked when a button actionning occurs. This implementation verifies that the filter value is met, and if true, calls the filteredButtonActionned(ButtonEvent) method.

Parameters:
buttonEvent - Informations about the button event.

filteredButtonActionned

public abstract void filteredButtonActionned(ButtonEvent<B> buttonEvent)
Invoked when a filtered actionning occurs.

Parameters:
buttonEvent - Informations about the button event.