jas.plot
Class DoubleAxis

java.lang.Object
  |
  +--jas.plot.AxisType
        |
        +--jas.plot.DoubleAxis
All Implemented Interfaces:
CoordinateTransformation, DoubleCoordinateTransformation, java.io.Externalizable, java.io.Serializable, Transformation

public final class DoubleAxis
extends AxisType
implements DoubleCoordinateTransformation

Implements a simple numeric axis, with either linear or logarithmic scale. Users may set a flag that determines whether the axis may round to close values for simplicity of labels or whether the axis should keep to the given range. If, for example, the minimum is set to 4.3 and the maximum is set to 95.9, this class may be configured to round the extrema so that the labels are 0, 10, 20, ..., 100. Use setUseSuggestedRange(boolean) to set whether a pretty range is automatically used.

See Also:
setUseSuggestedRange(boolean), Serialized Form

Fields inherited from class jas.plot.AxisType
axis
 
Constructor Summary
DoubleAxis()
          Creates linear axis.
DoubleAxis(boolean logarithmic)
          Creates a new numeric axis.
 
Method Summary
 double convert(double d)
          Returns a pixel value for a given double value.
 CoordinateTransformation getCoordinateTransformation()
          Returns an instance of DoubleCoordinateTransformation.
 double getDataMax()
          Returns the maximum of the data on the axis, as given to the method setMax().
 double getDataMin()
          Returns the minimum of the data on the axis, as given to the method setMin().
 double getIntersection()
           
 double getPlotMax()
          Returns the maximum of the axis range.
 double getPlotMin()
          Returns the minimum of the axis range.
 boolean getUseSuggestedRange()
           
 boolean isLogarithmic()
           
 void readExternal(java.io.ObjectInput in)
           
 void setLogarithmic(boolean logarithmic)
           
 void setMax(double data_max)
           
 void setMin(double data_min)
           
 void setUseSuggestedRange(boolean useSuggestedRange)
           
 double unConvert(double d)
          Returns a double value for a given pixel.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class jas.plot.AxisType
getAxis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleAxis

public DoubleAxis()
Creates linear axis.

DoubleAxis

public DoubleAxis(boolean logarithmic)
Creates a new numeric axis.
Parameters:
logarithmic - whether the axis uses logarithmic (as opposed to liear) scale
Method Detail

setLogarithmic

public void setLogarithmic(boolean logarithmic)

isLogarithmic

public boolean isLogarithmic()

setUseSuggestedRange

public void setUseSuggestedRange(boolean useSuggestedRange)

getUseSuggestedRange

public boolean getUseSuggestedRange()

setMin

public void setMin(double data_min)

setMax

public void setMax(double data_max)

getPlotMin

public double getPlotMin()
Returns the minimum of the axis range.
Specified by:
getPlotMin in interface DoubleCoordinateTransformation

getPlotMax

public double getPlotMax()
Returns the maximum of the axis range.
Specified by:
getPlotMax in interface DoubleCoordinateTransformation

getDataMin

public double getDataMin()
Returns the minimum of the data on the axis, as given to the method setMin().
See Also:
setMin(double)

getDataMax

public double getDataMax()
Returns the maximum of the data on the axis, as given to the method setMax().
See Also:
setMax(double)

getCoordinateTransformation

public CoordinateTransformation getCoordinateTransformation()
Returns an instance of DoubleCoordinateTransformation.
See Also:
DoubleCoordinateTransformation

convert

public double convert(double d)
Description copied from interface: DoubleCoordinateTransformation
Returns a pixel value for a given double value.
Specified by:
convert in interface DoubleCoordinateTransformation

unConvert

public double unConvert(double d)
Description copied from interface: DoubleCoordinateTransformation
Returns a double value for a given pixel.
Specified by:
unConvert in interface DoubleCoordinateTransformation

getIntersection

public double getIntersection()

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException