java.lang.Object
org.pentaho.reporting.libraries.designtime.swing.LibSwingUtil

public class LibSwingUtil extends Object
Utility classes for swing. This is an exact copy of SwingUtil found in the Engine Core ... but this project does not depend on that one, and therefore can not use it. Likewise, that project does not depend on this one and can not use it.
  • Method Details

    • centerFrameOnScreen

      public static void centerFrameOnScreen(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(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(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(Dialog dialog)
      Positions the specified dialog within its parent.
      Parameters:
      dialog - the dialog to be positioned on the screen.
    • positionDialogRelativeToParent

      public static void positionDialogRelativeToParent(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 Window getWindowAncestor(Component component)
    • safeRestoreWindow

      public static boolean safeRestoreWindow(Window frame, Rectangle bounds)
    • rectangleToString

      public static String rectangleToString(Rectangle rectangle)
    • parseRectangle

      public static Rectangle parseRectangle(String boundsAsText)