com.planeth.gtroids.control
Class KeyInputHelper

java.lang.Object
  extended bycom.planeth.gtroids.control.KeyInputHelper

public class KeyInputHelper
extends java.lang.Object

KeyInputHelper
Encapsulates the logic to add keyboardActions to a JPanel

Author:
Andreas Grässer, gal@planet-h.com.
created 03.10.2005
See Also:
GtAction

Method Summary
static void addAction(javax.swing.JPanel jPanel, java.lang.String action, int keyCode)
          Adds the keyCode as action (pressed and released) to the passed jPanel.
static void addAction(javax.swing.JPanel jPanel, java.lang.String action, int keyCode, boolean includeKeyMasks)
          Adds the keyCode as action (pressed and released) to the passed jPanel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addAction

public static void addAction(javax.swing.JPanel jPanel,
                             java.lang.String action,
                             int keyCode)
Adds the keyCode as action (pressed and released) to the passed jPanel.
No keyMasks are included.

Parameters:
jPanel - where the action has to be added
action - the base action type
keyCode - the keyCode for the action

addAction

public static void addAction(javax.swing.JPanel jPanel,
                             java.lang.String action,
                             int keyCode,
                             boolean includeKeyMasks)
Adds the keyCode as action (pressed and released) to the passed jPanel.
Includes all needed keyMasks (SHIFT, CTRL, ...), if includeKeyMasks is true.

Parameters:
jPanel - where the action has to be added
action - the base action type
keyCode - the keyCode for the action
includeKeyMasks - flag to enable