Class FloatingWindow

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

    public class FloatingWindow
    extends DockingWindow

    A window that is floating on-top of the root window and containing another docking window.

    A window can be maximized inside the floating window just as in a root window.

    After a floating window has been closed it shouldn't be reused again.

    Floating window inherits its component properties and shaped panel properties from the root window's window area. It is possible to set specific component and shaped panel properties for a floating window in the FloatingWindowProperties, see getFloatingWindowProperties().

    A floating window is created by calling the RootWindow.createFloatingWindow(Point, Dimension, DockingWindow) method or indirectly created by calling the DockingWindow.undock(Point) method.

    It's possible to add a menu bar to the floating window. Just call:

       myFloatingWindow.getRootPane().setJMenuBar(myMenuBar);
     

    The floating window is placed as the BorderLayout.CENTER component of the content pane of the root pane. You can add additional components in the other BorderLayout positions. Example, add a status label at the bottom:

       myFloatingWindow.getRootPane().getContentPane().add(myStstusLabel, BroderLayout.SOUTH);
     
    Since:
    IDW 1.4.0
    Version:
    $Revision: 1.51 $
    See Also:
    Serialized Form
    • Field Detail

      • dialog

        private java.awt.Window dialog
      • dragPanel

        private javax.swing.JPanel dragPanel
      • titleUpdater

        private java.lang.Runnable titleUpdater
      • awtMouseEventListener

        private java.awt.event.AWTEventListener awtMouseEventListener
    • Method Detail

      • setWindow

        public void setWindow​(DockingWindow newWindow)
        Sets the top level docking window inside this floating window.
        Parameters:
        newWindow - the top level docking window, null for no window i.e. empty floating window
      • getWindow

        public DockingWindow getWindow()
        Returns the top level docking window inside this floating window.
        Returns:
        the top level docking window inside this floating window
      • setMaximizedWindow

        public void setMaximizedWindow​(DockingWindow window)
        Sets the maximized window in this floating window.
        Parameters:
        window - the window to maximize, must be a member of the window tree inside this floating window
      • getMaximizedWindow

        public DockingWindow getMaximizedWindow()
        Returns the maximized window in this floating window.
        Returns:
        maximized window or null if no window is maximized
      • getFloatingWindowProperties

        public FloatingWindowProperties getFloatingWindowProperties()

        Returns the property values for this floating window.

        Floating window inherits its component properties and shaped panel properties from the root window's window area. It is possible to set specific component and shaped panel properties for a floating window in the FloatingWindowProperties.

        Returns:
        the property values for this floating window
      • getWindowProperties

        public DockingWindowProperties getWindowProperties()

        Returns the properties for this window.

        Note: A floating window only uses the close enabled and title provider properties of the docking window properties.

        Overrides:
        getWindowProperties in class DockingWindow
        Returns:
        the properties for this window
      • minimize

        public void minimize()
        Floating window cannot be minimized
        Overrides:
        minimize in class DockingWindow
      • minimize

        public void minimize​(Direction direction)
        Floating window cannot be minimized
        Overrides:
        minimize in class DockingWindow
        Parameters:
        direction -
      • isDockable

        public boolean isDockable()
        Description copied from class: DockingWindow
        Returns true if this window can be docked to the root window from a floating window.
        Overrides:
        isDockable in class DockingWindow
        Returns:
        true if this window can be docked
        See Also:
        DockingWindow.dock()
      • close

        public void close()
        Description copied from class: DockingWindow

        Removes this window from it's window parent. If the window parent is a split window or a tab window with one child, it will be removed as well.

        The location of this window is saved and the window can be restored to that location using the DockingWindow.restore() method.

        This method will call the DockingWindowListener.windowClosed(DockingWindow) method of all the listeners of this window and all window ancestors. The listeners of child windows will not be notified, for example closing a tab window containing views will not notify the listeners of views in that tab window.

        Overrides:
        close in class DockingWindow
      • getIcon

        public javax.swing.Icon getIcon()
        Description copied from class: DockingWindow
        Returns the icon for this window.
        Specified by:
        getIcon in class DockingWindow
        Returns:
        the icon
      • getChildWindow

        public DockingWindow getChildWindow​(int index)
        Description copied from class: DockingWindow
        Returns the child window with index index.
        Specified by:
        getChildWindow in class DockingWindow
        Parameters:
        index - the child window index
        Returns:
        the child window
      • getChildWindowCount

        public int getChildWindowCount()
        Description copied from class: DockingWindow
        Returns the number of child windows.
        Specified by:
        getChildWindowCount in class DockingWindow
        Returns:
        the number of child windows
      • startDrag

        void startDrag()
      • stopDrag

        void stopDrag()
      • getDragPanel

        javax.swing.JPanel getDragPanel()
      • windowContainsPoint

        boolean windowContainsPoint​(java.awt.Point p)
      • internalSetMaximizedWindow

        private void internalSetMaximizedWindow​(DockingWindow window)
      • doUpdateTitle

        private void doUpdateTitle()
      • updateFloatingWindow

        private void updateFloatingWindow​(java.util.Map map)
      • setInternalSize

        private void setInternalSize​(java.awt.Dimension size)
      • read

        protected DockingWindow read​(java.io.ObjectInputStream in,
                                     ReadContext context,
                                     ViewReader viewReader)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        protected void write​(java.io.ObjectOutputStream out,
                             WriteContext context,
                             ViewWriter viewWriter)
                      throws java.io.IOException
        Overrides:
        write in class DockingWindow
        Throws:
        java.io.IOException