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 String
The default template string (used in the default constructor, it is equivalent toSERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE
).static final String
A template string that will show the series, row and column keys plus the data value.static final String
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).static final String
A 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.Formatter
instance when generating labels). -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests 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.int
hashCode()
void
Sets 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.Formatter
instance 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 (null
not 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 tonull
then the generator will create labels for all data items.- Parameters:
selection
- the selection (null
permitted).
-
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:
generateItemLabel
in interfaceCategoryItemLabelGenerator
- Parameters:
dataset
- the dataset (null
not permitted).seriesKey
- the series key (null
not permitted).rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).- Returns:
- The label (never
null
for this implementation).
-
equals
Tests this label generator for equality with an arbitrary object. -
hashCode
-