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

pack-priv Class EventDispatchThread

extends Thread
Class Inheritance
Imports
java.awt.event.MouseEvent, .ActionEvent, .WindowEvent, java.util.ArrayList, sun.util.logging.PlatformLogger, sun.awt.dnd.SunDragSourceContextPeer

EventDispatchThread is a package-private AWT class which takes events off the EventQueue and dispatches them to the appropriate AWT components. The Thread starts a "permanent" event pump with a call to pumpEvents(Conditional) in its run() method. Event handlers can choose to block this event pump at any time, but should start a new pump (not a new EventDispatchThread) by again calling pumpEvents(Conditional). This secondary event pump will exit automatically as soon as the Conditional evaluate()s to false and an additional Event is pumped and dispatched.
Authors
Tom Ball, Amy Fowler, Fred Ecks, David Mendenhall
Since
1.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final int
private volatile boolean
private ArrayList<EventFilter>
private static final PlatformLogger
private EventQueue
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
private
EventDispatchThread()

Must always call 5 args super-class constructor passing false to indicate not to inherit locals.

pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv boolean
public synchronized EventQueue
private void
pack-priv void
pack-priv void
pumpEvents(int id, Conditional cond)

pack-priv void
pack-priv void
pack-priv void
pack-priv void
pumpEventsForHierarchy(int id, Conditional cond, Component modalComponent)

pack-priv void
pack-priv void
public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

public synchronized void
public void
Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadthreadIdtoStringyield

Field Detail

ANY_EVENTback to summary
private static final int ANY_EVENT
doDispatchback to summary
private volatile boolean doDispatch
eventFiltersback to summary
private ArrayList<EventFilter> eventFilters
eventLogback to summary
private static final PlatformLogger eventLog
theQueueback to summary
private EventQueue theQueue

Constructor Detail

EventDispatchThreadback to summary
private EventDispatchThread()

Must always call 5 args super-class constructor passing false to indicate not to inherit locals.

EventDispatchThreadback to summary
pack-priv EventDispatchThread(ThreadGroup group, String name, EventQueue queue)

Method Detail

addEventFilterback to summary
pack-priv void addEventFilter(EventFilter filter)
filterAndCheckEventback to summary
pack-priv boolean filterAndCheckEvent(AWTEvent event)
getEventQueueback to summary
public synchronized EventQueue getEventQueue()
processExceptionback to summary
private void processException(Throwable e)
pumpEventsback to summary
pack-priv void pumpEvents(Conditional cond)
pumpEventsback to summary
pack-priv void pumpEvents(int id, Conditional cond)
pumpEventsForFilterback to summary
pack-priv void pumpEventsForFilter(Conditional cond, EventFilter filter)
pumpEventsForFilterback to summary
pack-priv void pumpEventsForFilter(int id, Conditional cond, EventFilter filter)
pumpEventsForHierarchyback to summary
pack-priv void pumpEventsForHierarchy(Conditional cond, Component modalComponent)
pumpEventsForHierarchyback to summary
pack-priv void pumpEventsForHierarchy(int id, Conditional cond, Component modalComponent)
pumpOneEventForFiltersback to summary
pack-priv void pumpOneEventForFilters(int id)
removeEventFilterback to summary
pack-priv void removeEventFilter(EventFilter filter)
runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.

setEventQueueback to summary
public synchronized void setEventQueue(EventQueue eq)
stopDispatchingback to summary
public void stopDispatching()
java.awt back to summary

private Class EventDispatchThread.HierarchyEventFilter

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

Field Summary

Modifier and TypeField and Description
private Component

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Field Detail

modalComponentback to summary
private Component modalComponent

Constructor Detail

HierarchyEventFilterback to summary
public HierarchyEventFilter(Component modalComponent)

Method Detail

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

Implements java.awt.EventFilter.acceptEvent.