iRex DR1000 Merger v0.4.1

it.andynaz.irex.dr1000.document
Class ColorMgr

java.lang.Object
  extended by 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

Field Summary
static Color defaultColor
          Default color to use in strokes.
 
Constructor Summary
ColorMgr()
           
 
Method Summary
static Color decode(String colorCode)
          Safely decode a color.
private static String normalizeColorCode(String s)
          A '#' character is added at the beginning of the string s if it do not begin with '#'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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)
Constructor Detail

ColorMgr

public ColorMgr()
Method Detail

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)

iRex DR1000 Merger v0.4.1

© 2013 andynaz - http://andynaz.altervista.org