jcurzez
Class BackgroundColor

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

public final class BackgroundColor
extends Color

A background color. There are several predefined background colors :

Version:
0.0.3
Author:
Thomas Girard

Field Summary
static BackgroundColor BLACK
          The background color black.
static BackgroundColor BLUE
          The background color blue.
static BackgroundColor CYAN
          The background color cyan.
static BackgroundColor GREEN
          The background color green.
static BackgroundColor MAGENTA
          The background color magenta.
protected  java.lang.String name
          Name of this color.
static BackgroundColor RED
          The background color red.
static BackgroundColor WHITE
          The background color white.
static BackgroundColor YELLOW
          The background color yellow.
 
Constructor Summary
private BackgroundColor(java.lang.String name)
          Creates a background 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 BackgroundColor BLACK
The background color black.


RED

public static final BackgroundColor RED
The background color red.


GREEN

public static final BackgroundColor GREEN
The background color green.


YELLOW

public static final BackgroundColor YELLOW
The background color yellow.


BLUE

public static final BackgroundColor BLUE
The background color blue.


MAGENTA

public static final BackgroundColor MAGENTA
The background color magenta.


CYAN

public static final BackgroundColor CYAN
The background color cyan.


WHITE

public static final BackgroundColor WHITE
The background color white.


name

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

Constructor Detail

BackgroundColor

private BackgroundColor(java.lang.String name)
Creates a background 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