|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.rit.numeric.plot.Axis
edu.rit.numeric.plot.NumericalAxis
public abstract class NumericalAxis
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 | |
|---|---|
protected Ticks |
myTicksAboveOrRight
Ticks above or to the right of the axis. |
protected Ticks |
myTicksBelowOrLeft
Ticks below or to the left of the axis. |
| Fields inherited from class edu.rit.numeric.plot.Axis |
|---|
DEFAULT_PAINT, DEFAULT_STROKE, myLength, myPaint, myStroke |
| Constructor Summary | |
|---|---|
protected |
NumericalAxis(double theLength,
Stroke theStroke,
Paint thePaint,
Ticks theTicksBelowOrLeft,
Ticks theTicksAboveOrRight)
Construct a new numerical axis. |
| Method Summary | |
|---|---|
void |
drawHorizontal(Graphics2D g2d)
Draw this axis in the given graphics context starting at coordinates (0, 0) and moving horizontally to the right. |
void |
drawVertical(Graphics2D g2d)
Draw this axis in the given graphics context starting at coordinates (0, 0) and moving vertically up. |
abstract double |
getCrossing()
Returns the value of the point where the perpendicular axis crosses this axis. |
abstract double |
getDisplayDistance(double value)
Returns the distance on the display from the start of this axis to the given value. |
abstract double |
getEnd()
Returns the ending value of this axis. |
abstract double |
getMajorDivision(int i)
Returns the value of the given major division. |
abstract int |
getMajorDivisionCount()
Returns the number of major divisions on this axis. |
abstract double |
getMinorDivision(int i)
Returns the value of the given minor division. |
abstract int |
getMinorDivisionCount()
Returns the number of minor divisions on this axis. |
abstract double |
getStart()
Returns the starting value of this axis. |
Ticks |
getTicksAboveOrRight()
Returns the ticks above or to the right of this axis. |
Ticks |
getTicksBelowOrLeft()
Returns the ticks below or to the left of this axis. |
abstract boolean |
includesValue(double value)
Returns true if the given value falls within the bounds of this axis, false otherwise. |
| Methods inherited from class edu.rit.numeric.plot.Axis |
|---|
autoscale, getLength, getPaint, getStroke |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Ticks myTicksBelowOrLeft
protected Ticks myTicksAboveOrRight
| Constructor Detail |
|---|
protected NumericalAxis(double theLength,
Stroke theStroke,
Paint thePaint,
Ticks theTicksBelowOrLeft,
Ticks theTicksAboveOrRight)
theLength - Length of this axis on the display.theStroke - Stroke for drawing this axis on the display.thePaint - Paint for drawing this axis on the display.theTicksBelowOrLeft - Ticks to draw below or to the left of the axis (for a horizontal or
vertical axis, respectively). If null, no ticks are drawn below or to
the left.theTicksAboveOrRight - Ticks to draw above or to the right of the axis (for a horizontal or
vertical axis, respectively). If null, no ticks are drawn above or to
the right.
NullPointerException - (unchecked exception) Thrown if theStroke is null or
thePaint is null.
IllegalArgumentException - (unchecked exception) Thrown if theLength is less than or
equal to 0.| Method Detail |
|---|
public Ticks getTicksBelowOrLeft()
public Ticks getTicksAboveOrRight()
public void drawHorizontal(Graphics2D g2d)
drawHorizontal in class Axisg2d - 2-D graphics context.public void drawVertical(Graphics2D g2d)
drawVertical in class Axisg2d - 2-D graphics context.public abstract boolean includesValue(double value)
public abstract double getDisplayDistance(double value)
public abstract double getStart()
public abstract double getEnd()
public abstract int getMajorDivisionCount()
public abstract double getMajorDivision(int i)
i - Major division index in the range 0 ..
getMajorDivisionCount().public abstract int getMinorDivisionCount()
public abstract double getMinorDivision(int i)
i - Minor division index in the range 0 ..
getMinorDivisionCount().public abstract double getCrossing()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||