fr.lri.swingstates.canvas
Class CStateMachine.WheelOnShape

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.WheelOnShape
Enclosing class:
CStateMachine

public class CStateMachine.WheelOnShape
extends CStateMachine.MouseOnShape

A transition triggered by a mouse wheel event on a CShape with no mouse button down.

Author:
Caroline Appert

Constructor Summary
CStateMachine.WheelOnShape()
          Builds a transition triggered by a mouse wheel event with mo modifier down on a CShape that loops on the current state.
CStateMachine.WheelOnShape(int modifier)
          Builds a transition triggered by a mouse wheel event on a CShape that loops on the current state.
CStateMachine.WheelOnShape(int modifier, java.lang.String outState)
          Builds a transition triggered by a mouse wheel event on a CShape.
CStateMachine.WheelOnShape(java.lang.String outState)
          Builds a transition triggered by a mouse wheel event with any modifier on a CShape.
 
Method Summary
 int getScrollAmount()
           
 int getScrollType()
           
 int getUnitsToScroll()
           
 int getWheelRotation()
           
 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.WheelOnShape

public CStateMachine.WheelOnShape()
Builds a transition triggered by a mouse wheel event with mo modifier down on a CShape that loops on the current state.


CStateMachine.WheelOnShape

public CStateMachine.WheelOnShape(int modifier)
Builds a transition triggered by a mouse wheel event on a CShape that loops on the current state.

Parameters:
modifier - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT, ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT

CStateMachine.WheelOnShape

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

Parameters:
outState - The name of the output state

CStateMachine.WheelOnShape

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

Parameters:
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

getScrollAmount

public int getScrollAmount()
Returns:
the number of units that should be scrolled in response to this event.
See Also:
MouseWheelEvent.getScrollAmount()

getScrollType

public int getScrollType()
Returns:
the type of scrolling that should take place in response to this event.
See Also:
MouseWheelEvent.getScrollType()

getUnitsToScroll

public int getUnitsToScroll()
Returns:
This is a convenience method to aid in the implementation of the common-case MouseWheelListener - to scroll a ScrollPane or JScrollPane by an amount which conforms to the platform settings.
See Also:
MouseWheelEvent.getUnitsToScroll()

getWheelRotation

public int getWheelRotation()
Returns:
the number of "clicks" the mouse wheel was rotated.
See Also:
MouseWheelEvent.getWheelRotation()

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.