edu.rit.numeric.plot.impl
Class NumericalAxis
- java.lang.Object
-
- edu.rit.numeric.plot.impl.Axis
-
- edu.rit.numeric.plot.impl.NumericalAxis
-
- Direct Known Subclasses:
- LinearAxis, LogarithmicAxis
public abstract class NumericalAxis extends Axis
Class NumericalAxis is the abstract base class for a numerical axis on a plot. A numerical axis represents a numerical quantity; it is divided into major divisions; each major division is divided into minor divisions. A numerical axis may have tick marks at the major and minor divisions. A numerical axis may have tick labels at the major divisions.
-
-
Field Summary
-
Fields inherited from class edu.rit.numeric.plot.impl.Axis
DEFAULT_PAINT, DEFAULT_STROKE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voiddrawHorizontal(java.awt.Graphics2D g2d)Draw this axis in the given graphics context starting at coordinates (0, 0) and moving horizontally to the right.voiddrawVertical(java.awt.Graphics2D g2d)Draw this axis in the given graphics context starting at coordinates (0, 0) and moving vertically up.abstract doublegetCrossing()Returns the value of the point where the perpendicular axis crosses this axis.abstract doublegetDisplayDistance(double value)Returns the distance on the display from the start of this axis to the given value.abstract doublegetEnd()Returns the ending value of this axis.abstract doublegetMajorDivision(int i)Returns the value of the given major division.abstract intgetMajorDivisionCount()Returns the number of major divisions on this axis.abstract doublegetMinorDivision(int i)Returns the value of the given minor division.abstract intgetMinorDivisionCount()Returns the number of minor divisions on this axis.abstract doublegetStart()Returns the starting value of this axis.TicksgetTicksAboveOrRight()Returns the ticks above or to the right of this axis.TicksgetTicksBelowOrLeft()Returns the ticks below or to the left of this axis.abstract booleanincludesValue(double value)Returns true if the given value falls within the bounds of this axis, false otherwise.
-
-
-
Method Detail
-
getTicksBelowOrLeft
public Ticks getTicksBelowOrLeft()
Returns the ticks below or to the left of this axis.
-
getTicksAboveOrRight
public Ticks getTicksAboveOrRight()
Returns the ticks above or to the right of this axis.
-
drawHorizontal
public void drawHorizontal(java.awt.Graphics2D g2d)
Draw this axis in the given graphics context starting at coordinates (0, 0) and moving horizontally to the right.- Specified by:
drawHorizontalin classAxis- Parameters:
g2d- 2-D graphics context.
-
drawVertical
public void drawVertical(java.awt.Graphics2D g2d)
Draw this axis in the given graphics context starting at coordinates (0, 0) and moving vertically up.- Specified by:
drawVerticalin classAxis- Parameters:
g2d- 2-D graphics context.
-
includesValue
public abstract boolean includesValue(double value)
Returns true if the given value falls within the bounds of this axis, false otherwise.
-
getDisplayDistance
public abstract double getDisplayDistance(double value)
Returns the distance on the display from the start of this axis to the given value.
-
getStart
public abstract double getStart()
Returns the starting value of this axis. The starting value is the value at the left or bottom end of the axis for a horizontal or vertical orientation, respectively.
-
getEnd
public abstract double getEnd()
Returns the ending value of this axis. The ending value is the value at the right or top end of the axis for a horizontal or vertical orientation, respectively. Note that the ending value may be greater than or less than the starting value.
-
getMajorDivisionCount
public abstract int getMajorDivisionCount()
Returns the number of major divisions on this axis.
-
getMajorDivision
public abstract double getMajorDivision(int i)
Returns the value of the given major division.- Parameters:
i- Major division index in the range 0 .. getMajorDivisionCount().
-
getMinorDivisionCount
public abstract int getMinorDivisionCount()
Returns the number of minor divisions on this axis.
-
getMinorDivision
public abstract double getMinorDivision(int i)
Returns the value of the given minor division.- Parameters:
i- Minor division index in the range 0 .. getMinorDivisionCount().
-
getCrossing
public abstract double getCrossing()
Returns the value of the point where the perpendicular axis crosses this axis.
-
-
DMelt 3.0 © DataMelt by jWork.ORG