## org.jfree.report.modules.gui.swing.common
Class SwingUtil

    java.lang.Object
      org.jfree.report.modules.gui.swing.common.SwingUtil

    public class SwingUtil

extends java.lang.Object

Creation-Date: 20.11.2006, 22:42:21

Author:
  Thomas Morgner

Method Summary
`static void` `centerDialogInParent(java.awt.Dialog dialog)` Positions the specified dialog within its parent.
`static void` `centerFrameOnScreen(java.awt.Window frame)` Positions the specified frame in the middle of the screen.
`static java.awt.Point` `getCenterPoint()` Computes the center point of the current screen device.
`static java.awt.Rectangle` `getMaximumWindowBounds()` Computes the maximum bounds of the current screen device.
`static java.awt.Window` `getWindowAncestor(java.awt.Component component)`
`static void` `positionDialogRelativeToParent(java.awt.Dialog dialog, double horizontalPercent, double verticalPercent)` Positions the specified dialog at a position relative to its parent.
`static void` `positionFrameOnScreen(java.awt.Window frame, double horizontalPercent, double verticalPercent)` Positions the specified frame at a relative position in the screen, where 50% is considered to be the center of the screen.
`static void` `positionFrameRandomly(java.awt.Window frame)` Positions the specified frame at a random location on the screen while ensuring that the entire frame is visible (provided that the frame is smaller than the screen).

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

Method Detail

### getCenterPoint

    public static java.awt.Point getCenterPoint()

  Computes the center point of the current screen device. If this method is called on JDK 1.4, Xinerama-aware results are returned. (See Sun-Bug-ID 4463949 for details).

  Returns:
    the center point of the current screen.

### getMaximumWindowBounds

    public static java.awt.Rectangle getMaximumWindowBounds()

  Computes the maximum bounds of the current screen device. If this method is called on JDK 1.4, Xinerama-aware results are returned. (See Sun-Bug-ID 4463949 for details).

  Returns:
    the maximum bounds of the current screen.

### centerFrameOnScreen

    public static void centerFrameOnScreen(java.awt.Window frame)

  Positions the specified frame in the middle of the screen.

  Parameters:
    `frame` - the frame to be centered on the screen.

### positionFrameOnScreen

    public static void positionFrameOnScreen(java.awt.Window frame,
                                             double horizontalPercent,
                                             double verticalPercent)

  Positions the specified frame at a relative position in the screen, where 50% is considered to be the center of the screen.

  Parameters:
    `frame` - the frame.
    `horizontalPercent` - the relative horizontal position of the frame (0.0 to 1.0, where 0.5 is the center of the screen).
    `verticalPercent` - the relative vertical position of the frame (0.0 to 1.0, where 0.5 is the center of the screen).

### positionFrameRandomly

    public static void positionFrameRandomly(java.awt.Window frame)

  Positions the specified frame at a random location on the screen while ensuring that the entire frame is visible (provided that the frame is smaller than the screen).

  Parameters:
    `frame` - the frame.

### centerDialogInParent

    public static void centerDialogInParent(java.awt.Dialog dialog)

  Positions the specified dialog within its parent.

  Parameters:
    `dialog` - the dialog to be positioned on the screen.

### positionDialogRelativeToParent

    public static void positionDialogRelativeToParent(java.awt.Dialog dialog,
                                                      double horizontalPercent,
                                                      double verticalPercent)

  Positions the specified dialog at a position relative to its parent.

  Parameters:
    `dialog` - the dialog to be positioned.
    `horizontalPercent` - the relative location.
    `verticalPercent` - the relative location.

### getWindowAncestor

    public static java.awt.Window getWindowAncestor(java.awt.Component component)