|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.extensions.jfcunit.WindowMonitor
The WindowMonitor class is used to monitor for windows that might not show up in Frame.getFrames(). So we must watch for these windows to be opened.
Nested Class Summary | |
private class |
WindowMonitor.DispatchThread
Handle all Component events in a separate thread. |
private static class |
WindowMonitor.WindowEventItem
WindowEventItem is the basic type that handles the queue for queueWindowEvent and the DispatchThread. |
Field Summary | |
private static java.lang.Object |
QLOCK
Lock for the event queue and dispatch thread. |
private static WindowMonitor.DispatchThread |
s_dt
The dispatch thread used to process the event queue. |
private static boolean |
s_running
Flag used to shutdown the window monitor. |
private static WindowMonitor |
s_singleton
A handle to this class instance. |
private static WindowMonitor.WindowEventItem |
s_windowEventQueue
Event queue item or null if no pending items. |
private static java.util.ArrayList |
WINDOWS
All Non-Popup Windows which have been found. |
Constructor Summary | |
private |
WindowMonitor()
Constructor. |
Method Summary | |
private boolean |
containsKey(java.awt.Window key)
Check to see if the key is in the current list. |
void |
eventDispatched(java.awt.AWTEvent theEvent)
Event dispatch implementation. |
private static void |
flushAWT()
Flush the AWT Event Queue. |
private static WindowMonitor |
getSingleton()
return the singleton instance. |
static java.awt.Window[] |
getWindows()
Get all of the windows which are open. |
private static void |
populateWindows(java.awt.Window w)
Populate frames. |
private static void |
processEvent(java.awt.AWTEvent theEvent)
Processes the events by adding the event onto the event queue to be processed by the dispatch thread. |
private static void |
queueWindowEvent(java.awt.event.WindowEvent we)
Queue the event. |
private java.lang.Object |
remove(java.awt.Window key)
Remove the window from the list. |
static void |
start()
Start the monitor. |
static void |
stop()
Stop the monitor. |
private void |
stopInternal()
Stop the window monitor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static WindowMonitor s_singleton
private static WindowMonitor.DispatchThread s_dt
private static volatile boolean s_running
private static WindowMonitor.WindowEventItem s_windowEventQueue
private static final java.lang.Object QLOCK
private static final java.util.ArrayList WINDOWS
Constructor Detail |
private WindowMonitor()
Method Detail |
public static java.awt.Window[] getWindows()
public static void start()
public static void stop()
public void eventDispatched(java.awt.AWTEvent theEvent)
eventDispatched
in interface java.awt.event.AWTEventListener
theEvent
- AWTEvent which is to be processed.private static WindowMonitor getSingleton()
private static void flushAWT()
private static void populateWindows(java.awt.Window w)
w
- Frame to be traversed.private static void processEvent(java.awt.AWTEvent theEvent)
theEvent
- The event to be processed.private static void queueWindowEvent(java.awt.event.WindowEvent we)
we
- WindowEvent to be queued.private void stopInternal()
private boolean containsKey(java.awt.Window key)
key
- Window to search for.
private java.lang.Object remove(java.awt.Window key)
key
- Window to be removed.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |