Package org.fest.swing.monitor
Class WindowMonitor
java.lang.Object
org.fest.swing.monitor.WindowMonitor
Understands a monitor that keeps track of all known root windows (showing, hidden, closed.)
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Context
private final ContextMonitor
private final WindowAvailabilityMonitor
private final Windows
private final WindowStatus
-
Constructor Summary
ConstructorsConstructorDescriptionWindowMonitor
(Toolkit toolkit) Create an instance of WindowTracker which will track all windows coming and going on the current and subsequentAppContext
s.WindowMonitor
(Toolkit toolkit, Context context, WindowStatus windowStatus) -
Method Summary
Modifier and TypeMethodDescriptionReturns all known event queues.Returns the event queue corresponding to the given component.private void
static WindowMonitor
instance()
Returns the singleton instance of this class.boolean
Returns whether the window is ready to receive OS-level event input.private void
Return all available root windows.
-
Field Details
-
context
-
contextMonitor
-
windows
-
windowStatus
-
windowAvailabilityMonitor
-
-
Constructor Details
-
WindowMonitor
Create an instance of WindowTracker which will track all windows coming and going on the current and subsequentAppContext
s.WARNING: if an applet loads this class, it will only ever see stuff in its own
AppContext
.- Parameters:
toolkit
- theToolkit
to use.
-
WindowMonitor
-
-
Method Details
-
populateExistingWindows
private void populateExistingWindows() -
examine
-
isWindowReady
Returns whether the window is ready to receive OS-level event input. A window's "isShowing" flag may be settrue
before theWINDOW_OPENED
event is generated, and even after theWINDOW_OPENED
is sent the window peer is not guaranteed to be ready.- Parameters:
w
- the given window.- Returns:
- whether the window is ready to receive OS-level event input.
-
eventQueueFor
Returns the event queue corresponding to the given component. In most cases, this is the same asComponent.getToolkit().getSystemEventQueue()
, but in the case of applets will bypass theAppContext
and provide the real event queue.- Parameters:
c
- the given component.- Returns:
- the event queue corresponding to the given component.
-
allEventQueues
Returns all known event queues.- Returns:
- all known event queues.
-
rootWindows
Return all available root windows. A root window is one that has a null parent. Nominally this means a list similar to that returned by
, but in the case of anFrame.getFrames()
may return a few dialogs as well.Applet
- Returns:
- all available root windows.
-
instance
Returns the singleton instance of this class.- Returns:
- the singleton instance of this class.
-