Class EventType<T extends Event>
- Type Parameters:
-
T- the event class to which this type applies
- All Implemented Interfaces:
Serializable
public final class EventType<T extends Event> extends Object implements Serializable
Event. Event types form a hierarchy with the ROOT (equals to Event.ANY) as its root. This is useful in event filter / handler registration where a single event filter / handler can be registered to a super event type and will be receiving its sub type events as well. Note that you cannot construct two different EventType objects with the same name and parent.
Note about deserialization: All EventTypes that are going to be deserialized (e.g. as part of Event deserialization), need to exist at the time of deserialization. Deserialization of EventType will not create new EventType objects.
- Since:
- JavaFX 2.0
- See Also:
Field Summary
| Modifier and Type | Field | Description |
|---|---|---|
static final EventType |
ROOT |
The root event type. |
Constructor Summary
| Constructor | Description |
|---|---|
EventType() |
Deprecated. Do not use this constructor, as only one such EventType can exist |
EventType |
Constructs a new EventType with the specified name and the EventType.ROOT as its super type. |
EventType |
Constructs a new EventType with the specified super type and the name set to null. |
EventType |
Constructs a new EventType with the specified super type and name. |
Method Summary
Field Details
ROOT
public static final EventType<Event> ROOT
null.Constructor Details
EventType
@Deprecated public EventType()
EventType with the EventType.ROOT as its super type and the name set to null.EventType
public EventType(String name)
EventType with the specified name and the EventType.ROOT as its super type.- Parameters:
-
name- the name - Throws:
-
IllegalArgumentException- if an EventType with the same name andROOT/Event.ANYas parent
EventType
public EventType(EventType<? super T> superType)
EventType with the specified super type and the name set to null.- Parameters:
-
superType- the event super type - Throws:
-
IllegalArgumentException- if an EventType with "null" name and under this supertype exists
EventType
public EventType(EventType<? super T> superType, String name)
EventType with the specified super type and name.- Parameters:
-
superType- the event super type -
name- the name - Throws:
-
IllegalArgumentException- if an EventType with the same name and superType exists
Method Details
getSuperType
public final EventType<? super T> getSuperType()
null only for the EventType.ROOT.- Returns:
- the super type
getName
public final String getName()
- Returns:
- the name
toString
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.