|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.lri.swingstates.sm.Transition
fr.lri.swingstates.sm.transitions.Event
fr.lri.swingstates.sm.transitions.EventOnPosition
fr.lri.swingstates.canvas.CStateMachine.EventOnShape
fr.lri.swingstates.canvas.CStateMachine.MouseOnShape
public class CStateMachine.MouseOnShape
A transition triggered by a mouse event on a CShape in the canvas.
MouseOnShape is the super class of
PressOnShape: mouse button pressed on a shape in the
canvas
ReleaseOnShape: mouse button released on a shape in
the canvas
MoveOnShape: mouse moved on a shape in the canvas
DragOnShape: mouse dragged on a shape in the canvas
(move with a button pressed)
EnterOnShape: mouse cursor entered on a shape in the
canvas
LeaveOnShape: mouse cursor left a shape in the
canvas
For instance, the following code allows to specify a transition that fires only on the background of the canvas, where no shape is displayed. First specify an empty transition that fires on any shape, then a transition that fires anywhere on the canvas. For example:
public State s = new State () {
Transition tshape = new PressOnShape (BUTTON1) { ... }; // captures button presses on shapes
Transition tbackground = new Press (BUTTON1) { ... }; // captures button presses on background
}
| Constructor Summary | |
|---|---|
CStateMachine.MouseOnShape()
Builds a mouse transition with any modifier that loops on the current state. |
|
CStateMachine.MouseOnShape(int button)
Builds a mouse transition with any modifier that loops on the current state. |
|
CStateMachine.MouseOnShape(int button,
int modifier)
Builds a mouse transition that loops on the current state. |
|
CStateMachine.MouseOnShape(int button,
int modifier,
java.lang.String outState)
Builds a mouse transition. |
|
CStateMachine.MouseOnShape(int button,
java.lang.String outState)
Builds a mouse transition with any modifier. |
|
CStateMachine.MouseOnShape(java.lang.String outState)
Builds a mouse transition with any modifier. |
|
| Method Summary | |
|---|---|
int |
getButton()
Returns the button of the mouse event that fires this transition. |
java.awt.event.InputEvent |
getInputEvent()
|
int |
getModifier()
Returns the modifier of the event that fires this transition. |
java.awt.event.MouseEvent |
getMouseEvent()
|
java.awt.geom.Point2D |
getPoint()
Returns the location at which this transition has occured. |
CShape |
getShape()
Returns the CShape on which the event firing this transition has occured. |
java.lang.String |
toString()
|
| Methods inherited from class fr.lri.swingstates.canvas.CStateMachine.EventOnShape |
|---|
matches |
| 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 |
|---|
public CStateMachine.MouseOnShape(java.lang.String outState)
outState - The name of the output statepublic CStateMachine.MouseOnShape()
public CStateMachine.MouseOnShape(int button,
int modifier,
java.lang.String outState)
button - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2
or BUTTON3modifier - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT,
ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFToutState - The name of the output state
public CStateMachine.MouseOnShape(int button,
int modifier)
button - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2
or BUTTON3modifier - The modifier: NOMODIFIER, CONTROL, ALT, SHIFT,
ALT_CONTROL, CONTROL_SHIFT, ALT_SHIFT or ALT_CONTROL_SHIFT
public CStateMachine.MouseOnShape(int button,
java.lang.String outState)
button - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2
or BUTTON3outState - The name of the output statepublic CStateMachine.MouseOnShape(int button)
button - The button of the mouse event: NOBUTTON, BUTTON1, BUTTON2
or BUTTON3| Method Detail |
|---|
public int getButton()
public int getModifier()
public java.awt.event.InputEvent getInputEvent()
public java.awt.event.MouseEvent getMouseEvent()
public java.awt.geom.Point2D getPoint()
getPoint in class CStateMachine.EventOnShapepublic CShape getShape()
getShape in class CStateMachine.EventOnShapepublic java.lang.String toString()
toString in class CStateMachine.EventOnShape
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||