sm
Class StateMachine.State.MouseOnShape

java.lang.Object
  extended bysm.StateMachine.State.Transition
      extended bysm.StateMachine.State.EventOnPosition
          extended bysm.StateMachine.State.EventOnShape
              extended bysm.StateMachine.State.MouseOnShape
Direct Known Subclasses:
StateMachine.State.ClickOnShape, StateMachine.State.DragOnShape, StateMachine.State.MoveOnShape, StateMachine.State.PressOnShape, StateMachine.State.ReleaseOnShape
Enclosing class:
StateMachine.State

public class StateMachine.State.MouseOnShape
extends StateMachine.State.EventOnShape

A transition triggered by a mouse event on a SMShape in the canvas. The transition is specified by a button and modifiers. The position of the mouse when the transition fired can be retrieved.

Author:
Caroline Appert

Constructor Summary
StateMachine.State.MouseOnShape(java.lang.String e, int b)
          Constructs a mouse transition with any modifier that loops on the current state.
StateMachine.State.MouseOnShape(java.lang.String e, int b, int m)
          Constructs a mouse transition that loops on the current state.
StateMachine.State.MouseOnShape(java.lang.String e, int b, int m, java.lang.String a)
          Constructs a mouse transition.
StateMachine.State.MouseOnShape(java.lang.String e, int b, java.lang.String a)
          Constructs a mouse transition with any modifier.
 
Method Summary
 int getButton()
          Returns the button of the mouse event that fires this transition.
 
Methods inherited from class sm.StateMachine.State.EventOnShape
getShape, hashKey, 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.MouseOnShape

public StateMachine.State.MouseOnShape(java.lang.String e,
                                       int b,
                                       int m,
                                       java.lang.String a)
Constructs a mouse transition.

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

StateMachine.State.MouseOnShape

public StateMachine.State.MouseOnShape(java.lang.String e,
                                       int b,
                                       int m)
Constructs a mouse transition 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"*
b - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3
m - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT, ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT

StateMachine.State.MouseOnShape

public StateMachine.State.MouseOnShape(java.lang.String e,
                                       int b,
                                       java.lang.String a)
Constructs a mouse transition with any modifier.

Parameters:
e - The string describing the events for which this transition must be triggered: "Down", "Motion", "Move", "Up", "Click" or "Gesture"*
b - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3
a - The name of the output state

StateMachine.State.MouseOnShape

public StateMachine.State.MouseOnShape(java.lang.String e,
                                       int b)
Constructs a mouse transition with any 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"*
b - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3
Method Detail

getButton

public int getButton()
Returns the button of the mouse event that fires this transition.

Returns:
Returns the button of the mouse event that fires this transition (NOBUTTON, BUTTON1, BUTTON2 or BUTTON3).