java.lang.Object
org.jfree.chart3d.label.StandardCategoryItemLabelGenerator
- All Implemented Interfaces:
Serializable,CategoryItemLabelGenerator
public class StandardCategoryItemLabelGenerator
extends Object
implements CategoryItemLabelGenerator, Serializable
A default implementation of the
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
CategoryItemLabelGenerator interface.
The implementation uses a Formatter instance to generate
the labels. Four values are passed to the formatter: (1) the key for
the series, (2) the row key, (3) the column key and (4) the data value.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- Since:
- 1.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default template string (used in the default constructor, it is equivalent toSERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE).static final StringA template string that will show the series, row and column keys plus the data value.static final StringA template that shows the series key, column key and value (the row key is omitted because it is often the same as the series key).static final StringA template string that will show just the value (to 2 decimal places). -
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.StandardCategoryItemLabelGenerator(String template) Creates a new instance with the specified template string (which will be passed to ajava.util.Formatterinstance when generating labels). -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests this label generator for equality with an arbitrary object.generateItemLabel(CategoryDataset3D dataset, Comparable<?> seriesKey, Comparable<?> rowKey, Comparable<?> columnKey) Generates the item label for one data item in a category chart.Returns the item selection.inthashCode()voidSets the item selection (labels will be created by this generator only for data items that are contained in the collection).
-
Field Details
-
VALUE_TEMPLATE
A template string that will show just the value (to 2 decimal places).- Since:
- 1.3
- See Also:
-
KEYS_AND_VALUE_TEMPLATE
A template string that will show the series, row and column keys plus the data value.- Since:
- 1.3
- See Also:
-
SERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE
A template that shows the series key, column key and value (the row key is omitted because it is often the same as the series key).- Since:
- 1.3
- See Also:
-
DEFAULT_TEMPLATE
The default template string (used in the default constructor, it is equivalent toSERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE).- Since:
- 1.3
- See Also:
-
-
Constructor Details
-
StandardCategoryItemLabelGenerator
public StandardCategoryItemLabelGenerator()The default constructor. -
StandardCategoryItemLabelGenerator
Creates a new instance with the specified template string (which will be passed to ajava.util.Formatterinstance when generating labels). See the class description for an explanation of the values that are available for use in the template string.- Parameters:
template- the template (nullnot permitted).
-
-
Method Details
-
getItemSelection
Returns the item selection. The default value isnull.- Returns:
- The item selection.
- Since:
- 1.3
-
setItemSelection
Sets the item selection (labels will be created by this generator only for data items that are contained in the collection). If you set the selection tonullthen the generator will create labels for all data items.- Parameters:
selection- the selection (nullpermitted).
-
generateItemLabel
public String generateItemLabel(CategoryDataset3D dataset, Comparable<?> seriesKey, Comparable<?> rowKey, Comparable<?> columnKey) Generates the item label for one data item in a category chart.- Specified by:
generateItemLabelin interfaceCategoryItemLabelGenerator- Parameters:
dataset- the dataset (nullnot permitted).seriesKey- the series key (nullnot permitted).rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot permitted).- Returns:
- The label (never
nullfor this implementation).
-
equals
Tests this label generator for equality with an arbitrary object. -
hashCode
-