it.andynaz.irex.dr1000.document
Class ColorMgr
java.lang.Object
it.andynaz.irex.dr1000.document.ColorMgr
public class ColorMgr
- extends Object
Manage the colors.
Contains a default color to be used in the strokes and a method to safely
decode a color.
Note that the color codes for this class can be specified both as a string
RRGGBB
or #RRGGBB
.
- Version:
- 2013-04-23
- Author:
- andynaz
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
defaultColor
public static final Color defaultColor
- Default color to use in strokes.
Can be set using the global property
-Dandynaz.defaultColor=RRGGBB
;
if it is not set or the color can not be decoded, is the black
color.
- See Also:
Color.decode(java.lang.String)
ColorMgr
public ColorMgr()
decode
public static Color decode(String colorCode)
- Safely decode a color.
- Parameters:
colorCode
- numeric code of the color, as specified in che Color
class
- Returns:
- the color corresponding to the
colorCode
, or the default color
if the code can not be decoded
normalizeColorCode
private static String normalizeColorCode(String s)
- A '#' character is added at the beginning of the string
s
if it do
not begin with '#'.
- Parameters:
s
- a string color code
- Returns:
- the same string suitable to be used with the method
Color.decode(java.lang.String)
© 2013 andynaz - http://andynaz.altervista.org