Class LabelFormatterDate

java.lang.Object
info.monitorenter.gui.chart.labelformatters.ALabelFormatter
info.monitorenter.gui.chart.labelformatters.LabelFormatterDate
All Implemented Interfaces:
IAxisLabelFormatter, Serializable

public class LabelFormatterDate extends ALabelFormatter implements IAxisLabelFormatter
An ILabelFormatter instance that uses a DateFormat to format the labels.

Caution:
It only makes sense to use this class if the data of the corresponding axis may be interpreted as long number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.

Caution:
This implementation is not completely conform with the constraint: instance.parse(instance.format(value)) == value
This only works for subsequent call: one call to format contains the next value to return from parse to be the same as the format. That value is cached as date / time formatting produces truncation of the internal value (e.g. if no year is displayed).
Use:

 
     Chart2D chart = new <Constructor>
     Axis axis = new AxisSimple();
     axis.setFormatter(new LabelFormatterDate(DateFormat.getDateInstance()));
     chart.setAxisX(axis);
 
 
to use this class.

Version:
$Revision: 1.11 $
Author:
Achim Westermann
See Also: