org.jfree.chart.labels
Class StandardXYToolTipGenerator

java.lang.Object
  extended byorg.jfree.chart.labels.StandardXYToolTipGenerator
All Implemented Interfaces:
java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable, XYToolTipGenerator
Direct Known Subclasses:
StandardXYZToolTipGenerator

public class StandardXYToolTipGenerator
extends java.lang.Object
implements XYToolTipGenerator, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable

A standard tool tip generator for plots that use data from an XYDataset.

Author:
David Gilbert
See Also:
Serialized Form

Constructor Summary
StandardXYToolTipGenerator()
          Creates a tool tip generator using default number formatters.
StandardXYToolTipGenerator(java.text.NumberFormat xFormat, java.text.NumberFormat yFormat)
          Cnstructs a tool tip generator using the specified number formatters.
 
Method Summary
 java.lang.Object clone()
          Returns an independent copy of the generator.
 boolean equals(java.lang.Object o)
          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.
 java.text.NumberFormat getXFormat()
          Returns the number formatter for the x-values.
 java.text.NumberFormat getYFormat()
          Returns the number formatter for the y-values.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardXYToolTipGenerator

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


StandardXYToolTipGenerator

public StandardXYToolTipGenerator(java.text.NumberFormat xFormat,
                                  java.text.NumberFormat yFormat)
Cnstructs a tool tip generator using the specified number formatters.

Parameters:
xFormat - the format object for the x values.
yFormat - the format object for the y values.
Method Detail

getXFormat

public java.text.NumberFormat getXFormat()
Returns the number formatter for the x-values.

Returns:
the number formatter for the x-values.

getYFormat

public java.text.NumberFormat getYFormat()
Returns the number formatter for the y-values.

Returns:
the number formatter for the y-values.

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 interface XYToolTipGenerator
Parameters:
data - the dataset.
series - the series index (zero-based).
item - the item index (zero-based).
Returns:
the tool tip text.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns an independent copy of the generator.

Specified by:
clone in interface org.jfree.util.PublicCloneable
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - if cloning is not supported.

equals

public boolean equals(java.lang.Object o)
Tests if this object is equal to another.

Parameters:
o - the other object.
Returns:
A boolean.