org.jagatoo.input.managers
Class SimpleInputActionManager

java.lang.Object
  extended by org.jagatoo.input.managers.SimpleInputActionManager
All Implemented Interfaces:
InputStateListener

public class SimpleInputActionManager
extends java.lang.Object
implements InputStateListener

The SimpleInputActionManager can be used to bind input DeviceComponents to simple input-actions (like Strings).

You need to add it to the InputSystem or one of its registered InputDevices as an InputStateListener to make it work.

You can use it as a singleton. The singleton instance is always automatically added to the InputSystem as a listener.


Constructor Summary
SimpleInputActionManager()
           
 
Method Summary
 void addActionListener(SimpleInputActionListener l)
           
 void bindAction(DeviceComponent comp, java.lang.Object action)
           
 java.lang.Object getBoundAction(DeviceComponent comp)
           
static SimpleInputActionManager getInstance()
           
 int getNumBoundActions()
           
protected  void notifyListeners(java.lang.Object action, int delta, int state)
           
 void onInputStateChanged(InputEvent e, DeviceComponent comp, int delta, int state)
          This event is fired, if an input device of any kind changed its state.
 void removeActionListener(SimpleInputActionListener l)
           
 void unbindAction(DeviceComponent comp)
           
 void unbindAction(java.lang.Object action)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleInputActionManager

public SimpleInputActionManager()
Method Detail

getInstance

public static final SimpleInputActionManager getInstance()

addActionListener

public void addActionListener(SimpleInputActionListener l)

removeActionListener

public void removeActionListener(SimpleInputActionListener l)

getNumBoundActions

public final int getNumBoundActions()

bindAction

public void bindAction(DeviceComponent comp,
                       java.lang.Object action)

unbindAction

public void unbindAction(DeviceComponent comp)

unbindAction

public void unbindAction(java.lang.Object action)

getBoundAction

public final java.lang.Object getBoundAction(DeviceComponent comp)

notifyListeners

protected void notifyListeners(java.lang.Object action,
                               int delta,
                               int state)

onInputStateChanged

public void onInputStateChanged(InputEvent e,
                                DeviceComponent comp,
                                int delta,
                                int state)
Description copied from interface: InputStateListener
This event is fired, if an input device of any kind changed its state.

Specified by:
onInputStateChanged in interface InputStateListener
Parameters:
e - the abstract event, that was triggered.
comp - the DeviceComponent, that is responsible for this event
delta - the delta information
state - the absolute state