public abstract class EventOnComponent extends EventOnPosition
Transition tcomponent = new EventOnComponent("anEvent") { public void action() { // colors in red the component on which the transition has been fired getComponent().setBackground(Color.RED); } }
Constructor and Description |
---|
EventOnComponent(java.lang.Class eventClass)
Builds a transition on a JComponent with no modifier that loops on the current state.
|
EventOnComponent(java.lang.Class eventClass,
java.lang.String outState)
Builds a transition on a component with no modifier.
|
EventOnComponent(java.lang.String keyEvent)
Builds a transition on a JComponent with no modifier that loops on the current state.
|
EventOnComponent(java.lang.String keyEvent,
java.lang.String outState)
Builds a transition on a component with no modifier.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
getComponent()
Returns the component on which the mouse event firing this transition has occured.
|
java.awt.geom.Point2D |
getPointInComponent(java.awt.Component c)
Returns the location at which this transition
has occured in the coordinate system of a given component.
|
boolean |
matches(java.util.EventObject eventObject)
Tests if an event can trigger that transition.
|
java.lang.String |
toString() |
getPoint
getClassEvent
action, getEvent, getInputState, getOutputState, guard, manageEventID, oldToString, pickingRequired, setTriggeringEvent
public EventOnComponent(java.lang.String keyEvent)
keyEvent
- The string describing the events for which this transition must be triggeredpublic EventOnComponent(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 EventOnComponent(java.lang.Class eventClass)
eventClass
.eventClass
- The class of eventspublic EventOnComponent(java.lang.Class eventClass, java.lang.String outState)
eventClass
.eventClass
- The class of eventsoutState
- The name of the output statepublic java.lang.String toString()
toString
in class EventOnPosition
public java.awt.Component getComponent()
public java.awt.geom.Point2D getPointInComponent(java.awt.Component c)
c
- the component defining the coordinate system.public boolean matches(java.util.EventObject eventObject)
matches
in class EventOnPosition
eventObject
- The event to testeventObject
can trigger this transition.