|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.concurrent.CopyOnWriteArrayList<E> com.bbn.openmap.event.ListenerSupport<java.awt.event.ComponentListener> com.bbn.openmap.gui.WindowSupport
public class WindowSupport
The WindowSupport class provides support for managing JFrames or JInternalFrames for other components. The frame is disposed of when the window is closed, and recreated when displayInWindow is called. The WindowSupport remembers size and location changes for the window when it is recreated.
The WindowSupport class now has inner classes that are used to create different types of windows for components. Dlg is used for JDialogs, which remain on top of the main application frame even when they don't have focus. IntrnlFrm is used for JInternalFrames, for windows that get clipped if the move off the area of the main application. Frm is used for a standard JFrame which can be obscured by the main application window. Components are free to specify which WSDisplay type they always want to be display in, or they can ask for a standard WindowSupport object which will use the static defaultWindowSupportDisplayType variable to determine the WSDisplay type (for a consistent feel across the application). The default setting for this variable is to use the Frm type.
Nested Class Summary | |
---|---|
static class |
WindowSupport.Dlg
|
static class |
WindowSupport.Frm
|
static class |
WindowSupport.IntrnlFrm
|
static interface |
WindowSupport.WSDisplay
|
Field Summary | |
---|---|
protected java.awt.Point |
componentLocation
|
protected java.awt.Dimension |
componentSize
|
protected java.awt.Component |
content
|
protected static java.lang.Class |
defaultWindowSupportDisplayType
|
protected WindowSupport.WSDisplay |
display
|
static java.lang.String |
DisplayWindowCmd
|
static java.lang.String |
KillWindowCmd
|
protected int |
maxHeight
|
protected int |
maxWidth
|
protected java.lang.Class |
persistentDisplayType
|
protected java.lang.String |
title
|
Fields inherited from class com.bbn.openmap.event.ListenerSupport |
---|
source |
Constructor Summary | |
---|---|
WindowSupport(java.awt.Component content,
java.lang.String windowTitle)
Create the window support. |
|
WindowSupport(java.awt.Component content,
WindowSupport.WSDisplay display)
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae)
|
void |
addComponentListener(java.awt.event.ComponentListener l)
Add a component listener that is interested in hearing about what happens to the window. |
protected void |
checkBounds(java.awt.Component comp,
int x,
int y,
int width,
int height)
Checks the component's dimensions against the requested values and against any maximum limits that may have been set in the WindowSupport. |
protected void |
cleanUp()
Get rid of the window used to display the content. |
void |
componentHidden(java.awt.event.ComponentEvent e)
ComponentListener method. |
void |
componentMoved(java.awt.event.ComponentEvent e)
ComponentListener method, new location is noted. |
void |
componentResized(java.awt.event.ComponentEvent e)
ComponentListener method, new size is noted. |
void |
componentShown(java.awt.event.ComponentEvent e)
ComponentListener method. |
protected WindowSupport.WSDisplay |
createDisplay(java.awt.Frame owner)
Called when a component hasn't specified what kind of window they want. |
protected WindowSupport.WSDisplay |
createDisplay(java.awt.Frame owner,
java.lang.Class displayType)
Called when a display type is known, and may override the default settings. |
void |
displayInWindow()
Display the window, and find out what the natural or revised size and location are for the window. |
void |
displayInWindow(java.awt.Frame owner)
Display the window, and find out what the natural or revised size and location are for the window. |
void |
displayInWindow(java.awt.Frame owner,
java.lang.Class displayType,
int x,
int y,
int width,
int height)
Display the window. |
void |
displayInWindow(java.awt.Frame owner,
int x,
int y,
int width,
int height)
Display the window. |
void |
displayInWindow(int x,
int y,
int width,
int height)
Display the window. |
protected void |
finalize()
|
java.awt.Point |
getComponentLocation()
Get the location of the window. |
java.awt.Dimension |
getComponentSize()
Get the size of the window. |
java.awt.Component |
getContent()
|
static java.lang.Class |
getDefaultWindowSupportDisplayType()
|
WindowSupport.WSDisplay |
getDisplay()
|
java.lang.String |
getTitle()
|
java.awt.Container |
getWindow()
Return the window displaying the content. |
void |
killWindow()
Set the window to be hidden and fire a ComponentEvent for COMPONENT_HIDDEN. |
java.awt.Component |
modifyContent(java.awt.Component comp)
Subclass method to allow modifications to content, wrappers, etc. |
void |
removeComponentListener(java.awt.event.ComponentListener l)
Remove a component listener that was interested in hearing about what happens to the window. |
void |
setComponentLocation(java.awt.Point p)
Set the location of the window. |
void |
setComponentSize(java.awt.Dimension dim)
Set the size of the window. |
void |
setContent(java.awt.Component comp)
Sets the content in the JInternalFrame/JDialog. |
protected static void |
setDefaultPosition(java.awt.Component comp)
For applications, checks where the Environment says the window should be placed, and then uses the packed height and width to make adjustments. |
static void |
setDefaultWindowSupportDisplayType(java.lang.Class defaultWindowSupportDisplayType)
|
void |
setDisplay(WindowSupport.WSDisplay dis)
|
protected void |
setFavIcon(WindowSupport.WSDisplay wsd)
Set the FavIcon for the WSDisplay. |
void |
setMaxSize(int width,
int height)
Sets the maximum pixel size of the window. |
void |
setTitle(java.lang.String tle)
Sets the title of the JInternalFrame/JDialog. |
Methods inherited from class com.bbn.openmap.event.ListenerSupport |
---|
add, add, addAll, clear, getSource, iterator, listIterator, remove, remove, set, setSource, size |
Methods inherited from class java.util.concurrent.CopyOnWriteArrayList |
---|
addAll, addAllAbsent, addIfAbsent, clone, contains, containsAll, equals, get, hashCode, indexOf, indexOf, isEmpty, lastIndexOf, lastIndexOf, listIterator, removeAll, retainAll, subList, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.awt.Component content
protected java.lang.String title
protected java.awt.Point componentLocation
protected java.awt.Dimension componentSize
public static final java.lang.String DisplayWindowCmd
public static final java.lang.String KillWindowCmd
protected transient WindowSupport.WSDisplay display
protected static java.lang.Class defaultWindowSupportDisplayType
protected int maxHeight
protected int maxWidth
protected java.lang.Class persistentDisplayType
Constructor Detail |
---|
public WindowSupport(java.awt.Component content, java.lang.String windowTitle)
content
- the content to display in the window.windowTitle
- the title of the window.public WindowSupport(java.awt.Component content, WindowSupport.WSDisplay display)
Method Detail |
---|
public void setComponentLocation(java.awt.Point p)
public java.awt.Point getComponentLocation()
public void setComponentSize(java.awt.Dimension dim)
public java.awt.Dimension getComponentSize()
public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
protected void finalize()
finalize
in class java.lang.Object
public void setTitle(java.lang.String tle)
public java.lang.String getTitle()
public void setContent(java.awt.Component comp)
public java.awt.Component getContent()
public void setMaxSize(int width, int height)
protected WindowSupport.WSDisplay createDisplay(java.awt.Frame owner)
owner
-
protected WindowSupport.WSDisplay createDisplay(java.awt.Frame owner, java.lang.Class displayType)
owner
- displayType
- a WSDisplay class to create. If null, the
persistentDisplayType will be used.
public static java.lang.Class getDefaultWindowSupportDisplayType()
public static void setDefaultWindowSupportDisplayType(java.lang.Class defaultWindowSupportDisplayType)
public void setDisplay(WindowSupport.WSDisplay dis)
public java.awt.Component modifyContent(java.awt.Component comp)
public WindowSupport.WSDisplay getDisplay()
public void displayInWindow()
public void displayInWindow(java.awt.Frame owner)
owner
- Frame for JDialogpublic void displayInWindow(int x, int y, int width, int height)
x
- the horizontal pixel location for the window.y
- the vertical pixel location for the window.width
- the horizontal size of the window, if less than or equal to
zero the content size will be used.height
- the vertical size of the window, if less than or equal to
zero the content size will be used.public void displayInWindow(java.awt.Frame owner, int x, int y, int width, int height)
owner
- Frame for JDialogx
- the horizontal pixel location for the window.y
- the vertical pixel location for the window.width
- the horizontal size of the window, if less than or equal to
zero the content size will be used.height
- the vertical size of the window, if less than or equal to
zero the content size will be used.public void displayInWindow(java.awt.Frame owner, java.lang.Class displayType, int x, int y, int width, int height)
owner
- Frame for JDialogdisplayType
- the WSDisplay class to use for the window.x
- the horizontal pixel location for the window.y
- the vertical pixel location for the window.width
- the horizontal size of the window, if less than or equal to
zero the content size will be used.height
- the vertical size of the window, if less than or equal to
zero the content size will be used.protected void checkBounds(java.awt.Component comp, int x, int y, int width, int height)
protected static void setDefaultPosition(java.awt.Component comp)
public void killWindow()
protected void cleanUp()
public void addComponentListener(java.awt.event.ComponentListener l)
public void removeComponentListener(java.awt.event.ComponentListener l)
public java.awt.Container getWindow()
protected void setFavIcon(WindowSupport.WSDisplay wsd)
wsd
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |