|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.approximatrix.charting.render.RowColorModel
public class RowColorModel
This class implements the correspondence between the DataSets and the colors used for rendering the charts and the legend.
| Field Summary | |
|---|---|
protected java.util.HashMap |
customColors
|
protected java.util.HashMap |
customShapes
|
static Diamond2D |
DIAMOND_SHAPE
A diamond marker for plotting |
static java.awt.geom.Ellipse2D |
ELLIPSE_SHAPE
An ellipse marker for plotting |
private static RowColorModel |
instance
|
protected ChartDataModel |
model
|
protected static java.awt.Color[] |
predefinedColors
Predefined colors for plotting lines and markers |
protected int |
predefinedColorsIdx
Index holding the next predefined color to use for plotting |
protected static java.awt.geom.RectangularShape[] |
predefinedShapes
Array of predefined shapes for plot markers |
static java.awt.geom.Rectangle2D |
SQUARE_SHAPE
A square marker for plotting |
static Triangle2D |
TRIANGLE_SHAPE
A triangle marker for plotting |
static Triangle2D |
TRIANGLEDOWN_SHAPE
An upside-down triangle marker for plotting |
| Constructor Summary | |
|---|---|
RowColorModel(ChartDataModel model)
Creates new RowColorModel. |
|
| Method Summary | |
|---|---|
java.awt.Color |
getColor(int row)
Computes the Color for a DataSet. |
static RowColorModel |
getInstance(ChartDataModel model)
Deprecated. |
java.lang.String |
getRow(int i)
Returns the row title of a specific DataSet. |
int |
getRowCount()
Computes the amount of all Legend entries, ie. |
java.awt.geom.RectangularShape |
getShape(int row)
Returns the Shape for a DataSet. |
void |
setColor(int row,
java.awt.Color color)
Force a certain color for a row |
void |
setShape(int row,
java.awt.geom.RectangularShape shape)
Force a certain Shape for a row |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static RowColorModel instance
protected ChartDataModel model
protected static final java.awt.Color[] predefinedColors
public static final java.awt.geom.Ellipse2D ELLIPSE_SHAPE
public static final java.awt.geom.Rectangle2D SQUARE_SHAPE
public static final Diamond2D DIAMOND_SHAPE
public static final Triangle2D TRIANGLE_SHAPE
public static final Triangle2D TRIANGLEDOWN_SHAPE
protected static final java.awt.geom.RectangularShape[] predefinedShapes
protected int predefinedColorsIdx
protected java.util.HashMap customColors
protected java.util.HashMap customShapes
| Constructor Detail |
|---|
public RowColorModel(ChartDataModel model)
model - the ChartDataModel which contains the information about all the DataSets| Method Detail |
|---|
public static RowColorModel getInstance(ChartDataModel model)
model - the ChartDataModel whose data sets will be mapped to
colors.
public int getRowCount()
public java.lang.String getRow(int i)
i - the DataSet index
public java.awt.Color getColor(int row)
Color.red etc are used. If there are more DataSets than stored colors, random colors are used.
row - the row for which the Color should be returned
public java.awt.geom.RectangularShape getShape(int row)
predefinedShapes array are cycled through unless you define
your own shape to data binding using
setShape(int row, RectangularShape shape).
row - the row for which the Shape should be returned
public void setColor(int row,
java.awt.Color color)
row - the row for which the Color should be setcolor - the color that is associated with the row
public void setShape(int row,
java.awt.geom.RectangularShape shape)
row - the row for which the Shape should be setshape - the RectangularShape that is associated with the row
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||