at.wisch.joystick.event
Class ControllerEventManager

java.lang.Object
  extended by at.wisch.joystick.event.ControllerEventManager

public class ControllerEventManager
extends java.lang.Object

The Class ControllerEventManager. This class keeps a collection of ControllerEventListeners. ControllerEventListeners can be added and removed, and if a ControllerEvent occurs, all the registered listeners are called back.

If we add a ControllerEventListener and automatic event polling is not enabled yet, it will be enabled. If we remove the last ControllerEventListener, automatic event polling will be disabled.

Author:
Martin Wischenbart

Constructor Summary
ControllerEventManager()
           
 
Method Summary
static boolean addControllerEventListener(ControllerEventListener listener)
          Adds a ControllerEventListener to the collection.
static void controllerEventOccured(AdvancedControllerEvent event)
          Invokes the callback method for all registered listeners.
static boolean removeControllerEventListener(ControllerEventListener listener)
          Removes the ControllerEventListener from the collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControllerEventManager

public ControllerEventManager()
Method Detail

addControllerEventListener

public static boolean addControllerEventListener(ControllerEventListener listener)
Adds a ControllerEventListener to the collection.

Parameters:
listener - the ControllerEventListener
Returns:
true, if successful. false, if adding was not successful or if event polling could not be enabled.
See Also:
ControllerEventListener

removeControllerEventListener

public static boolean removeControllerEventListener(ControllerEventListener listener)
Removes the ControllerEventListener from the collection.

Parameters:
listener - the ControllerEventListener
Returns:
true, if successful. false, if removing was not successful or if event polling could not be disabled.
See Also:
ControllerEventListener

controllerEventOccured

public static void controllerEventOccured(AdvancedControllerEvent event)
Invokes the callback method for all registered listeners.

Parameters:
event - the AdvancedControllerEvent
See Also:
ControllerEventListener.controllerEventOccured(AdvancedControllerEvent)