JIDE 3.5.15

com.jidesoft.scale
Class DatePeriodConverter

java.lang.Object
  extended by com.jidesoft.scale.AbstractPeriodConverter<Date>
      extended by com.jidesoft.scale.DatePeriodConverter
All Implemented Interfaces:
PeriodConverter<Date>, Serializable

public class DatePeriodConverter
extends AbstractPeriodConverter<Date>

A PeriodConverter which converts the Date to text using the specified date formats.

See Also:
Serialized Form

Field Summary
static String RESOURCE_PREFIX
           
 
Constructor Summary
DatePeriodConverter(String periodName, DateFormat labelFormat, DateFormat toolTipFormat)
           
DatePeriodConverter(String periodName, DateFormat labelFormat, DateFormat toolTipFormat, int endFormatField)
           
 
Method Summary
static PeriodConverter<Date> createDefaultPeriodConverter(ScaleArea<Date> scaleArea)
           
static PeriodConverter<Date> createPeriodConverter(ScaleArea<Date> scaleArea, DatePeriod period)
           
protected  String format(DateFormat format, Date date)
           
 String getDescription(Date startInstant, Date endInstant)
          Gets the long text representing the period.
 String getText(Date startInstant, Date endInstant)
          Gets the short text representing the period.
 String getText(DateFormat format, Date startInstant, Date endInstant)
           
 void setFormatEndDate(boolean formatEndDate, int endFormatField)
           
 
Methods inherited from class com.jidesoft.scale.AbstractPeriodConverter
getDisplayName, getPrototypeDisplayValue, setPrototypeDisplayValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_PREFIX

public static final String RESOURCE_PREFIX
See Also:
Constant Field Values
Constructor Detail

DatePeriodConverter

public DatePeriodConverter(String periodName,
                           DateFormat labelFormat,
                           DateFormat toolTipFormat)

DatePeriodConverter

public DatePeriodConverter(String periodName,
                           DateFormat labelFormat,
                           DateFormat toolTipFormat,
                           int endFormatField)
Method Detail

setFormatEndDate

public void setFormatEndDate(boolean formatEndDate,
                             int endFormatField)

getText

public String getText(Date startInstant,
                      Date endInstant)
Description copied from interface: PeriodConverter
Gets the short text representing the period. It can be used as the scale area header text.

Parameters:
startInstant - the start instance of the period
endInstant - the end instance of the period
Returns:
the short text representing the period.

getDescription

public String getDescription(Date startInstant,
                             Date endInstant)
Description copied from interface: PeriodConverter
Gets the long text representing the period. It can be used as the scale area header tooltip.

Parameters:
startInstant - the start instance of the period
endInstant - the end instance of the period
Returns:
the long text representing the period.

getText

public String getText(DateFormat format,
                      Date startInstant,
                      Date endInstant)

format

protected String format(DateFormat format,
                        Date date)

createDefaultPeriodConverter

public static PeriodConverter<Date> createDefaultPeriodConverter(ScaleArea<Date> scaleArea)

createPeriodConverter

public static PeriodConverter<Date> createPeriodConverter(ScaleArea<Date> scaleArea,
                                                          DatePeriod period)

JIDE 3.5.15