|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.rit.numeric.plot.Ticks
public class Ticks
Class Ticks provides information about tick marks to be drawn on a NumericalAxis.
| Field Summary | |
|---|---|
static Font |
DEFAULT_LABEL_FONT
The default tick label font (sanserif, plain, 12). |
static double |
DEFAULT_LABEL_OFFSET
The default offset from the tick mark to the tick label (5). |
static Paint |
DEFAULT_LABEL_PAINT
The default tick label paint (black). |
static double |
DEFAULT_LENGTH
The default tick mark length (5). |
static Paint |
DEFAULT_PAINT
The default tick mark paint (black). |
static Stroke |
DEFAULT_STROKE
The default tick mark stroke (solid, width=1). |
protected Font |
myLabelFont
Font for drawing tick labels on the display, if any. |
protected DecimalFormat |
myLabelFormat
Format for the tick labels, or null for no tick labels. |
protected double |
myLabelOffset
Offset from the tick marks to the tick labels, if any. |
protected Paint |
myLabelPaint
Paint for drawing tick labels on the display, if any. |
protected double |
myLabelScale
Scale factor for the tick labels. |
protected double |
myLength
Length of the tick marks on the display. |
protected Paint |
myPaint
Paint for drawing tick marks on the display. |
protected Stroke |
myStroke
Stroke for drawing tick marks on the display. |
| Constructor Summary | |
|---|---|
Ticks()
Construct a new ticks information object. |
|
Ticks(DecimalFormat theLabelFormat)
Construct a new ticks information object. |
|
Ticks(DecimalFormat theLabelFormat,
double theLabelScale)
Construct a new ticks information object. |
|
Ticks(Stroke theStroke,
Paint thePaint,
double theLength,
DecimalFormat theLabelFormat,
double theLabelScale,
Font theLabelFont,
Paint theLabelPaint,
double theLabelOffset)
Construct a new ticks information object. |
|
| Method Summary | |
|---|---|
void |
drawAbove(Graphics2D g2d)
Draw a tick above. |
void |
drawAbove(Graphics2D g2d,
double theLabelValue)
Draw a tick above. |
void |
drawBelow(Graphics2D g2d)
Draw a tick below. |
void |
drawBelow(Graphics2D g2d,
double theLabelValue)
Draw a tick below. |
void |
drawLeft(Graphics2D g2d)
Draw a tick to the left. |
void |
drawLeft(Graphics2D g2d,
double theLabelValue)
Draw a tick to the left. |
void |
drawRight(Graphics2D g2d)
Draw a tick to the right. |
void |
drawRight(Graphics2D g2d,
double theLabelValue)
Draw a tick to the right. |
Font |
getLabelFont()
Returns the font for drawing tick labels on the display. |
DecimalFormat |
getLabelFormat()
Returns the format for the tick labels. |
double |
getLabelOffset()
Returns the offset from the tick marks to the tick labels. |
Paint |
getLabelPaint()
Returns the paint for drawing tick labels on the display. |
double |
getLabelScale()
Returns the scale factor for the tick labels. |
double |
getLength()
Returns the length of the tick marks on the display. |
Paint |
getPaint()
Returns the paint for drawing tick marks on the display. |
Stroke |
getStroke()
Returns the stroke for drawing tick marks 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
public static final double DEFAULT_LENGTH
public static final Font DEFAULT_LABEL_FONT
public static final Paint DEFAULT_LABEL_PAINT
public static final double DEFAULT_LABEL_OFFSET
protected Stroke myStroke
protected Paint myPaint
protected double myLength
protected DecimalFormat myLabelFormat
protected double myLabelScale
protected Font myLabelFont
protected Paint myLabelPaint
protected double myLabelOffset
| Constructor Detail |
|---|
public Ticks()
public Ticks(DecimalFormat theLabelFormat)
theLabelFormat - Format for the tick labels. If null, no tick labels are drawn.
public Ticks(DecimalFormat theLabelFormat,
double theLabelScale)
theLabelFormat - Format for the tick labels. If null, no tick labels are drawn.theLabelScale - Scale factor for the tick labels. Each tick label's numerical value
is divided by theLabelScale before being displayed. Use a
value of 1.0 for no scaling.
IllegalArgumentException - (unchecked exception) Thrown if theLabelFormat is non-null
and theLabelScale is equal to 0.
public Ticks(Stroke theStroke,
Paint thePaint,
double theLength,
DecimalFormat theLabelFormat,
double theLabelScale,
Font theLabelFont,
Paint theLabelPaint,
double theLabelOffset)
theStroke - Stroke for drawing tick marks on the display.thePaint - Paint for drawing tick marks on the display.theLength - Length of the tick marks on the display.theLabelFormat - Format for the tick labels. If null, no tick labels are drawn.theLabelScale - Scale factor for the tick labels. Each tick label's numerical value
is divided by theLabelScale before being displayed. Use a
value of 1.0 for no scaling.theLabelFont - Font for drawing tick labels on the display, if any. Ignored if no
tick labels are to be drawn.theLabelPaint - Paint for drawing tick labels on the display, if any. Ignored if no
tick labels are to be drawn.theLabelOffset - Offset from the tick marks to the tick labels, if any. Ignored if no
tick labels are to be drawn.
NullPointerException - (unchecked exception) Thrown if theStroke is null,
thePaint is null, theLabelFormat is non-null and
theLabelFont is null, or theLabelFormat is non-null
and theLabelPaint is null.
IllegalArgumentException - (unchecked exception) Thrown if theLength is less than or
equal to 0, theLabelFormat is non-null and
theLabelScale is equal to 0, or theLabelFormat is
non-null and theLabelOffset is less than or equal to 0.| Method Detail |
|---|
public Stroke getStroke()
public Paint getPaint()
public double getLength()
public DecimalFormat getLabelFormat()
public double getLabelScale()
public Font getLabelFont()
public Paint getLabelPaint()
public double getLabelOffset()
public void drawLeft(Graphics2D g2d)
g2d - 2-D graphics context.
public void drawLeft(Graphics2D g2d,
double theLabelValue)
g2d - 2-D graphics context.theLabelValue - Numerical value for the tick label, if any.public void drawRight(Graphics2D g2d)
g2d - 2-D graphics context.
public void drawRight(Graphics2D g2d,
double theLabelValue)
g2d - 2-D graphics context.theLabelValue - Numerical value for the tick label, if any.public void drawBelow(Graphics2D g2d)
g2d - 2-D graphics context.
public void drawBelow(Graphics2D g2d,
double theLabelValue)
g2d - 2-D graphics context.theLabelValue - Numerical value for the tick label, if any.public void drawAbove(Graphics2D g2d)
g2d - 2-D graphics context.
public void drawAbove(Graphics2D g2d,
double theLabelValue)
g2d - 2-D graphics context.theLabelValue - Numerical value for the tick label, if any.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||