public final class WindowUtils extends Object
Frame
and
Dialog
objects and descendants, in particular).Modifier | Constructor and Description |
---|---|
private |
WindowUtils()
Hide the constructor - don't wan't anybody creating an instance of this
|
Modifier and Type | Method and Description |
---|---|
static Window |
findWindow(Component c) |
static List<Component> |
getAllComponents(Container c) |
private static GraphicsConfiguration |
getDefaultGraphicsConfiguration() |
static Point |
getPointForCentering(JInternalFrame window)
Returns the
Point at which a window should be placed to
center that window on the given desktop. |
static Point |
getPointForCentering(Window window)
Returns the
Point at which a window should be placed to
center that window on the screen. |
static Point |
getPointForStaggering(Window originWindow)
Returns the
Point at which a window should be placed in
order to be staggered slightly from another "origin" window to
ensure that the title areas of both windows remain visible to the user. |
private static Rectangle |
getUsableDeviceBounds(GraphicsConfiguration gc) |
private static boolean |
isUnowned(Window window) |
private WindowUtils()
private static GraphicsConfiguration getDefaultGraphicsConfiguration()
private static Rectangle getUsableDeviceBounds(GraphicsConfiguration gc)
public static Point getPointForCentering(Window window)
Returns the Point
at which a window should be placed to
center that window on the screen.
Some thought was taken as to whether to implement a method such as this, or to simply make a method that, given a window, will center it. It was decided that it is better to not alter an object within a method.
window
- The window to calculate the center point for. This object
can not be null.Point
at which the window should be placed to
center that window on the screen.public static Point getPointForCentering(JInternalFrame window)
Point
at which a window should be placed to
center that window on the given desktop.
Some thought was taken as to whether to implement a method such as this,
or to simply make a method that, given a window, will center it. It was
decided that it is better to not alter an object within a method.
window
- The window (JInternalFrame) to calculate the center point
for. This object can not be null.Point
at which the window should be placed to
center that window on the given desktoppublic static Point getPointForStaggering(Window originWindow)
Point
at which a window should be placed in
order to be staggered slightly from another "origin" window to
ensure that the title areas of both windows remain visible to the user.
originWindow
- Window from which the staggered location will be calculatedpublic static Window findWindow(Component c)
public static List<Component> getAllComponents(Container c)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses