Class EventQueueMonitor
java.lang.Object
com.sun.java.accessibility.util.EventQueueMonitor
- All Implemented Interfaces:
AWTEventListener, EventListener
The
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).- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds the specified listener to be notified when the GUI subsystem is initialized.static voidAdds the specified listener to be notified when a top level window is created or destroyed.voideventDispatched(AWTEvent theEvent) Handle events as a result of registering a listener on theEventQueueinmaybeInitialize().static AccessibleObtain theAccessibleobject at the given point on the Screen.static PointReturn the last recorded position of the mouse in screen coordinates.static Window[]Return the list of top level Windows in use in the Java Virtual Machine.static WindowReturn the top levelWindowthat currently has keyboard focus.static booleanSays whether the GUI subsystem has been initialized or not.static voidTell theEventQueueMonitorto start listening for events.static voidRemoves the specified listener to be notified when the GUI subsystem is initialized.static voidRemoves the specified listener to be notified when a top level window is created or destroyed.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
EventQueueMonitor
public EventQueueMonitor()Create a newEventQueueMonitorinstance. 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().
-
-
Method Details
-
maybeInitialize
public static void maybeInitialize()Tell theEventQueueMonitorto start listening for events. -
eventDispatched
Handle events as a result of registering a listener on theEventQueueinmaybeInitialize().- Specified by:
eventDispatchedin interfaceAWTEventListener- Parameters:
theEvent- the event to be processed
-
getAccessibleAt
Obtain theAccessibleobject at the given point on the Screen. The return value may be null if anAccessibleobject cannot be found at the particular point.- Parameters:
p- the point to be accessed- Returns:
- the
Accessibleat the specified point
-
isGUIInitialized
public static boolean isGUIInitialized()Says whether the GUI subsystem has been initialized or not. If this returns true, the assistive technology can freely create GUI component instances. If the return value is false, the assistive technology should register aGUIInitializedListenerand wait to create GUI component instances until the listener is called.- Returns:
- true if the GUI subsystem has been initialized
- See Also:
-
addGUIInitializedListener
Adds the specified listener to be notified when the GUI subsystem is initialized. Assistive technologies should get the results ofisGUIInitialized()before calling this method.- Parameters:
l- the listener to add- See Also:
-
removeGUIInitializedListener
Removes the specified listener to be notified when the GUI subsystem is initialized.- Parameters:
l- the listener to remove- See Also:
-
addTopLevelWindowListener
Adds the specified listener to be notified when a top level window is created or destroyed.- Parameters:
l- the listener to add- See Also:
-
removeTopLevelWindowListener
Removes the specified listener to be notified when a top level window is created or destroyed.- Parameters:
l- the listener to remove- See Also:
-
getCurrentMousePosition
Return the last recorded position of the mouse in screen coordinates.- Returns:
- the last recorded position of the mouse in screen coordinates
-
getTopLevelWindows
Return the list of top level Windows in use in the Java Virtual Machine.- Returns:
- an array of top level
Windows in use in the Java Virtual Machine
-
getTopLevelWindowWithFocus
Return the top levelWindowthat currently has keyboard focus.- Returns:
- the top level
Windowthat currently has keyboard focus
-