|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.saic.isd.awt.WindowUtil
Provides helper methods for Windows.
Typical Usage:
Because this only contains static methods,
it is used when needed, where needed.
Primary Life Cycle:
None.
Synchronization:
Thread safe because all methods using static variables are synchronized.
Field Summary | |
static int |
CENTER
|
static int |
NORTH_EAST_CORNER
|
static int |
NORTH_WEST_CORNER
|
Constructor Summary | |
WindowUtil()
|
Method Summary | |
static void |
addMouseListener(java.awt.Container container,
java.awt.event.MouseListener listener)
Recursively add a MouseListener to a container and all its components. |
static void |
centerOnScreen(java.awt.Window window)
Set the window location to center the window on the screen. |
static void |
limitSizeBasedOnScreen(java.awt.Window window)
Limit the window's initial size to the screen size. |
static void |
putAtPosition(java.awt.Window window,
int position)
Places a Window at a particular position. |
static void |
removeMouseListener(java.awt.Container container,
java.awt.event.MouseListener listener)
Recursively remove a MouseListener from a container and all its components. |
static void |
setLocationRelativeToLast(java.awt.Point lastPoint,
java.awt.Window window)
Set the window location based on another location. |
static void |
setLocationRelativeToLast(java.awt.Window window)
Set the window location based on the previous call to the method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CENTER
public static final int NORTH_WEST_CORNER
public static final int NORTH_EAST_CORNER
Constructor Detail |
public WindowUtil()
Method Detail |
public static void setLocationRelativeToLast(java.awt.Window window)
Note: Because this method depends on the size of the window, the pack() method of the window and any other operations that may cause a change in the windows size should be completed before using this method.
window
- to set the location onpublic static void setLocationRelativeToLast(java.awt.Point lastPoint, java.awt.Window window)
Note: Because this method depends on the size of the window, the pack() method of the window and any other operations that may cause a change in the windows size should be completed before using this method.
lastPoint
- specifies the location to use in calculating the
new window placement. Normally this would start with a point
of [0, 0] and on each call the values within the point are
incremented.window
- to set the location onpublic static void limitSizeBasedOnScreen(java.awt.Window window)
window
- to limit the sizepublic static void centerOnScreen(java.awt.Window window)
Note: Because this method depends on the size of the windw, the pack() method of the window and any other operations that may cause a change in the windows size should be completed before using this method.
window
- to set the location onpublic static void putAtPosition(java.awt.Window window, int position)
window
- window to set the location ofpublic static void addMouseListener(java.awt.Container container, java.awt.event.MouseListener listener)
container
- to add the MouseListener to.listener
- to addpublic static void removeMouseListener(java.awt.Container container, java.awt.event.MouseListener listener)
container
- to remove the MouseListener from.listener
- to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |