|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
sm.SMStateMachineEvent
An event which indicates that an action occurred in a state machine. This event is used both for the following state machine events:
A SMStateMachineEvent object is fired to every SMStateMachineEventListener or SMStateMachineEventAdapter object which is registered to receive the "interesting" mouse events using the state machine's addSMListener method. (SMStateMachineEventAdapter objects implement the SMStateMachineEventListener interface.) Each such listener object gets a SMStateMachineEvent containing the state machine event.
The current state and current canvas attached to this state machine can be retrieved using SMStateMachineEvent.getCurrentState()
and SMStateMachineEvent.getCurrentState()
.
The getPreviousState()
and getTransition()
retrieve the previous state and the transition when the event is due to the passage of a transition in the state machine. For every other events (attached to an interactive object, detached from an interactive object, etc.), those methods return null.
Constructor Summary | |
SMStateMachineEvent(java.lang.Object stateMachine,
StateMachine.State.Transition t,
StateMachine.State previousState,
StateMachine.State currentState,
InteractiveObject io)
Builds a SMStateMachineEvent. |
|
SMStateMachineEvent(StateMachine stateMachine)
Builds a SMStateMachineEvent originated by a state machine that has just been inited. |
|
SMStateMachineEvent(StateMachine stateMachine,
InteractiveObject io)
Builds a SMStateMachineEvent originated by a state machine that has just been inited. |
|
SMStateMachineEvent(StateMachine stateMachine,
StateMachine.State.Transition t,
StateMachine.State cState,
InteractiveObject io)
Builds a SMStateMachineEvent originated by a state machine that has just fired a transition that makes it loop on the current state. |
|
SMStateMachineEvent(StateMachine stateMachine,
StateMachine.State.Transition t,
StateMachine.State pState,
StateMachine.State cState)
Builds a SMStateMachineEvent. |
Method Summary | |
StateMachine.State |
getCurrentState()
Returns the current state of the state machine that originated this SMStateMachineEvent. |
StateMachine.State |
getPreviousState()
Returns the previous state of the state machine that originated this SMStateMachineEvent. |
StateMachine |
getSmSource()
Returns the state machine that originated this event. |
StateMachine.State.Transition |
getTransition()
Returns the transition that has just been fired by this state machine. |
java.lang.String |
toString()
|
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SMStateMachineEvent(StateMachine stateMachine, StateMachine.State.Transition t, StateMachine.State pState, StateMachine.State cState)
stateMachine
- The state machine that originated this event.t
- The transition of the state machine that has just been fired.pState
- The state of the state machine before t has been fired.cState
- The current state of the state machine.public SMStateMachineEvent(StateMachine stateMachine, StateMachine.State.Transition t, StateMachine.State cState, InteractiveObject io)
previousState
field is equal to the currentState
field.
stateMachine
- The state machine that originated this event.t
- The transition of the state machine that has just been fired.cState
- The current state of the state machine.io
- The interactive object that has originated this event.public SMStateMachineEvent(StateMachine stateMachine)
stateMachine
- The state machine that originated this event.public SMStateMachineEvent(StateMachine stateMachine, InteractiveObject io)
stateMachine
- The state machine that originated this event.io
- The interactive object that has originated a transitionpublic SMStateMachineEvent(java.lang.Object stateMachine, StateMachine.State.Transition t, StateMachine.State previousState, StateMachine.State currentState, InteractiveObject io)
stateMachine
- The state machine that has originated a transition.t
- The transition of the state machine that has just been fired.previousState
- The state of the state machine before t has been fired.currentState
- The current state of the state machine.io
- The interactive object that has originated a transition.Method Detail |
public StateMachine.State getCurrentState()
public StateMachine.State getPreviousState()
null
when this SMStateMachineEvent has been originated by a state machine when it
has been attached to an interactive object, detached from an interactive object, resumed, reset or suspended.public StateMachine.State.Transition getTransition()
null
when this SMStateMachineEvent has been originated by a state machine when it has been attached to a canvas, detached from a canvas, resumed, reset or suspended.public StateMachine getSmSource()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |