- java.lang.Object
-
- org.jfree.chart.labels.AbstractXYItemLabelGenerator
-
- org.jfree.chart.labels.StandardXYToolTipGenerator
-
- All Implemented Interfaces:
Serializable,Cloneable,PublicCloneable,XYToolTipGenerator
- Direct Known Subclasses:
BoxAndWhiskerXYToolTipGenerator,StandardXYZToolTipGenerator
public class StandardXYToolTipGenerator extends AbstractXYItemLabelGenerator implements XYToolTipGenerator, Cloneable, PublicCloneable, Serializable
A standard tool tip generator for use with anXYItemRenderer.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_TOOL_TIP_FORMATThe default tooltip format.
-
Constructor Summary
Constructors Constructor Description StandardXYToolTipGenerator()Creates a tool tip generator using default number formatters.StandardXYToolTipGenerator(String formatString, DateFormat xFormat, DateFormat yFormat)Creates a tool tip generator using the specified date 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, NumberFormat xFormat, NumberFormat yFormat)Creates a tool tip generator using the specified number formatters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.inthashCode()Returns a hash code for this instance.-
Methods inherited from class org.jfree.chart.labels.AbstractXYItemLabelGenerator
createItemArray, generateLabelString, getFormatString, getNullYString, getXDateFormat, getXFormat, getYDateFormat, getYFormat
-
-
-
-
Field Detail
-
DEFAULT_TOOL_TIP_FORMAT
public static final String DEFAULT_TOOL_TIP_FORMAT
The default tooltip format.- See Also:
- Constant Field Values
-
-
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 (nullnot permitted).xFormat- the format object for the x values (nullnot permitted).yFormat- the format object for the y values (nullnot 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 (nullnot permitted).xFormat- the format object for the x values (nullnot permitted).yFormat- the format object for the y values (nullnot 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 (nullnot permitted).xFormat- the format object for the x values (nullpermitted).yFormat- the format object for the y values (nullnot permitted).
-
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 (nullnot permitted).xFormat- the format object for the x values (nullnot permitted).yFormat- the format object for the y values (nullnot permitted).
-
-
Method Detail
-
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).
-
generateToolTip
public String generateToolTip(XYDataset dataset, int series, int item)
Generates the tool tip text for an item in a dataset.- Specified by:
generateToolTipin interfaceXYToolTipGenerator- Parameters:
dataset- the dataset (nullnot permitted).series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The tooltip text (possibly
null).
-
equals
public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classAbstractXYItemLabelGenerator- Parameters:
obj- the other object (nullpermitted).- Returns:
- A boolean.
-
clone
public Object clone() throws CloneNotSupportedException
Returns an independent copy of the generator.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractXYItemLabelGenerator- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if cloning is not supported.
-
hashCode
public int hashCode()
Description copied from class:AbstractXYItemLabelGeneratorReturns a hash code for this instance.- Overrides:
hashCodein classAbstractXYItemLabelGenerator- Returns:
- A hash code.
-
-