ballwar.model
Interface IMovementKeys


public interface IMovementKeys

Interface that represents a set of movement keys. Key names are the virtual key names without the leading "VK_". See the Java documentation under "KeyEvent". To change a key's behavior from being initiated from being pressed to being released, simply change the name returned by getXXKey() to "released "+keyname, e.g. return "released END" for getStopKey(). See KeyStroke.getKeyStroke(String s) for more information.


Field Summary
static IMovementKeys ARROWSEND
          A predefined set of movement keys where the arrow keys ("UP", "DOWN", "LEFT" and "RIGHT") are associated with their respective directions and the "END" key is associated with stopping.
static IMovementKeys WASDX
          A predefined set of movement keys where "W" = up, "A" = left, "S" = stop, "D" = right, and "X"=down.
 
Method Summary
 String getDownKey()
          Get the name of the key that controls downward movement.
 String getLeftKey()
          Get the name of the key that controls leftward movement.
 String getRightKey()
          Get the name of the key that controls right ward movement.
 String getStopKey()
          Get the name of the key that stops the movement.
 String getUpKey()
          Get the name of the key that controls upward movement.
 

Field Detail

ARROWSEND

static final IMovementKeys ARROWSEND
A predefined set of movement keys where the arrow keys ("UP", "DOWN", "LEFT" and "RIGHT") are associated with their respective directions and the "END" key is associated with stopping.


WASDX

static final IMovementKeys WASDX
A predefined set of movement keys where "W" = up, "A" = left, "S" = stop, "D" = right, and "X"=down.

Method Detail

getUpKey

String getUpKey()
Get the name of the key that controls upward movement.

Returns:
The name of the virtual key minus the "VK_".

getDownKey

String getDownKey()
Get the name of the key that controls downward movement.

Returns:
The name of the virtual key minus the "VK_".

getLeftKey

String getLeftKey()
Get the name of the key that controls leftward movement.

Returns:
The name of the virtual key minus the "VK_".

getRightKey

String getRightKey()
Get the name of the key that controls right ward movement.

Returns:
The name of the virtual key minus the "VK_".

getStopKey

String getStopKey()
Get the name of the key that stops the movement.

Returns:
The name of the virtual key minus the "VK_".