|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.chart.axis.Axis | +--org.jfree.chart.axis.ValueAxis | +--org.jfree.chart.axis.DateAxis
The base class for axes that display dates.
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
,
Serialized FormField Summary | |
static java.util.Date |
DEFAULT_ANCHOR_DATE
The default anchor date. |
static double |
DEFAULT_AUTO_RANGE_MINIMUM_SIZE_IN_MILLISECONDS
The default minimum auto range size. |
static DateRange |
DEFAULT_DATE_RANGE
The default axis range. |
static DateTickUnit |
DEFAULT_DATE_TICK_UNIT
The default date tick unit. |
Fields inherited from class org.jfree.chart.axis.ValueAxis |
DEFAULT_AUTO_RANGE, DEFAULT_AUTO_RANGE_MINIMUM_SIZE, DEFAULT_AUTO_TICK_UNIT_SELECTION, DEFAULT_INVERTED, DEFAULT_LOWER_BOUND, DEFAULT_LOWER_MARGIN, DEFAULT_RANGE, DEFAULT_UPPER_BOUND, DEFAULT_UPPER_MARGIN, MAXIMUM_TICK_COUNT |
Constructor Summary | |
protected |
DateAxis(java.lang.String label)
Creates 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.text.DateFormat |
getDateFormatOverride()
Returns the date format override. |
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. |
boolean |
isTickMarksAtStartOfUnit()
Returns true if the tick marks are displayed at the start of each time unit,
and false if they are displayed in the middle of each time unit. |
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 |
setDateFormatOverride(java.text.DateFormat formatter)
Sets the date format override. |
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 |
setTickMarksAtStartOfUnit(boolean flag)
Sets the flag that controls whether the tick marks are displayed at the start or the middle of each tick unit. |
void |
setTickUnit(DateTickUnit unit)
Sets the tick unit for the axis. |
void |
setTickUnit(DateTickUnit unit,
boolean notify,
boolean turnOffAutoSelection)
Sets the tick unit attribute without any other side effects. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final DateRange DEFAULT_DATE_RANGE
public static final double DEFAULT_AUTO_RANGE_MINIMUM_SIZE_IN_MILLISECONDS
public static final DateTickUnit DEFAULT_DATE_TICK_UNIT
public static final java.util.Date DEFAULT_ANCHOR_DATE
Constructor Detail |
protected DateAxis(java.lang.String label)
label
- the axis label.Method Detail |
public DateTickUnit getTickUnit()
public void setTickUnit(DateTickUnit unit)
false
, and registered listeners are notified that the axis has been changed.
unit
- the new tick unit.public void setTickUnit(DateTickUnit unit, boolean notify, boolean turnOffAutoSelection)
unit
- the new tick unit.notify
- notify registered listeners?turnOffAutoSelection
- turn off auto selection?public java.text.DateFormat getDateFormatOverride()
public void setDateFormatOverride(java.text.DateFormat formatter)
formatter
- the date formatter (null
permitted).public java.util.Date getAnchorDate()
null
).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 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 boolean isTickMarksAtStartOfUnit()
true
if the tick marks are displayed at the start of each time unit,
and false
if they are displayed in the middle of each time unit.
public void setTickMarksAtStartOfUnit(boolean flag)
flag
- a boolean.public void setMaximumDate(java.util.Date maximumDate)
maximumDate
- the new maximum date.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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |