|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.chart.AbstractChartModel<T>
com.jgoodies.chart.ColoredChartModel<T>
public final class ColoredChartModel<T>
A wrapper for ChartModels that colorizes the uncolored wrapped items.
More precisely, if m
is the wrapped ChartModel, and w
is this wrapper, then w.getItemCount() == m.getItemCount()
,
and for all indices i
, w
and m
return the same
data, icon, text, and size. And w.getColor(i) == m.getColor(i)
,
iff m.getColor(i) == null
.
ChartModel
Constructor Summary | |
---|---|
ColoredChartModel(ChartModel<T> chartModel,
int colorCount,
float saturation,
float brightness)
Constructs a wrapper ChartModel on the given model. |
Method Summary | |
---|---|
float |
getBrightness()
|
Color |
getColor(int index)
Returns the color of the item at the given index. |
int |
getColorCount()
|
T |
getData(int index)
Returns the user data at the given index. |
Icon |
getIcon(int index)
Returns the icon at the given index. |
int |
getItemCount()
Returns the number of items in this model. |
float |
getSaturation()
|
long |
getSize(int index)
Returns the mandatory size at the given index. |
String |
getText(int index)
Returns the text at the given index. |
void |
setBrightness(float newBrightness)
|
void |
setColorCount(int newColorCount)
|
void |
setSaturation(float newSaturation)
|
Methods inherited from class com.jgoodies.chart.AbstractChartModel |
---|
addChangeListener, fireStateChanged, removeChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColoredChartModel(ChartModel<T> chartModel, int colorCount, float saturation, float brightness)
null
color.
chartModel
- the chart model to colorizecolorCount
- the number of colors to computesaturation
- the saturation of the computed colorsbrightness
- the brightness of the computed colors
NullPointerException
- if the chartModel is null
Method Detail |
---|
public int getColorCount()
public void setColorCount(int newColorCount)
public float getSaturation()
public void setSaturation(float newSaturation)
public float getBrightness()
public void setBrightness(float newBrightness)
public int getItemCount()
public T getData(int index)
index
- the index to look at
public Icon getIcon(int index)
index
- the index to look at
public String getText(int index)
index
- the index to look at
public long getSize(int index)
index
- the index to look at
public Color getColor(int index)
null
and leave it
to a wrapper chart model to colorize the data.
Returns the delegate's color if non-null
,
the computed otherwise.
index
- the index to look at
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |