org.jfree.chart.tooltips
Class StandardCategoryToolTipGenerator

java.lang.Object
  |
  +--org.jfree.chart.tooltips.StandardCategoryToolTipGenerator
All Implemented Interfaces:
CategoryToolTipGenerator, java.io.Serializable, ToolTipGenerator

public class StandardCategoryToolTipGenerator
extends java.lang.Object
implements CategoryToolTipGenerator, java.io.Serializable

A standard tooltip generator for plots that use data from a CategoryDataset.

Author:
David Gilbert
See Also:
Serialized Form

Constructor Summary
StandardCategoryToolTipGenerator()
          Creates a new tool tip generator with a default number formatter.
StandardCategoryToolTipGenerator(java.text.DateFormat formatter)
          Creates a tool tip generator with the specified date formatter.
StandardCategoryToolTipGenerator(java.text.NumberFormat formatter)
          Creates a tool tip generator with the specified number formatter.
 
Method Summary
 boolean equals(java.lang.Object o)
          Tests if this object is equal to another.
 java.lang.String generateToolTip(CategoryDataset data, int series, int category)
          Generates a tooltip text item for a particular category within a series.
 java.text.DateFormat getDateFormat()
          Returns the date formatter.
 java.text.NumberFormat getNumberFormat()
          Returns the number formatter.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardCategoryToolTipGenerator

public StandardCategoryToolTipGenerator()
Creates a new tool tip generator with a default number formatter.


StandardCategoryToolTipGenerator

public StandardCategoryToolTipGenerator(java.text.NumberFormat formatter)
Creates a tool tip generator with the specified number formatter.

Parameters:
formatter - the number formatter.

StandardCategoryToolTipGenerator

public StandardCategoryToolTipGenerator(java.text.DateFormat formatter)
Creates a tool tip generator with the specified date formatter.

Parameters:
formatter - the date formatter.
Method Detail

getNumberFormat

public java.text.NumberFormat getNumberFormat()
Returns the number formatter.

Returns:
the number formatter.

getDateFormat

public java.text.DateFormat getDateFormat()
Returns the date formatter.

Returns:
the date formatter.

generateToolTip

public java.lang.String generateToolTip(CategoryDataset data,
                                        int series,
                                        int category)
Generates a tooltip text item for a particular category within a series.

Specified by:
generateToolTip in interface CategoryToolTipGenerator
Parameters:
data - the dataset.
series - the series index (zero-based).
category - the category index (zero-based).
Returns:
the tooltip text or null if value is null.

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
o - the other object.
Returns:
A boolean.