Package org.jdesktop.swingx.util
Class WindowUtils
java.lang.Object
org.jdesktop.swingx.util.WindowUtils
Encapsulates various utilities for windows (ie:
Frame
and
Dialog
objects and descendants, in particular).-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Hide the constructor - don't wan't anybody creating an instance of this -
Method Summary
Modifier and TypeMethodDescriptionstatic Window
private static GraphicsConfiguration
static Point
getPointForCentering
(Window window) Returns thePoint
at which a window should be placed to center that window on the screen.static Point
getPointForCentering
(JInternalFrame window) Returns thePoint
at which a window should be placed to center that window on the given desktop.static Point
getPointForStaggering
(Window originWindow) Returns thePoint
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
private static boolean
-
Constructor Details
-
WindowUtils
private WindowUtils()Hide the constructor - don't wan't anybody creating an instance of this
-
-
Method Details
-
getDefaultGraphicsConfiguration
-
isUnowned
-
getUsableDeviceBounds
-
getPointForCentering
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.
- Parameters:
window
- The window to calculate the center point for. This object can not be null.- Returns:
- the
Point
at which the window should be placed to center that window on the screen.
-
getPointForCentering
Returns thePoint
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.- Parameters:
window
- The window (JInternalFrame) to calculate the center point for. This object can not be null.- Returns:
- the
Point
at which the window should be placed to center that window on the given desktop
-
getPointForStaggering
Returns thePoint
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.- Parameters:
originWindow
- Window from which the staggered location will be calculated- Returns:
- location staggered from the upper left location of the origin window
-
findWindow
-
getAllComponents
-