|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.Axis | +--com.jrefinery.chart.ValueAxis | +--com.jrefinery.chart.DateAxis
The base class for axes that display java.util.Date values.
You will find it easier to understand how this axis works if you bear in mind that it really displays/measures integer (or long) data, where the integers are milliseconds since midnight, 1-Jan-1970. When displaying tick labels, the millisecond values are converted back to dates using a DateFormat instance.
HorizontalDateAxis
Field Summary | |
static java.util.Date |
DEFAULT_ANCHOR_DATE
The default anchor date. |
static java.util.Date |
DEFAULT_CROSSHAIR_DATE
The default crosshair date. |
static DateTickUnit |
DEFAULT_DATE_TICK_UNIT
The default date tick unit. |
Fields inherited from class com.jrefinery.chart.ValueAxis |
DEFAULT_AUTO_RANGE, DEFAULT_AUTO_RANGE_MINIMUM_SIZE, DEFAULT_CROSSHAIR_PAINT, DEFAULT_CROSSHAIR_STROKE, DEFAULT_CROSSHAIR_VISIBLE, DEFAULT_GRID_LINE_PAINT, DEFAULT_GRID_LINE_STROKE, DEFAULT_LOWER_BOUND, DEFAULT_LOWER_MARGIN, DEFAULT_RANGE, DEFAULT_UPPER_BOUND, DEFAULT_UPPER_MARGIN, MAXIMUM_TICK_COUNT |
Fields inherited from class com.jrefinery.chart.Axis |
fixedDimension, label, labelFont, labelInsets, labelPaint, plot, tickLabelFont, tickLabelInsets, tickLabelPaint, tickLabelsVisible, tickMarkPaint, 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_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,
java.awt.Paint tickMarkPaint,
boolean autoRange,
java.lang.Number autoRangeMinimumSize,
Range range,
boolean autoTickUnitSelection,
TickUnits standardTickUnits,
DateTickUnit tickUnit,
java.text.SimpleDateFormat tickLabelFormatter,
boolean gridLinesVisible,
java.awt.Stroke gridStroke,
java.awt.Paint gridPaint,
java.util.Date anchorDate,
boolean crosshairVisible,
java.util.Date crosshairDate,
java.awt.Stroke crosshairStroke,
java.awt.Paint crosshairPaint)
Constructs a date axis. |
Method Summary | |
java.util.Date |
calculateHighestVisibleTickValue(DateTickUnit unit)
Calculates the value of the highest visible tick on the axis. |
java.util.Date |
calculateLowestVisibleTickValue(DateTickUnit unit)
Calculates the value of the lowest visible tick on the axis. |
static TickUnits |
createStandardDateTickUnits()
Returns a collection of standard date tick units. |
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. |
DateTickUnit |
getTickUnit()
Returns the tick unit for the axis. |
protected java.util.Date |
nextStandardDate(java.util.Date date,
DateTickUnit unit)
Returns the first "standard" date (based on the specified field and units). |
protected java.util.Date |
previousStandardDate(java.util.Date date,
DateTickUnit unit)
Returns the previous "standard" date, for a given date and tick unit. |
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)
Deprecated. use setRange(double, double) method. |
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(java.util.Date lower,
java.util.Date upper)
Sets the axis range. |
void |
setRange(double lower,
double upper)
Sets the axis range. |
void |
setRange(Range range)
Sets the upper and lower bounds for the axis. |
void |
setTickUnit(DateTickUnit unit)
Sets the tick unit for the axis. |
protected void |
setTickUnitAttribute(DateTickUnit unit)
Sets the tick unit attribute without any other side effects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final DateTickUnit DEFAULT_DATE_TICK_UNIT
public static final java.util.Date DEFAULT_ANCHOR_DATE
public static final java.util.Date DEFAULT_CROSSHAIR_DATE
Constructor Detail |
protected DateAxis(java.lang.String label)
label
- the axis label (null permitted).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, java.awt.Paint tickMarkPaint, boolean autoRange, java.lang.Number autoRangeMinimumSize, Range range, boolean autoTickUnitSelection, TickUnits standardTickUnits, DateTickUnit tickUnit, java.text.SimpleDateFormat tickLabelFormatter, boolean gridLinesVisible, java.awt.Stroke gridStroke, java.awt.Paint gridPaint, java.util.Date anchorDate, boolean crosshairVisible, java.util.Date crosshairDate, java.awt.Stroke crosshairStroke, java.awt.Paint crosshairPaint)
label
- the axis label (null permitted).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).tickMarkPaint
- the paint used to draw tick marks (if visible).autoRange
- flag indicating whether the axis range is automatically adjusted to
fit the data.autoRangeMinimumSize
- the smallest range allowed when the axis range is calculated to
fit the data.range
- the axis range.autoTickUnitSelection
- a flag indicating whether the tick unit is automatically
selected.standardTickUnits
- the standard tick units.tickUnit
- the tick unit.tickLabelFormatter
- formatter to use for date formatting.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).anchorDate
- the anchor date.crosshairVisible
- a flag controlling whether 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 ValueAxis
range
- the new range.public void setRange(java.util.Date lower, java.util.Date upper)
lower
- the lower bound for the axis.upper
- the upper bound for the axis.public void setRange(double lower, double upper)
setRange
in class ValueAxis
lower
- the lower bound for the axis.upper
- the upper bound for the axis.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 DateTickUnit getTickUnit()
public void setTickUnit(DateTickUnit unit)
unit
- the new date unit.protected void setTickUnitAttribute(DateTickUnit unit)
unit
- the new tick unit.public java.util.Date getAnchorDate()
public void setAnchorDate(java.util.Date anchorDate)
anchorDate
- the new anchor date (null permitted).public void setAnchorValue(double value)
This method keeps the anchorDate and anchorValue in synch.
setAnchorValue
in class ValueAxis
value
- the new value.public java.util.Date getCrosshairDate()
public void setCrosshairDate(java.util.Date crosshairDate)
crosshairDate
- the new crosshair date (null permitted).public java.util.Date calculateLowestVisibleTickValue(DateTickUnit unit)
unit
- date unit to use.public java.util.Date calculateHighestVisibleTickValue(DateTickUnit unit)
unit
- date unit to use.protected java.util.Date previousStandardDate(java.util.Date date, DateTickUnit unit)
date
- the reference date.unit
- the tick unit.protected java.util.Date nextStandardDate(java.util.Date date, DateTickUnit unit)
date
- the reference date.unit
- the date tick unit.public static TickUnits createStandardDateTickUnits()
public void setAxisRange(double lower, double upper)
lower
- the lower bound for the axis.upper
- the upper bound for the axis.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |