org.jfree.chart.title

Class LegendItemBlockContainer

Implemented Interfaces:
Block, Cloneable, Drawable, PublicCloneable, Serializable

public class LegendItemBlockContainer
extends BlockContainer

A container that holds all the pieces of a single legend item.
Since:
1.0.2

Constructor Summary

LegendItemBlockContainer(Arrangement arrangement, int datasetIndex, int series)
Deprecated. As of 1.0.6, use the other constructor.
LegendItemBlockContainer(Arrangement arrangement, Dataset dataset, Comparable seriesKey)
Creates a new legend item block.

Method Summary

Object
draw(Graphics2D g2, Rectangle2D area, Object params)
Draws the block within the specified area.
Dataset
getDataset()
Returns a reference to the dataset for the associated legend item.
int
getDatasetIndex()
Deprecated. As of 1.0.6, use the getDataset() method.
int
getSeriesIndex()
Returns the series index.
Comparable
getSeriesKey()
Returns the series key.
String
getToolTipText()
Returns the tool tip text.
String
getURLText()
Returns the URL text.
void
setToolTipText(String text)
Sets the tool tip text.
void
setURLText(String text)
Sets the URL text.

Methods inherited from class org.jfree.chart.block.BlockContainer

add, add, arrange, clear, clone, draw, draw, equals, getArrangement, getBlocks, isEmpty, setArrangement

Methods inherited from class org.jfree.chart.block.AbstractBlock

arrange, arrange, calculateTotalHeight, calculateTotalWidth, clone, drawBorder, equals, getBorder, getBounds, getContentXOffset, getContentYOffset, getFrame, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBorder, setBounds, setFrame, setHeight, setID, setMargin, setMargin, setPadding, setPadding, setWidth, toContentConstraint, trimBorder, trimMargin, trimPadding, trimToContentHeight, trimToContentWidth

Constructor Details

LegendItemBlockContainer

public LegendItemBlockContainer(Arrangement arrangement,
                                int datasetIndex,
                                int series)

Deprecated. As of 1.0.6, use the other constructor.

Creates a new legend item block.
Parameters:
arrangement - the arrangement.
datasetIndex - the dataset index.
series - the series index.

LegendItemBlockContainer

public LegendItemBlockContainer(Arrangement arrangement,
                                Dataset dataset,
                                Comparable seriesKey)
Creates a new legend item block.
Parameters:
arrangement - the arrangement.
dataset - the dataset.
seriesKey - the series key.
Since:
1.0.6

Method Details

draw

public Object draw(Graphics2D g2,
                   Rectangle2D area,
                   Object params)
Draws the block within the specified area.
Specified by:
draw in interface Block
Overrides:
draw in interface BlockContainer
Parameters:
g2 - the graphics device.
area - the area.
params - passed on to blocks within the container (null permitted).
Returns:
An instance of EntityBlockResult, or null.

getDataset

public Dataset getDataset()
Returns a reference to the dataset for the associated legend item.
Returns:
A dataset reference.
Since:
1.0.6

getDatasetIndex

public int getDatasetIndex()

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

Returns the dataset index.
Returns:
The dataset index.

getSeriesIndex

public int getSeriesIndex()
Returns the series index.
Returns:
The series index.

getSeriesKey

public Comparable getSeriesKey()
Returns the series key.
Returns:
The series key.
Since:
1.0.6

getToolTipText

public String getToolTipText()
Returns the tool tip text.
Returns:
The tool tip text (possibly null).
Since:
1.0.3

getURLText

public String getURLText()
Returns the URL text.
Returns:
The URL text (possibly null).
Since:
1.0.3

setToolTipText

public void setToolTipText(String text)
Sets the tool tip text.
Parameters:
text - the text (null permitted).
Since:
1.0.3

setURLText

public void setURLText(String text)
Sets the URL text.
Parameters:
text - the text (null permitted).
Since:
1.0.3