qx.util.fsm
Class FiniteStateMachine

java.lang.Object
  extended by qx.core.Object
      extended by qx.core.Target
          extended by qx.util.fsm.FiniteStateMachine

public class FiniteStateMachine
extends Target

A finite state machine.

See State for details on creating States, and qx.util.fsm.Transitions for details on creating transitions between states.


Constructor Summary
FiniteStateMachine()
           
FiniteStateMachine(java.lang.String machineName)
           
 
Method Summary
 void addObject(java.lang.String friendlyName, java.lang.Object obj, java.lang.Object groupNames)
          Add an object (typically a widget) that is to be accessed during state transitions, to the finite state machine.
 void addState(State state)
          Add a state to the finite state machine.
 Event copyEvent(Event event)
          Copy an event
 void displayAllObjects()
          Display all of the saved objects and their reverse mappings.
 void enqueueEvent(Event event, boolean bAddAtHead)
          Enqueue an event for processing
 void eventListener(Event event)
          Event listener for all event types in the finite state machine
 int getDebugFlags()
          Returns the (computed) value of the property debugFlags.
 java.lang.String getFriendlyName(java.lang.Object obj)
          Get the friendly name of an object.
 java.lang.Object getGroupObjects(java.lang.String groupName)
          Retrieve the list of objects which have registered, via addObject as being members of the specified group.
 int getMaxSavedStates()
          Returns the (computed) value of the property maxSavedStates.
 java.lang.String getName()
          Returns the (computed) value of the property name.
 java.lang.String getNextState()
          Returns the (computed) value of the property nextState.
 java.lang.Object getObject(java.lang.String friendlyName)
          Retrieve an object previously saved via addObject(java.lang.String, java.lang.Object, java.lang.Object), using its Friendly Name.
 java.lang.String getPreviousState()
          Returns the (computed) value of the property previousState.
 java.lang.String getState()
          Returns the (computed) value of the property state.
 void initDebugFlags(int arg)
          Calls the apply method and dispatches the change event of the property debugFlags with the default value defined by the class developer.
 void initMaxSavedStates(int arg)
          Calls the apply method and dispatches the change event of the property maxSavedStates with the default value defined by the class developer.
 void initName(java.lang.String arg)
          Calls the apply method and dispatches the change event of the property name with the default value defined by the class developer.
 void initNextState(java.lang.String arg)
          Calls the apply method and dispatches the change event of the property nextState with the default value defined by the class developer.
 void initPreviousState(java.lang.String arg)
          Calls the apply method and dispatches the change event of the property previousState with the default value defined by the class developer.
 void initState(java.lang.String arg)
          Calls the apply method and dispatches the change event of the property state with the default value defined by the class developer.
 void postponeEvent(Event event)
          Add the specified event to a list of events to be passed to the next state following state transition.
 void pushState(boolean bCurrent)
          Save the current or previous state on the saved-state stack.
 void removeObject(java.lang.String friendlyName)
          Remove an object which had previously been added by addObject(java.lang.String, java.lang.Object, java.lang.Object).
 java.lang.Object replaceState(State state, boolean bDispose)
          Replace a state in the finite state machine.
 void resetDebugFlags()
          Resets the user value of the property debugFlags.
 void resetMaxSavedStates()
          Resets the user value of the property maxSavedStates.
 void resetName()
          Resets the user value of the property name.
 void resetNextState()
          Resets the user value of the property nextState.
 void resetPreviousState()
          Resets the user value of the property previousState.
 void resetState()
          Resets the user value of the property state.
 void setDebugFlags(int arg)
          Sets the user value of the property debugFlags.
 void setMaxSavedStates(int arg)
          Sets the user value of the property maxSavedStates.
 void setName(java.lang.String arg)
          Sets the user value of the property name.
 void setNextState(java.lang.String arg)
          Sets the user value of the property nextState.
 void setPreviousState(java.lang.String arg)
          Sets the user value of the property previousState.
 void setState(java.lang.String arg)
          Sets the user value of the property state.
 void start()
          Start (or restart, after it has terminated) the finite state machine from the starting state.
 
Methods inherited from class qx.core.Target
_dispatchEvent, addChangeSelectionListener, addChangeValueListener, addEventListener, addExecuteListener, addJavaEventListener, createDispatchChangeEvent, createDispatchDataEvent, createDispatchEvent, dispatchEvent, hasEventListeners, removeEventListener
 
Methods inherited from class qx.core.Object
_disposeFields, _disposeObjectDeep, _disposeObjects, base, dispose, get, getDisposed, isDisposed, reset, self, set, toHashCode, toString_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FiniteStateMachine

public FiniteStateMachine()

FiniteStateMachine

public FiniteStateMachine(java.lang.String machineName)
Method Detail

addObject

public void addObject(java.lang.String friendlyName,
                      java.lang.Object obj,
                      java.lang.Object groupNames)

Add an object (typically a widget) that is to be accessed during state transitions, to the finite state machine.


addState

public void addState(State state)

Add a state to the finite state machine.


copyEvent

public Event copyEvent(Event event)

Copy an event


displayAllObjects

public void displayAllObjects()

Display all of the saved objects and their reverse mappings.


enqueueEvent

public void enqueueEvent(Event event,
                         boolean bAddAtHead)

Enqueue an event for processing


eventListener

public void eventListener(Event event)

Event listener for all event types in the finite state machine


getDebugFlags

public int getDebugFlags()

Returns the (computed) value of the property debugFlags.

For further details take a look at the property definition: debugFlags.


getFriendlyName

public java.lang.String getFriendlyName(java.lang.Object obj)

Get the friendly name of an object.


getGroupObjects

public java.lang.Object getGroupObjects(java.lang.String groupName)

Retrieve the list of objects which have registered, via addObject as being members of the specified group.


getMaxSavedStates

public int getMaxSavedStates()

Returns the (computed) value of the property maxSavedStates.

For further details take a look at the property definition: maxSavedStates.


getName

public java.lang.String getName()

Returns the (computed) value of the property name.

For further details take a look at the property definition: name.


getNextState

public java.lang.String getNextState()

Returns the (computed) value of the property nextState.

For further details take a look at the property definition: nextState.


getObject

public java.lang.Object getObject(java.lang.String friendlyName)

Retrieve an object previously saved via addObject(java.lang.String, java.lang.Object, java.lang.Object), using its Friendly Name.


getPreviousState

public java.lang.String getPreviousState()

Returns the (computed) value of the property previousState.

For further details take a look at the property definition: previousState.


getState

public java.lang.String getState()

Returns the (computed) value of the property state.

For further details take a look at the property definition: state.


initDebugFlags

public void initDebugFlags(int arg)

Calls the apply method and dispatches the change event of the property debugFlags with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: debugFlags.


initMaxSavedStates

public void initMaxSavedStates(int arg)

Calls the apply method and dispatches the change event of the property maxSavedStates with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: maxSavedStates.


initName

public void initName(java.lang.String arg)

Calls the apply method and dispatches the change event of the property name with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: name.


initNextState

public void initNextState(java.lang.String arg)

Calls the apply method and dispatches the change event of the property nextState with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: nextState.


initPreviousState

public void initPreviousState(java.lang.String arg)

Calls the apply method and dispatches the change event of the property previousState with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: previousState.


initState

public void initState(java.lang.String arg)

Calls the apply method and dispatches the change event of the property state with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: state.


postponeEvent

public void postponeEvent(Event event)

Add the specified event to a list of events to be passed to the next state following state transition.


pushState

public void pushState(boolean bCurrent)

Save the current or previous state on the saved-state stack. A future transition can then provide, as its nextState value, the class constant:

qx.util.fsm.FiniteStateMachine.StateChange.POP_STATE_STACK

which will cause the next state to be whatever is at the top of the saved-state stack, and remove that top element from the saved-state stack.


removeObject

public void removeObject(java.lang.String friendlyName)

Remove an object which had previously been added by addObject(java.lang.String, java.lang.Object, java.lang.Object).


replaceState

public java.lang.Object replaceState(State state,
                                     boolean bDispose)

Replace a state in the finite state machine. This is useful if initially “dummy” states are created which load the real state table for a series of operations (and possibly also load the gui associated with the new states at the same time). Having portions of the finite state machine and their associated gui pages loaded at run time can help prevent long delays at application start-up time.


resetDebugFlags

public void resetDebugFlags()

Resets the user value of the property debugFlags.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: debugFlags.


resetMaxSavedStates

public void resetMaxSavedStates()

Resets the user value of the property maxSavedStates.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: maxSavedStates.


resetName

public void resetName()

Resets the user value of the property name.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: name.


resetNextState

public void resetNextState()

Resets the user value of the property nextState.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: nextState.


resetPreviousState

public void resetPreviousState()

Resets the user value of the property previousState.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: previousState.


resetState

public void resetState()

Resets the user value of the property state.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: state.


setDebugFlags

public void setDebugFlags(int arg)

Sets the user value of the property debugFlags.

For further details take a look at the property definition: debugFlags.


setMaxSavedStates

public void setMaxSavedStates(int arg)

Sets the user value of the property maxSavedStates.

For further details take a look at the property definition: maxSavedStates.


setName

public void setName(java.lang.String arg)

Sets the user value of the property name.

For further details take a look at the property definition: name.


setNextState

public void setNextState(java.lang.String arg)

Sets the user value of the property nextState.

For further details take a look at the property definition: nextState.


setPreviousState

public void setPreviousState(java.lang.String arg)

Sets the user value of the property previousState.

For further details take a look at the property definition: previousState.


setState

public void setState(java.lang.String arg)

Sets the user value of the property state.

For further details take a look at the property definition: state.


start

public void start()

Start (or restart, after it has terminated) the finite state machine from the starting state. The starting state is defined as the first state added to the finite state machine.



Copyright © 2008 1&1. All Rights Reserved.