|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.event.ListenerSupport | +--com.bbn.openmap.gui.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.
Field Summary | |
protected java.awt.Point |
componentLocation
|
protected java.awt.Dimension |
componentSize
|
protected java.awt.Component |
content
|
protected javax.swing.JDialog |
dialog
The dialog used for non-internal windows. |
static java.lang.String |
DisplayWindowCmd
|
protected javax.swing.JInternalFrame |
iFrame
The frame used when the DrawingToolLauncher is used in an applet, or if Environment.useInternalFrames == true; |
static java.lang.String |
KillWindowCmd
|
protected int |
maxHeight
|
protected int |
maxWidth
|
protected java.lang.String |
title
|
Fields inherited from class com.bbn.openmap.event.ListenerSupport |
listeners, source |
Constructor Summary | |
WindowSupport(java.awt.Component content,
java.lang.String windowTitle)
Create the window support. |
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. |
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,
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()
|
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. |
void |
setMaxSize(int width,
int height)
Sets the maximum pixel size of the window. |
protected void |
setPosition(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. |
void |
setTitle(java.lang.String tle)
Sets the title of the JInternalFrame/JDialog. |
Methods inherited from class com.bbn.openmap.event.ListenerSupport |
addListener, getListeners, getSource, iterator, readObject, removeAll, removeListener, setSource, size, writeObject |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, 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 javax.swing.JInternalFrame iFrame
protected transient javax.swing.JDialog dialog
protected int maxHeight
protected int maxWidth
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.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 java.awt.Component modifyContent(java.awt.Component comp)
public void setContent(java.awt.Component comp)
public java.awt.Component getContent()
public void setMaxSize(int width, int height)
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.protected void checkBounds(java.awt.Component comp, int x, int y, int width, int height)
protected void setPosition(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()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |