public final class AxisIntervals extends Object
This class is used in many of the demonstration applications supplied with the Tinfour software library. For example, it is used to select intervals for legends in color-coded surface representations. It is used to label axes in trend-line graphs. And it is also used to pick contour intervals in contour-rendering applications.
Modifier and Type | Method and Description |
---|---|
static AxisIntervals |
computeIntervals(double value0,
double value1,
int primaryMinIntervalInPixels,
int secondaryMinIntervalInPixels,
int sizeInPixels)
Compute the intervals over a range of values.
|
static AxisIntervals |
computeIntervals(double value0,
double value1,
int primaryMinIntervalInPixels,
int secondaryMinIntervalInPixels,
int sizeInPixels,
boolean bracketValues)
Compute the intervals over a range of values.
|
double |
getCoordinateScale()
Get a multiplicative factor for scaling coordinates to pixels.
|
int |
getIntervalMagnitude()
Gets the integer power of ten corresponding to the
magnitude of the primary interval.
|
double[] |
getLabelCoordinates()
Gets the coordinates for labels.
|
String |
getLabelFormat()
Get a label format that is intended to be appropriate to
the magnitude of the primary interval
|
String[] |
getLabels()
Gets formatted labels for the tic coordinates.
|
double[][] |
getTicCoordinates()
Gets the coordinates for the tic marks to be added to the axis.
|
double |
getUnitsPerPixel()
Gets the scale factor for units in the value coordinate system
compare to pixels.
|
double |
getValue0()
Gets the minimum value of the range used to specify the axis.
|
double |
getValue1()
Gets the maximum value of the range used to specify the axis.
|
boolean |
isValue0Labeled()
Indicates if value0 was included in the primary tic coordinates.
|
boolean |
isValue1Labeled()
Indicates if value1 was included in the primary tic coordinates.
|
double |
mapValueToPixel(double value)
Maps a value to a corresponding pixel coordinate.
|
public double getValue0()
public double getValue1()
public boolean isValue0Labeled()
public boolean isValue1Labeled()
public double[][] getTicCoordinates()
public double[] getLabelCoordinates()
public String[] getLabels()
public String getLabelFormat()
public double getCoordinateScale()
public static AxisIntervals computeIntervals(double value0, double value1, int primaryMinIntervalInPixels, int secondaryMinIntervalInPixels, int sizeInPixels)
value0
- the minimum value to be represented.value1
- the maximum value to be represented.primaryMinIntervalInPixels
- the minimum spacing allowed for the
primary intervalsecondaryMinIntervalInPixels
- the minimum space allowed for the
secondary intervalsizeInPixels
- the overall size of the area for labeling,
i..e$#46; the length of a horizontal axis or the height of
a vertical axispublic static AxisIntervals computeIntervals(double value0, double value1, int primaryMinIntervalInPixels, int secondaryMinIntervalInPixels, int sizeInPixels, boolean bracketValues)
value0
- the minimum value to be represented.value1
- the maximum value to be represented.primaryMinIntervalInPixels
- the minimum spacing allowed for the
primary intervalsecondaryMinIntervalInPixels
- the minimum space allowed for the
secondary intervalsizeInPixels
- the overall size of the area for labeling,
i..e$#46; the length of a horizontal axis or the height of
a vertical axisbracketValues
- true if the computed interval must fully
bracket the input values; false if bracketing is optional.public double mapValueToPixel(double value)
value
- the value to be mapped.public int getIntervalMagnitude()
public double getUnitsPerPixel()
Copyright © 2021. All rights reserved.