|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.rit.numeric.plot.Axis
public abstract class Axis
Class Axis is the abstract base class for an axis on a plot. It also provides static methods to help determine the scale for an axis.
| Field Summary | |
|---|---|
static Paint |
DEFAULT_PAINT
The default axis paint (black). |
static Stroke |
DEFAULT_STROKE
The default axis stroke (solid, width=1). |
protected double |
myLength
Length of this axis on the display. |
protected Paint |
myPaint
Paint for drawing this axis on the display. |
protected Stroke |
myStroke
Stroke for drawing this axis on the display. |
| Constructor Summary | |
|---|---|
protected |
Axis(double theLength,
Stroke theStroke,
Paint thePaint)
Construct a new axis. |
| Method Summary | |
|---|---|
static double |
autoscale(double max)
Determine a pleasing scale for an axis. |
abstract void |
drawHorizontal(Graphics2D g2d)
Draw this axis in the given graphics context starting at coordinates (0, 0) and moving horizontally to the right. |
abstract void |
drawVertical(Graphics2D g2d)
Draw this axis in the given graphics context starting at coordinates (0, 0) and moving vertically up. |
double |
getLength()
Returns the length of this axis on the display. |
Paint |
getPaint()
Returns the paint for drawing this axis on the display. |
Stroke |
getStroke()
Returns the stroke for drawing this axis on the display. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Stroke DEFAULT_STROKE
public static final Paint DEFAULT_PAINT
protected double myLength
protected Stroke myStroke
protected Paint myPaint
| Constructor Detail |
|---|
protected Axis(double theLength,
Stroke theStroke,
Paint thePaint)
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.
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 double getLength()
public Stroke getStroke()
public Paint getPaint()
public abstract void drawHorizontal(Graphics2D g2d)
g2d - 2-D graphics context.public abstract void drawVertical(Graphics2D g2d)
g2d - 2-D graphics context.public static double autoscale(double max)
Note: The autoscale() method works for negative inputs. If max < 0, then autoscale(max) = -autoscale(-max).
Note: autoscale(0) = 0.
max - Maximum value to be displayed along the axis.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||