public class ActionEvent extends Event
Event
representing some type of action. This event type is widely
used to represent a variety of things, such as when a javafx.scene.control.Button
has been fired, when a javafx.animation.KeyFrame
has finished, and other
such usages.Modifier and Type | Field and Description |
---|---|
static EventType<ActionEvent> |
ACTION
The only valid EventType for the ActionEvent.
|
static EventType<ActionEvent> |
ANY
Common supertype for all action event types.
|
private static long |
serialVersionUID |
consumed, eventType, NULL_SOURCE_TARGET, target
Constructor and Description |
---|
ActionEvent()
Creates a new
ActionEvent with an event type of ACTION . |
ActionEvent(java.lang.Object source,
EventTarget target)
Construct a new
ActionEvent with the specified event source and target. |
Modifier and Type | Method and Description |
---|---|
ActionEvent |
copyFor(java.lang.Object newSource,
EventTarget newTarget)
Creates and returns a copy of this event with the specified event source
and target.
|
EventType<? extends ActionEvent> |
getEventType()
Gets the event type of this event.
|
private static final long serialVersionUID
public static final EventType<ActionEvent> ACTION
public static final EventType<ActionEvent> ANY
public ActionEvent()
ActionEvent
with an event type of ACTION
.
The source and target of the event is set to NULL_SOURCE_TARGET
.public ActionEvent(java.lang.Object source, EventTarget target)
ActionEvent
with the specified event source and target.
If the source or target is set to null
, it is replaced by the
NULL_SOURCE_TARGET
value. All ActionEvents have their type set to
ACTION
.source
- the event source which sent the eventtarget
- the event target to associate with the eventpublic ActionEvent copyFor(java.lang.Object newSource, EventTarget newTarget)
Event
null
, it is
replaced by the NULL_SOURCE_TARGET
value.public EventType<? extends ActionEvent> getEventType()
Event
Event
class can have different event types. These event types further specify
what kind of event occurred.getEventType
in class Event