|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.jrefinery.chart.Axis
com.jrefinery.chart.ValueAxis
com.jrefinery.chart.DateAxis
public abstract class DateAxis
The base class for axes that display java.util.Date values.
HorizontalDateAxis| Field Summary | |
|---|---|
protected java.util.Date |
anchorDate
The anchor date (needs to be synchronised with the anchorValue in the ValueAxis superclass, as this form is maintained for convenience only). |
protected java.util.Date |
crosshairDate
The crosshair date (needs to be synchronised with the crosshairValue in the ValueAxis superclass, as this form is maintained for convenience only). |
static java.util.Date |
DEFAULT_CROSSHAIR_DATE
The default crosshair date. |
protected static java.lang.String[] |
standardTickFormats
An array of strings, corresponding to the tickValues array, and used to create a DateFormat object for displaying tick values. |
protected static long[] |
standardTickUnitMagnitudes
The approximate magnitude of each of the standard tick units. |
protected static int[][] |
standardTickUnits
An array of Calendar fields that will be used for automatic tick generation. |
protected java.text.SimpleDateFormat |
tickLabelFormatter
A formatter for the tick labels. |
protected DateUnit |
tickUnit
The current tick unit. |
| Fields inherited from class com.jrefinery.chart.Axis |
|---|
fixedDimension, label, labelFont, labelInsets, labelPaint, listeners, plot, tickLabelFont, tickLabelInsets, tickLabelPaint, tickLabelsVisible, tickMarkStroke, tickMarksVisible, ticks, visible |
| Fields inherited from interface com.jrefinery.chart.AxisConstants |
|---|
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_STROKE |
| Constructor Summary | |
|---|---|
protected |
DateAxis(java.lang.String label)
Constructs a date axis, using default values where necessary. |
protected |
DateAxis(java.lang.String label,
java.awt.Font labelFont,
java.awt.Paint labelPaint,
java.awt.Insets labelInsets,
boolean tickLabelsVisible,
java.awt.Font tickLabelFont,
java.awt.Paint tickLabelPaint,
java.awt.Insets tickLabelInsets,
boolean tickMarksVisible,
java.awt.Stroke tickMarkStroke,
boolean autoRange,
Range range,
boolean autoTickUnitSelection,
DateUnit tickUnit,
java.text.SimpleDateFormat tickLabelFormatter,
boolean gridLinesVisible,
java.awt.Stroke gridStroke,
java.awt.Paint gridPaint,
boolean crosshairVisible,
java.util.Date crosshairDate,
java.awt.Stroke crosshairStroke,
java.awt.Paint crosshairPaint)
Constructs a date axis. |
| Method Summary | |
|---|---|
java.util.Date |
calculateHighestVisibleTickValue(DateUnit unit)
Calculates the value of the highest visible tick on the axis. |
java.util.Date |
calculateLowestVisibleTickValue(DateUnit unit)
Calculates the value of the lowest visible tick on the axis. |
protected int |
findAxisMagnitudeIndex()
Returns the index of the largest tick unit that will fit within the axis range. |
java.util.Date |
getAnchorDate()
Returns the anchor date for the axis. |
java.util.Date |
getCrosshairDate()
Returns the crosshair date for the axis. |
java.util.Date |
getMaximumDate()
Returns the latest date visible on the axis. |
java.util.Date |
getMinimumDate()
Returns the earliest date visible on the axis. |
java.text.SimpleDateFormat |
getTickLabelFormatter()
Returns the formatter for the tick labels. |
DateUnit |
getTickUnit()
Returns the tick unit for the axis. |
protected java.util.Date |
nextStandardDate(java.util.Date date,
int field,
int units)
Returns the first "standard" date (based on the specified field and units). |
protected java.util.Date |
previousStandardDate(java.util.Date date,
int field,
int units)
Returns the previous "standard" date (based on the specified field and units). |
void |
setAnchorDate(java.util.Date anchorDate)
Sets the anchor date for the axis. |
void |
setAnchorValue(double value)
Sets the anchor value. |
void |
setAxisRange(double lower,
double upper)
Sets the axis range. |
void |
setCrosshairDate(java.util.Date crosshairDate)
Sets the crosshair date for the axis. |
void |
setMaximumDate(java.util.Date maximumDate)
Sets the maximum date visible on the axis. |
void |
setMinimumDate(java.util.Date minimumDate)
Sets the minimum date visible on the axis. |
void |
setRange(Range range)
Sets the upper and lower bounds for the axis. |
void |
setTickUnit(DateUnit unit)
Sets the tick unit for the axis. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Date DEFAULT_CROSSHAIR_DATE
protected java.util.Date anchorDate
protected java.util.Date crosshairDate
protected DateUnit tickUnit
protected java.text.SimpleDateFormat tickLabelFormatter
protected static long[] standardTickUnitMagnitudes
protected static int[][] standardTickUnits
protected static java.lang.String[] standardTickFormats
| Constructor Detail |
|---|
protected DateAxis(java.lang.String label)
label - The axis label.
protected DateAxis(java.lang.String label,
java.awt.Font labelFont,
java.awt.Paint labelPaint,
java.awt.Insets labelInsets,
boolean tickLabelsVisible,
java.awt.Font tickLabelFont,
java.awt.Paint tickLabelPaint,
java.awt.Insets tickLabelInsets,
boolean tickMarksVisible,
java.awt.Stroke tickMarkStroke,
boolean autoRange,
Range range,
boolean autoTickUnitSelection,
DateUnit tickUnit,
java.text.SimpleDateFormat tickLabelFormatter,
boolean gridLinesVisible,
java.awt.Stroke gridStroke,
java.awt.Paint gridPaint,
boolean crosshairVisible,
java.util.Date crosshairDate,
java.awt.Stroke crosshairStroke,
java.awt.Paint crosshairPaint)
label - The axis label.labelFont - The font for displaying the axis label.labelPaint - The paint used to draw the axis label.labelInsets - Determines the amount of blank space around the label.tickLabelsVisible - Flag indicating whether or not tick labels are visible.tickLabelFont - The font used to display tick labels.tickLabelPaint - The paint used to draw tick labels.tickLabelInsets - Determines the amount of blank space around tick labels.tickMarksVisible - Flag indicating whether or not tick marks are visible.tickMarkStroke - The stroke used to draw tick marks (if visible).autoRange - Flag indicating whether or not the axis range is automatically adjusted to
fit the data.range - The axis range.autoTickUnitSelection - A flag indicating whether or not the tick unit is automatically
selected.tickUnit - The tick unit.gridLinesVisible - Flag indicating whether or not grid lines are visible.gridStroke - The Stroke used to display grid lines (if visible).gridPaint - The Paint used to display grid lines (if visible).crosshairVisible - A flag controlling whether or not the crosshair is visible for this
axis.crosshairDate - The crosshair date.crosshairStroke - The crosshair stroke.crosshairPaint - The crosshair paint.| Method Detail |
|---|
public void setRange(Range range)
As a side-effect, the auto-range flag is set to false.
setRange in class ValueAxisrange - The new range.public java.util.Date getMinimumDate()
public void setMinimumDate(java.util.Date minimumDate)
minimumDate - The new minimum date.public java.util.Date getMaximumDate()
public void setMaximumDate(java.util.Date maximumDate)
maximumDate - The new maximum date.public void setAnchorValue(double value)
This method keeps the anchorDate and anchorValue in synch.
setAnchorValue in class ValueAxisvalue - The new value.
public void setAxisRange(double lower,
double upper)
lower - The lower bound for the axis.upper - The upper bound for the axis.public java.util.Date getCrosshairDate()
public void setCrosshairDate(java.util.Date crosshairDate)
maximumDate - The new crosshair date (null permitted).public java.util.Date getAnchorDate()
public void setAnchorDate(java.util.Date anchorDate)
anchorDate - The new anchor date (null permitted).public DateUnit getTickUnit()
public void setTickUnit(DateUnit unit)
unit - The new date unit.public java.text.SimpleDateFormat getTickLabelFormatter()
public java.util.Date calculateLowestVisibleTickValue(DateUnit unit)
public java.util.Date calculateHighestVisibleTickValue(DateUnit unit)
protected java.util.Date previousStandardDate(java.util.Date date,
int field,
int units)
protected java.util.Date nextStandardDate(java.util.Date date,
int field,
int units)
protected int findAxisMagnitudeIndex()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||