- java.lang.Object
-
- org.jfree.chart.labels.AbstractXYItemLabelGenerator
-
- org.jfree.chart.labels.StandardXYItemLabelGenerator
-
- All Implemented Interfaces:
Serializable,Cloneable,PublicCloneable,XYItemLabelGenerator
public class StandardXYItemLabelGenerator extends AbstractXYItemLabelGenerator implements XYItemLabelGenerator, Cloneable, PublicCloneable, Serializable
A standard item label generator for plots that use data from anXYDataset.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_ITEM_LABEL_FORMATThe default item label format.
-
Constructor Summary
Constructors Constructor Description StandardXYItemLabelGenerator()Creates an item label generator using default number formatters.StandardXYItemLabelGenerator(String formatString)Creates an item label generator using the specified number formatters.StandardXYItemLabelGenerator(String formatString, DateFormat xFormat, DateFormat yFormat)Creates a label generator using the specified date formatters.StandardXYItemLabelGenerator(String formatString, DateFormat xFormat, NumberFormat yFormat)Creates an item label generator using the specified formatters.StandardXYItemLabelGenerator(String formatString, NumberFormat xFormat, DateFormat yFormat)Creates an item label generator using the specified formatters (a number formatter for the x-values and a date formatter for the y-values).StandardXYItemLabelGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat)Creates an item label generator using the specified number formatters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns an independent copy of the generator.booleanequals(Object obj)Tests this object for equality with an arbitrary object.StringgenerateLabel(XYDataset dataset, int series, int item)Generates the item label text for an item in a dataset.inthashCode()Returns a hash code for this instance.-
Methods inherited from class org.jfree.chart.labels.AbstractXYItemLabelGenerator
createItemArray, generateLabelString, getFormatString, getNullYString, getXDateFormat, getXFormat, getYDateFormat, getYFormat
-
-
-
-
Field Detail
-
DEFAULT_ITEM_LABEL_FORMAT
public static final String DEFAULT_ITEM_LABEL_FORMAT
The default item label format.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StandardXYItemLabelGenerator
public StandardXYItemLabelGenerator()
Creates an item label generator using default number formatters.
-
StandardXYItemLabelGenerator
public StandardXYItemLabelGenerator(String formatString)
Creates an item label generator using the specified number formatters.- Parameters:
formatString- the item label format string (nullnot permitted).
-
StandardXYItemLabelGenerator
public StandardXYItemLabelGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat)
Creates an item label generator using the specified number formatters.- Parameters:
formatString- the item label format string (nullnot permitted).xFormat- the format object for the x values (nullnot permitted).yFormat- the format object for the y values (nullnot permitted).
-
StandardXYItemLabelGenerator
public StandardXYItemLabelGenerator(String formatString, DateFormat xFormat, NumberFormat yFormat)
Creates an item label generator using the specified formatters.- Parameters:
formatString- the item label format string (nullnot permitted).xFormat- the format object for the x values (nullnot permitted).yFormat- the format object for the y values (nullnot permitted).
-
StandardXYItemLabelGenerator
public StandardXYItemLabelGenerator(String formatString, NumberFormat xFormat, DateFormat yFormat)
Creates an item label generator using the specified formatters (a number formatter for the x-values and a date formatter for the y-values).- Parameters:
formatString- the item label format string (nullnot permitted).xFormat- the format object for the x values (nullpermitted).yFormat- the format object for the y values (nullnot permitted).
-
StandardXYItemLabelGenerator
public StandardXYItemLabelGenerator(String formatString, DateFormat xFormat, DateFormat yFormat)
Creates a label generator using the specified date formatters.- Parameters:
formatString- the label format string (nullnot permitted).xFormat- the format object for the x values (nullnot permitted).yFormat- the format object for the y values (nullnot permitted).
-
-
Method Detail
-
generateLabel
public String generateLabel(XYDataset dataset, int series, int item)
Generates the item label text for an item in a dataset.- Specified by:
generateLabelin interfaceXYItemLabelGenerator- Parameters:
dataset- the dataset (nullnot permitted).series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The label text (possibly
null).
-
clone
public Object clone() throws CloneNotSupportedException
Returns an independent copy of the generator.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractXYItemLabelGenerator- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if cloning is not supported.
-
equals
public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classAbstractXYItemLabelGenerator- Parameters:
obj- the other object (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Description copied from class:AbstractXYItemLabelGeneratorReturns a hash code for this instance.- Overrides:
hashCodein classAbstractXYItemLabelGenerator- Returns:
- A hash code.
-
-