sm
Class StateMachine.State.KeyTransition

java.lang.Object
  extended bysm.StateMachine.State.Transition
      extended bysm.StateMachine.State.KeyTransition
Direct Known Subclasses:
StateMachine.State.KeyPress, StateMachine.State.KeyRelease, StateMachine.State.KeyType
Enclosing class:
StateMachine.State

public abstract class StateMachine.State.KeyTransition
extends StateMachine.State.Transition

A transition triggered by a key event. Keys can be specified either by the ASCII character they represent or by their keycode.

Author:
Caroline Appert

Constructor Summary
StateMachine.State.KeyTransition(java.lang.String e)
          Constructs a transition triggered by a key event with any modifier that loops on the current state.
StateMachine.State.KeyTransition(java.lang.String e, char c)
          Constructs a transition triggered by a key event with any modifier that loops on the current state.
StateMachine.State.KeyTransition(java.lang.String e, char c, int m)
          Constructs a transition triggered by a key event that loops on the current state.
StateMachine.State.KeyTransition(java.lang.String e, char c, int m, java.lang.String a)
          Constructs a transition triggered by a key event.
StateMachine.State.KeyTransition(java.lang.String e, char c, java.lang.String a)
          Constructs a transition triggered by a key event with any modifier.
StateMachine.State.KeyTransition(java.lang.String e, int k)
          Constructs a transition triggered by a key event with any modifier that loops on the current state.
StateMachine.State.KeyTransition(java.lang.String e, int k, int m)
          Constructs a transition triggered by a key event that loops on the current state.
StateMachine.State.KeyTransition(java.lang.String e, int k, int m, java.lang.String a)
          Constructs a transition triggered by a key event.
StateMachine.State.KeyTransition(java.lang.String e, int k, java.lang.String a)
          Constructs a transition triggered by a key event with any modifier.
StateMachine.State.KeyTransition(java.lang.String e, java.lang.String a)
          Constructs a transition triggered by a key event with any modifier.
 
Method Summary
 char getChar()
          Returns the character associated with the key event that triggers this transition.
 java.awt.event.InputEvent getInputEvent()
           
 int getKeyCode()
           
 void setChar(char c)
          Sets the character associated with the key event that triggers this transition
 void setInputEvent(java.awt.event.InputEvent inputEvent)
           
 void setKeyCode(int kc)
           
 
Methods inherited from class sm.StateMachine.State.Transition
action, getModifier, getOutputStateName, getVirtualEvent, guard, hashKey, oldToString, setVirtualEvent, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e,
                                        java.lang.String a)
Constructs a transition triggered by a key event with any modifier.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"
a - The name of the output state

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e)
Constructs a transition triggered by a key event with any modifier that loops on the current state.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e,
                                        char c,
                                        java.lang.String a)
Constructs a transition triggered by a key event with any modifier.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"
c - The char corresponding to the key event
a - The name of the output state

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e,
                                        int k,
                                        java.lang.String a)
Constructs a transition triggered by a key event with any modifier.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"
k - The key code (ASCII) corresponding to the key event
a - The name of the output state

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e,
                                        char c)
Constructs a transition triggered by a key event with any modifier that loops on the current state.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"
c - The char corresponding to the key event

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e,
                                        int k)
Constructs a transition triggered by a key event with any modifier that loops on the current state.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"
k - The key code (ASCII) corresponding to the key event

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e,
                                        char c,
                                        int m,
                                        java.lang.String a)
Constructs a transition triggered by a key event.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"
c - The char corresponding to the key event
m - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT, ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT
a - The name of the output state

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e,
                                        int k,
                                        int m,
                                        java.lang.String a)
Constructs a transition triggered by a key event.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"
k - The key code (ASCII) corresponding to the key event
m - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT, ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT
a - The name of the output state

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e,
                                        char c,
                                        int m)
Constructs a transition triggered by a key event that loops on the current state.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"
c - The char corresponding to the key event
m - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT, ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT

StateMachine.State.KeyTransition

public StateMachine.State.KeyTransition(java.lang.String e,
                                        int k,
                                        int m)
Constructs a transition triggered by a key event that loops on the current state.

Parameters:
e - The string describing the events for which this transition must be triggered: "KeyPress", "KeyRelease" or "KeyType"
k - The key code (ASCII) corresponding to the key event
m - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT, ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT
Method Detail

setChar

public void setChar(char c)
Sets the character associated with the key event that triggers this transition

Parameters:
c - The character

getChar

public char getChar()
Returns the character associated with the key event that triggers this transition.

Returns:
Returns the character associated with the key event that triggers this transition

setKeyCode

public void setKeyCode(int kc)
Parameters:
kc - The key code (ASCII) to associate to the key event that initiates this transition

getKeyCode

public int getKeyCode()
Returns:
Returns the key code (ASCII) associating to the key event that initiates this transition

getInputEvent

public java.awt.event.InputEvent getInputEvent()

setInputEvent

public void setInputEvent(java.awt.event.InputEvent inputEvent)