|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.washington.NVisF.plotter.ColoringStrategy
A ColoringStrategy defines how to construct colors from the available
data. This class uses a single customizable color for every object.
Several predefined colors are available which can be accessed by handle
or by name, and a default color is defined in case none is selected
by the user. Subclasses of this class can override the get methods
to provide different behavior.
Two different methods for getting colors are provided. The idea is
that a single data object could be displayed with a simple one-component
representation or a multiple component representation. In the latter
case, one could define multiple colors, one for each component. The
PlotCommand
provides only the number of data objects. The getColors
method returns one color per object, while the getMultiColors method
takes an extra argument, the number of colors per data object, and
returns a array of length (#objects)*(#colors/object) where colors
0...m-1 are the m colors for the first data object, etc. The default
behavior of this method is to simply duplicate the single colors to
fill the desired array.
Field Summary | |
static Color3f |
blue
|
static Color3f |
DEFAULT_COLOR
The default color, currently equal to white. |
static Color3f |
green
|
static Color3f |
red
|
static Color3f |
white
|
static Color3f |
yellow
|
Constructor Summary | |
ColoringStrategy()
Creates a new ColoringStrategy using the default color. |
|
ColoringStrategy(Color3f color)
Creates a new ColoringStrategy using the specified color. |
Method Summary | |
Color3f[] |
fillWithSingleColor(int numObjects)
returns a Color3f[] of length numObjects where every color is the same as this ColoringStrategy's defined color. |
Color3f |
getColor()
returns this ColoringStrategy's defined color. |
static java.util.Map |
getColorNameMap()
Returns a Map between names of colors and the colors. |
Color3f[] |
getColors(PlotCommand command)
Returns an array containing one color for each data object according to the particular algorithm of this ColoringStrategy. |
static java.util.List |
getKnownColors()
Returns a List of Strings containing the names of all known colors. |
Color3f[] |
getMultiColors(PlotCommand command,
int vCount)
Returns an array containing vCount colors for each data object. |
Color3f |
setColor(Color3f color)
sets the color used by this ColoringStrategy. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Color3f white
public static final Color3f red
public static final Color3f blue
public static final Color3f yellow
public static final Color3f green
public static final Color3f DEFAULT_COLOR
Constructor Detail |
public ColoringStrategy()
public ColoringStrategy(Color3f color)
Method Detail |
public static java.util.Map getColorNameMap()
public static java.util.List getKnownColors()
public Color3f[] getColors(PlotCommand command)
command
- the PlotCommand
providing datapublic Color3f[] getMultiColors(PlotCommand command, int vCount)
command
- the PlotCommand
providing datavCount
- the desired number of colors per objectpublic Color3f[] fillWithSingleColor(int numObjects)
public Color3f getColor()
public Color3f setColor(Color3f color)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |