Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jdesktop.swingx.util
Class WindowUtils

    java.lang.Object
      org.jdesktop.swingx.util.WindowUtils

    public final class WindowUtils

extends java.lang.Object

Encapsulates various utilities for windows (ie: `Frame` and `Dialog` objects and descendants, in particular).

Author:
  Richard Bair

Nested Class Summary
`static class` | `WindowUtils.MinSizeComponentListener` Deprecated. (pre-1.6.2) no replacement

Method Summary
`static java.awt.Window` | `findWindow(java.awt.Component c)`
`static java.util.List<java.awt.Component>` | `getAllComponents(java.awt.Container c)`
`static java.awt.Point` | `getPointForCentering(javax.swing.JInternalFrame window)` Returns the `Point` at which a window should be placed to center that window on the given desktop.
`static java.awt.Point` | `getPointForCentering(java.awt.Window window)` Returns the `Point` at which a window should be placed to center that window on the screen.
`static java.awt.Point` | `getPointForStaggering(java.awt.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.
`static void` | `setMinimumSizeManager(java.awt.Window window, int minWidth, int minHeight)` Deprecated. (pre-1.6.2) no replacement; use `Window.setMinimumSize(java.awt.Dimension)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getPointForCentering

    public static java.awt.Point getPointForCentering(java.awt.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.

  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

    public static java.awt.Point getPointForCentering(javax.swing.JInternalFrame window)

  Returns the `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.

  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

    public static java.awt.Point getPointForStaggering(java.awt.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.

  Parameters:
    `originWindow` - Window from which the staggered location will be calculated
  Returns:
    location staggered from the upper left location of the origin window

### findWindow

    public static java.awt.Window findWindow(java.awt.Component c)

### getAllComponents

    public static java.util.List<java.awt.Component> getAllComponents(java.awt.Container c)

### setMinimumSizeManager

    @Deprecated
    public static void setMinimumSizeManager(java.awt.Window window,
                                                        int minWidth,
                                                        int minHeight)

  Deprecated. (pre-1.6.2) no replacement; use `Window.setMinimumSize(java.awt.Dimension)`

  Installs/resets a ComponentListener to resize the given window to minWidth/Height if needed.

  Parameters:
    `window` -
    `minWidth` -
    `minHeight` -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010. All Rights Reserved.