com.swfm.mica.core
Class MiColorManager

java.lang.Object
  extended bycom.swfm.mica.core.MiColorManager

public class MiColorManager
extends java.lang.Object

This class manages colors, essentially mapping names of colors to RGB(A) values.

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
static java.awt.Color black
           
static java.awt.Color blue
           
static java.awt.Color cyan
           
static java.awt.Color darkBlue
           
static java.awt.Color darkGray
           
static java.awt.Color darkWhite
           
static java.awt.Color gray
           
static java.awt.Color green
           
static java.awt.Color lightGray
           
static java.awt.Color magenta
           
static int MAX_COLOR_RGB_VALUE
           
static java.awt.Color orange
           
static java.awt.Color pink
           
static java.awt.Color red
           
static java.awt.Color transparent
          Popular colors declared public for convienient access.
static java.awt.Color veryDarkWhite
           
static java.awt.Color veryLightGray
           
static java.awt.Color veryVeryLightGray
           
static java.awt.Color white
           
static java.awt.Color windowsGray
           
static java.awt.Color yellow
           
 
Constructor Summary
MiColorManager()
           
 
Method Summary
static java.awt.Color getColor(java.lang.String name)
          Returns the color corresponding to the given name.
static java.lang.String getColorName(java.awt.Color color)
          Returns the name of the given color.
static java.lang.String[] getColorNames()
          Returns an array of the names of all the named colors.
static java.awt.Color[] getColors()
          Returns an array of all the named colors.
static int getNumberOfColors()
          Returns the number of named colors.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_COLOR_RGB_VALUE

public static final int MAX_COLOR_RGB_VALUE
See Also:
Constant Field Values

transparent

public static final java.awt.Color transparent
Popular colors declared public for convienient access.


black

public static final java.awt.Color black

white

public static final java.awt.Color white

darkGray

public static final java.awt.Color darkGray

gray

public static final java.awt.Color gray

lightGray

public static final java.awt.Color lightGray

veryLightGray

public static final java.awt.Color veryLightGray

veryVeryLightGray

public static final java.awt.Color veryVeryLightGray

veryDarkWhite

public static final java.awt.Color veryDarkWhite

windowsGray

public static final java.awt.Color windowsGray

darkWhite

public static final java.awt.Color darkWhite

red

public static final java.awt.Color red

green

public static final java.awt.Color green

blue

public static final java.awt.Color blue

cyan

public static final java.awt.Color cyan

pink

public static final java.awt.Color pink

yellow

public static final java.awt.Color yellow

magenta

public static final java.awt.Color magenta

orange

public static final java.awt.Color orange

darkBlue

public static final java.awt.Color darkBlue
Constructor Detail

MiColorManager

public MiColorManager()
Method Detail

getColor

public static java.awt.Color getColor(java.lang.String name)
Returns the color corresponding to the given name. Valid names are "transparent" (i.e. MiiTypes.Mi_TRANSPARENT_COLOR_NAME), hexidecimal rgb values (i.e. "0xff0000" or "#ff0000"), or an actual name (i.e. "red").

Parameters:
name - the name of a color
Returns:
the corresponding color

getNumberOfColors

public static int getNumberOfColors()
Returns the number of named colors.

Returns:
the number of colors

getColorName

public static java.lang.String getColorName(java.awt.Color color)
Returns the name of the given color. Valid colors are null (i.e. MiiTypes.Mi_TRANSPARENT_COLOR), a named color (i.e. "red"), or any other color (returns "#" + the hexidecimal RGB value).

Parameters:
color - the color to get the name of
Returns:
the textual name of the color

getColorNames

public static java.lang.String[] getColorNames()
Returns an array of the names of all the named colors.

Returns:
the array of color names

getColors

public static java.awt.Color[] getColors()
Returns an array of all the named colors.

Returns:
the array of colors.