org.jfree.chart.labels

Class StandardXYToolTipGenerator

public class StandardXYToolTipGenerator extends AbstractXYItemLabelGenerator implements XYToolTipGenerator, Cloneable, PublicCloneable, Serializable

A standard tool tip generator for use with an XYItemRenderer.
Field Summary
static StringDEFAULT_TOOL_TIP_FORMAT
The default tooltip format.
Constructor Summary
StandardXYToolTipGenerator()
Creates a tool tip generator using default number formatters.
StandardXYToolTipGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat)
Creates a tool tip generator using the specified number formatters.
StandardXYToolTipGenerator(String formatString, DateFormat xFormat, NumberFormat yFormat)
Creates a tool tip generator using the specified number formatters.
StandardXYToolTipGenerator(String formatString, NumberFormat xFormat, DateFormat yFormat)
Creates a tool tip generator using the specified formatters (a number formatter for the x-values and a date formatter for the y-values).
StandardXYToolTipGenerator(String formatString, DateFormat xFormat, DateFormat yFormat)
Creates a tool tip generator using the specified date formatters.
Method Summary
Objectclone()
Returns an independent copy of the generator.
booleanequals(Object obj)
Tests this object for equality with an arbitrary object.
StringgenerateToolTip(XYDataset dataset, int series, int item)
Generates the tool tip text for an item in a dataset.
static StandardXYToolTipGeneratorgetTimeSeriesInstance()
Returns a tool tip generator that formats the x-values as dates and the y-values as numbers.

Field Detail

DEFAULT_TOOL_TIP_FORMAT

public static final String DEFAULT_TOOL_TIP_FORMAT
The default tooltip format.

Constructor Detail

StandardXYToolTipGenerator

public StandardXYToolTipGenerator()
Creates a tool tip generator using default number formatters.

StandardXYToolTipGenerator

public StandardXYToolTipGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat)
Creates a tool tip generator using the specified number formatters.

Parameters: formatString the item label format string (null not permitted). xFormat the format object for the x values (null not permitted). yFormat the format object for the y values (null not permitted).

StandardXYToolTipGenerator

public StandardXYToolTipGenerator(String formatString, DateFormat xFormat, NumberFormat yFormat)
Creates a tool tip generator using the specified number formatters.

Parameters: formatString the label format string (null not permitted). xFormat the format object for the x values (null not permitted). yFormat the format object for the y values (null not permitted).

StandardXYToolTipGenerator

public StandardXYToolTipGenerator(String formatString, NumberFormat xFormat, DateFormat yFormat)
Creates a tool tip generator using the specified formatters (a number formatter for the x-values and a date formatter for the y-values).

Parameters: formatString the item label format string (null not permitted). xFormat the format object for the x values (null permitted). yFormat the format object for the y values (null not permitted).

Since: 1.0.4

StandardXYToolTipGenerator

public StandardXYToolTipGenerator(String formatString, DateFormat xFormat, DateFormat yFormat)
Creates a tool tip generator using the specified date formatters.

Parameters: formatString the label format string (null not permitted). xFormat the format object for the x values (null not permitted). yFormat the format object for the y values (null not permitted).

Method Detail

clone

public Object clone()
Returns an independent copy of the generator.

Returns: A clone.

Throws: CloneNotSupportedException if cloning is not supported.

equals

public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.

Parameters: obj the other object (null permitted).

Returns: A boolean.

generateToolTip

public String generateToolTip(XYDataset dataset, int series, int item)
Generates the tool tip text for an item in a dataset.

Parameters: dataset the dataset (null not permitted). series the series index (zero-based). item the item index (zero-based).

Returns: The tooltip text (possibly null).

getTimeSeriesInstance

public static StandardXYToolTipGenerator getTimeSeriesInstance()
Returns a tool tip generator that formats the x-values as dates and the y-values as numbers.

Returns: A tool tip generator (never null).