Class SwingWindowManager

  • All Implemented Interfaces:
    WindowManager

    public class SwingWindowManager
    extends Object
    implements WindowManager

    The Swing specific implementation of the WindowManager interface.

    Version:
    $Id: SwingWindowManager.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • SwingWindowManager

        public SwingWindowManager()
    • Method Detail

      • createInternalFrame

        public Window createInternalFrame​(WindowBuilderData builderData,
                                          WindowData data,
                                          Window wnd)
                                   throws WindowBuilderException
        Creates and initializes an internal frame window and adds it to its parent frame. This implementation will return an object derived from Swing's JInternalFrame class. This internal frame will already have been added to the parent frame's desktop. For this to work the parent window must be a Swing JFrame and it must contain a JDesktopPane instance; otherwise an exception will be thrown.
        Specified by:
        createInternalFrame in interface WindowManager
        Parameters:
        builderData - the builder data object
        data - the data for the window
        wnd - the window to be initialized
        Returns:
        the window
        Throws:
        WindowBuilderException - if an error occurs
      • initWindowBounds

        protected void initWindowBounds​(WindowAdapter window,
                                        WindowData data,
                                        Window parent)
        Initializes the bounds of the given AWT window object.
        Parameters:
        window - the adapter for the window to initialize
        data - the window data
        parent - the parent window
      • initWindowBounds

        protected void initWindowBounds​(SwingWindow window,
                                        WindowData data,
                                        Window parent)
        Initializes the bounds of a newly created window. Checks if bounds are provided in the given window data object.
        Parameters:
        window - the window to initialize
        data - the window data
        parent - the parent window
      • initSwingWindowProperties

        protected void initSwingWindowProperties​(SwingWindow window,
                                                 WindowData data,
                                                 Window parent)
        Initializes the given Swing window implementation from the given data object.
        Parameters:
        window - the window
        data - the data object
        parent - the parent window
      • createJDialog

        protected JDialog createJDialog​(WindowBuilderData builderData)
        Creates a new dialog object. This method ensures that the correct owner window will be set.
        Parameters:
        builderData - the builder data object (contains the parent window)
        Returns:
        the new dialog