java.lang.Object
org.jfree.chart3d.label.StandardXYZItemLabelGenerator
- All Implemented Interfaces:
Serializable
,XYZItemLabelGenerator
public class StandardXYZItemLabelGenerator
extends Object
implements XYZItemLabelGenerator, 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.
XYZItemLabelGenerator
interface.
The implementation uses a Formatter
instance to generate
the item labels. Four values are passed to the formatter for possible
inclusion in the resulting label: (1) the key for the series,
(2) the x-value (3) the y-value and (4) the z-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
A label template that will display the (x, y, z) coordinates with 3 decimal places.static final String
The default label template.static final String
A label template that will display the series key followed by the (x, y, z) coordinates with 3 decimal places. -
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.StandardXYZItemLabelGenerator
(String template) Creates a new instance with the specified label template. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this label generator for equality with an arbitrary object.generateItemLabel
(XYZDataset dataset, Comparable<?> seriesKey, int itemIndex) Generates a label for the specified data item.Returns the item selection (if this is non-null
, labels will only be generated for the items in the selection).int
hashCode()
void
setItemSelection
(XYZDataItemSelection selection) Sets the item selection, which can be used to specify a subset of the data items that should have item labels generated.
-
Field Details
-
KEY_AND_COORDS_3DP_TEMPLATE
A label template that will display the series key followed by the (x, y, z) coordinates with 3 decimal places.- See Also:
-
COORDS_3DP_TEMPLATE
A label template that will display the (x, y, z) coordinates with 3 decimal places.- See Also:
-
DEFAULT_TEMPLATE
The default label template.- See Also:
-
-
Constructor Details
-
StandardXYZItemLabelGenerator
public StandardXYZItemLabelGenerator()The default constructor. -
StandardXYZItemLabelGenerator
Creates a new instance with the specified label template.- Parameters:
template
- the label template (null
not permitted).
-
-
Method Details
-
getItemSelection
Returns the item selection (if this is non-null
, labels will only be generated for the items in the selection).- Returns:
- The item selection (possibly
null
).
-
setItemSelection
Sets the item selection, which can be used to specify a subset of the data items that should have item labels generated. If this is set tonull
then item labels will be generated for all items.- Parameters:
selection
- the selection (null
permitted).
-
generateItemLabel
Generates a label for the specified data item.- Specified by:
generateItemLabel
in interfaceXYZItemLabelGenerator
- Parameters:
dataset
- the dataset (null
not permitted).seriesKey
- the series key (null
not permitted).itemIndex
- the item index.- Returns:
- The series label (possibly
null
).
-
equals
Tests this label generator for equality with an arbitrary object. -
hashCode
-