public class StandardCategoryItemLabelGenerator extends java.lang.Object implements CategoryItemLabelGenerator, java.io.Serializable
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.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_TEMPLATE
The default template string (used in the default constructor, it is
equivalent to
SERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE). |
static java.lang.String |
KEYS_AND_VALUE_TEMPLATE
A template string that will show the series, row and column keys plus
the data value.
|
static java.lang.String |
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).
|
static java.lang.String |
VALUE_TEMPLATE
A template string that will show just the value (to 2 decimal places).
|
| Constructor and Description |
|---|
StandardCategoryItemLabelGenerator()
The default constructor.
|
StandardCategoryItemLabelGenerator(java.lang.String template)
Creates a new instance with the specified template string (which will
be passed to a
java.util.Formatter instance when generating
labels). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Tests this label generator for equality with an arbitrary object.
|
java.lang.String |
generateItemLabel(CategoryDataset3D dataset,
java.lang.Comparable<?> seriesKey,
java.lang.Comparable<?> rowKey,
java.lang.Comparable<?> columnKey)
Generates the item label for one data item in a category chart.
|
KeyedValues3DItemSelection |
getItemSelection()
Returns the item selection.
|
int |
hashCode() |
void |
setItemSelection(StandardKeyedValues3DItemSelection selection)
Sets the item selection (labels will be created by this generator only
for data items that are contained in the collection).
|
public static final java.lang.String VALUE_TEMPLATE
public static final java.lang.String KEYS_AND_VALUE_TEMPLATE
public static final java.lang.String SERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE
public static final java.lang.String DEFAULT_TEMPLATE
SERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE).public StandardCategoryItemLabelGenerator()
public StandardCategoryItemLabelGenerator(java.lang.String template)
java.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.template - the template (null not permitted).public KeyedValues3DItemSelection getItemSelection()
null.public void setItemSelection(StandardKeyedValues3DItemSelection selection)
null then the generator will create labels for
all data items.selection - the selection (null permitted).public java.lang.String generateItemLabel(CategoryDataset3D dataset, java.lang.Comparable<?> seriesKey, java.lang.Comparable<?> rowKey, java.lang.Comparable<?> columnKey)
generateItemLabel in interface CategoryItemLabelGeneratordataset - 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).null for this implementation).public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public int hashCode()
hashCode in class java.lang.Object