|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jguiraffe.gui.platform.swing.builder.window.WindowHelper
class WindowHelper
An internally used helper class for the Swing window package.
This class implements some functionality common to all Swing window implementations. It further defines some helper methods. Because of Swing's inheritence hierarchy it is not possible to implement this functionality in common base classes, so the composition approach is used.
| Constructor Summary | |
|---|---|
WindowHelper(SwingWindow window)
Creates a new instance of WindowHelper and initializes it
with the associated window. |
|
| Method Summary | |
|---|---|
void |
addWindowListener(WindowListener l)
Registers the specified window listener at this window. |
static void |
center(java.awt.Component c,
Window parent)
Sets the location of the specified component so that it gets centered in the area of its parent window. |
void |
closeWindow()
Called when the window should be closed. |
protected void |
doOpenWindow()
Opens the window directly. |
static javax.swing.JDesktopPane |
findDesktopPane(java.awt.Container container)
Tries to find a desktop pane in the given container or its children. |
Window |
getParentWindow()
Returns the window's parent. |
SwingWindow |
getSwingWindow()
|
WindowClosingStrategy |
getWindowClosingStrategy()
Returns the window's closing strategy. |
java.lang.Object |
getWindowController()
Returns the window's controller. |
java.util.Collection |
getWindowListeners()
Returns a collection with all registered window listeners. |
static void |
initComponentBounds(java.awt.Component comp,
WindowData data)
Determines the bounds of the given component based on the passed in window data object. |
void |
openWindow()
Opens this window. |
void |
removeWindowListener(WindowListener l)
Removes the specified window listener from this window. |
void |
setParent(Window parent)
Sets the window's parent. |
void |
setWindowClosingStrategy(WindowClosingStrategy windowClosingStrategy)
Sets the window's closing strategy. |
void |
setWindowController(java.lang.Object ctrl)
Allows to set the window's controller. |
static boolean |
sizeDefined(WindowData data)
Checks if in the given window data object the window's size is fully defined. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WindowHelper(SwingWindow window)
WindowHelper and initializes it
with the associated window.
window - the window| Method Detail |
|---|
public SwingWindow getSwingWindow()
public WindowClosingStrategy getWindowClosingStrategy()
public void setWindowClosingStrategy(WindowClosingStrategy windowClosingStrategy)
windowClosingStrategy - the new closing strategypublic java.lang.Object getWindowController()
public void setWindowController(java.lang.Object ctrl)
ctrl - the new controllerpublic Window getParentWindow()
public void setParent(Window parent)
parent - the parent windowpublic void addWindowListener(WindowListener l)
l - the listener to registerpublic void removeWindowListener(WindowListener l)
l - the listener to removepublic java.util.Collection getWindowListeners()
public void closeWindow()
public void openWindow()
public static boolean sizeDefined(WindowData data)
data - the window data object
public static javax.swing.JDesktopPane findDesktopPane(java.awt.Container container)
container - the container to search
public static void center(java.awt.Component c,
Window parent)
c - the component to centerparent - the parent window
public static void initComponentBounds(java.awt.Component comp,
WindowData data)
pack()
method is invoked on the window).
comp - the component to initializedata - the data object with the boundsprotected void doOpenWindow()
openWindow().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||