|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.insightful.gdevice.ColorScheme
A ColorScheme object represents a set of colors for drawing a graph. It consists of a background color, 16 palette colors, and 256 image colors.
Nested Class Summary | |
static class |
ColorScheme.PDFColorScheme
|
Field Summary | |
protected String |
m_name
Friendly name for the color scheme. |
static int |
NUMBER_IMAGE_COLORS
Number of image colors (256). |
Constructor Summary | |
ColorScheme()
Constructs a ColorScheme object by querying the engine for a palette. |
|
ColorScheme(boolean queryEngine)
Constructs a ColorScheme object by querying the engine or by using a standard set of colors. |
|
ColorScheme(String name,
Color backgroundColor,
Color[] paletteColors,
Color[] imageColors)
Constructs a ColorScheme object with the specified name and colors. |
|
ColorScheme(String name,
int[] colorInts)
Constructs a ColorScheme object with the specified name, and with colors constructed from the specified integers. |
Method Summary | |
static ColorScheme |
createFromXML(XMLElement elt)
Creates a ColorScheme object from an XML element. |
Color |
getBackgroundColor()
Returns the background color. |
Color |
getImageColor(int index)
Returns the image color of the given index. |
Color[] |
getImageColors()
Returns all the image colors. |
IndexColorModel |
getImageIndexColorModel()
Creates an IndexColorModel representing the image colors. |
int[] |
getInts()
Returns an integer array representing this color scheme. |
Color |
getLineColor(int index)
Return color for drawing lines, given color int. |
String |
getName()
Returns the friendly name for this color scheme. |
protected Color[] |
getPalette()
Retrieve a palette...try to get existing palette, and, if that fails, get default palette |
Color |
getPaletteColor(int index)
Returns the palette color of the given index. |
String[] |
getPaletteColorLabels()
Retrieve a list of numbered labels representing the colors (assuming background color is first) |
Color[] |
getPaletteColors()
Returns all the palette colors. |
Color |
getPolygonColor(int index)
Return color for drawing polygons, given color int. |
Color |
getTextColor(int index)
Return color for drawing text, given color int. |
boolean |
isPDF()
returns true if this is a pdf-style colorscheme, so we don't use weird image colors for polygon. |
void |
writeXML(PrintWriter out,
String colorschemeTag)
Creates an XML representation for this color scheme. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NUMBER_IMAGE_COLORS
protected String m_name
Constructor Detail |
public ColorScheme()
public ColorScheme(boolean queryEngine)
public ColorScheme(String name, Color backgroundColor, Color[] paletteColors, Color[] imageColors)
name
- friendly name for this color scheme.backgroundColor
- background color. If this
value is null, white is used.paletteColors
- array of colors for the palette.
If the array has more than 16 colors, only the
first 16 are used. If the array has fewer than
16 colors, black is used for the remaining
palette colors.imageColors
- array of 256 colors for images.
If the array has more than 256 colors, only the
first 256 are used. If the array has fewer than
256 colors, the remaining colors will match
those for the default color scheme.public ColorScheme(String name, int[] colorInts)
The colorInts parameter should have 3 x (1 + 16 + 256) = 819 elements. If it has too few, black is used for the unspecified colors. If the it has too many elements the extra ones are ignored.
name
- friendly name for this color scheme.colorInts
- array of 819 integers, each triplet
of which represents a number in RGB format.Method Detail |
protected Color[] getPalette()
public String getName()
public int[] getInts()
public Color getBackgroundColor()
public boolean isPDF()
public Color getLineColor(int index)
public Color getTextColor(int index)
public Color getPolygonColor(int index)
public Color getPaletteColor(int index)
index
- index of the color in the palette.
public Color[] getPaletteColors()
public Color getImageColor(int index)
index
- index of the color in the image color array.
public Color[] getImageColors()
public IndexColorModel getImageIndexColorModel()
public void writeXML(PrintWriter out, String colorschemeTag)
out
- stream for writing the XML.colorschemeTag
- XML tag to use.public static ColorScheme createFromXML(XMLElement elt)
elt
- XML element representing a color scheme.
public String[] getPaletteColorLabels()
|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |