|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.layer.util.stateMachine.StateMachine
The StateMachine lets you organize event handling, if the order of the events are important to you. You can use the setState commands with the state you want, if you are holding on a copy of it. Otherwise, the state machine assumes you know the index of the state you want.
Field Summary | |
protected State |
currentState
The current state that will receive the next event. |
protected State |
resetState
The state to go to whan all is bad. |
java.util.Vector |
states
The states to track. |
Constructor Summary | |
StateMachine()
|
|
StateMachine(State[] s)
Define the state machine using the array of states. |
Method Summary | |
State |
getResetState()
Return the reset state. |
State |
getState()
Return the current State. |
State |
getState(int stateIndex)
Return the state at the given index. |
void |
reset()
Sets the current state to the reset state. |
void |
setMapMouseListenerResponses(boolean value)
Set the MapMouseListenerResponse for all the states. |
void |
setResetState(int stateIndex)
Set the reset state to be used by the state machine. |
void |
setResetState(State state)
Set the state to be gone to if the state machine is reset. |
void |
setState(int stateIndex)
Set the current state to the state residing in the vector at the given index. |
void |
setState(State state)
Set the current state to the given state. |
void |
setStates(State[] s)
Set the states to the new array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.util.Vector states
protected State currentState
protected State resetState
Constructor Detail |
public StateMachine()
public StateMachine(State[] s)
s
- array of states.Method Detail |
public void reset()
public void setStates(State[] s)
s
- array of states.public void setState(State state)
state
- the state to set to the current one.public void setState(int stateIndex)
stateIndex
- the index of the current state.public State getState()
public State getState(int stateIndex)
public void setResetState(State state)
public void setResetState(int stateIndex)
public State getResetState()
public void setMapMouseListenerResponses(boolean value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |