Class SwingWindowManager
- java.lang.Object
-
- net.sf.jguiraffe.gui.platform.swing.builder.window.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 Summary
Constructors Constructor Description SwingWindowManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Window
createDialog(WindowBuilderData builderData, WindowData data, boolean modal, Window wnd)
Creates a dialog window.Window
createFrame(WindowBuilderData builderData, WindowData data, Window wnd)
Creates a frame window.Window
createInternalFrame(WindowBuilderData builderData, WindowData data, Window wnd)
Creates and initializes an internal frame window and adds it to its parent frame.protected JDialog
createJDialog(WindowBuilderData builderData)
Creates a new dialog object.protected void
initSwingWindowProperties(SwingWindow window, WindowData data, Window parent)
Initializes the given Swing window implementation from the given data object.protected void
initWindowBounds(SwingWindow window, WindowData data, Window parent)
Initializes the bounds of a newly created window.protected void
initWindowBounds(WindowAdapter window, WindowData data, Window parent)
Initializes the bounds of the given AWT window object.
-
-
-
Method Detail
-
createFrame
public Window createFrame(WindowBuilderData builderData, WindowData data, Window wnd) throws WindowBuilderException
Creates a frame window. This implementation returns a wrapper for ajavax.swing.JFrame
object.- Specified by:
createFrame
in interfaceWindowManager
- Parameters:
builderData
- the builder data objectdata
- the data for the windowwnd
- the window to be initialized- Returns:
- the window
- Throws:
WindowBuilderException
- if an error occurs
-
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'sJInternalFrame
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 SwingJFrame
and it must contain aJDesktopPane
instance; otherwise an exception will be thrown.- Specified by:
createInternalFrame
in interfaceWindowManager
- Parameters:
builderData
- the builder data objectdata
- the data for the windowwnd
- the window to be initialized- Returns:
- the window
- Throws:
WindowBuilderException
- if an error occurs
-
createDialog
public Window createDialog(WindowBuilderData builderData, WindowData data, boolean modal, Window wnd) throws WindowBuilderException
Creates a dialog window. This implementation returns a wrapper for ajavax.swing.JDialog
object.- Specified by:
createDialog
in interfaceWindowManager
- Parameters:
builderData
- the builder data objectdata
- the data for the windowmodal
- the modal flagwnd
- 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 initializedata
- the window dataparent
- 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 initializedata
- the window dataparent
- 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 windowdata
- the data objectparent
- 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
-
-