public class Event extends java.util.EventObject implements java.lang.Cloneable
Eventclass.
source
getSource, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static final EventTarget NULL_SOURCE_TARGET
public static final EventType<Event> ANY
protected EventType<? extends Event> eventType
protected EventTarget target
protected boolean consumed
public Event(EventType<? extends Event> eventType)
Eventwith the specified event type. The source and target of the event is set to
NULL_SOURCE_TARGET.
eventType- the event type
public Event(java.lang.Object source, EventTarget target, EventType<? extends Event> eventType)
Eventwith the specified event source, target and type. If the source or target is set to
null, it is replaced by the
NULL_SOURCE_TARGETvalue.
source- the event source which sent the event
target- the event target to associate with the event
eventType- the event type
public EventTarget getTarget()
public EventType<? extends Event> getEventType()
Eventclass can have different event types. These event types further specify what kind of event occurred.
public Event copyFor(java.lang.Object newSource, EventTarget newTarget)
null, it is replaced by the
NULL_SOURCE_TARGETvalue.
newSource- the new source of the copied event
newTarget- the new target of the copied event
public boolean isConsumed()
Eventhas been consumed by any filter or handler.
trueif this
Eventhas been consumed,
falseotherwise
public void consume()
Eventas consumed. This stops its further propagation.
public java.lang.Object clone()
Event.
clonein class
java.lang.Object
Eventwith all values copied from this
Event.
public static void fireEvent(EventTarget eventTarget, Event event)
eventTarget- the target for the event
event- the event to fire
java.lang.NullPointerException- if eventTarget or event is null
Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.