org.jfree.chart.entity

Class LegendItemEntity

Implemented Interfaces:
Cloneable, PublicCloneable, Serializable

public class LegendItemEntity
extends ChartEntity
implements Cloneable, Serializable

An entity that represents an item within a legend.

Constructor Summary

LegendItemEntity(Shape area)
Creates a legend item entity.

Method Summary

Object
clone()
Returns a clone of the entity.
boolean
equals(Object obj)
Tests this object for equality with an arbitrary object.
Dataset
getDataset()
Returns a reference to the dataset that this legend item is derived from.
int
getSeriesIndex()
Deprecated. As of 1.0.6, use the getSeriesKey() method.
Comparable
getSeriesKey()
Returns the series key that identifies the legend item.
void
setDataset(Dataset dataset)
Sets a reference to the dataset that this legend item is derived from.
void
setSeriesIndex(int index)
Deprecated. As of 1.0.6, use the setSeriesKey(Comparable) method.
void
setSeriesKey(Comparable key)
Sets the key for the series.
String
toString()
Returns a string representing this object (useful for debugging purposes).

Methods inherited from class org.jfree.chart.entity.ChartEntity

clone, equals, getArea, getImageMapAreaTag, getShapeCoords, getShapeType, getToolTipText, getURLText, hashCode, setArea, setToolTipText, setURLText, toString

Constructor Details

LegendItemEntity

public LegendItemEntity(Shape area)
Creates a legend item entity.
Parameters:
area - the area.

Method Details

clone

public Object clone()
            throws CloneNotSupportedException
Returns a clone of the entity.
Overrides:
clone in interface ChartEntity
Returns:
A clone.

equals

public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.
Overrides:
equals in interface ChartEntity
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

getDataset

public Dataset getDataset()
Returns a reference to the dataset that this legend item is derived from.
Returns:
The dataset.
Since:
1.0.6

getSeriesIndex

public int getSeriesIndex()

Deprecated. As of 1.0.6, use the getSeriesKey() method.

Returns the series index.
Returns:
The series index.

getSeriesKey

public Comparable getSeriesKey()
Returns the series key that identifies the legend item.
Returns:
The series key.
Since:
1.0.6

setDataset

public void setDataset(Dataset dataset)
Sets a reference to the dataset that this legend item is derived from.
Parameters:
dataset - the dataset.
Since:
1.0.6

setSeriesIndex

public void setSeriesIndex(int index)

Deprecated. As of 1.0.6, use the setSeriesKey(Comparable) method.

Sets the series index.
Parameters:
index - the series index.

setSeriesKey

public void setSeriesKey(Comparable key)
Sets the key for the series.
Parameters:
key - the key.
Since:
1.0.6

toString

public String toString()
Returns a string representing this object (useful for debugging purposes).
Overrides:
toString in interface ChartEntity
Returns:
A string (never null).