sm
Class SMStateMachineEventAdapter

java.lang.Object
  extended bysm.SMStateMachineEventAdapter
All Implemented Interfaces:
java.util.EventListener, SMStateMachineEventListener

public class SMStateMachineEventAdapter
extends java.lang.Object
implements SMStateMachineEventListener

An abstract adapter class for receiving state machine events. The methods in this class are empty. This class exists as convenience for creating listener objects.

State machine events let you track when a state machine is attached to a canvas, detached from a canvas, reset, resumed, suspended or when a state machine passed a transition leading it to a new state or letting it in the current state.

Extend this class to create a SMStateMachineEvent listener and override the methods for the events of interest. (If you implement the SMStateMachineEventListener interface, you have to define all of the methods in it. This abstract class defines null methods for them all, so you can only have to define methods for events you care about.)

Create a listener object using the extended class and then register it with a state machine using the state machine's addSMListener method. When the state machine is attached, detached, resumed, reset, suspended, goes to another state or loops on the current state, the relevant method in the listener object is invoked and the SMStateMachineEvent is passed to it.

Author:
Caroline Appert
See Also:
SMStateMachineEvent, SMStateMachineEventListener

Constructor Summary
SMStateMachineEventAdapter()
           
 
Method Summary
 void smAttached(SMStateMachineEvent e)
          Invoked when the state machine has been attached to a canvas.
 void smDetached(SMStateMachineEvent e)
          Invoked when the state machine has been detached from a canvas.
 void smInited(SMStateMachineEvent e)
          Invoked when the state machine has been inited.
 void smRestarted(SMStateMachineEvent e)
          Invoked when the state machine has been reset.
 void smResumed(SMStateMachineEvent e)
          Invoked when the state machine has been resumed.
 void smStateChanged(SMStateMachineEvent e)
          Invoked when the state machine has fired a transition changing the current state.
 void smStateLooped(SMStateMachineEvent e)
          Invoked when the state machine has fired a transition making it loop on the current state.
 void smSuspended(SMStateMachineEvent e)
          Invoked when the state machine has been suspended.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMStateMachineEventAdapter

public SMStateMachineEventAdapter()
Method Detail

smAttached

public void smAttached(SMStateMachineEvent e)
Description copied from interface: SMStateMachineEventListener
Invoked when the state machine has been attached to a canvas.

Specified by:
smAttached in interface SMStateMachineEventListener
Parameters:
e - the event.

smDetached

public void smDetached(SMStateMachineEvent e)
Description copied from interface: SMStateMachineEventListener
Invoked when the state machine has been detached from a canvas.

Specified by:
smDetached in interface SMStateMachineEventListener
Parameters:
e - the event.

smSuspended

public void smSuspended(SMStateMachineEvent e)
Description copied from interface: SMStateMachineEventListener
Invoked when the state machine has been suspended.

Specified by:
smSuspended in interface SMStateMachineEventListener
Parameters:
e - the event.

smResumed

public void smResumed(SMStateMachineEvent e)
Description copied from interface: SMStateMachineEventListener
Invoked when the state machine has been resumed.

Specified by:
smResumed in interface SMStateMachineEventListener
Parameters:
e - the event.

smRestarted

public void smRestarted(SMStateMachineEvent e)
Description copied from interface: SMStateMachineEventListener
Invoked when the state machine has been reset.

Specified by:
smRestarted in interface SMStateMachineEventListener
Parameters:
e - the event.

smStateChanged

public void smStateChanged(SMStateMachineEvent e)
Description copied from interface: SMStateMachineEventListener
Invoked when the state machine has fired a transition changing the current state.

Specified by:
smStateChanged in interface SMStateMachineEventListener
Parameters:
e - the event.

smStateLooped

public void smStateLooped(SMStateMachineEvent e)
Description copied from interface: SMStateMachineEventListener
Invoked when the state machine has fired a transition making it loop on the current state.

Specified by:
smStateLooped in interface SMStateMachineEventListener
Parameters:
e - the event.

smInited

public void smInited(SMStateMachineEvent e)
Description copied from interface: SMStateMachineEventListener
Invoked when the state machine has been inited.

Specified by:
smInited in interface SMStateMachineEventListener
Parameters:
e - the event.