Package org.jfree.chart.labels
Class StandardXYLabelGenerator
java.lang.Object
org.jfree.chart.labels.AbstractXYItemLabelGenerator
org.jfree.chart.labels.StandardXYLabelGenerator
- All Implemented Interfaces:
Serializable,Cloneable,XYLabelGenerator,org.jfree.util.PublicCloneable
public class StandardXYLabelGenerator extends AbstractXYItemLabelGenerator implements XYLabelGenerator, Cloneable, org.jfree.util.PublicCloneable, Serializable
A standard label generator for plots that use data from an
XYDataset.- 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 StandardXYLabelGenerator()Creates an item label generator using default number formatters.StandardXYLabelGenerator(String formatString, DateFormat xFormat, DateFormat yFormat)Creates a label generator using the specified date formatters.StandardXYLabelGenerator(String formatString, DateFormat xFormat, NumberFormat yFormat)Creates an item label generator using the specified number formatters.StandardXYLabelGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat)Creates an item label generator using the specified number formatters. -
Method Summary
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.Methods inherited from class org.jfree.chart.labels.AbstractXYItemLabelGenerator
generateLabelString, getFormatString, getXDateFormat, getXFormat, getYDateFormat, getYFormat
-
Field Details
-
DEFAULT_ITEM_LABEL_FORMAT
The default item label format.- See Also:
- Constant Field Values
-
-
Constructor Details
-
StandardXYLabelGenerator
public StandardXYLabelGenerator()Creates an item label generator using default number formatters. -
StandardXYLabelGenerator
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).
-
StandardXYLabelGenerator
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).
-
StandardXYLabelGenerator
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 Details
-
generateLabel
Generates the item label text for an item in a dataset.- Specified by:
generateLabelin interfaceXYLabelGenerator- 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
Returns an independent copy of the generator.- Specified by:
clonein interfaceorg.jfree.util.PublicCloneable- Overrides:
clonein classAbstractXYItemLabelGenerator- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if cloning is not supported.
-
equals
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classAbstractXYItemLabelGenerator- Parameters:
obj- the other object (nullpermitted).- Returns:
- A boolean.
-