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.


Constructor Index

 o StateCommandableAideStd()

Method Index

 o doStateCommand(String)
 o enumerateStateCommands()
Returns all the StateCommands for the part, configured to reflect the current state.
 o getCurrentState()
Returns the current state, which is never null.
 o setStateCommandable(StateCommandable)
Sets the aide's StateCommandable.
 o setStateMachine(StateMachine)
Sets the aide's state machine.

Constructors

 o StateCommandableAideStd
 public StateCommandableAideStd()

Methods

 o 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.
 o 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.
 o getCurrentState
 public String getCurrentState()
Returns the current state, which is never null.

Returns:
the current state.
 o enumerateStateCommands
 public Enumeration enumerateStateCommands()
Returns all the StateCommands for the part, configured to reflect the current state.

Returns:
the StateCommands.
 o doStateCommand
 public void doStateCommand(String command)

All Packages  Class Hierarchy  This Package  Previous  Next  Index