com.odesys.chart
Class Axis

java.lang.Object
  |
  +--com.odesys.chart.Axis

public class Axis
extends java.lang.Object

This class represents a coordinate axis. It automatically determines the position of the marks on the axis based on the data range. The automatically determined values can be overriden using methods provided by the class.


Constructor Summary
Axis()
          Creates a new Axis instance.
 
Method Summary
 AxisMark[] getMarks()
          Gets the marks of this Axis.
 float getMax()
          Gets the max value of this Axis.
 float getMin()
          Gets the min value of this Axis.
 java.lang.String getName()
          Gets the name of this Axis.
 float getPos(float value)
          Calculates the position of the specified value.
 float getValue(float pos)
          Calculates the value that corresponds to the specified position.
 boolean isMarksAuto()
          Checks if the marks of this Axis are being created automatically.
 boolean isMaxAuto()
          Checks if the max value is being determined automatically.
 boolean isMinAuto()
          Checks if the min value is being determined automatically.
 boolean isReversed()
          Checks if the Axis is reversed.
 boolean isZeroInRange()
          Checks if the zero is being kept in the range of this Axis.
 void setDataRange(float minData, float maxData)
          Sets the data range of this Axis.
 void setMarks(AxisMark[] marks)
          Sets the Marks of this Axis.
 void setMarksAuto(boolean auto)
          Sets whether the marks of this Axis should be created automatically
 void setMax(float max)
          Sets the max value of this Axis.
 void setMaxAuto(boolean auto)
          Sets whether the max value should be determined automatically.
 void setMin(float min)
          Sets the min value of this Axis.
 void setMinAuto(boolean auto)
          Sets whether the min value should be determined automatically.
 void setName(java.lang.String name)
          Sets the name of this Axis.
 void setReversed(boolean reversed)
          Sets whether the axis should be reversed.
 void setZeroInRange(boolean zeroInRange)
          When set to true the zero is always kept in the range of this Axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Axis

public Axis()
Creates a new Axis instance.
Method Detail

setMin

public void setMin(float min)
Sets the min value of this Axis. This method disables the automatical calculation of the min value.

getMin

public float getMin()
Gets the min value of this Axis.

setMax

public void setMax(float max)
Sets the max value of this Axis. This method disables the automatical calculation of the max value.

getMax

public float getMax()
Gets the max value of this Axis.

setDataRange

public void setDataRange(float minData,
                         float maxData)
Sets the data range of this Axis. Updates the min and/or the max values of this Axis if the automatical calculation of those values is enabled.

setZeroInRange

public void setZeroInRange(boolean zeroInRange)
When set to true the zero is always kept in the range of this Axis.

isZeroInRange

public boolean isZeroInRange()
Checks if the zero is being kept in the range of this Axis.

setMinAuto

public void setMinAuto(boolean auto)
Sets whether the min value should be determined automatically.

isMinAuto

public boolean isMinAuto()
Checks if the min value is being determined automatically.

setMaxAuto

public void setMaxAuto(boolean auto)
Sets whether the max value should be determined automatically.

isMaxAuto

public boolean isMaxAuto()
Checks if the max value is being determined automatically.

setReversed

public void setReversed(boolean reversed)
Sets whether the axis should be reversed.

isReversed

public boolean isReversed()
Checks if the Axis is reversed.

getPos

public float getPos(float value)
Calculates the position of the specified value. The min value has position 0.0f (or 1.0f if the Axis is reversed) and the max value has position 1.0f (or 0.0f if the Axis is reversed).

getValue

public float getValue(float pos)
Calculates the value that corresponds to the specified position.

setMarksAuto

public void setMarksAuto(boolean auto)
Sets whether the marks of this Axis should be created automatically

isMarksAuto

public boolean isMarksAuto()
Checks if the marks of this Axis are being created automatically.

setMarks

public void setMarks(AxisMark[] marks)
Sets the Marks of this Axis. This method disables the automatical creation of the marks.

getMarks

public AxisMark[] getMarks()
Gets the marks of this Axis.

setName

public void setName(java.lang.String name)
Sets the name of this Axis.

getName

public java.lang.String getName()
Gets the name of this Axis.