public class CElementEvent extends Event
A transition triggered by a CElement
each time this
CElement
is modified. For example, one can want to track
the potential collisions of a given shape ball
with the
left edge of the canvas.
Transition tshape = CElementEvent(ball) { public boolean guard() { return ((CShape)getCElement()).getMinX() < 0; } public void action() { ... // do something } }
Constructor and Description |
---|
CElementEvent(CElement cElement)
Builds a transition that loops on the current state triggered by any
changes on a
CElement . |
CElementEvent(CElement cElement,
java.lang.String outState)
Builds a transition triggered by any changes on a
CElement . |
Modifier and Type | Method and Description |
---|---|
CElement |
getCElement() |
VirtualCElementEvent |
getCElementEvent() |
boolean |
matches(java.util.EventObject eventObject)
Tests if an event can trigger that transition.
|
getClassEvent, toString
action, getEvent, getInputState, getOutputState, guard, manageEventID, oldToString, pickingRequired, setTriggeringEvent
public CElementEvent(CElement cElement)
CElement
.cElement
- The CElement
to track.public CElementEvent(CElement cElement, java.lang.String outState)
CElement
.cElement
- The CElement
to track.outState
- The name of the output state.public CElement getCElement()
CElement
that has just triggered this
animation.public boolean matches(java.util.EventObject eventObject)
public VirtualCElementEvent getCElementEvent()