public abstract class EventOnShape extends EventOnPosition
A transition triggered on a CShape in the canvas. OnShape transitions allow developpers to retrieve the shape in the canvas where this transition has been fired:
Transition tshape = new EventOnShape ("anEvent") {
public void action() {
// colors in red the shape on which the transition has been fired
getShape().setFillPaint(Color.RED);
}
}
| Constructor and Description |
|---|
EventOnShape(java.lang.Class eventClass)
Builds a transition on a CShape with no modifier that can be
triggered by any virtual events whose type is a subclass of
eventClass. |
EventOnShape(java.lang.Class eventClass,
java.lang.String outState)
Builds a transition on a CShape with no modifier that can be
triggered by any virtual events whose type is a subclass of
eventClass. |
EventOnShape(java.lang.String keyEvent)
Builds a transition on a CShape with no modifier that loops on the
current state.
|
EventOnShape(java.lang.String keyEvent,
java.lang.String outState)
Builds a transition on a CShape with no modifier.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
boolean |
matches(java.util.EventObject eventObject)
Tests if an event can trigger that transition.
|
boolean |
pickingRequired() |
java.lang.String |
toString() |
getClassEventaction, getEvent, getInputState, getOutputState, guard, manageEventID, oldToString, setTriggeringEventpublic EventOnShape(java.lang.String keyEvent)
keyEvent - The string describing the events for which this transition
must be triggeredpublic EventOnShape(java.lang.String keyEvent,
java.lang.String outState)
keyEvent - The string describing the events for which this transition
must be triggeredoutState - The name of the output statepublic EventOnShape(java.lang.Class eventClass,
java.lang.String outState)
eventClass.eventClass - The class of eventsoutState - The name of the output statepublic EventOnShape(java.lang.Class eventClass)
eventClass.eventClass - The class of eventspublic CShape getShape()
public java.lang.String toString()
toString in class EventOnPositionpublic java.awt.geom.Point2D getPoint()
getPoint in class EventOnPositionpublic boolean matches(java.util.EventObject eventObject)
matches in class EventOnPositioneventObject - The event to testeventObject
can trigger this transition.public boolean pickingRequired()
pickingRequired in class Transition