|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.pxlab.gui.AxisModel
public abstract class AxisModel
This class describes a very general model for a bounded range of numbers which may be viewed by a Axis. An essential property of the model is that it does not fix the scale type and the corresponding operation which is used to construct standard sequences on the scale. The mapping of the model to the axis view is a two-step process: First the model's range is mapped onto the interval [0.0, 1.0] and then this interval is mapped onto the view. This is a graphic illustration of the the mapping of the axis model:
Model Minimum ------------ Value ------------Maximum
| | |
V V V
MappedScale 0.0 ---------------------------------- 1.0
| | |
V V V
View ScaleX --------------- x ---------- (ScaleX + RangeX)
getMappedValue(x): Model -> MappedScale
setValueFromMap(x): MappedScale -> Model
AxisListener,
Slider| Field Summary | |
|---|---|
protected AxisListener |
axisListener
|
protected double |
maximum
|
protected double |
minimum
|
protected double |
value
|
| Constructor Summary | |
|---|---|
AxisModel()
|
|
| Method Summary | |
|---|---|
protected abstract double |
getMappedValue(double x)
Map a value from the axis model into the range [0.0, 1.0] on the MappedScale |
double |
getMaximum()
Return the upper bound of the axis model. |
double |
getMinimum()
Return the lower bound of the axis model. |
protected abstract double |
getStepSizeValue(int n)
Return the size of a single step on the model's scale when the range [min, max] is divided by n equally spaced steps. |
double |
getValue()
Return the current value of the axis model. |
protected abstract double |
getValueForSteps(int n,
double step)
Get the position on the scale where we arrive when moving from position start by n steps of size step. |
protected abstract double |
getValueFromMap(double v)
Get a value on the model's scale from a value on the MappedScale in the range [0.0, 1.0] |
void |
removeAxisListener()
|
void |
setAxisListener(AxisListener ax)
|
void |
setMaximum(double x)
Set the upper bound of the axis model. |
void |
setMinimum(double x)
Set the lower bound of the range of values. |
void |
setValue(double v)
Set the current value of the axis model. |
protected boolean |
setValueFromMap(double v)
Set the model's value from a value on the MappedScale in the range [0.0, 1.0]. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double minimum
protected double maximum
protected double value
protected AxisListener axisListener
| Constructor Detail |
|---|
public AxisModel()
| Method Detail |
|---|
public void setMinimum(double x)
public double getMinimum()
public void setMaximum(double x)
public double getMaximum()
public double getValue()
public void setValue(double v)
protected abstract double getMappedValue(double x)
protected boolean setValueFromMap(double v)
public void setAxisListener(AxisListener ax)
public void removeAxisListener()
protected abstract double getValueFromMap(double v)
protected abstract double getStepSizeValue(int n)
protected abstract double getValueForSteps(int n,
double step)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||