com.ontimize.util.gis.client.gui.utils
Enum Colors
java.lang.Object
java.lang.Enum<Colors>
com.ontimize.util.gis.client.gui.utils.Colors
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<Colors>
public enum Colors
- extends java.lang.Enum<Colors>
Colors is an enumeration class that makes it easier to work with colors. Methods are provided for
conversion to hex strings, and for getting alpha channel colors.
- Since:
- Apr 21, 2007, 12:55:24 PM
- Version:
- 1.0
- Author:
- Nazmul Idris
|
Field Summary |
static java.lang.String |
BLACK
|
static java.lang.String |
BLUE
|
static java.lang.String |
CYAN
|
static java.lang.String |
DARKBLUE
|
static java.lang.String |
DARKGRAY
|
static java.lang.String |
GRAY
|
static java.lang.String |
GREEN
|
static java.lang.String |
LIGHTGRAY
|
static java.lang.String |
MAGENTA
|
static java.lang.String |
ORANGE
|
static java.lang.String |
PINK
|
static java.lang.String |
RED
|
static java.lang.String |
WHITE
|
static java.lang.String |
YELLOW
|
|
Method Summary |
static java.awt.Color |
alpha(java.awt.Color c,
float t)
|
java.awt.Color |
alpha(float t)
|
java.awt.Color |
color()
|
java.awt.Color |
color(float f)
|
static java.awt.Color |
colorNameToColor(java.lang.String name)
|
static java.awt.Color |
colorRGBHexToColor(java.lang.String rgb)
|
static java.awt.Color |
parseColor(java.lang.String color)
|
java.lang.String |
toHexString()
|
java.lang.String |
toString()
|
static Colors |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Colors[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
| Methods inherited from class java.lang.Enum |
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Pink
public static final Colors Pink
Green
public static final Colors Green
Orange
public static final Colors Orange
Yellow
public static final Colors Yellow
Red
public static final Colors Red
LightBlue
public static final Colors LightBlue
Blue
public static final Colors Blue
Black
public static final Colors Black
White
public static final Colors White
Gray
public static final Colors Gray
LightGray
public static final Colors LightGray
GRAY
public static final java.lang.String GRAY
- See Also:
- Constant Field Values
BLACK
public static final java.lang.String BLACK
- See Also:
- Constant Field Values
BLUE
public static final java.lang.String BLUE
- See Also:
- Constant Field Values
RED
public static final java.lang.String RED
- See Also:
- Constant Field Values
YELLOW
public static final java.lang.String YELLOW
- See Also:
- Constant Field Values
CYAN
public static final java.lang.String CYAN
- See Also:
- Constant Field Values
DARKGRAY
public static final java.lang.String DARKGRAY
- See Also:
- Constant Field Values
GREEN
public static final java.lang.String GREEN
- See Also:
- Constant Field Values
LIGHTGRAY
public static final java.lang.String LIGHTGRAY
- See Also:
- Constant Field Values
MAGENTA
public static final java.lang.String MAGENTA
- See Also:
- Constant Field Values
ORANGE
public static final java.lang.String ORANGE
- See Also:
- Constant Field Values
PINK
public static final java.lang.String PINK
- See Also:
- Constant Field Values
WHITE
public static final java.lang.String WHITE
- See Also:
- Constant Field Values
DARKBLUE
public static final java.lang.String DARKBLUE
- See Also:
- Constant Field Values
values
public static Colors[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (Colors c : Colors.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static Colors valueOf(java.lang.String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name - the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified name
java.lang.NullPointerException - if the argument is null
alpha
public java.awt.Color alpha(float t)
alpha
public static java.awt.Color alpha(java.awt.Color c,
float t)
color
public java.awt.Color color()
color
public java.awt.Color color(float f)
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Enum<Colors>
toHexString
public java.lang.String toHexString()
colorNameToColor
public static java.awt.Color colorNameToColor(java.lang.String name)
throws java.lang.Exception
- Throws:
java.lang.Exception
colorRGBHexToColor
public static java.awt.Color colorRGBHexToColor(java.lang.String rgb)
throws java.lang.Exception
- Throws:
java.lang.Exception
parseColor
public static java.awt.Color parseColor(java.lang.String color)
throws java.lang.Exception
- Throws:
java.lang.Exception