|
OFC Charts 3.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.oxymel.ofc.charts.ColorPalette
ColorPalette class allows to customize the colors used in a given graphic. It contains a set of colors, and it provides methods to manage the colors. The colors belonging to the Palette are ordered, and the first one is at the position 0.
Constructor Summary | |
ColorPalette()
Constructor The Color palette is initialized with default colors |
Method Summary | |
void |
addColor(java.awt.Color color)
Adds a new color to the palette. |
void |
clear()
Reset the color palette so that it becomes empty. |
static java.awt.Color |
getColor(int R,
int G,
int B)
Builds a Color instance from its RGB representation |
java.awt.Color |
getColorAt(int colorPosition)
Gets the color located at the given position; |
void |
initPalette()
Initializes the ColorPalette with the defaults values, it contains 12 different colors |
void |
initPaletteAsBlueGradient()
Initializes the ColorPalette as blue gradient, it contains 5 colors |
void |
initPaletteAsExcelColor()
Initializes the ColorPaletteSets as an excel color palette, it contains 8 colors |
void |
initPaletteAsHotToColdEffect()
Initializes the ColorPalette as cold to hot effect, it contains 22 colors |
void |
initPaletteHotToColdFromData(int nbOfData)
Initializes the ColorPalette as cold to hot effect with the given number of data |
void |
initPaletteWith42Colors()
Initializes the ColorPalette with 42 differents colors |
void |
setColorAt(java.awt.Color color,
int colorPosition)
Sets or replaces the color at the given position by the one passed as argument (color). |
void |
setColorAt(int R,
int G,
int B,
int colorPosition)
Sets or replaces the color at the given position by the one passed as argument as a RGB color. |
int |
size()
Gets the number of colors contained in palette. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ColorPalette()
Method Detail |
public int size()
public void clear()
public void addColor(java.awt.Color color)
color
- new color to addpublic java.awt.Color getColorAt(int colorPosition)
colorPosition
- The color position in the palettepublic void setColorAt(java.awt.Color color, int colorPosition)
color
- New color to set at the colorPosition in the palettecolorPosition
- color position in palette, it must corresponds to an existing positionpublic void setColorAt(int R, int G, int B, int colorPosition)
R
- Red part of colorG
- Green part of colorB
- Blue part of colorcolorPosition
- The color position in the palette, it must corresponds to an existing positionpublic static java.awt.Color getColor(int R, int G, int B)
R
- Red part of colorG
- Green part of colorB
- Blue part of colorpublic void initPalette()
public void initPaletteAsBlueGradient()
public void initPaletteAsHotToColdEffect()
public void initPaletteAsExcelColor()
public void initPaletteHotToColdFromData(int nbOfData)
nbOfData
- intpublic void initPaletteWith42Colors()
|
OFC Charts 3.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |