Module org.jfree.chart3d
Package org.jfree.chart3d.label

# Class StandardXYZItemLabelGenerator

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 `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:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`COORDS_3DP_TEMPLATE`
A label template that will display the (x, y, z) coordinates with 3 decimal places.
`static final String`
`DEFAULT_TEMPLATE`
The default label template.
`static final String`
`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.

## Constructor Summary

Constructors
Constructor
Description
`StandardXYZItemLabelGenerator()`
The default constructor.
`StandardXYZItemLabelGenerator(String template)`
Creates a new instance with the specified label template.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Tests this label generator for equality with an arbitrary object.
`String`
`generateItemLabel(XYZDataset dataset, Comparable<?> seriesKey, int itemIndex)`
Generates a label for the specified data item.
`XYZDataItemSelection`
`getItemSelection()`
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.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### KEY_AND_COORDS_3DP_TEMPLATE

public static final String 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:
  - Constant Field Values

### COORDS_3DP_TEMPLATE

public static final String COORDS_3DP_TEMPLATE
A label template that will display the (x, y, z) coordinates with 3 decimal places.

See Also:
  - Constant Field Values

### DEFAULT_TEMPLATE

public static final String DEFAULT_TEMPLATE
The default label template.

See Also:
  - Constant Field Values

## Constructor Details

### StandardXYZItemLabelGenerator

public StandardXYZItemLabelGenerator()
The default constructor.

### StandardXYZItemLabelGenerator

public StandardXYZItemLabelGenerator(String template)
Creates a new instance with the specified label template.

Parameters:
  `template` - the label template (`null` not permitted).

## Method Details

### getItemSelection

public XYZDataItemSelection 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

public 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. If this is set to `null` then item labels will be generated for all items.

Parameters:
  `selection` - the selection (`null` permitted).

### generateItemLabel

public String generateItemLabel(XYZDataset dataset, Comparable<?> seriesKey, int itemIndex)
Generates a label for the specified data item.

Specified by:
  `generateItemLabel` in interface `XYZItemLabelGenerator`
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

public boolean equals(Object obj)
Tests this label generator for equality with an arbitrary object.

Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - the object (`null` permitted).
Returns:
  A boolean.

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`