public class GuiHelper
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.awt.Dimension |
decodeDimension(java.lang.String dim)
Create a Rectangle from a String encoded as "width,height"
|
static java.awt.Rectangle |
decodeRectangle(java.lang.String rectangle)
Create a Rectangle from a String encoded as "x,y,width,height"
|
static java.lang.String |
encodeDimension(java.awt.Dimension d)
Write a Dimension as a String encoded as "width,height"
|
static java.lang.String |
encodeRectangle(java.awt.Rectangle r)
Write a Rectangle as a String encoded as "x,y,width,height"
|
static javax.swing.JComponent |
findComponent(java.awt.Container panel,
java.lang.String name)
find a
JComponent by name in a Container |
static float |
getBrightness(java.awt.Color c)
get a float representing the brightness of a Color
|
static int |
getWidth(java.lang.String str)
Deprecated.
Does not return stable information between JDK's
|
static int |
getWidth(java.lang.String str,
int width)
Deprecated.
Does not return stable information between JDK's
|
static boolean |
isColor(java.lang.String value)
check if a value supplied as a String contains
the information to be used as a Color
|
static boolean |
isFont(java.lang.String value)
check if a value supplied as a String contains
the information to be used as a Font
|
static java.awt.Rectangle |
setMiddle(java.awt.Rectangle target,
java.awt.Rectangle source)
Calculates Middle for a target from a source
|
public static java.awt.Rectangle setMiddle(java.awt.Rectangle target,
java.awt.Rectangle source)
target - java.awt.Rectanglesource - java.awt.Rectanglejava.lang.IllegalArgumentException - if either source or target is nullpublic static final java.awt.Dimension decodeDimension(java.lang.String dim)
dim - Stringpublic static final java.awt.Rectangle decodeRectangle(java.lang.String rectangle)
rectangle - Stringpublic static final java.lang.String encodeRectangle(java.awt.Rectangle r)
r - RectangledecodeRectangle(String)public static final java.lang.String encodeDimension(java.awt.Dimension d)
d - DimensiondecodeDimension(String)@Deprecated public static int getWidth(java.lang.String str)
str - String@Deprecated
public static int getWidth(java.lang.String str,
int width)
str - Stringpublic static boolean isColor(java.lang.String value)
value - String, the value to be used as Colorpublic static final float getBrightness(java.awt.Color c)
c - Colorpublic static boolean isFont(java.lang.String value)
value - String, the value to be used as Fontpublic static final javax.swing.JComponent findComponent(java.awt.Container panel,
java.lang.String name)
JComponent by name in a Containerpanel - Containername - String name of JComponent