|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectli.netcat.chart.data.AbstractChartModelAdapter
li.netcat.chart.data.StaticScaleModel
Implementation of a NumericScaleModel
that uses a linear scale.
This scale has an arbitrary number of static marks.
Constructor Summary | |
StaticScaleModel(double[] marks)
Construcs a new instance of a StaticScaleModel with the given marks. |
Method Summary | |
float |
getLength()
Returns the length of the scale |
int |
getMarkCount()
Returns the number of marks of this scale. |
double[] |
getMarks()
Returns a clone of the marks of this scale. |
float |
getPosition(int markIndex)
Returns the position of the mark at the given index. |
java.lang.String |
getText(int markIndex)
Returns the text of the mark at the given index. |
double |
getValue(int markIndex)
Returns the value of the mark at the given index. |
void |
invalidate()
Invoked when the underlying model changes. |
boolean |
isCentered()
Returns the centered flag. |
void |
setLength(float length)
Sets the length of the scale. |
void |
setMarks(double[] marks)
Sets the static marks to this scale. |
void |
setRange(double min,
double max,
boolean relative)
Sets the range for this scale. |
float |
toPosition(double value)
Calculates the position of an arbitrary value. |
Methods inherited from class li.netcat.chart.data.AbstractChartModelAdapter |
getChartModel, setChartModel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface li.netcat.chart.data.ChartModelAdapter |
getChartModel, setChartModel |
Constructor Detail |
public StaticScaleModel(double[] marks)
marks
- The marks of the scale. It must be at least 2 elements long and marks[i] < marks[i+1] must
be true for all valid i.Method Detail |
public void setMarks(double[] marks)
marks
- The marks of the scale. It must be at least 2 elements long and marks[i] < marks[i+1] must
be true for all valid i.public double[] getMarks()
public void setRange(double min, double max, boolean relative)
NumericScaleModel
setRange
in interface NumericScaleModel
min
- The minimum value, it is <= max.max
- The maximum value, it is >= min.relative
- Flag that indicates that the values are in percent.
The value 1.0 refers to 100%.public float getLength()
ScaleModel
getLength
in interface ScaleModel
public void setLength(float length)
ScaleModel
setLength
in interface ScaleModel
length
- The length of the scale, must be > 0.0f.public int getMarkCount()
ScaleModel
getMarkCount
in interface ScaleModel
public float getPosition(int markIndex)
ScaleModel
getPosition
in interface ScaleModel
markIndex
- The index of the mark. It must be >= 0 and < getMarkCount()
.public double getValue(int markIndex)
ScaleModel
getValue
in interface ScaleModel
markIndex
- The index of the mark. It must be >= 0 and < getMarkCount()
.public java.lang.String getText(int markIndex)
ScaleModel
getText
in interface ScaleModel
markIndex
- The index of the mark. It must be >= 0 and < getMarkCount()
.public float toPosition(double value)
ScaleModel
toPosition
in interface ScaleModel
value
- An arbitrary value.
public boolean isCentered()
ScaleModel
isCentered
in interface ScaleModel
public void invalidate()
AbstractChartModelAdapter
invalidate
in class AbstractChartModelAdapter
|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |