org.jfree.chart.labels
Class StandardPieItemLabelGenerator

java.lang.Object
  extended byorg.jfree.chart.labels.StandardPieItemLabelGenerator
All Implemented Interfaces:
java.lang.Cloneable, PieItemLabelGenerator, java.io.Serializable

public class StandardPieItemLabelGenerator
extends java.lang.Object
implements PieItemLabelGenerator, java.lang.Cloneable, java.io.Serializable

A standard item label generator for plots that use data from a PieDataset.

Author:
David Gilbert
See Also:
Serialized Form

Constructor Summary
StandardPieItemLabelGenerator()
          Creates an item label generator with a default number formatter.
StandardPieItemLabelGenerator(java.text.NumberFormat formatter)
          Creates an item label generator with the specified number formatter.
 
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(PieDataset data, java.lang.Comparable key, int pieIndex)
          Generates a tool tip text item for one section in a pie chart.
 java.text.NumberFormat getNumberFormat()
          Returns the number formatter.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardPieItemLabelGenerator

public StandardPieItemLabelGenerator()
Creates an item label generator with a default number formatter.


StandardPieItemLabelGenerator

public StandardPieItemLabelGenerator(java.text.NumberFormat formatter)
Creates an item label generator with the specified number formatter.

Parameters:
formatter - the number formatter.
Method Detail

getNumberFormat

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

Returns:
the number formatter.

generateToolTip

public java.lang.String generateToolTip(PieDataset data,
                                        java.lang.Comparable key,
                                        int pieIndex)
Generates a tool tip text item for one section in a pie chart.

Specified by:
generateToolTip in interface PieItemLabelGenerator
Parameters:
data - the dataset.
key - the item key.
pieIndex - the pie index (ignored).
Returns:
The tool tip text (possibly null).

clone

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

Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - should not happen.

equals

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

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