|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ge.research.charts.tooltips.AbstractTooltipGenerator
An abstract tooltip generator, that produces a tooltip for each datapoint within a chart. The tooltip string should be computed for each datapoint, however the created string needs not be different for each point. The tooltip string is defined for an entire chart, with placeholders for series name, category/domain name/value, and point/range values, that can be filled in for each datapoint.
| Field Summary | |
static int |
CURRENCYSTYLE
Constant used by NumberFormat factory methods to specify a style of format for currency numbers |
static java.text.SimpleDateFormat |
DEFAULT_DATE_FORMAT
The default date format to use when displaying date values as strings |
static java.text.DecimalFormat |
DEFAULT_ITEM_LABEL_NUMBER_FORMAT
The default number format style to use when displaying item lable numbers as strings |
static java.text.DecimalFormat |
DEFAULT_ITEM_VALUE_NUMBER_FORMAT
The default number format style to use when displaying item value numbers as strings |
static java.lang.String |
DEFAULT_TOOLTIP
The default tooltip string to use |
static int |
INTEGERSTYLE
Constant used by NumberFormat factory methods to specify a style of format for integers |
static java.lang.String |
ITEM_LABEL_PLACEHOLDER
The tooltip placeholder, marking where to insert the category name or domain label/value, within the tooltip string |
static java.lang.String |
ITEM_VALUE_PLACEHOLDER
The tooltip placeholder, marking where to insert the category/range value, within the tooltip string |
static int |
NUMBERSTYLE
Constant used by NumberFormat factory methods to specify a style of format for general numbers |
static int |
PERCENTSTYLE
Constant used by NumberFormat factory methods to specify a style of format for percent numbers |
static java.lang.String |
SERIES_NAME_PLACEHOLDER
The tooltip placeholder, marking where to insert the value of the series name, within the tooltip string |
| Constructor Summary | |
AbstractTooltipGenerator()
|
|
| Method Summary | |
java.lang.String |
generateToolTip(java.lang.String seriesName,
java.lang.Object item,
java.lang.Object value)
Constructs the tooltip for a datapoint, using the tooltip string format as well as the various applicable date and number formaters. |
java.text.SimpleDateFormat |
getDateFormat()
Returns the SimpleDateFormat object to be applied to Date data values within the chart. |
java.lang.String |
getDateFormatString()
Returns the string representation of the date format pattern to be applied to Date data values within the chart. |
java.text.NumberFormat |
getItemLabelNumberFormat()
Returns the NumberFormat object to be applied to Number item label values within the chart. |
java.lang.String |
getItemLabelNumberFormatString()
Returns the string representation of the number format pattern to be applied to Number item label values within the chart. |
java.text.NumberFormat |
getItemValueNumberFormat()
Returns the NumberFormat object to be applied to Number datapoint values within the chart. |
java.lang.String |
getItemValueNumberFormatString()
Returns the string representation of the number format pattern to be applied to Number datapoint values within the chart. |
protected java.lang.String |
getStringValue(java.lang.Comparable c)
Returns the string representation of the Comparable argument object.
|
java.lang.String |
getTooltipStr()
Returns the tooltip string to be used for displaying information about the datapoints of a chart. |
void |
setDateFormat(java.lang.String string)
Sets the date format pattern to apply to Date data values within the chart.
|
void |
setItemLabelNumberFormat(java.text.DecimalFormat format)
Sets the item label NumberFormat to apply to Number item label values within the chart.
|
void |
setItemLabelNumberFormat(int style)
Sets the item label NumberFormat to apply to Number item label values within the chart.
|
void |
setItemValueNumberFormat(java.text.DecimalFormat format)
Sets the datapoint value NumberFormat to apply to Number datapoint values within the chart.
|
void |
setItemValueNumberFormat(int style)
Sets the datapoint value NumberFormat to apply to Number datapoint values within the chart.
|
void |
setTooltipStr(java.lang.String string)
Sets the tooltip string to use for displaying information about the datapoints of a chart. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NUMBERSTYLE
NumberFormat factory methods to specify a style of format for general numbers
public static final int CURRENCYSTYLE
NumberFormat factory methods to specify a style of format for currency numbers
public static final int PERCENTSTYLE
NumberFormat factory methods to specify a style of format for percent numbers
public static final int INTEGERSTYLE
NumberFormat factory methods to specify a style of format for integers
public static final java.text.SimpleDateFormat DEFAULT_DATE_FORMAT
public static final java.text.DecimalFormat DEFAULT_ITEM_LABEL_NUMBER_FORMAT
public static final java.text.DecimalFormat DEFAULT_ITEM_VALUE_NUMBER_FORMAT
public static final java.lang.String SERIES_NAME_PLACEHOLDER
public static final java.lang.String ITEM_LABEL_PLACEHOLDER
public static final java.lang.String ITEM_VALUE_PLACEHOLDER
public static final java.lang.String DEFAULT_TOOLTIP
| Constructor Detail |
public AbstractTooltipGenerator()
| Method Detail |
public java.lang.String generateToolTip(java.lang.String seriesName,
java.lang.Object item,
java.lang.Object value)
seriesName - the name of the dataseries the datapoint belongs toitem - the datapoint "place" (category or domain value)value - the datapoint value
public final java.text.SimpleDateFormat getDateFormat()
SimpleDateFormat object to be applied to Date data values within the chart.
SimpleDateFormat object to use for Date data values within the chartpublic final java.lang.String getDateFormatString()
Date data values within the chart.
Date data values within the chartpublic final java.text.NumberFormat getItemLabelNumberFormat()
NumberFormat object to be applied to Number item label values within the chart.
NumberFormat object to use for Number item label values within the chartpublic final java.lang.String getItemLabelNumberFormatString()
Number item label values within the chart.
Number item label values within the chartpublic final java.text.NumberFormat getItemValueNumberFormat()
NumberFormat object to be applied to Number datapoint values within the chart.
NumberFormat object to use for Number datapoint values within the chartpublic final java.lang.String getItemValueNumberFormatString()
Number datapoint values within the chart.
Number datapoint values within the chartpublic final java.lang.String getTooltipStr()
public final void setDateFormat(java.lang.String string)
Date data values within the chart.
If the argument string is null or an invalid date format pattern, then the
DEFAULT_DATE_FORMAT pattern is used.
string - the date format pattern to apply to Date data values within the chartDEFAULT_DATE_FORMATpublic final void setItemLabelNumberFormat(int style)
NumberFormat to apply to Number item label values within the chart.
If the argument style is not one of the acceptable style types (of the NumberFormat class),
then the DEFAULT_ITEM_LABEL_NUMBER_FORMAT is used.
style - the NumberFormat style to apply to Number item label values within the chartDEFAULT_ITEM_LABEL_NUMBER_FORMAT,
NumberFormat.getIntegerInstance(),
NumberFormat.getCurrencyInstance(),
NumberFormat.getPercentInstance(),
NumberFormat.getNumberInstance()public final void setItemLabelNumberFormat(java.text.DecimalFormat format)
NumberFormat to apply to Number item label values within the chart.
If the argument format is null, then the
DEFAULT_ITEM_LABEL_NUMBER_FORMAT is used.
format - the NumberFormat to apply to Number item label values within the chartDEFAULT_ITEM_LABEL_NUMBER_FORMATpublic final void setItemValueNumberFormat(int style)
NumberFormat to apply to Number datapoint values within the chart.
If the argument style is not one of the acceptable style types (of the NumberFormat class),
then the DEFAULT_ITEM_VALUE_NUMBER_FORMAT is used.
style - the NumberFormat style to apply to Number datapoint values within the chartDEFAULT_ITEM_VALUE_NUMBER_FORMAT,
NumberFormat.getIntegerInstance(),
NumberFormat.getCurrencyInstance(),
NumberFormat.getPercentInstance(),
NumberFormat.getNumberInstance()public final void setItemValueNumberFormat(java.text.DecimalFormat format)
NumberFormat to apply to Number datapoint values within the chart.
If the argument format is null, then the
DEFAULT_ITEM_VALUE_NUMBER_FORMAT is used.
format - the NumberFormat to apply to Number datapoint values within the chartDEFAULT_ITEM_VALUE_NUMBER_FORMATpublic void setTooltipStr(java.lang.String string)
string is null or StringUtils.EMPTY_STRING,
then the tooltip string is set to the DEFAULT_TOOLTIP.
string - the tooltip string to use for displaying information about the datapoints of a chartDEFAULT_TOOLTIP,
StringUtils.isNullOrEmpty(java.lang.String)protected final java.lang.String getStringValue(java.lang.Comparable c)
Comparable argument object.
If the Comparable argument object is not of a specific subtype currently
able to generate an accurate string representation for, then StringUtils.EMPTY_STRING is returned.
c - the Comparable object to return the string value of
Comparable argument object.StringUtils.EMPTY_STRING
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||