Package org.jfree.chart.labels
Class BubbleXYItemLabelGenerator
- java.lang.Object
-
- org.jfree.chart.labels.AbstractXYItemLabelGenerator
-
- org.jfree.chart.labels.BubbleXYItemLabelGenerator
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,XYItemLabelGenerator
,PublicCloneable
public class BubbleXYItemLabelGenerator extends AbstractXYItemLabelGenerator implements XYItemLabelGenerator, PublicCloneable, java.io.Serializable
An item label generator defined for use with theXYBubbleRenderer
class, or any other class that uses anXYZDataset
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_FORMAT_STRING
The default item label format.(package private) static long
serialVersionUID
For serialization.private java.text.DateFormat
zDateFormat
A date formatter for the z-value - if this is null, then zFormat must be non-null.private java.text.NumberFormat
zFormat
A number formatter for the z value - if this isnull
, then zDateFormat must be non-null.
-
Constructor Summary
Constructors Constructor Description BubbleXYItemLabelGenerator()
Creates a new tool tip generator using default number formatters for the x, y and z-values.BubbleXYItemLabelGenerator(java.lang.String formatString, java.text.DateFormat xFormat, java.text.DateFormat yFormat, java.text.DateFormat zFormat)
Constructs a new item label generator using the specified date formatters.BubbleXYItemLabelGenerator(java.lang.String formatString, java.text.NumberFormat xFormat, java.text.NumberFormat yFormat, java.text.NumberFormat zFormat)
Constructs a new tool tip generator using the specified number formatters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object[]
createItemArray(XYZDataset dataset, int series, int item)
Creates the array of items that can be passed to theMessageFormat
class for creating labels.boolean
equals(java.lang.Object obj)
Tests this object for equality with an arbitrary object.java.lang.String
generateLabel(XYDataset dataset, int series, int item)
Generates an item label for a particular item within a series.java.lang.String
generateLabelString(XYDataset dataset, int series, int item)
Generates a label string for an item in the dataset.java.text.DateFormat
getZDateFormat()
Returns the date formatter for the z-values.java.text.NumberFormat
getZFormat()
Returns the number formatter for the z-values.int
hashCode()
Returns a hash code for this instance.-
Methods inherited from class org.jfree.chart.labels.AbstractXYItemLabelGenerator
clone, createItemArray, getFormatString, getNullYString, getXDateFormat, getXFormat, getYDateFormat, getYFormat
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.chart.util.PublicCloneable
clone
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
DEFAULT_FORMAT_STRING
public static final java.lang.String DEFAULT_FORMAT_STRING
The default item label format.- See Also:
- Constant Field Values
-
zFormat
private java.text.NumberFormat zFormat
A number formatter for the z value - if this isnull
, then zDateFormat must be non-null.
-
zDateFormat
private java.text.DateFormat zDateFormat
A date formatter for the z-value - if this is null, then zFormat must be non-null.
-
-
Constructor Detail
-
BubbleXYItemLabelGenerator
public BubbleXYItemLabelGenerator()
Creates a new tool tip generator using default number formatters for the x, y and z-values.
-
BubbleXYItemLabelGenerator
public BubbleXYItemLabelGenerator(java.lang.String formatString, java.text.NumberFormat xFormat, java.text.NumberFormat yFormat, java.text.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).
-
BubbleXYItemLabelGenerator
public BubbleXYItemLabelGenerator(java.lang.String formatString, java.text.DateFormat xFormat, java.text.DateFormat yFormat, java.text.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).
-
-
Method Detail
-
getZFormat
public java.text.NumberFormat getZFormat()
Returns the number formatter for the z-values.- Returns:
- The number formatter (possibly
null
).
-
getZDateFormat
public java.text.DateFormat getZDateFormat()
Returns the date formatter for the z-values.- Returns:
- The date formatter (possibly
null
).
-
generateLabel
public java.lang.String generateLabel(XYDataset dataset, int series, int item)
Generates an item label for a particular item within a series.- Specified by:
generateLabel
in interfaceXYItemLabelGenerator
- 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 java.lang.String generateLabelString(XYDataset dataset, int series, int item)
Generates a label string for an item in the dataset.- Overrides:
generateLabelString
in classAbstractXYItemLabelGenerator
- Parameters:
dataset
- the dataset (null
not permitted).series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- The label (possibly
null
).
-
createItemArray
protected java.lang.Object[] createItemArray(XYZDataset dataset, int series, int item)
Creates the array of items that can be passed to theMessageFormat
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(java.lang.Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equals
in classAbstractXYItemLabelGenerator
- Parameters:
obj
- the other object (null
permitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for this instance.- Overrides:
hashCode
in classAbstractXYItemLabelGenerator
- Returns:
- A hash code.
-
-