|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.richclient.util.WindowUtils
public class WindowUtils
Utility functions for manipulating the display of windows.
| Method Summary | |
|---|---|
static void |
centerOnParent(Window window,
Component parent)
Center the window relative to it's parent. |
static void |
centerOnParentAndSetVisible(Window window)
Pack the window, center it relative to it's parent, and set the window visible. |
static void |
centerOnScreen(Window window)
Take the window and center it on the screen. |
static void |
centerOnScreenAndSetVisible(Window window)
Pack the window, center it on the screen, and set the window visible. |
static Point |
getCenteringPointOnScreen(Dimension dimension)
Return the centering point on the screen for the object with the specified dimension. |
static Dimension |
getDimensionFromPercent(int percentWidth,
int percentHeight)
Return a Dimension whose size is defined not in terms of
pixels, but in terms of a given percent of the screen's width and height. |
static int |
getScreenHeight()
|
static Dimension |
getScreenSize()
Return the system screen size. |
static int |
getScreenWidth()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Dimension getScreenSize()
public static Point getCenteringPointOnScreen(Dimension dimension)
dimension - the dimension of an object
public static void centerOnScreenAndSetVisible(Window window)
window - the window to center and show.public static void centerOnScreen(Window window)
This works around a bug in setLocationRelativeTo(...): it currently does not take multiple monitors into accounts on all operating systems.
window - the window to centerpublic static void centerOnParentAndSetVisible(Window window)
window - the window to center and show.
public static void centerOnParent(Window window,
Component parent)
window - the window to centerparent - the parent
public static final Dimension getDimensionFromPercent(int percentWidth,
int percentHeight)
Dimension whose size is defined not in terms of
pixels, but in terms of a given percent of the screen's width and height.
Use to set the preferred size of a component to a certain percentage of the screen.
percentWidth - percentage width of the screen, in range
1..100.percentHeight - percentage height of the screen, in range
1..100.public static int getScreenWidth()
public static int getScreenHeight()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||