Class SwingUtility

java.lang.Object
org.flexdock.util.SwingUtility

public class SwingUtility extends Object
Author:
Christopher Butler
  • Constructor Details

    • SwingUtility

      public SwingUtility()
  • Method Details

    • toComponent

      public static Component toComponent(Object obj)
    • revalidate

      public static void revalidate(Component comp)
    • repaint

      public static void repaint(Component comp)
    • drawRect

      public static void drawRect(Graphics g, Rectangle r)
    • getChildPorts

      public static DockingPort[] getChildPorts(DockingPort port)
    • getPoints

      public static Point[] getPoints(Rectangle rect)
    • getPoints

      public static Point[] getPoints(Rectangle rect, Component convertFromScreen)
    • centerOnScreen

      public static final void centerOnScreen(Window window)
    • center

      public static void center(Window window, Component parent)
    • getContentPane

      public static Container getContentPane(Component c)
    • setPlaf

      public static void setPlaf(Class lookAndFeelClass)
    • setPlaf

      public static void setPlaf(String lookAndFeelClassName)
    • add

      public static void add(Point p1, Point p2)
    • subtract

      public static void subtract(Point p1, Point p2)
    • translate

      public static void translate(Component src, Polygon poly, Component dest)
    • focus

      public static void focus(Component c)
    • getNearestFocusableComponent

      public static Component getNearestFocusableComponent(Component c)
    • getNearestFocusableComponent

      public static Component getNearestFocusableComponent(Component c, Container desiredRoot)
    • activateWindow

      public static void activateWindow(Component c)
    • brighter

      public static Color brighter(Color color, double factor)
      Parameters:
      color -
      factor -
      Returns:
      a new color, brighter than the one passed as argument by a percentage factor
      author Cyril Gambis - [Mar 17, 2005]
    • darker

      public static Color darker(Color color, double factor)
      Parameters:
      color -
      factor -
      Returns:
      a new color, darker than the one passed as argument by a percentage factor
      author Cyril Gambis - [Mar 17, 2005]
    • grayScale

      public static Color grayScale(Color color)
      Parameters:
      color -
      Returns:
      the grey color corresponding to the color passed as parameter
      author Cyril Gambis - [Mar 17, 2005]
    • createImage

      public static BufferedImage createImage(Component comp)
    • getDividerProportion

      public static float getDividerProportion(JSplitPane splitPane)
    • getOtherComponent

      public static Component getOtherComponent(JSplitPane split, Component current)
    • putClientProperty

      public static void putClientProperty(Component c, Object key, Object value)
    • getClientProperty

      public static Object getClientProperty(Component c, Object key)
    • removeClientProperty

      public static void removeClientProperty(Component c, Object key)
    • getActiveWindow

      public static Window getActiveWindow()
    • getSplitPaneSize

      public static int getSplitPaneSize(JSplitPane splitPane)
    • setSplitDivider

      public static void setSplitDivider(JSplitPane split, float proportion)
      Moves the supplied JSplitPane divider to the specified proportion. Valid values for proportion range from 0.0F to 1.0F. For example, a proportion of 0.3F will move the divider to 30% of the "size" (width for horizontal split, height for vertical split) of the split container that contains the specified Dockable. If a proportion of less than 0.0F is supplied, the value 0.0F is used. If a proportion greater than 1.0F is supplied, the value 1.0F is used.
      This method should be effective regardless of whether the split layout in question has been fully realized and is currently visible on the screen. This should alleviate common problems associated with setting percentages of unrealized Component dimensions, which are initially 0x0 before the Component has been rendered to the screen.
      If the specified JSplitPane is null, then this method returns with no action taken.
      Parameters:
      split - the JSplitPane whose divider location is to be set.
      proportion - a double-precision floating point value that specifies a percentage, from zero (top/left) to 1.0 (bottom/right)
      See Also:
    • isSkinLFInstalled

      public static boolean isSkinLFInstalled()
    • toggleFocus

      public static void toggleFocus(int direction)