public abstract class WindowAdapter extends Object implements SwingWindow, WindowWrapper
Abstract base class for Swing Window implementations that are
based on java.awt.Window.
This class wraps an instance of java.awt.Window and implements
parts of the methods required by the
Window interface
in a way that they access this window's properties. Concrete sub classes will
have to implement the properties that are not supported by the
java.awt.Window class.
| Modifier | Constructor and Description |
|---|---|
protected |
WindowAdapter(Window wrappedWindow,
boolean center)
Creates a new instance of
WindowAdapter and initializes it
with the wrapped window. |
| Modifier and Type | Method and Description |
|---|---|
void |
addMouseListener(FormMouseListener l)
Adds a mouse listener to this window.
|
void |
addWindowListener(WindowListener l)
Registers the specified window listener at this window.
|
boolean |
close(boolean force)
Closes this window.
|
Component |
getComponent()
Returns the underlying component.
|
int |
getHeight()
Returns the window's height.
|
Window |
getParentWindow()
Returns the window's parent.
|
int |
getWidth()
Returns the window's width.
|
Window |
getWindow()
Returns the wrapped window object.
|
WindowClosingStrategy |
getWindowClosingStrategy()
Returns the window's closing strategy.
|
Object |
getWindowController()
Returns the window's controller.
|
net.sf.jguiraffe.gui.platform.swing.builder.window.WindowHelper |
getWindowHelper()
Returns the window helper object used by this window.
|
Collection<WindowListener> |
getWindowListeners()
Returns a collection with all registered window listeners.
|
Object |
getWrappedWindow()
Returns the wrapped (AWT) window.
|
int |
getXPos()
Returns the window's x pos.
|
int |
getYPos()
Returns the window's y pos.
|
boolean |
isVisible()
Checks if this window is visible.
|
void |
open()
Opens this window.
|
void |
packWindow()
Packs the window.
|
void |
registerAutoCloseListener()
Registers a window listener that closes the underlying window if the user
hits the close icon in the title bar.
|
void |
removeMouseListener(FormMouseListener l)
Removes a mouse listener from this window.
|
void |
removeWindowListener(WindowListener l)
Removes the specified window listener from this window.
|
void |
setBounds(int x,
int y,
int w,
int h)
Sets all coordinates for this window.
|
void |
setParentWindow(Window parent)
Sets the window's parent.
|
void |
setVisible(boolean f)
Sets the visible flag for this window.
|
void |
setWindowClosingStrategy(WindowClosingStrategy windowClosingStrategy)
Sets the window's closing strategy.
|
void |
setWindowController(Object ctrl)
Allows to set the window's controller.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdispose, getRootPanegetRootContainer, getTitle, setTitleprotected WindowAdapter(Window wrappedWindow, boolean center)
WindowAdapter and initializes it
with the wrapped window.wrappedWindow - the (AWT) window to wrapcenter - a flag whether the window should be centeredpublic net.sf.jguiraffe.gui.platform.swing.builder.window.WindowHelper getWindowHelper()
getWindowHelper in interface SwingWindowpublic Window getWindow()
public boolean isVisible()
public void setVisible(boolean f)
setVisible in interface Windowf - the flag's valuepublic void open()
public boolean close(boolean force)
WindowHelper.public int getXPos()
public int getYPos()
public int getWidth()
public int getHeight()
public void setBounds(int x,
int y,
int w,
int h)
public Window getParentWindow()
getParentWindow in interface Windowpublic void setParentWindow(Window parent)
setParentWindow in interface SwingWindowparent - the parent windowpublic void addWindowListener(WindowListener l)
addWindowListener in interface Windowl - the listener to registerpublic void removeWindowListener(WindowListener l)
removeWindowListener in interface Windowl - the listener to removepublic Collection<WindowListener> getWindowListeners()
getWindowListeners in interface SwingWindowpublic WindowClosingStrategy getWindowClosingStrategy()
getWindowClosingStrategy in interface Windowpublic void setWindowClosingStrategy(WindowClosingStrategy windowClosingStrategy)
setWindowClosingStrategy in interface WindowwindowClosingStrategy - the new closing strategypublic Object getWindowController()
getWindowController in interface Windowpublic void setWindowController(Object ctrl)
setWindowController in interface SwingWindowctrl - the new controllerpublic Object getWrappedWindow()
getWrappedWindow in interface WindowWrapperpublic Component getComponent()
getComponent in interface SwingWindowpublic void packWindow()
pack()
method of java.awt.Window.packWindow in interface SwingWindowpublic void addMouseListener(FormMouseListener l)
WindowHelper.addMouseListener in interface Windowl - the listener to be addedpublic void removeMouseListener(FormMouseListener l)
WindowHelper.removeMouseListener in interface Windowl - the listener to be removedpublic void registerAutoCloseListener()
registerAutoCloseListener in interface SwingWindowCopyright © 2016 The JGUIraffe Team. All rights reserved.