Class Window

    • Constructor Detail

      • Window

        public Window()
      • Window

        public Window​(Component content)
    • Method Detail

      • remove

        public Sequence<Component> remove​(int index,
                                          int count)
        Description copied from interface: Sequence
        Removes one or more items from the sequence.
        Specified by:
        remove in interface Sequence<Component>
        Overrides:
        remove in class Container
        Parameters:
        index - The starting index to remove.
        count - The number of items to remove, beginning with index.
        Returns:
        A sequence containing the items that were removed.
      • setVisible

        public void setVisible​(boolean visible)
        Description copied from class: Component
        Sets the component's visibility.
        Overrides:
        setVisible in class Container
        Parameters:
        visible - true if the component should be painted; false, otherwise.
      • setEnabled

        public void setEnabled​(boolean enabled)
        Description copied from class: Component
        Sets the component's enabled state. Enabled components respond to user input events; disabled components do not.
        Overrides:
        setEnabled in class Component
        Parameters:
        enabled - true if the component is enabled; false, otherwise.
      • getOwner

        public Window getOwner()
      • getRootOwner

        public Window getRootOwner()
      • getOwnedWindow

        public Window getOwnedWindow​(int index)
      • getOwnedWindowCount

        public int getOwnedWindowCount()
      • isOwner

        public boolean isOwner​(Window window)
        Tests whether this window is an owning ancestor of a given window. A window is not considered an owner of itself.
        Parameters:
        window - The window which could be an owned descendant of this window.
        Returns:
        true if this window is an owning ancestor of the given window; false otherwise.
      • isOpen

        public boolean isOpen()
        Returns this window's open state.
        Returns:
        true if the window is open; false otherwise.
      • isOpening

        public boolean isOpening()
        Returns this window's opening state.
        Returns:
        true if the window is opening; false otherwise.
      • open

        public final void open​(Display display)
        Opens the window.
        Parameters:
        display - The display on which to open this window.
      • open

        public final void open​(Window ownerArgument)
        Opens the window.
        Parameters:
        ownerArgument - The window's owner. The window is opened on the owner's display.
        Throws:
        java.lang.IllegalArgumentException - if the owner argument is null.
      • open

        public void open​(Display display,
                         Window ownerArgument)
        Opens the window.

        Note that this method is not a synchronous call, it schedules an event to open the window.

        Parameters:
        display - The display on which the window will be opened.
        ownerArgument - The window's owner, or null if the window has no owner.
      • isClosed

        public boolean isClosed()
        Returns this window's closed state.
        Returns:
        true if the window is closed; false otherwise.
      • isClosing

        public boolean isClosing()
        Returns this window's closing state.
        Returns:
        true if the window is closing; false otherwise.
      • close

        public void close()
        Closes the window and all of its owned windows. If any owned window fails to close, this window will also fail to close.
      • getTitle

        public java.lang.String getTitle()
        Returns the window's title.
        Returns:
        The pane's title, or null if no title is set.
      • setTitle

        public void setTitle​(java.lang.String title)
        Sets the window's title.
        Parameters:
        title - The new title, or null for no title.
      • setIcon

        public void setIcon​(java.net.URL iconURL)
        Sets the window's icon by URL.

        If the icon already exists in the application context resource cache, the cached value will be used. Otherwise, the icon will be loaded synchronously and added to the cache.

        Parameters:
        iconURL - The location of the icon to set.
      • setContent

        public void setContent​(Component content)
      • getClientArea

        public Bounds getClientArea()
        Returns:
        The bounds of the window's client area.
      • isActive

        public boolean isActive()
        Returns the window's active state.
        Returns:
        true if the window is active; false; otherwise.
      • requestActive

        public boolean requestActive()
        Requests that this window become the active window.
        Returns:
        true if the window became active; false otherwise.
      • setActive

        protected void setActive​(boolean active,
                                 Window obverseWindow)
        Called to notify a window that its active state has changed.
        Parameters:
        active - The new value of the "active" state for this window.
        obverseWindow - The "other" window (that is now in the obverse state).
      • getActiveWindow

        public static Window getActiveWindow()
        Returns the currently active window.
        Returns:
        The window that is currently active, or null if no window is active.
      • clearActive

        public static void clearActive()
        Clears the active window.
      • getFocusDescendant

        public Component getFocusDescendant()
        Returns:
        The window descendant to which focus will be restored when this window is moved to the front.
      • clearFocusDescendant

        public void clearFocusDescendant()
        Clears the window descendant to which focus will be restored when this window is moved to the front, meaning that when this window is moved to front, focus will not be restored to the window.
      • isTopMost

        public boolean isTopMost()
        Determines if this is the top-most window.
        Returns:
        true if this window is at the top of the Z-order of its display.
      • isBottomMost

        public boolean isBottomMost()
        Determines if this is the bottom-most window.
        Returns:
        true if this window is at the bottom of the Z-order of its display.
      • moveToFront

        public void moveToFront()
        Moves the window to the top of the window stack. All owned windows are subsequently moved to the front, ensuring that this window's owned windows remain on top of it. If the window does not have any owned windows, focus is restored to it.
      • moveToBack

        public void moveToBack()
        Moves the window to the bottom of the window stack. If the window is active, the active window will be cleared. If the window is the focus host, the focus will be cleared.
      • isMaximized

        public boolean isMaximized()
      • setMaximized

        public void setMaximized​(boolean maximized)