org.jagatoo.commands
Class InputActionCommand
java.lang.Object
org.jagatoo.commands.CommandBase
org.jagatoo.commands.NoParamCommandBase
org.jagatoo.commands.InputActionCommand
- All Implemented Interfaces:
- Command, NoParamCommand, InputAction, InvokableInputAction, LabeledInputAction, LabeledInvokableInputAction
public abstract class InputActionCommand
- extends NoParamCommandBase
- implements LabeledInvokableInputAction
This is a Command, that can be bound to a key.
|
Constructor Summary |
|
InputActionCommand(java.lang.String commandKey,
int ordinal,
java.lang.String text)
Creates a new key-bound Command. |
protected |
InputActionCommand(java.lang.String commandKey,
int ordinal,
java.lang.String text,
int numParams)
Creates a new key-bound Command. |
|
InputActionCommand(java.lang.String commandKey,
java.lang.String text)
Creates a new key-bound Command. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
InputActionCommand
protected InputActionCommand(java.lang.String commandKey,
int ordinal,
java.lang.String text,
int numParams)
- Creates a new key-bound
Command.
- Parameters:
commandKey - this is NOT the Keyboard-key, but the command's key (name).ordinal - this KeyCommandInterface's ordinal. The next auto-ordinal will be resettet to (ordinal + 1), if this is >= 0.text - the Text, that is displayed in a configuration dialognumParams -
InputActionCommand
public InputActionCommand(java.lang.String commandKey,
int ordinal,
java.lang.String text)
- Creates a new key-bound
Command.
- Parameters:
commandKey - this is NOT the Keyboard-key, but the command's key (name).ordinal - this KeyCommandInterface's ordinal. The next auto-ordinal will be resettet to (ordinal + 1), if this is >= 0.text - the Text, that is displayed in a configuration dialog
InputActionCommand
public InputActionCommand(java.lang.String commandKey,
java.lang.String text)
- Creates a new key-bound
Command.
- Parameters:
commandKey - this is NOT the Keyboard-key, but the command's key (name).text - the Text, that is displayed in a configuration dialog
ordinal
public final int ordinal()
-
- Specified by:
ordinal in interface InputAction
- Returns:
- This InputAction's ordinal number,
which must be zero-based for all actions of a set.
invokeAction
public java.lang.String invokeAction(InputDevice device,
DeviceComponent comp,
int delta,
int state,
long nanoTime)
throws InputSystemException
- This method is invoked when the bound InputDevice changed its state.
- Specified by:
invokeAction in interface InvokableInputAction
- Parameters:
device - the bound devicecomp - the bound device componentdelta - the delta of the previous and current statestate - the current state
- Returns:
- a success message (implementation dependent)
- Throws:
InputSystemException