All Packages Class Hierarchy This Package Previous Next Index
Class uhr.core.role.StateCommandableAideStd
java.lang.Object
|
+----uhr.core.role.StateCommandableAideStd
- public class StateCommandableAideStd
- extends Object
- implements StateCommandableAide
This serves as an "aide-de-camp" to a StateCommandable. Its
main responsibilities are:
1. Allow a parts commands to be easily listed in a context menu,
made available when the user right clicks on the part in the
System Tree.
2. House a resuable, stable state machine.
3. Increase the uniformity, understandablity and richness of
state machine parts.
Please note that commands, states and transitions must be added
in that order and no other.
Note this may be used by any class needing state assistance, but
we speak as if it was used only by parts.
-
StateCommandableAideStd()
-
-
doStateCommand(String)
-
-
enumerateStateCommands()
- Returns all the StateCommands for the part, configured to reflect
the current state.
-
getCurrentState()
- Returns the current state, which is never null.
-
setStateCommandable(StateCommandable)
- Sets the aide's StateCommandable.
-
setStateMachine(StateMachine)
- Sets the aide's state machine.
StateCommandableAideStd
public StateCommandableAideStd()
setStateCommandable
public void setStateCommandable(StateCommandable stateCommandable)
- Sets the aide's StateCommandable. This much be done before the
aide is exposed.
- Parameters:
- stateCommandable - the instance that will have its
doStateCommand(String command) called when that
method is called on the aide, and whose state machine is
maintained by the aide.
setStateMachine
public void setStateMachine(StateMachine stateMachine)
- Sets the aide's state machine. These are designed to be shared
by different aides, because from the aide's point of view the
state machines are read only. This must be done before the aide
is exposed.
- Parameters:
- stateMachine - the state machine for the aide to use.
getCurrentState
public String getCurrentState()
- Returns the current state, which is never null.
- Returns:
- the current state.
enumerateStateCommands
public Enumeration enumerateStateCommands()
- Returns all the StateCommands for the part, configured to reflect
the current state.
- Returns:
- the StateCommands.
doStateCommand
public void doStateCommand(String command)
All Packages Class Hierarchy This Package Previous Next Index