|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.mapper.AbstractAxisMapper
lt.monarch.chart.mapper.CountableAxisMapper
lt.monarch.chart.mapper.DateListAxisMapper
public class DateListAxisMapper extends CountableAxisMapper
Axis mapper which maps a date list. List may have date gaps. Gaps are ignored. All dates are mapped sequentially and spaced equally. Month edges are detected and marked on the scale. Note: KEY values in the data model must be sorted in ascending order.
| Constructor and Description |
|---|
DateListAxisMapper(java.util.Date[] dates)
Constructs a new DateListAxisMapper with the specified array of dates. |
DateListAxisMapper(java.util.Date[] dates,
AxisMapperRange mapperRange)
Constructs a new DateListAxisMapper with the specified array of dates with the
specified axis mapper range. |
| Modifier and Type | Method and Description |
|---|---|
void |
addDate(java.util.Date newDate)
Adds single date point to the array of dates being mapped. |
java.lang.String |
formatKey(java.lang.Object key)
Provides text representation of the specified Date value. |
java.util.Calendar |
getCalendar()
Gets a calendar of the date axis mapper. |
java.text.DateFormat |
getDateFormat(int units)
Gets the general date format of the date list axis mapper. |
java.util.Date[] |
getDates()
Gets the list of dates. |
int |
getElementCount()
Gets the number of elements in the list. |
protected java.text.Format[] |
getFormats()
Gets all formats. |
int |
getLabelCount()
Gets label count in the axis mapper. |
double |
getPreferredHeight(AbstractGraphics g,
AbstractTextPainter textPainter)
Gets preferred height. |
double |
getPreferredWidth(AbstractGraphics g,
AbstractTextPainter textPainter)
Gets preferred width. |
java.lang.Object[] |
getRegisteredKeys()
Gets axis registered keys. |
AxisScale |
getScale()
Returns a scale for this axis. |
AxisMapperRange |
getViewRange()
Gets the visible range as AxisMapperRange object. |
protected double |
map(int i)
Maps the i-th dates list element. |
double |
map(java.lang.Object key)
Maps the specified Date value into the mapping range. |
java.lang.Object |
mapBack(double pos)
Converts the position on the coordinate axis to the Date object. |
void |
setCalendar(java.util.Calendar calendar)
Sets a Calendar for this date axis mapper. |
void |
setDateFormat(java.text.DateFormat dateFormat,
int units)
Sets the date format for specified scale units. |
void |
setDates(java.util.Date[] dates)
Sets dates which will be mapped. |
void |
setFinestScaleUnits(int units)
Sets the finest scale units. |
void |
setStartingScaleUnits(int units)
Sets the biggest scale units. |
void |
setVisibleRange(java.util.Date start,
java.util.Date end)
Sets date view range for the axis. |
void |
showAllTicks(boolean show)
Sets property, which defines if the finest scale ticks are shown. |
| Methods inherited from class lt.monarch.chart.mapper.CountableAxisMapper |
|---|
getTextHeigh, getTextWidth |
| Methods inherited from class lt.monarch.chart.mapper.AbstractAxisMapper |
|---|
addListener, fireMappingChanged, getProjectionRange, removeListener, setProjectionRange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateListAxisMapper(java.util.Date[] dates)
DateListAxisMapper with the specified array of dates.
dates - the array of dates
public DateListAxisMapper(java.util.Date[] dates,
AxisMapperRange mapperRange)
DateListAxisMapper with the specified array of dates with the
specified axis mapper range.
dates - the array of datesmapperRange - the mapper range| Method Detail |
|---|
public void setCalendar(java.util.Calendar calendar)
Calendar for this date axis mapper. The Calendar will be used to
extract integer fields as YEAR, MONTH, DAY and so on from Date objects.
calendar - the calendarpublic void setStartingScaleUnits(int units)
units - Any of these values: Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTHpublic void setFinestScaleUnits(int units)
units - Any of these values: Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH
public void setDateFormat(java.text.DateFormat dateFormat,
int units)
dateFormat - : desired DateFormat,units - Any of these values: Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTHpublic java.util.Calendar getCalendar()
setCalendar(java.util.Calendar)public java.text.DateFormat getDateFormat(int units)
units - time unit type, use Calendar variable list.public AxisMapperRange getViewRange()
AxisMapperRange object.
public void setDates(java.util.Date[] dates)
dates - date listpublic void addDate(java.util.Date newDate)
newDate - date to add
public void setVisibleRange(java.util.Date start,
java.util.Date end)
start - start dateend - end datepublic double map(java.lang.Object key)
key - the Date to mapkey in the date range; a value in range [0,1]protected double map(int i)
i - index of dates list elementpublic java.lang.Object mapBack(double pos)
mapBack in interface AxisMappermapBack in class AbstractAxisMapperpos - the position on the coordinate axisAxisMapper.mapBack(double)public AxisScale getScale()
public int getElementCount()
public java.lang.String formatKey(java.lang.Object key)
key - the Date object to formatpublic void showAllTicks(boolean show)
show - if true all ticks are shown.public java.util.Date[] getDates()
public java.lang.Object[] getRegisteredKeys()
CountableAxisMapper
getRegisteredKeys in class CountableAxisMapperpublic int getLabelCount()
CountableAxisMapper
getLabelCount in class CountableAxisMapperprotected java.text.Format[] getFormats()
public double getPreferredHeight(AbstractGraphics g,
AbstractTextPainter textPainter)
AxisMapper
g - graphics contexttextPainter - text painter mode
public double getPreferredWidth(AbstractGraphics g,
AbstractTextPainter textPainter)
AxisMapper
g - graphics contexttextPainter - text painter mode
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||