APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.awt

pack-priv Class SequencedEvent

extends AWTEvent
implements ActiveEvent
Class Inheritance
All Implemented Interfaces
java.awt.ActiveEvent
Imports
java.io.Serial, java.util.LinkedList, sun.awt.AWTAccessor, .SunToolkit

A mechanism for ensuring that a series of AWTEvents are executed in a precise order. The nested events will be dispatched in the order in which their wrapping SequencedEvents were constructed. The only exception to this rule is if the peer of the target of the nested event was destroyed (with a call to Component.removeNotify) before the wrapping SequencedEvent was able to be dispatched. In this case, the nested event is never dispatched.
Author
David Mendenhall

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private boolean
private static boolean
private Thread
private static final int
private static final LinkedList<SequencedEvent>
private final AWTEvent
private final LinkedList<AWTEvent>
private static final long
serialVersionUID

Hides java.awt.AWTEvent.serialVersionUID.

Use serialVersionUID from JDK 1.6 for interoperability.
Inherited from java.awt.AWTEvent:
ACTION_EVENT_MASKADJUSTMENT_EVENT_MASKCOMPONENT_EVENT_MASKconsumedCONTAINER_EVENT_MASKFOCUS_EVENT_MASKfocusManagerIsDispatchingHIERARCHY_BOUNDS_EVENT_MASKHIERARCHY_EVENT_MASKidINPUT_METHOD_EVENT_MASKINPUT_METHODS_ENABLED_MASKINVOCATION_EVENT_MASKisPostedITEM_EVENT_MASKKEY_EVENT_MASKMOUSE_EVENT_MASKMOUSE_MOTION_EVENT_MASKMOUSE_WHEEL_EVENT_MASKPAINT_EVENT_MASKRESERVED_ID_MAXTEXT_EVENT_MASKWINDOW_EVENT_MASKWINDOW_FOCUS_EVENT_MASKWINDOW_STATE_EVENT_MASK

Constructor Summary

AccessConstructor and Description
public
SequencedEvent(AWTEvent
the AWTEvent which this SequencedEvent's dispatch() method will dispatch
nested
)

Constructs a new SequencedEvent which will dispatch the specified nested event.

Method Summary

Modifier and TypeMethod and Description
public final void
dispatch()

Implements java.awt.ActiveEvent.dispatch.

Dispatches the nested event after all previous nested events have been dispatched or disposed.

pack-priv final void
dispose()

Disposes of this instance.

private static final synchronized SequencedEvent
public final boolean
isFirstOrDisposed()

Sequenced events are dispatched in order, so we cannot dispatch until we are the first sequenced event in the queue (i.e. it's our turn).

Inherited from java.awt.AWTEvent:
consumeconvertToOldcopyPrivateDataIntodispatchedgetIDisConsumedparamStringsetSourcetoString

Field Detail

disposedback to summary
private boolean disposed
fxAppThreadIsDispatchThreadback to summary
private static boolean fxAppThreadIsDispatchThread
fxCheckSequenceThreadback to summary
private Thread fxCheckSequenceThread
Annotations
@SuppressWarnings:serial
IDback to summary
private static final int ID
listback to summary
private static final LinkedList<SequencedEvent> list
nestedback to summary
private final AWTEvent nested
pendingEventsback to summary
private final LinkedList<AWTEvent> pendingEvents
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.AWTEvent.serialVersionUID.

Use serialVersionUID from JDK 1.6 for interoperability.

Annotations
@Serial

Constructor Detail

SequencedEventback to summary
public SequencedEvent(AWTEvent nested)

Constructs a new SequencedEvent which will dispatch the specified nested event.

Parameters
nested:AWTEvent

the AWTEvent which this SequencedEvent's dispatch() method will dispatch

Method Detail

dispatchback to summary
public final void dispatch()

Implements java.awt.ActiveEvent.dispatch.

Dispatches the nested event after all previous nested events have been dispatched or disposed. If this method is invoked before all previous nested events have been dispatched, then this method blocks until such a point is reached.

Note

Locking protocol. Since dispose() can get EventQueue lock, dispatch() shall never call dispose() while holding the lock on the list, as EventQueue lock is held during dispatching. The locks should be acquired in the same order.

disposeback to summary
pack-priv final void dispose()

Disposes of this instance. This method is invoked once the nested event has been dispatched and handled, or when the peer of the target of the nested event has been disposed with a call to Component.removeNotify.

Note

Locking protocol. Since SunToolkit.postEvent can get EventQueue lock, it shall never be called while holding the lock on the list, as EventQueue lock is held during dispatching and dispatch() will get lock on the list. The locks should be acquired in the same order.

getFirstback to summary
private static final synchronized SequencedEvent getFirst()
isFirstOrDisposedback to summary
public final boolean isFirstOrDisposed()

Sequenced events are dispatched in order, so we cannot dispatch until we are the first sequenced event in the queue (i.e. it's our turn). But while we wait for our turn to dispatch, the event could have been disposed for a number of reasons.

java.awt back to summary

private final Class SequencedEvent.SequencedEventsFilter

extends Object
implements EventFilter
Class Inheritance
All Implemented Interfaces
java.awt.EventFilter

Field Summary

Modifier and TypeField and Description
private final SequencedEvent

Constructor Summary

AccessConstructor and Description
private
SequencedEventsFilter(SequencedEvent currentSequencedEvent)

Method Summary

Modifier and TypeMethod and Description
public EventFilter.FilterAction
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentSequencedEventback to summary
private final SequencedEvent currentSequencedEvent

Constructor Detail

SequencedEventsFilterback to summary
private SequencedEventsFilter(SequencedEvent currentSequencedEvent)

Method Detail

acceptEventback to summary
public EventFilter.FilterAction acceptEvent(AWTEvent ev)

Implements java.awt.EventFilter.acceptEvent.

Annotations
@Override