jcurzez
Class ForegroundColor

java.lang.Object
  |
  +--jcurzez.Color
        |
        +--jcurzez.ForegroundColor

public final class ForegroundColor
extends Color

A foreground color. There are several predefined foreground colors :

Version:
0.0.3
Author:
Thomas Girard

Field Summary
static ForegroundColor BLACK
          The foreground color black.
static ForegroundColor BLUE
          The foreground color blue.
static ForegroundColor CYAN
          The foreground color cyan.
static ForegroundColor GREEN
          The foreground color green.
static ForegroundColor MAGENTA
          The foreground color magenta.
protected  java.lang.String name
          Name of this color.
static ForegroundColor RED
          The foreground color red.
static ForegroundColor WHITE
          The foreground color white.
static ForegroundColor YELLOW
          The foreground color yellow.
 
Constructor Summary
private ForegroundColor(java.lang.String name)
          Creates a foreground color with specified name.
 
Method Summary
 boolean equals(java.lang.Object o)
          Tests equality.
 java.lang.Object getRealColor()
          Returns the real color.
 void setRealColor(java.lang.Object o)
          Modifies the real color.
 java.lang.String toString()
          Returns the name of this color.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLACK

public static final ForegroundColor BLACK
The foreground color black.


RED

public static final ForegroundColor RED
The foreground color red.


GREEN

public static final ForegroundColor GREEN
The foreground color green.


YELLOW

public static final ForegroundColor YELLOW
The foreground color yellow.


BLUE

public static final ForegroundColor BLUE
The foreground color blue.


MAGENTA

public static final ForegroundColor MAGENTA
The foreground color magenta.


CYAN

public static final ForegroundColor CYAN
The foreground color cyan.


WHITE

public static final ForegroundColor WHITE
The foreground color white.


name

protected final java.lang.String name
Name of this color.

Constructor Detail

ForegroundColor

private ForegroundColor(java.lang.String name)
Creates a foreground color with specified name.

Parameters:
name - the color name.
Method Detail

toString

public java.lang.String toString()
Returns the name of this color.

Overrides:
toString in class java.lang.Object
Returns:
Color.name.

setRealColor

public void setRealColor(java.lang.Object o)
Modifies the real color. This operation must be done only once, (no more, no less) otherwise an runtime exception is thrown.

Parameters:
o - the object to store as a real color.
Throws:
IllegalColorStateException - if this method is invoked more than once.
java.lang.IllegalArgumentException - if o is null.

getRealColor

public java.lang.Object getRealColor()
Returns the real color.

Returns:
Color.realColor.

equals

public final boolean equals(java.lang.Object o)
Tests equality. Prevents overridding by making it final.

Overrides:
equals in class java.lang.Object


Send me an email