|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsm.StateMachine.State
A state of a state machine.
This is an inner class of StateMachine
and is meant to be used as follows:
StateMachine sm = new StateMachine ("sm") { ... public State myState = new State() { ... declare transitions ... } ... }The string name of the state, which is used to specify output states in transitions, will be the name of the field (
"myState"
in this example).
For this to work, the field must be declared public.
StateMachine
Nested Class Summary | |
class |
StateMachine.State.Click
A transition triggered by a mouse clicked event anywhere in the canvas. |
class |
StateMachine.State.ClickOnShape
A transition triggered by a mouse button clicked on an SMShape. |
class |
StateMachine.State.ClickOnTag
A transition triggered by a mouse clicked event on an SMShape with a given tag. |
class |
StateMachine.State.Drag
A transition triggered by a mouse moved event with a button pressed anywhere in the canvas. |
class |
StateMachine.State.DragOnShape
A transition triggered by a mouse move event on an SMShape with a mouse button down. |
class |
StateMachine.State.DragOnTag
A transition triggered by a mouse moved event with a button pressed on an SMShape with a given tag. |
class |
StateMachine.State.EnterOnShape
A transition triggered with no modifier on a SMShape. |
class |
StateMachine.State.EnterOnTag
A transition triggered when the cursor enters in an SMShape with a given tag. |
class |
StateMachine.State.Event
A transition triggered in the canvas. |
class |
StateMachine.State.EventOnPosition
A transition triggered on a location in the canvas. |
class |
StateMachine.State.EventOnShape
A transition triggered on a SMShape in the canvas. |
class |
StateMachine.State.EventOnTag
A transition triggered on a tagged shape in the canvas. |
class |
StateMachine.State.KeyPress
A transition triggered by a key pressed event. |
class |
StateMachine.State.KeyRelease
A transition triggered by a key released event. |
class |
StateMachine.State.KeyTransition
A transition triggered by a key event. |
class |
StateMachine.State.KeyType
A transition triggered by a key typed event. |
class |
StateMachine.State.LeaveOnShape
A transition triggered with no modifier on a SMShape. |
class |
StateMachine.State.LeaveOnTag
A transition triggered when the cursor leaves a SMShape with a given tag. |
class |
StateMachine.State.MouseOnPosition
A transition triggered by a mouse event on a location in the canvas. |
class |
StateMachine.State.MouseOnShape
A transition triggered by a mouse event on a SMShape in the canvas. |
class |
StateMachine.State.MouseOnTag
A transition triggered by a mouse event on a tagged shape in the canvas. |
class |
StateMachine.State.Move
A transition triggered by a mouse moved event with no button pressed anywhere in the canvas. |
class |
StateMachine.State.MoveOnShape
A transition triggered by a mouse move event on an SMShape with no mouse button down. |
class |
StateMachine.State.MoveOnTag
A transition triggered by a mouse moved event with no button pressed on an SMShape with a given tag. |
class |
StateMachine.State.Press
A transition triggered by a mouse pressed event anywhere in the canvas. |
class |
StateMachine.State.PressOnShape
A transition triggered by a mouse button pressed on an SMShape. |
class |
StateMachine.State.PressOnTag
A transition triggered by a mouse pressed event on an SMShape with a given tag. |
class |
StateMachine.State.Release
A transition triggered by a mouse released event anywhere in the canvas. |
class |
StateMachine.State.ReleaseOnShape
A transition triggered by a mouse button released on an SMShape. |
class |
StateMachine.State.ReleaseOnTag
A transition triggered by a mouse released event on an SMShape with a given tag. |
class |
StateMachine.State.TimeOut
A transition triggered by a timer. |
class |
StateMachine.State.Transition
A transition of a state machine. |
Field Summary | |
static int |
ALT
Specifies that the ALT keyboard modifier must be pressed. |
static int |
ALT_CONTROL
Specifies that the ALT and CONTROL keyboard modifiers must be pressed. |
static int |
ALT_CONTROL_SHIFT
Specifies that the ALT, CONTROL and SHIFT keyboard modifiers must be pressed. |
static int |
ALT_SHIFT
Specifies that the ALT and SHIFT keyboard modifiers must be pressed. |
static int |
ANYMODIFIER
Specifies that any keyboard modifiers can be pressed. |
static int |
BUTTON1
Specifies that the mouse must have the button 1 pressed. |
static int |
BUTTON2
Specify that the mouse must have the button 2 pressed. |
static int |
BUTTON3
Specifies that the mouse must have the button 3 pressed. |
static int |
CONTROL
Specifies that the CONTROL keyboard modifier must be pressed. |
static int |
CONTROL_SHIFT
Specifies that the CONTROL and SHIFT keyboard modifiers must be pressed. |
static int |
NOBUTTON
Specifies that the mouse must have all buttons released. |
static int |
NOMODIFIER
Specifies that no keyboard modifiers must be pressed. |
static int |
SHIFT
Specifies that the SHIFT keyboard modifier must be pressed. |
Constructor Summary | |
StateMachine.State()
Builds a new state. |
|
StateMachine.State(java.lang.String n)
Builds a new state with a given name. |
Method Summary | |
void |
enter()
The method called when the parent state machine enters this state. |
java.lang.String |
getName()
|
java.util.Hashtable |
getTransitions()
|
void |
leave()
The method called when the parent state machine leaves this state. |
java.lang.String |
oldToString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NOBUTTON
public static final int BUTTON1
public static final int BUTTON2
public static final int BUTTON3
public static final int NOMODIFIER
public static final int SHIFT
public static final int CONTROL
public static final int ALT
public static final int CONTROL_SHIFT
public static final int ALT_SHIFT
public static final int ALT_CONTROL
public static final int ALT_CONTROL_SHIFT
public static final int ANYMODIFIER
Constructor Detail |
public StateMachine.State()
public StateMachine.State(java.lang.String n)
n
- The string name of the state, which is used to specify destination state in transitions.Method Detail |
public java.lang.String getName()
public java.lang.String oldToString()
public java.util.Hashtable getTransitions()
public void enter()
State s = new State () { public void enter () { ... do something ...} ... }
public void leave()
State s = new State () { public void leave () { ... do something ...} ... }
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |