java.lang.Object
org.jfree.chart3d.renderer.category.StandardCategoryColorSource
com.orsoncharts.demo.HighlightCategoryColorSource
- All Implemented Interfaces:
Serializable
,org.jfree.chart3d.renderer.category.CategoryColorSource
public class HighlightCategoryColorSource
extends org.jfree.chart3d.renderer.category.StandardCategoryColorSource
A custom implementation of the
CategoryColorSource
interface.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance with default colors.HighlightCategoryColorSource
(int row, int column, Color highlightColor, Color... colors) Creates a new instance with the supplied sequence of colors. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this color source for equality with an arbitrary object.getColor
(int series, int row, int column) Returns the color to use for the specified item.Returns the highlight color.int
Returns the column index of the item to be highlighted.int
Returns the row index of the item to be highlighted.void
setHighlightColor
(Color color) Sets the highlight color.void
setHighlightColumnIndex
(int index) Sets the column index of the item to highlight (you can set this to -1 to have no item highlighted).void
setHighlightRowIndex
(int index) Sets the row index of the item to highlight (you can set this to -1 to have no item highlighted).Methods inherited from class org.jfree.chart3d.renderer.category.StandardCategoryColorSource
getLegendColor, hashCode, style
-
Constructor Details
-
HighlightCategoryColorSource
public HighlightCategoryColorSource()Creates a new instance with default colors. -
HighlightCategoryColorSource
Creates a new instance with the supplied sequence of colors. The supplied array must have at least one entry, and all entries must be non-null
.- Parameters:
row
- the row index of the item to highlight (or -1).column
- the column index of the item to highlight (or -1).highlightColor
- the highlight color (null
not permitted).colors
- the colors (null
not permitted).
-
-
Method Details
-
getHighlightRowIndex
public int getHighlightRowIndex()Returns the row index of the item to be highlighted. The default value is-1
.- Returns:
- The row index.
-
setHighlightRowIndex
public void setHighlightRowIndex(int index) Sets the row index of the item to highlight (you can set this to -1 to have no item highlighted).- Parameters:
index
- the row index.
-
getHighlightColumnIndex
public int getHighlightColumnIndex()Returns the column index of the item to be highlighted. The default value is-1
.- Returns:
- The row index.
-
setHighlightColumnIndex
public void setHighlightColumnIndex(int index) Sets the column index of the item to highlight (you can set this to -1 to have no item highlighted).- Parameters:
index
- the row index.
-
getHighlightColor
Returns the highlight color. The default value isColor.RED
.- Returns:
- The highlight color (never
null
).
-
setHighlightColor
Sets the highlight color.- Parameters:
color
- the color (null
not permitted).
-
getColor
Returns the color to use for the specified item.- Specified by:
getColor
in interfaceorg.jfree.chart3d.renderer.category.CategoryColorSource
- Overrides:
getColor
in classorg.jfree.chart3d.renderer.category.StandardCategoryColorSource
- Parameters:
series
- the series index.row
- the row index.column
- the column index.- Returns:
- The color (never
null
).
-
equals
Tests this color source for equality with an arbitrary object.- Overrides:
equals
in classorg.jfree.chart3d.renderer.category.StandardCategoryColorSource
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-