|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omegahat.Graphics.Primitives.Scale
A scale (e.g., for an axis), defined by a minimum and maximum value.
Scales can be constructed from an array of numbers or specified directly. Scale objects are typically used to control the plotting limits of a graphical element.
The pretty method converts a scale into an axis, having a lower and upper bound and a number of intervals. The computed axis will be within the range defined by the scale.
| Field Summary | |
protected double |
max
|
protected double |
min
|
| Constructor Summary | |
Scale()
|
|
Scale(double[] data)
use the range of the data. |
|
Scale(double min,
double max)
use the supplied minimum and maximum. |
|
| Method Summary | |
double |
log10(double x)
|
double |
max()
Retrieve the maximum of this scale. |
double |
max(double v)
Set the maximum of this scale. |
double |
min()
Retrieve the minimum of this scale. |
double |
min(double v)
Set the minimum of this scale. |
AxisRangeInt |
pretty(int n)
|
ScaleInt |
reScale(double[] data)
extend the scale by the range of the data. |
java.lang.String |
toString()
|
double |
transformDimension(double dim)
transform dimension (scale) in native units to normalized parent co-ordinates. |
double |
transformLocation(double locn)
transform location in native units to normalized parent co-ordinates. |
double |
transformToNative(double value)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected double min
protected double max
| Constructor Detail |
public Scale()
public Scale(double min,
double max)
public Scale(double[] data)
Values of NaN in the data are allowed, and ignored.
| Method Detail |
public double min()
ScaleIntmin in interface ScaleIntpublic double min(double v)
ScaleIntmin in interface ScaleIntpublic double max()
ScaleIntmax in interface ScaleIntpublic double max(double v)
ScaleIntmax in interface ScaleIntpublic ScaleInt reScale(double[] data)
NaN values in the data are allowed and ignored.
reScale in interface ScaleIntpublic double transformLocation(double locn)
transformLocation in interface ScaleIntpublic double transformDimension(double dim)
transformDimension in interface ScaleIntpublic double log10(double x)
public double transformToNative(double value)
transformToNative in interface ScaleIntpublic AxisRangeInt pretty(int n)
pretty in interface ScaleIntpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||