com.cc.framework.ui
Class Color

java.lang.Object
  extended bycom.cc.framework.ui.Color
All Implemented Interfaces:
java.io.Serializable

public class Color
extends java.lang.Object
implements java.io.Serializable

Enumeration of Color Codes used by the Painters

Since:
1.0
Version:
$Revision: 1.16 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
static Color BLACK
          color : black
static Color BLUE
          color : blue
private  int bluePart
          Blue
private static java.lang.String[][] COLORNAMES
          Table with HTML color codes
static Color GREEN
          color : green
private  int greenPart
          Green
static Color ORANGE
          color : orange
static Color RED
          color : red
private  int redPart
          Red
private static long serialVersionUID
          Serial Version UID
static Color WHITE
          color : white
static Color YELLOW
          color : yellow
 
Constructor Summary
Color(int rgb)
          Constructor for Color
Color(int red, int green, int blue)
          Constructor for Color
Color(java.lang.String colorString)
          Constructor for Color
 
Method Summary
 int blue()
           
private  java.lang.String decToHex(int dec)
          Converts an int to a hex value
 int green()
           
private static int hexToInt(char digit)
          Converts a hex value to an int value
private static int hexToInt(java.lang.String hexDigits)
          Converts a hex value to an int value
static java.lang.String mapColorName(java.lang.String name)
          Returns the color for a color value
static Color mapString(java.lang.String colorString)
          Creates a color object for the specified argument
 int red()
           
 java.awt.Color toAWT()
          Generates a Color AWT-Objekt
 java.lang.String toDez()
          Returns a String with the dezimal values for the color
 java.lang.String toHex()
          Returns a String with the hex values for the color
 java.lang.String toHtml()
          Generates a Color value in the form #AABBCC
 java.lang.String toHtmlName()
          Returns the HTML Name for the color
 int toRGB()
          Returns a rgb value for the color
 java.lang.String toString()
          Returns a String representation for the color in the form #AABBCC
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

WHITE

public static final Color WHITE
color : white


BLACK

public static final Color BLACK
color : black


RED

public static final Color RED
color : red


GREEN

public static final Color GREEN
color : green


BLUE

public static final Color BLUE
color : blue


ORANGE

public static final Color ORANGE
color : orange


YELLOW

public static final Color YELLOW
color : yellow


redPart

private int redPart
Red


greenPart

private int greenPart
Green


bluePart

private int bluePart
Blue


COLORNAMES

private static final java.lang.String[][] COLORNAMES
Table with HTML color codes

Constructor Detail

Color

public Color(int red,
             int green,
             int blue)
Constructor for Color

Parameters:
red - The value for red
green - The value for green
blue - The value for blue

Color

public Color(int rgb)
Constructor for Color

Parameters:
rgb - The value of the color including the red, green, blue part

Color

public Color(java.lang.String colorString)
Constructor for Color

Parameters:
colorString - The string value of the color
Method Detail

hexToInt

private static int hexToInt(char digit)
Converts a hex value to an int value

Parameters:
digit - Digit to convert
Returns:
The int value

hexToInt

private static int hexToInt(java.lang.String hexDigits)
Converts a hex value to an int value

Parameters:
hexDigits - Digit to convert
Returns:
The int value

mapColorName

public static java.lang.String mapColorName(java.lang.String name)
Returns the color for a color value

Parameters:
name - ColorCode
Returns:
String

mapString

public static Color mapString(java.lang.String colorString)
Creates a color object for the specified argument

Parameters:
colorString - The color value
Returns:
A color object

decToHex

private java.lang.String decToHex(int dec)
Converts an int to a hex value

Parameters:
dec - The int value
Returns:
The hex value

toHtmlName

public java.lang.String toHtmlName()
Returns the HTML Name for the color

Returns:
String

toString

public java.lang.String toString()
Returns a String representation for the color in the form #AABBCC

Returns:
A String for the color in the form #AABBCC

toHtml

public java.lang.String toHtml()
Generates a Color value in the form #AABBCC

Returns:
Returns a String with the hex value in the form #AABBCC

toHex

public java.lang.String toHex()
Returns a String with the hex values for the color

Returns:
String

toDez

public java.lang.String toDez()
Returns a String with the dezimal values for the color

Returns:
String

toRGB

public int toRGB()
Returns a rgb value for the color

Returns:
String

toAWT

public java.awt.Color toAWT()
Generates a Color AWT-Objekt

Returns:
The java.awt.Color Object

blue

public int blue()
Returns:
blue part of the color

green

public int green()
Returns:
green part of the color

red

public int red()
Returns:
red part of the color


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.