|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.ChartObj
com.quinncurtis.chart2djava.AutoScale
public abstract class AutoScale
The AutoScale class is the abstract base class for the auto-scaling classes used to scale the plotting area of graphs, and used to set the minimum and maximum values of the axes displayed in the graphs.
Field Summary |
---|
Constructor Summary | |
---|---|
AutoScale()
The default AutoScale constructor. |
Method Summary | |
---|---|
void |
adjustForZeroEndpoints(double rmin,
double rmax)
Correct an initial range that has equal minimum and maximum values. |
void |
calcChartAutoScaleDataset()
Calculate new auto-scale values based on the values in the data set referenced by the theDataset field. |
void |
calcChartAutoScaleDatasets()
Calculate new auto-scale values based on the values in the data sets referenced by the theDatasetsArray field. |
void |
calcChartAutoScaleInitialValues()
Calculate new auto-scale values based on the minimum and maximum values stored in the initialMin and initialMax fields. |
void |
calcChartAutoScaleTransform()
Calculate new auto-scale values based on the values in the chart scale referenced by the theChartCoordinates field. |
void |
calcDatasetRange()
Calculate the minimum and maximum values for the x- or y-coordinates of the theDataset dataset. |
void |
calcDatasetsRange()
Calculate the minimum and maximum values for the x- or y-coordinates of the theDatasetsArray datasets. |
double |
calcFinalMax(double rmax,
double rtickinterval,
int nthtick,
int nroundmode)
Calculates the auto-scale maximum, based on the rounding mode and the calculated tick intervals. |
double |
calcFinalMin(double rmin,
double rtickinterval,
int nthtick,
int nroundmode)
Calculates the auto-scale minimum, based on the rounding mode and the calculated tick intervals. |
int |
calcNthTickMajor(double rrange)
Calculates the number of minor ticks per major tick based on a normalized range. |
double |
calcOffset(double r,
int n)
Rounds a number to the specified precision level. |
abstract void |
calcRoundAxisValues(double raxmin,
double raxmax,
int nroundmode)
An abstract method that rounds minimum and maximum values appropriate for axis labels. |
double |
calcTickInterval(double rrange)
Calculates the minor tick interval based on a normalized range. |
void |
copy(AutoScale source)
Copies the source AutoScale object. |
int |
errorCheck(int nerror)
Checks the current object for common errors. |
int |
getAxisLabelsDecimalPos()
Returns the number of digits to the right of the decimal point to use for axis labels |
int |
getAxisMinorTicksPerMajor()
Returns the number of minor ticks per major tick mark in the auto-scale setup. |
double |
getFinalMax()
Returns the final maximum value of the auto-scale setup. |
double |
getFinalMin()
Returns the final minimum value of the auto-scale setup. |
double |
getInitialMax()
Returns the initial maximum value of the auto-scale setup. |
double |
getInitialMin()
Returns the initial minimum value of the auto-scale setup. |
double |
getLabelsOrigin()
Returns the starting value of labels and tick marks in the auto-scale setup. |
double |
getMaxRangeAdjust()
Returns the initial maximum value adjustment factor. |
double |
getMinRangeAdjust()
Returns the initial minimum value adjustment factor. |
double |
MaskDigits(double r,
int n)
Rounds a number to the specified precision level and returns the amount rounded off, not the rounded number. |
void |
setChartAutoScale(ChartDataset[] datasets,
int naxis,
int nmode)
Initialize an AutoScale object based on the data values in a a group of datasets. |
void |
setChartAutoScale(ChartDataset dataset,
int naxis,
int nmode)
Initialize an AutoScale object based on the data values in a dataset. |
void |
setChartAutoScale(double rmin,
double rmax,
int naxis,
int nmode)
Initialize an AutoScale object the specific minimum and maximum values. |
void |
setChartAutoScale(PhysicalCoordinates transform,
int naxis,
int nmode)
Initialize an AutoScale object based on the scaling values of an PhysicalCoordinates object. |
void |
setMaxRangeAdjust(double r)
The initial maximum for the auto-scale calculation can be adjusted by a value to make the autoscale range larger. |
void |
setMinRangeAdjust(double r)
The initial minimum for the auto-scale calculation can be adjusted by a value to make the autoscale range larger. |
double |
ShiftDecimalLeft(double r,
int n)
Multiplies a number, r, by 10^n. |
double |
ShiftDecimalRight(double r,
int n)
Divides a number, r, by 10^n. |
Methods inherited from class com.quinncurtis.chart2djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID, TypeSafeVectorCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AutoScale()
Method Detail |
---|
public void adjustForZeroEndpoints(double rmin, double rmax)
rmin
- The minimum value of the initial range.rmax
- The maximum value of the initial range.public void calcChartAutoScaleDataset()
public void calcChartAutoScaleDatasets()
public void calcChartAutoScaleInitialValues()
public void calcChartAutoScaleTransform()
public void calcDatasetRange()
public void calcDatasetsRange()
public double calcFinalMax(double rmax, double rtickinterval, int nthtick, int nroundmode)
rmax
- The current auto-scale maximum.rtickinterval
- The current auto-scale minor tick interval value.nthtick
- The current auto-scale value for the number of minor ticks per major tick interval.nroundmode
- The auto-scale rounding mode (AUTOAXES_EXACT, AUTOAXES_NEAR, AUTOAXES_FAR).
public double calcFinalMin(double rmin, double rtickinterval, int nthtick, int nroundmode)
rmin
- The current auto-scale minimum.rtickinterval
- The current auto-scale minor tick interval value.nthtick
- The current auto-scale value for the number of minor ticks per major tick interval.nroundmode
- The auto-scale rounding mode (AUTOAXES_EXACT, AUTOAXES_NEAR, AUTOAXES_FAR).
public int calcNthTickMajor(double rrange)
rrange
- Specifies the value of the normalized range.
public double calcOffset(double r, int n)
r
- The number to be rounded.n
- The precision level.
public abstract void calcRoundAxisValues(double raxmin, double raxmax, int nroundmode)
raxmin
- The initial axis minimum value.raxmax
- The initial axis maximum value.nroundmode
- The new axis values are calculated using this rounding mode (AUTOAXES_FAR,
AUTOAXES_NEAR, AUTOAXES_EXACT).public double calcTickInterval(double rrange)
rrange
- Specifies the value of the normalized range.
public void copy(AutoScale source)
source
- The source AutoScale object.public int errorCheck(int nerror)
errorCheck
in class ChartObj
nerror
- Current error state.
public int getAxisLabelsDecimalPos()
public int getAxisMinorTicksPerMajor()
public double getFinalMax()
public double getFinalMin()
public double getInitialMax()
public double getInitialMin()
public double getLabelsOrigin()
public double getMaxRangeAdjust()
public double getMinRangeAdjust()
public double MaskDigits(double r, int n)
r
- The number to be rounded.n
- The precision level.
public void setChartAutoScale(ChartDataset[] datasets, int naxis, int nmode)
datasets
- The auto-scale values are calculated based on the minimum and maximum values
derived from this array of datasets.naxis
- The auto-scale values are calculated for this axis (X_AXIS or Y_AXIS).nmode
- The auto-scale values are calculated using this rounding mode (AUTOAXES_FAR,
AUTOAXES_NEAR, AUTOAXES_EXACT).public void setChartAutoScale(ChartDataset dataset, int naxis, int nmode)
dataset
- The auto-scale values are calculated based on the minimum and maximum values
derived from this dataset.naxis
- The auto-scale values are calculated for this axis (X_AXIS or Y_AXIS).nmode
- The auto-scale values are calculated using this rounding mode (AUTOAXES_FAR,
AUTOAXES_NEAR, AUTOAXES_EXACT).public void setChartAutoScale(double rmin, double rmax, int naxis, int nmode)
rmin
- The auto-scale values are calculated based on this minimum value.rmax
- The auto-scale values are calculated based on this maximum value.naxis
- The auto-scale values are calculated for this axis (X_AXIS or Y_AXIS).nmode
- The auto-scale values are calculated using this rounding mode (AUTOAXES_FAR,
AUTOAXES_NEAR, AUTOAXES_EXACT).public void setChartAutoScale(PhysicalCoordinates transform, int naxis, int nmode)
transform
- The auto-scale values are calculated based on the minimum and maximum scaling
values of this PhysicalCoordinates object.naxis
- The auto-scale values are calculated for this axis (X_AXIS or Y_AXIS).nmode
- The auto-scale values are calculated using this rounding mode (AUTOAXES_FAR,
AUTOAXES_NEAR, AUTOAXES_EXACT).public void setMaxRangeAdjust(double r)
r
- Sets the adjustment value for the maximum end of the range. The adjusted maximum value is
calculated as (new maximum) = (initial maximum) + rpublic void setMinRangeAdjust(double r)
r
- Sets the adjustment value for the minimum end of the range. The adjusted minimum value is
calculated as (new minimum) = (initial minimum) - rpublic double ShiftDecimalLeft(double r, int n)
r
- The number to be multiplied.n
- The number r is multiplied by 10^n.
public double ShiftDecimalRight(double r, int n)
r
- The number to be divided.n
- The number r is divided by 10^n.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |