public class SwingUtility extends Object
Constructor and Description |
---|
SwingUtility() |
Modifier and Type | Method and Description |
---|---|
static void |
activateWindow(Component c) |
static void |
add(Point p1,
Point p2) |
static Color |
brighter(Color color,
double factor) |
static void |
center(Window window,
Component parent) |
static void |
centerOnScreen(Window window) |
static BufferedImage |
createImage(Component comp) |
static Color |
darker(Color color,
double factor) |
static void |
drawRect(Graphics g,
Rectangle r) |
static void |
focus(Component c) |
static Window |
getActiveWindow() |
static DockingPort[] |
getChildPorts(DockingPort port) |
static Object |
getClientProperty(Component c,
Object key) |
static Container |
getContentPane(Component c) |
static float |
getDividerProportion(JSplitPane splitPane) |
static Component |
getNearestFocusableComponent(Component c) |
static Component |
getNearestFocusableComponent(Component c,
Container desiredRoot) |
static Component |
getOtherComponent(JSplitPane split,
Component current) |
static Point[] |
getPoints(Rectangle rect) |
static Point[] |
getPoints(Rectangle rect,
Component convertFromScreen) |
static int |
getSplitPaneSize(JSplitPane splitPane) |
static Color |
grayScale(Color color) |
static boolean |
isSkinLFInstalled() |
static void |
putClientProperty(Component c,
Object key,
Object value) |
static void |
removeClientProperty(Component c,
Object key) |
static void |
repaint(Component comp) |
static void |
revalidate(Component comp) |
static void |
setPlaf(Class lookAndFeelClass) |
static void |
setPlaf(String lookAndFeelClassName) |
static void |
setSplitDivider(JSplitPane split,
float proportion)
Moves the supplied
JSplitPane divider to the specified proportion . |
static void |
subtract(Point p1,
Point p2) |
static Component |
toComponent(Object obj) |
static void |
toggleFocus(int direction) |
static void |
translate(Component src,
Polygon poly,
Component dest) |
public static void revalidate(Component comp)
public static void repaint(Component comp)
public static DockingPort[] getChildPorts(DockingPort port)
public static final void centerOnScreen(Window window)
public static void setPlaf(Class lookAndFeelClass)
public static void setPlaf(String lookAndFeelClassName)
public static void focus(Component c)
public static Component getNearestFocusableComponent(Component c, Container desiredRoot)
public static void activateWindow(Component c)
public static Color brighter(Color color, double factor)
color
- factor
- public static Color darker(Color color, double factor)
color
- factor
- public static Color grayScale(Color color)
color
- public static BufferedImage createImage(Component comp)
public static float getDividerProportion(JSplitPane splitPane)
public static Component getOtherComponent(JSplitPane split, Component current)
public static Window getActiveWindow()
public static int getSplitPaneSize(JSplitPane splitPane)
public static void setSplitDivider(JSplitPane split, float proportion)
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.
Component
dimensions, which are initially 0x0
before
the Component
has been rendered to the screen.
JSplitPane
is null
, then this method returns with no action
taken.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)getSplitPaneSize(JSplitPane)
,
JSplitPane.setDividerLocation(double)
public static boolean isSkinLFInstalled()
public static void toggleFocus(int direction)