Class ActionEvent

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class ActionEvent
    extends Event
    An Event representing some type of action.
    Since:
    1.4.0
    See Also:
    Serialized Form
    • Field Detail

      • ACTION

        public static final EventType<ActionEvent> ACTION
        The only valid EventType for the ActionEvent.
    • Constructor Detail

      • ActionEvent

        public ActionEvent​(EventTarget<? extends ActionEvent> target)
        Construct a new ActionEvent with the specified event target. All ActionEvents have their type set to ACTION.
        Parameters:
        target - the event target to associate with the event
      • ActionEvent

        public ActionEvent​(EventTarget<? extends ActionEvent> target,
                           EventType<? extends Event> eventType)
        Construct a new ActionEvent with the specified event target and type. All ActionEvents have their type set to ACTION.
        Parameters:
        target - the event target to associate with the event
        eventType - the event type
      • ActionEvent

        public ActionEvent​(EventTarget<? extends ActionEvent> target,
                           EventType<? extends Event> eventType,
                           java.util.List<java.lang.Object> args)
        Construct a new ActionEvent with the specified event target, type and args. All ActionEvents have their type set to ACTION.
        Parameters:
        target - the event target to associate with the event
        eventType - the event type
        args - arguments to make available to the EventHandler
    • Method Detail

      • getEventType

        public EventType<? extends ActionEvent> getEventType()
        Description copied from class: Event
        Gets the event type of this event. Objects of the same Event class can have different event types. These event types further specify what kind of event occurred.
        Overrides:
        getEventType in class Event
        Returns:
        the event type
      • copyFor

        public ActionEvent copyFor​(java.lang.Object newSource,
                                   EventTarget<? extends Event> newTarget)
        Description copied from class: Event
        Creates and returns a copy of this event with the specified event source and target.
        Overrides:
        copyFor in class Event
        Parameters:
        newSource - the new source of the copied event
        newTarget - the new target of the copied event
        Returns:
        the event copy with the new source and target