Interface SwingWindow

  • All Superinterfaces:
    net.sf.jguiraffe.gui.builder.window.Window
    All Known Implementing Classes:
    InternalFrameAdapter, WindowAdapter

    public interface SwingWindow
    extends net.sf.jguiraffe.gui.builder.window.Window

    Definition of an extended window interface implemented by Swing window implementations.

    This interface has the purpose to simplify implementations of Swing based windows and support testing. It is used internally in this package.

    Version:
    $Id: SwingWindow.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void dispose()
      Closes this window and frees all its resources.
      Component getComponent()
      Returns the Swing component that represents this window.
      JRootPane getRootPane()
      Returns the root pane of the window.
      net.sf.jguiraffe.gui.platform.swing.builder.window.WindowHelper getWindowHelper()
      Returns the window helper used by this window.
      Collection<net.sf.jguiraffe.gui.builder.window.WindowListener> getWindowListeners()
      Returns a collection with all registered window listeners.
      void packWindow()
      "Packs" the window.
      void registerAutoCloseListener()
      Registers an internal window listener that closes this window when the user hits the close icon in the window's title bar.
      void setParentWindow​(net.sf.jguiraffe.gui.builder.window.Window parent)
      Sets this window's parent window.
      void setWindowController​(Object ctrl)
      Sets the window's controller.
      • Methods inherited from interface net.sf.jguiraffe.gui.builder.window.Window

        addMouseListener, addWindowListener, close, getHeight, getParentWindow, getRootContainer, getTitle, getWidth, getWindowClosingStrategy, getWindowController, getXPos, getYPos, isVisible, open, removeMouseListener, removeWindowListener, setBounds, setTitle, setVisible, setWindowClosingStrategy
    • Method Detail

      • getWindowListeners

        Collection<net.sf.jguiraffe.gui.builder.window.WindowListener> getWindowListeners()
        Returns a collection with all registered window listeners.
        Returns:
        a collection with the registered window listeners
      • getWindowHelper

        net.sf.jguiraffe.gui.platform.swing.builder.window.WindowHelper getWindowHelper()
        Returns the window helper used by this window.
        Returns:
        the window helper
      • getComponent

        Component getComponent()
        Returns the Swing component that represents this window.
        Returns:
        the component for this window
      • setParentWindow

        void setParentWindow​(net.sf.jguiraffe.gui.builder.window.Window parent)
        Sets this window's parent window.
        Parameters:
        parent - the new parent
      • setWindowController

        void setWindowController​(Object ctrl)
        Sets the window's controller.
        Parameters:
        ctrl - the controller
      • packWindow

        void packWindow()
        "Packs" the window. This method is called when the window is opened and no size has been set. In this case pack() must be called to ensure that a reasonable default size is calculated.
      • registerAutoCloseListener

        void registerAutoCloseListener()
        Registers an internal window listener that closes this window when the user hits the close icon in the window's title bar. This method is called by the window manager after the creation of the window if auto-close is desired.
      • getRootPane

        JRootPane getRootPane()
        Returns the root pane of the window.
        Returns:
        the window's root pane
      • dispose

        void dispose()
        Closes this window and frees all its resources. This method is called when the SwingWindow is actually to be removed.