org.jfree.chart.labels

Class BubbleXYItemLabelGenerator

Implemented Interfaces:
Cloneable, Serializable, XYItemLabelGenerator

public class BubbleXYItemLabelGenerator
extends AbstractXYItemLabelGenerator
implements XYItemLabelGenerator, Serializable

An item label generator defined for use with the XYBubbleRenderer class, or any other class that uses an XYZDataset.
Since:
1.0.1

Field Summary

static String
DEFAULT_FORMAT_STRING
The default item label format.

Constructor Summary

BubbleXYItemLabelGenerator()
Creates a new tool tip generator using default number formatters for the x, y and z-values.
BubbleXYItemLabelGenerator(String formatString, DateFormat xFormat, DateFormat yFormat, DateFormat zFormat)
Constructs a new item label generator using the specified date formatters.
BubbleXYItemLabelGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat, NumberFormat zFormat)
Constructs a new tool tip generator using the specified number formatters.

Method Summary

protected Object[]
createItemArray(XYZDataset dataset, int series, int item)
Creates the array of items that can be passed to the MessageFormat class for creating labels.
boolean
equals(Object obj)
Tests this object for equality with an arbitrary object.
String
generateLabel(XYDataset dataset, int series, int item)
Generates an item label for a particular item within a series.
String
generateLabelString(XYDataset dataset, int series, int item)
Generates a label string for an item in the dataset.
DateFormat
getZDateFormat()
Returns the date formatter for the z-values.
NumberFormat
getZFormat()
Returns the number formatter for the z-values.

Methods inherited from class org.jfree.chart.labels.AbstractXYItemLabelGenerator

clone, createItemArray, equals, generateLabelString, getFormatString, getXDateFormat, getXFormat, getYDateFormat, getYFormat

Field Details

DEFAULT_FORMAT_STRING

public static final String DEFAULT_FORMAT_STRING
The default item label format.

Constructor Details

BubbleXYItemLabelGenerator

public BubbleXYItemLabelGenerator()
Creates a new tool tip generator using default number formatters for the x, y and z-values.

BubbleXYItemLabelGenerator

public BubbleXYItemLabelGenerator(String formatString,
                                  DateFormat xFormat,
                                  DateFormat yFormat,
                                  DateFormat zFormat)
Constructs a new item label generator using the specified date formatters.
Parameters:
formatString - the format string.
xFormat - the format object for the x values (null not permitted).
yFormat - the format object for the y values (null not permitted).
zFormat - the format object for the z values (null not permitted).

BubbleXYItemLabelGenerator

public BubbleXYItemLabelGenerator(String formatString,
                                  NumberFormat xFormat,
                                  NumberFormat yFormat,
                                  NumberFormat zFormat)
Constructs a new tool tip generator using the specified number formatters.
Parameters:
formatString - the format string.
xFormat - the format object for the x values (null not permitted).
yFormat - the format object for the y values (null not permitted).
zFormat - the format object for the z values (null not permitted).

Method Details

createItemArray

protected Object[] createItemArray(XYZDataset dataset,
                                   int series,
                                   int item)
Creates the array of items that can be passed to the MessageFormat class for creating labels.
Parameters:
dataset - the dataset (null not permitted).
series - the series (zero-based index).
item - the item (zero-based index).
Returns:
The items (never null).

equals

public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.
Overrides:
equals in interface AbstractXYItemLabelGenerator
Parameters:
obj - the other object (null permitted).
Returns:
A boolean.

generateLabel

public String generateLabel(XYDataset dataset,
                            int series,
                            int item)
Generates an item label for a particular item within a series.
Specified by:
generateLabel in interface XYItemLabelGenerator
Parameters:
dataset - the dataset (null not permitted).
series - the series index (zero-based).
item - the item index (zero-based).
Returns:
The item label (possibly null).

generateLabelString

public String generateLabelString(XYDataset dataset,
                                  int series,
                                  int item)
Generates a label string for an item in the dataset.
Overrides:
generateLabelString in interface AbstractXYItemLabelGenerator
Parameters:
dataset - the dataset (null not permitted).
series - the series (zero-based index).
item - the item (zero-based index).
Returns:
The label (possibly null).

getZDateFormat

public DateFormat getZDateFormat()
Returns the date formatter for the z-values.
Returns:
The date formatter (possibly null).

getZFormat

public NumberFormat getZFormat()
Returns the number formatter for the z-values.
Returns:
The number formatter (possibly null).