|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ge.research.charts.ColorMap
Defines a set of Color objects to be used for charting purposes. The Colors
can be accessed from static methods or by instantiating this class, setting up an ordered queue of the Colors, which can be "popped"
from the queue using the "getNextColor" methods.
| Constructor Summary | |
ColorMap()
Default constructor. |
|
| Method Summary | |
static java.awt.Color |
getColor(int index)
Retrieves the Color from the internal COLORLIST at the specified index. |
static java.awt.Color |
getColor(java.lang.String name)
Retrieves the Color identified by the argument name. |
static java.awt.Color[] |
getColorList()
Returns a clone of the COLORLIST |
static java.util.Map |
getColorMap()
Returns a copy of the COLORMAP |
java.awt.Color |
getNextColor()
Returns the next Color from the COLORLIST as specified by the current index.
|
java.awt.Color |
getNextColor(java.awt.Color skipColor)
Returns the next Color from the COLORLIST as specified by the current index.
|
java.awt.Color |
getNextColor(java.awt.Color[] skipColors)
Returns the next Color from the COLORLIST as specified by the current index.
|
java.awt.Color |
getNextColor(java.lang.String skipColor)
Looks up the Color identified by skipColor from the COLORMAP
and uses the value found (null if the Color is not found) as the argument to the
getNextColor(java.awt.Color) method. |
java.awt.Color |
getNextColor(java.lang.String[] skipColors)
Looks up the Colors identified by skipColors from the COLORMAP
and uses the values found (null if a Color is not found) as the argument to the
getNextColor(java.awt.Color[]) method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ColorMap()
| Method Detail |
public static java.awt.Color getColor(java.lang.String name)
Color identified by the argument name.
name - the name of the color to retrieve
Color identified by the argument name.
If the argument name is not recognized, null is returned.public static java.awt.Color getColor(int index)
Color from the internal COLORLIST at the specified index.
index - the index of the list to extract
Color at the specified position within the COLORLIST.
If the index is negative or greater than or equal to COLORLIST.length, null is returned.public static java.awt.Color[] getColorList()
COLORLIST
COLORLISTObject.clone()public static java.util.Map getColorMap()
COLORMAP
COLORMAPpublic java.awt.Color getNextColor()
Color from the COLORLIST as specified by the current index.
The currIndex wraps around to the beginning of the COLORLIST when it reaches the end of the list.
The value of currIndex is incremented after each call to this method.
Color in the sequencepublic java.awt.Color getNextColor(java.awt.Color skipColor)
Color from the COLORLIST as specified by the current index.
The Color extracted from the COLORLIST is tested against the skipColor.
If the Colors are the same, then the next color from the COLORLIST is extracted and tested.
Only a color not matching the skipColor can be returned. If the entire COLORLIST has been checked
and no non-matching Color is found, then it returns null.
The currIndex wraps around to the beginning of the COLORLIST when it reaches the end of the list.
The value of currIndex is incremented after each call to this method.
skipColor - a Color not to return, regardless if it is next in the list or not
Color in the sequence that is not the skipColor.
Returns null if no such Color can be foundgetNextColor()public java.awt.Color getNextColor(java.awt.Color[] skipColors)
Color from the COLORLIST as specified by the current index.
The Color extracted from the COLORLIST is tested against the skipColors array.
If the Color is the same as one in the array, then the next color from the COLORLIST is extracted and tested.
Only a color not matching any of the skipColors can be returned. If the entire COLORLIST has been checked
and no non-matching Color is found, then it returns null.
The currIndex wraps around to the beginning of the COLORLIST when it reaches the end of the list.
The value of currIndex is incremented after each call to this method.
skipColors - an array of Colors not to return
Color in the sequence that is not in the skipColors array
Returns null if no such Color can be foundgetNextColor()public java.awt.Color getNextColor(java.lang.String skipColor)
Color identified by skipColor from the COLORMAP
and uses the value found (null if the Color is not found) as the argument to the
getNextColor(java.awt.Color) method.
skipColor - a color not to return, regardless if it is next in the list or not
Color in the sequence that is not the skipColor.
Returns null if no such Color can be foundgetNextColor(java.awt.Color)public java.awt.Color getNextColor(java.lang.String[] skipColors)
Colors identified by skipColors from the COLORMAP
and uses the values found (null if a Color is not found) as the argument to the
getNextColor(java.awt.Color[]) method.
skipColors - an array of colors not to return
Color in the sequence that is not in the skipColors array
Returns null if no such Color can be foundgetNextColor(java.awt.Color[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||