Top Description Inners Fields Constructors Methods
javafx.event

public final Class EventType<T extends Event>

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Type Parameters
<T>
the event class to which this type applies
Imports
java.io.InvalidObjectException, .ObjectStreamException, .Serializable, java.util.ArrayList, .Deque, .Iterator, .LinkedList, .List, .Set, .WeakHashMap

This class represents a specific event type associated with an Event.

Event types form a hierarchy with the EventType#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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final String
public static final EventType<Event>
ROOT

The root event type.

private WeakHashMap<EventType<? extends T>, Void>
private final EventType<? super T>

Constructor Summary

AccessConstructor and Description
public
EventType()
Deprecated Do not use this constructor, as only one such EventType can exist

Constructs a new EventType with the EventType.ROOT as its super type and the name set to null.

public
EventType(final String
the name
name
)

Constructs a new EventType with the specified name and the EventType.ROOT as its super type.

public
EventType(final EventType<? super T>
the event super type
superType
)

Constructs a new EventType with the specified super type and the name set to null.

public
EventType(final EventType<? super T>
the event super type
superType
,
final String
the name
name
)

Constructs a new EventType with the specified super type and name.

pack-priv
EventType(final String name, final EventType<? super T> superType)

Internal constructor that skips various checks

Method Summary

Modifier and TypeMethod and Description
public final String

Returns:

the name
getName
()

Gets the name of this event type.

public final EventType<? super T>

Returns:

the super type
getSuperType
()

Gets the super type of this event type.

private void
register(EventType<? extends T> subType)

public String

Returns:

a string representation of this EventType object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this EventType object.

private Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private final String name
Annotations
@SuppressWarnings:doclint:missing
ROOTback to summary
public static final EventType<Event> ROOT

The root event type. All other event types are either direct or indirect sub types of it. It is also the only event type which has its super event type set to null.

subTypesback to summary
private WeakHashMap<EventType<? extends T>, Void> subTypes
Annotations
@SuppressWarnings:doclint:missing
superTypeback to summary
private final EventType<? super T> superType
Annotations
@SuppressWarnings:doclint:missing

Constructor Detail

EventTypeback to summary
public EventType()

Deprecated

Do not use this constructor, as only one such EventType can exist

Constructs a new EventType with the EventType.ROOT as its super type and the name set to null.

Annotations
@Deprecated
EventTypeback to summary
public EventType(final String name)

Constructs a new EventType with the specified name and the EventType.ROOT as its super type.

Parameters
name:String

the name

Exceptions
IllegalArgumentException:
if an EventType with the same name and EventType#ROOT/Event#ANY as parent
EventTypeback to summary
public EventType(final EventType<? super T> superType)

Constructs a new EventType with the specified super type and the name set to null.

Parameters
superType:EventType<? super T>

the event super type

Exceptions
IllegalArgumentException:
if an EventType with "null" name and under this supertype exists
EventTypeback to summary
public EventType(final EventType<? super T> superType, final String name)

Constructs a new EventType with the specified super type and name.

Parameters
superType:EventType<? super T>

the event super type

name:String

the name

Exceptions
IllegalArgumentException:
if an EventType with the same name and superType exists
EventTypeback to summary
pack-priv EventType(final String name, final EventType<? super T> superType)

Internal constructor that skips various checks

Method Detail

getNameback to summary
public final String getName()

Gets the name of this event type.

Returns:String

the name

getSuperTypeback to summary
public final EventType<? super T> getSuperType()

Gets the super type of this event type. The returned value is null only for the EventType.ROOT.

Returns:EventType<? super T>

the super type

registerback to summary
private void register(EventType<? extends T> subType)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this EventType object.

Returns:String

a string representation of this EventType object.

Annotations
@Override
writeReplaceback to summary
private Object writeReplace()
Annotations
@SuppressWarnings:doclint:missing
javafx.event back to summary

pack-priv Class EventType.EventTypeSerialization

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

Field Summary

Modifier and TypeField and Description
private List<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private EventType<T extends Event>
findSubType(Set<EventType<T extends Event>> subTypes, String name)

private Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

pathback to summary
private List<String> path

Constructor Detail

EventTypeSerializationback to summary
public EventTypeSerialization(List<String> path)

Method Detail

findSubTypeback to summary
private EventType<T extends Event> findSubType(Set<EventType<T extends Event>> subTypes, String name)
readResolveback to summary
private Object readResolve() throws ObjectStreamException