Package org.jfree.chart.labels
Class CustomXYToolTipGenerator
- java.lang.Object
-
- org.jfree.chart.labels.CustomXYToolTipGenerator
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,XYToolTipGenerator
,PublicCloneable
public class CustomXYToolTipGenerator extends java.lang.Object implements XYToolTipGenerator, java.lang.Cloneable, PublicCloneable, java.io.Serializable
A tool tip generator that stores custom tooltips. The dataset passed into the generateToolTip method is ignored.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
For serialization.private java.util.List
toolTipSeries
Storage for the tooltip lists.
-
Constructor Summary
Constructors Constructor Description CustomXYToolTipGenerator()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToolTipSeries(java.util.List toolTips)
Adds a list of tooltips for a series.java.lang.Object
clone()
Returns an independent copy of the generator.boolean
equals(java.lang.Object obj)
Tests if this object is equal to another.java.lang.String
generateToolTip(XYDataset data, int series, int item)
Generates a tool tip text item for a particular item within a series.int
getListCount()
Returns the number of tool tip lists stored by the renderer.int
getToolTipCount(int list)
Returns the number of tool tips in a given list.java.lang.String
getToolTipText(int series, int item)
Returns the tool tip text for an item.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
toolTipSeries
private java.util.List toolTipSeries
Storage for the tooltip lists.
-
-
Method Detail
-
getListCount
public int getListCount()
Returns the number of tool tip lists stored by the renderer.- Returns:
- The list count.
-
getToolTipCount
public int getToolTipCount(int list)
Returns the number of tool tips in a given list.- Parameters:
list
- the list index (zero based).- Returns:
- The tooltip count.
-
getToolTipText
public java.lang.String getToolTipText(int series, int item)
Returns the tool tip text for an item.- Parameters:
series
- the series index.item
- the item index.- Returns:
- The tool tip text.
-
addToolTipSeries
public void addToolTipSeries(java.util.List toolTips)
Adds a list of tooltips for a series.- Parameters:
toolTips
- the list of tool tips.
-
generateToolTip
public java.lang.String generateToolTip(XYDataset data, int series, int item)
Generates a tool tip text item for a particular item within a series.- Specified by:
generateToolTip
in interfaceXYToolTipGenerator
- Parameters:
data
- the dataset (ignored in this implementation).series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- The tooltip text.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Returns an independent copy of the generator.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classjava.lang.Object
- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException
- if cloning is not supported.
-
equals
public boolean equals(java.lang.Object obj)
Tests if this object is equal to another.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the other object.- Returns:
- A boolean.
-
-