Class Context

java.lang.Object
org.fest.swing.monitor.Context

@ThreadSafe class Context extends Object
Understands a monitor that maps event queues to GUI components and GUI components to event event queues.
  • Field Details

    • windowEventQueueMapping

      private final WindowEventQueueMapping windowEventQueueMapping
      Maps unique event queues to the set of root windows found on each queue.
    • eventQueueMapping

      private final EventQueueMapping eventQueueMapping
      Maps components to their corresponding event queues.
    • lock

      private final Object lock
  • Constructor Details

  • Method Details

    • rootWindows

      Collection<Window> 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 Frame.getFrames(), but in the case of an Applet may return a few dialogs as well.
      Returns:
      all available root windows.
    • storedQueueFor

      EventQueue storedQueueFor(Component c)
    • removeContextFor

      void removeContextFor(Component component)
    • addContextFor

      void addContextFor(Component component)
    • eventQueueFor

      @RunsInEDT EventQueue eventQueueFor(Component c)
      Return the event queue corresponding to the given component. In most cases, this is the same as Toolkit.getSystemEventQueue(), but in the case of applets will bypass the AppContext and provide the real event queue.
      Parameters:
      c - the given component.
      Returns:
      the event queue corresponding to the given component
    • topParentOf

      @RunsInEDT private static Component topParentOf(Component c)
    • allEventQueues

      Collection<EventQueue> allEventQueues()
      Returns all known event queues.
      Returns:
      all known event queues.