fr.lri.swingstates.canvas
Class CStateMachine.ClickOnShape

java.lang.Object
  extended by fr.lri.swingstates.sm.Transition
      extended by fr.lri.swingstates.sm.transitions.Event
          extended by fr.lri.swingstates.sm.transitions.EventOnPosition
              extended by fr.lri.swingstates.canvas.CStateMachine.EventOnShape
                  extended by fr.lri.swingstates.canvas.CStateMachine.MouseOnShape
                      extended by fr.lri.swingstates.canvas.CStateMachine.ClickOnShape
Enclosing class:
CStateMachine

public class CStateMachine.ClickOnShape
extends CStateMachine.MouseOnShape

A transition triggered by a mouse button clicked on a CShape. A click is defined as a quick succession of mouse press and mouse release, without significant motion in between. Note that the mouse press and mouse release events are always sent, even when a mouse click event is sent.

Author:
Caroline Appert

Constructor Summary
CStateMachine.ClickOnShape()
          Builds a transition triggered by a mouse clicked event with any modifier and any button on a CShape that loops on the current state.
CStateMachine.ClickOnShape(int button)
          Builds a transition triggered by a mouse clicked event with any modifier on a CShape that loops on the current state.
CStateMachine.ClickOnShape(int button, int modifier)
          Builds a transition triggered by a mouse clicked event on a CShape that loops on the current state.
CStateMachine.ClickOnShape(int button, int modifier, java.lang.String outState)
          Builds a transition triggered by a mouse clicked event on a CShape.
CStateMachine.ClickOnShape(int button, java.lang.String outState)
          Builds a transition triggered by a mouse clicked event with any modifier on a CShape.
CStateMachine.ClickOnShape(java.lang.String outState)
          Builds a transition triggered by a mouse clicked event with any modifier on a CShape.
 
Method Summary
 boolean matches(java.util.EventObject eventObject)
          Tests if an event can trigger that transition.
 
Methods inherited from class fr.lri.swingstates.canvas.CStateMachine.MouseOnShape
getButton, getInputEvent, getModifier, getMouseEvent, getPoint, getShape, toString
 
Methods inherited from class fr.lri.swingstates.sm.Transition
action, getEvent, getInputState, getOutputState, guard, oldToString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CStateMachine.ClickOnShape

public CStateMachine.ClickOnShape()
Builds a transition triggered by a mouse clicked event with any modifier and any button on a CShape that loops on the current state.


CStateMachine.ClickOnShape

public CStateMachine.ClickOnShape(java.lang.String outState)
Builds a transition triggered by a mouse clicked event with any modifier on a CShape.

Parameters:
outState - The name of the output state

CStateMachine.ClickOnShape

public CStateMachine.ClickOnShape(int button)
Builds a transition triggered by a mouse clicked event with any modifier on a CShape that loops on the current state.

Parameters:
button - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3

CStateMachine.ClickOnShape

public CStateMachine.ClickOnShape(int button,
                                  int modifier)
Builds a transition triggered by a mouse clicked event on a CShape that loops on the current state.

Parameters:
button - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3
modifier - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT, ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT

CStateMachine.ClickOnShape

public CStateMachine.ClickOnShape(int button,
                                  java.lang.String outState)
Builds a transition triggered by a mouse clicked event with any modifier on a CShape.

Parameters:
button - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3
outState - The name of the output state

CStateMachine.ClickOnShape

public CStateMachine.ClickOnShape(int button,
                                  int modifier,
                                  java.lang.String outState)
Builds a transition triggered by a mouse clicked event on a CShape.

Parameters:
button - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3
modifier - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT, ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT
outState - The name of the output state
Method Detail

matches

public boolean matches(java.util.EventObject eventObject)
Tests if an event can trigger that transition.

Overrides:
matches in class CStateMachine.EventOnShape
Parameters:
eventObject - The event to test
Returns:
True if the eventObject can trigger this transition.