|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.util.stateMachine.StateMachine
public class 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. |
protected 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 | |
---|---|
void |
addStates(State[] s)
Append States to the state Vector. |
State |
getResetState()
Return the reset state. |
State |
getState()
Return the current State. |
State |
getState(int stateIndex)
Return the state at the given index. |
java.util.Vector |
getStates()
Get the Vector of States. |
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 |
setStateAt(int stateIndex,
State state)
Set the state at an index to new State Object. |
void |
setStates(State[] s)
Set the states to the new array. |
void |
setStates(java.util.Vector s)
Set the states to the vector of States. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected 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 setStates(java.util.Vector s)
s
- public java.util.Vector getStates()
public void addStates(State[] s)
s
- an 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 void setStateAt(int stateIndex, State state)
stateIndex
- 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 |