All Packages Class Hierarchy This Package Previous Next Index
Interface uhr.core.role.StateCommandableAide
- public interface 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.
More methods will be added as needed.
-
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.
setStateCommandable
public abstract 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 abstract 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 abstract String getCurrentState()
- Returns the current state, which is never null.
- Returns:
- the current state.
enumerateStateCommands
public abstract Enumeration enumerateStateCommands()
- Returns all the StateCommands for the part, configured to reflect
the current state.
- Returns:
- the StateCommands.
doStateCommand
public abstract void doStateCommand(String command)
All Packages Class Hierarchy This Package Previous Next Index