org.jagatoo.input.devices.components
Class DeviceComponent

java.lang.Object
  extended by org.jagatoo.input.devices.components.DeviceComponent
Direct Known Subclasses:
AnalogDeviceComponent, DigitalDeviceComponent, MouseWheel.WheelUpDownComponent

public abstract class DeviceComponent
extends java.lang.Object

DeviceComponents can be keys, buttons, axes, etc.


Nested Class Summary
static class DeviceComponent.Type
           
 
Field Summary
protected static int nextID
           
 
Constructor Summary
protected DeviceComponent(DeviceComponent.Type type, java.lang.String name)
           
 
Method Summary
 void bindAction(InvokableInputAction action)
          Binds an InputAction to this DeviceComponent, which is executed on a state change.
 void bindAction(InvokableInputAction action, InputDevice device)
          Binds an InputAction to this DeviceComponent, which is executed on a state change.
 int getDeviceComponentID()
           
 java.lang.String getLocalizedName()
           
 java.lang.String getName()
           
 DeviceComponent.Type getType()
           
 boolean isAnalog()
           
 boolean isDigital()
           
 void notifyBoundActions(InputDevice device, int delta, int state, long nanoTime)
          Notifies all bound InvokableInputActions.
 void unbindAction(InvokableInputAction action)
          Unbinds an InputAction from this DeviceComponent.
 void unbindAction(InvokableInputAction action, InputDevice device)
          Unbinds an InputAction from this DeviceComponent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nextID

protected static int nextID
Constructor Detail

DeviceComponent

protected DeviceComponent(DeviceComponent.Type type,
                          java.lang.String name)
Method Detail

getDeviceComponentID

public final int getDeviceComponentID()
Returns:
this component's ID.

getName

public final java.lang.String getName()
Returns:
this component's name.

getLocalizedName

public java.lang.String getLocalizedName()
Returns:
this component's localized (translated) name.

getType

public final DeviceComponent.Type getType()
Returns:
the DeviceComponent's Type.

isDigital

public final boolean isDigital()
Returns:
whether this DeviceComponent is an instance of DigitalDeviceComponent.

isAnalog

public final boolean isAnalog()
Returns:
whether this DeviceComponent is an instance of AnalogDeviceComponent.

bindAction

public void bindAction(InvokableInputAction action,
                       InputDevice device)
Binds an InputAction to this DeviceComponent, which is executed on a state change.

Parameters:
action - the action to bind
device - the InputDevice to use

bindAction

public void bindAction(InvokableInputAction action)
Binds an InputAction to this DeviceComponent, which is executed on a state change.

Parameters:
action - the action to bind

unbindAction

public void unbindAction(InvokableInputAction action,
                         InputDevice device)
Unbinds an InputAction from this DeviceComponent.

Parameters:
action - the action to bind
device - the InputDevice to use

unbindAction

public void unbindAction(InvokableInputAction action)
Unbinds an InputAction from this DeviceComponent.

Parameters:
action - the action to bind

notifyBoundActions

public void notifyBoundActions(InputDevice device,
                               int delta,
                               int state,
                               long nanoTime)
Notifies all bound InvokableInputActions.

Parameters:
device -
delta -
state -