AWTEventListener
, EventListener
public class EventQueueMonitor extends Object implements AWTEventListener
EventQueueMonitor
class provides key core functionality for Assistive Technologies (and other system-level technologies that need some of the same things that Assistive Technology needs).Constructor | Description |
---|---|
EventQueueMonitor() |
Create a new EventQueueMonitor instance. |
Modifier and Type | Method | Description |
---|---|---|
static void |
addGUIInitializedListener |
Adds the specified listener to be notified when the GUI subsystem is initialized. |
static void |
addTopLevelWindowListener |
Adds the specified listener to be notified when a top level window is created or destroyed. |
void |
eventDispatched |
Handle events as a result of registering a listener on the EventQueue in maybeInitialize() . |
static Accessible |
getAccessibleAt |
Obtain the Accessible object at the given point on the Screen. |
static Point |
getCurrentMousePosition() |
Return the last recorded position of the mouse in screen coordinates. |
static Window[] |
getTopLevelWindows() |
Return the list of top level Windows in use in the Java Virtual Machine. |
static Window |
getTopLevelWindowWithFocus() |
Return the top level Window that currently has keyboard focus. |
static boolean |
isGUIInitialized() |
Says whether the GUI subsystem has been initialized or not. |
static void |
maybeInitialize() |
Tell the EventQueueMonitor to start listening for events. |
static void |
removeGUIInitializedListener |
Removes the specified listener to be notified when the GUI subsystem is initialized. |
static void |
removeTopLevelWindowListener |
Removes the specified listener to be notified when a top level window is created or destroyed. |
public EventQueueMonitor()
EventQueueMonitor
instance. Normally, this will be called only by the AWT Toolkit during initialization time. Assistive technologies should not create instances of EventQueueMonitor by themselves. Instead, they should either refer to it directly via the static methods in this class, e.g., getCurrentMousePosition()
or obtain the instance by asking the Toolkit, e.g., Toolkit.getSystemEventQueue()
.public static void maybeInitialize()
EventQueueMonitor
to start listening for events.public void eventDispatched(AWTEvent theEvent)
EventQueue
in maybeInitialize()
.eventDispatched
in interface AWTEventListener
theEvent
- the event to be processedpublic static Accessible getAccessibleAt(Point p)
Accessible
object at the given point on the Screen. The return value may be null if an Accessible
object cannot be found at the particular point.p
- the point to be accessedAccessible
at the specified pointpublic static boolean isGUIInitialized()
GUIInitializedListener
and wait to create GUI component instances until the listener is called.public static void addGUIInitializedListener(GUIInitializedListener l)
isGUIInitialized()
before calling this method.l
- the listener to addpublic static void removeGUIInitializedListener(GUIInitializedListener l)
l
- the listener to removepublic static void addTopLevelWindowListener(TopLevelWindowListener l)
l
- the listener to addpublic static void removeTopLevelWindowListener(TopLevelWindowListener l)
l
- the listener to removepublic static Point getCurrentMousePosition()
public static Window[] getTopLevelWindows()
Window
s in use in the Java Virtual Machinepublic static Window getTopLevelWindowWithFocus()
Window
that currently has keyboard focus.Window
that currently has keyboard focus
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/jdk.accessibility/com/sun/java/accessibility/util/EventQueueMonitor.html