public class StyleConstants extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StyleConstants.ArrowShape
Possible shapes for arrows on edges.
|
static class |
StyleConstants.FillMode
How to fill the contents of the element.
|
static class |
StyleConstants.IconMode
Where to place the icon around the text (or instead of the text).
|
static class |
StyleConstants.JComponents
Possible JComponents.
|
static class |
StyleConstants.ShadowMode
How to draw the shadow of the element.
|
static class |
StyleConstants.Shape
Possible shapes for elements.
|
static class |
StyleConstants.ShapeKind |
static class |
StyleConstants.SizeMode
How to set the size of the element.
|
static class |
StyleConstants.SpriteOrientation
Orientation of a sprite toward its attachment point.
|
static class |
StyleConstants.StrokeMode
How to draw the contour of the element.
|
static class |
StyleConstants.TextAlignment
How to align words around their attach point.
|
static class |
StyleConstants.TextBackgroundMode |
static class |
StyleConstants.TextMode
How to draw the text of an element.
|
static class |
StyleConstants.TextStyle
Variant of the font.
|
static class |
StyleConstants.TextVisibilityMode
How to show the text of an element.
|
static class |
StyleConstants.Units
The available units for numerical values.
|
static class |
StyleConstants.VisibilityMode
How to show an element.
|
Modifier and Type | Field and Description |
---|---|
protected static Pattern |
awtColor
Pattern to ensure that java.awt.Color.toString() strings are recognised
as colour.
|
protected static HashMap<String,Color> |
colorMap
A set of colour names mapped to real AWT Colour objects.
|
protected static Pattern |
cssColor
Pattern to ensure a CSS style "rgb(1,2,3)" colour is recognised.
|
protected static Pattern |
cssColorA
Pattern to ensure a CSS style "rgba(1,2,3,4)" colour is recognised.
|
protected static Pattern |
hexaColor
Pattern to ensure an hexadecimal number is a recognised colour.
|
protected static Pattern |
number
Pattern to ensure a string is a Value in various units.
|
protected static Pattern |
numberUnit
Pattern to ensure a string is a Value in various units.
|
protected static Pattern |
sharpColor1
Pattern to ensure a "#FFFFFF" colour is recognised.
|
protected static Pattern |
sharpColor2
Pattern to ensure a "#FFFFFF" colour is recognised.
|
Constructor and Description |
---|
StyleConstants() |
Modifier and Type | Method and Description |
---|---|
static Color |
convertColor(Object anyValue)
Try to convert the given string value to a colour.
|
static String |
convertLabel(Object value)
Check if the given value is an instance of CharSequence (String is) and
return it as a string.
|
protected static StyleConstants.Units |
convertUnit(String unit)
Convert "gu", "px" and "%" to Units.GU, Units.PX, Units.PERCENTS.
|
static Value |
convertValue(Object value)
Convert an object to a value with units.
|
static float |
convertWidth(Object value)
Try to convert an arbitrary value to a float.
|
protected static HashMap<String,Color> colorMap
protected static Pattern sharpColor1
protected static Pattern sharpColor2
protected static Pattern cssColor
protected static Pattern cssColorA
protected static Pattern awtColor
protected static Pattern hexaColor
protected static Pattern numberUnit
public StyleConstants()
public static Color convertColor(Object anyValue)
anyValue
- The value to convert.public static String convertLabel(Object value)
value
- The value to convert.public static float convertWidth(Object value)
value
- The input to convert.public static Value convertValue(Object value)
value
- A Number or a CharSequence.protected static StyleConstants.Units convertUnit(String unit)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses