sm
Class StateMachine.State.EventOnShape

java.lang.Object
  extended bysm.StateMachine.State.Transition
      extended bysm.StateMachine.State.EventOnPosition
          extended bysm.StateMachine.State.EventOnShape
Direct Known Subclasses:
StateMachine.State.EnterOnShape, StateMachine.State.EventOnTag, StateMachine.State.LeaveOnShape, StateMachine.State.MouseOnShape
Enclosing class:
StateMachine.State

public abstract class StateMachine.State.EventOnShape
extends StateMachine.State.EventOnPosition

A transition triggered on a SMShape in the canvas. OnShape transitions allow developpers to retrieve the shape in the canvas where this transition has been fired:

 	Transition tshape = new EventOnShape (BUTTON1) {
 		public void action() {
 			// colors in red the shape on which the transition has been fired
 			getShape().setFillPaint(Color.RED);
 		}
 	}

Author:
Caroline Appert

Constructor Summary
StateMachine.State.EventOnShape(java.lang.String e)
          Constructs a mouse transition on a SMShape with no modifier that loops on the current state.
StateMachine.State.EventOnShape(java.lang.String e, int m)
          Constructs a mouse transition on a SMShape that loops on the current state.
StateMachine.State.EventOnShape(java.lang.String e, int m, java.lang.String a)
          Constructs a mouse transition on a SMShape.
StateMachine.State.EventOnShape(java.lang.String e, java.lang.String a)
          Constructs a mouse transition on a SMShape with no modifier.
 
Method Summary
 SMShape getShape()
          Returns the SMShape on which the mouse event firing this transition has occured.
 java.lang.String hashKey()
          Returns the hashkey of this transition.
 java.lang.String toString()
           
 
Methods inherited from class sm.StateMachine.State.EventOnPosition
getInputEvent, getPoint, setInputEvent
 
Methods inherited from class sm.StateMachine.State.Transition
action, getModifier, getOutputStateName, getVirtualEvent, guard, oldToString, setVirtualEvent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StateMachine.State.EventOnShape

public StateMachine.State.EventOnShape(java.lang.String e)
Constructs a mouse transition on a SMShape with no modifier that loops on the current state.

Parameters:
e - The string describing the events for which this transition must be triggered: "Down", "Motion", "Move", "Up", "Click" or "Gesture"*

StateMachine.State.EventOnShape

public StateMachine.State.EventOnShape(java.lang.String e,
                                       int m)
Constructs a mouse transition on a SMShape that loops on the current state.

Parameters:
e - The string describing the events for which this transition must be triggered: "Down", "Motion", "Move", "Up", "Click" or "Gesture"*

StateMachine.State.EventOnShape

public StateMachine.State.EventOnShape(java.lang.String e,
                                       java.lang.String a)
Constructs a mouse transition on a SMShape with no modifier.

Parameters:
e - The string describing the events for which this transition must be triggered: "Down", "Motion", "Move", "Up", "Click" or "Gesture"*
a - The name of the output state

StateMachine.State.EventOnShape

public StateMachine.State.EventOnShape(java.lang.String e,
                                       int m,
                                       java.lang.String a)
Constructs a mouse transition on a SMShape.

Parameters:
e - The string describing the events for which this transition must be triggered: "Down", "Motion", "Move", "Up", "Click" or "Gesture"*
a - The name of the output state
m - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT, ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT
Method Detail

hashKey

public java.lang.String hashKey()
Description copied from class: StateMachine.State.Transition
Returns the hashkey of this transition. Used for recording the transition in the state's hashtable.

Overrides:
hashKey in class StateMachine.State.EventOnPosition

toString

public java.lang.String toString()
Overrides:
toString in class StateMachine.State.Transition

getShape

public SMShape getShape()
Returns the SMShape on which the mouse event firing this transition has occured.

Returns:
Returns the SMShape on which the mouse event firing this transition has occured.