public class LegendItem
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private java.text.AttributedString |
attributedLabel
The attributed label (if null, fall back to the regular label).
|
private Dataset |
dataset
The dataset.
|
private int |
datasetIndex
The dataset index.
|
private java.lang.String |
description
The description (not currently used - could be displayed as a tool tip).
|
private java.awt.Paint |
fillPaint
The paint.
|
private org.jfree.ui.GradientPaintTransformer |
fillPaintTransformer
A gradient paint transformer.
|
private java.lang.String |
label
The label.
|
private java.awt.Font |
labelFont
The label font (
null is permitted). |
private java.awt.Paint |
labelPaint
The label paint (
null is permitted). |
private java.awt.Shape |
line
The line.
|
private java.awt.Paint |
linePaint
The line paint.
|
private java.awt.Stroke |
lineStroke
The stroke.
|
private boolean |
lineVisible
A flag that controls whether or not the line is visible.
|
private java.awt.Paint |
outlinePaint
The outline paint.
|
private java.awt.Stroke |
outlineStroke
The outline stroke.
|
private static long |
serialVersionUID
For serialization.
|
private int |
series
The series index.
|
private java.lang.Comparable |
seriesKey
The series key.
|
private java.awt.Shape |
shape
The shape.
|
private boolean |
shapeFilled
A flag that controls whether or not the shape is filled.
|
private boolean |
shapeOutlineVisible
A flag that controls whether or not the shape outline is visible.
|
private boolean |
shapeVisible
A flag that controls whether or not the shape is visible.
|
private java.lang.String |
toolTipText
The tool tip text.
|
private static java.awt.Shape |
UNUSED_SHAPE
The shape must be non-null for a LegendItem - if no shape is required,
use this.
|
private static java.awt.Stroke |
UNUSED_STROKE
The stroke must be non-null for a LegendItem - if no stroke is required,
use this.
|
private java.lang.String |
urlText
The url text.
|
| Constructor and Description |
|---|
LegendItem(java.text.AttributedString label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
boolean shapeVisible,
java.awt.Shape shape,
boolean shapeFilled,
java.awt.Paint fillPaint,
boolean shapeOutlineVisible,
java.awt.Paint outlinePaint,
java.awt.Stroke outlineStroke,
boolean lineVisible,
java.awt.Shape line,
java.awt.Stroke lineStroke,
java.awt.Paint linePaint)
Creates a new legend item.
|
LegendItem(java.text.AttributedString label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape shape,
java.awt.Paint fillPaint)
Creates a legend item with a filled shape.
|
LegendItem(java.text.AttributedString label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape shape,
java.awt.Paint fillPaint,
java.awt.Stroke outlineStroke,
java.awt.Paint outlinePaint)
Creates a legend item with a filled and outlined shape.
|
LegendItem(java.text.AttributedString label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape line,
java.awt.Stroke lineStroke,
java.awt.Paint linePaint)
Creates a legend item using a line.
|
LegendItem(java.lang.String label)
Creates a legend item with the specified label.
|
LegendItem(java.lang.String label,
java.awt.Paint paint)
Creates a legend item with the specified label and fill paint.
|
LegendItem(java.lang.String label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
boolean shapeVisible,
java.awt.Shape shape,
boolean shapeFilled,
java.awt.Paint fillPaint,
boolean shapeOutlineVisible,
java.awt.Paint outlinePaint,
java.awt.Stroke outlineStroke,
boolean lineVisible,
java.awt.Shape line,
java.awt.Stroke lineStroke,
java.awt.Paint linePaint)
Creates a new legend item.
|
LegendItem(java.lang.String label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape shape,
java.awt.Paint fillPaint)
Creates a legend item with a filled shape.
|
LegendItem(java.lang.String label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape shape,
java.awt.Paint fillPaint,
java.awt.Stroke outlineStroke,
java.awt.Paint outlinePaint)
Creates a legend item with a filled and outlined shape.
|
LegendItem(java.lang.String label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape line,
java.awt.Stroke lineStroke,
java.awt.Paint linePaint)
Creates a legend item using a line.
|
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String |
characterIteratorToString(java.text.CharacterIterator iterator)
Returns a string containing the characters from the given iterator.
|
java.lang.Object |
clone()
Returns an independent copy of this object (except that the clone will
still reference the same dataset as the original
LegendItem). |
boolean |
equals(java.lang.Object obj)
Tests this item for equality with an arbitrary object.
|
java.text.AttributedString |
getAttributedLabel()
Returns the attributed label.
|
Dataset |
getDataset()
Returns the dataset.
|
int |
getDatasetIndex()
Returns the dataset index for this legend item.
|
java.lang.String |
getDescription()
Returns the description for the legend item.
|
java.awt.Paint |
getFillPaint()
Returns the fill paint.
|
org.jfree.ui.GradientPaintTransformer |
getFillPaintTransformer()
Returns the transformer used when the fill paint is an instance of
GradientPaint. |
java.lang.String |
getLabel()
Returns the label.
|
java.awt.Font |
getLabelFont()
Returns the label font.
|
java.awt.Paint |
getLabelPaint()
Returns the paint used to draw the label.
|
java.awt.Shape |
getLine()
Returns the line.
|
java.awt.Paint |
getLinePaint()
Returns the paint used for lines.
|
java.awt.Stroke |
getLineStroke()
Returns the line stroke for the series.
|
java.awt.Paint |
getOutlinePaint()
Returns the outline paint.
|
java.awt.Stroke |
getOutlineStroke()
Returns the outline stroke.
|
int |
getSeriesIndex()
Returns the series index for this legend item.
|
java.lang.Comparable |
getSeriesKey()
Returns the series key.
|
java.awt.Shape |
getShape()
Returns the shape used to label the series represented by this legend
item.
|
java.lang.String |
getToolTipText()
Returns the tool tip text.
|
java.lang.String |
getURLText()
Returns the URL text.
|
boolean |
isLineVisible()
Returns a flag that indicates whether or not the line is visible.
|
boolean |
isShapeFilled()
Returns a flag that controls whether or not the shape is filled.
|
boolean |
isShapeOutlineVisible()
Returns the flag that controls whether or not the shape outline
is visible.
|
boolean |
isShapeVisible()
Returns a flag that indicates whether or not the shape is visible.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
void |
setDataset(Dataset dataset)
Sets the dataset.
|
void |
setDatasetIndex(int index)
Sets the dataset index for this legend item.
|
void |
setDescription(java.lang.String text)
Sets the description for this legend item.
|
void |
setFillPaint(java.awt.Paint paint)
Sets the fill paint.
|
void |
setFillPaintTransformer(org.jfree.ui.GradientPaintTransformer transformer)
Sets the transformer used when the fill paint is an instance of
GradientPaint. |
void |
setLabelFont(java.awt.Font font)
Sets the label font.
|
void |
setLabelPaint(java.awt.Paint paint)
Sets the paint used to draw the label.
|
void |
setLine(java.awt.Shape line)
Sets the line.
|
void |
setLinePaint(java.awt.Paint paint)
Sets the line paint.
|
void |
setLineStroke(java.awt.Stroke stroke)
Sets the line stroke.
|
void |
setLineVisible(boolean visible)
Sets the flag that controls whether or not the line shape is visible for
this legend item.
|
void |
setOutlinePaint(java.awt.Paint paint)
Sets the outline paint.
|
void |
setOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke.
|
void |
setSeriesIndex(int index)
Sets the series index for this legend item.
|
void |
setSeriesKey(java.lang.Comparable key)
Sets the series key.
|
void |
setShape(java.awt.Shape shape)
Sets the shape for the legend item.
|
void |
setShapeVisible(boolean visible)
Sets the flag that controls whether or not the shape is visible.
|
void |
setToolTipText(java.lang.String text)
Sets the tool tip text for this legend item.
|
void |
setURLText(java.lang.String text)
Sets the URL text.
|
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
private static final long serialVersionUID
private Dataset dataset
private java.lang.Comparable seriesKey
private int datasetIndex
private int series
private java.lang.String label
private java.awt.Font labelFont
null is permitted).private transient java.awt.Paint labelPaint
null is permitted).private transient java.text.AttributedString attributedLabel
private java.lang.String description
private java.lang.String toolTipText
private java.lang.String urlText
private boolean shapeVisible
private transient java.awt.Shape shape
private boolean shapeFilled
private transient java.awt.Paint fillPaint
private org.jfree.ui.GradientPaintTransformer fillPaintTransformer
private boolean shapeOutlineVisible
private transient java.awt.Paint outlinePaint
private transient java.awt.Stroke outlineStroke
private boolean lineVisible
private transient java.awt.Shape line
private transient java.awt.Stroke lineStroke
private transient java.awt.Paint linePaint
private static final java.awt.Shape UNUSED_SHAPE
private static final java.awt.Stroke UNUSED_STROKE
public LegendItem(java.lang.String label)
label - the label (null not permitted).public LegendItem(java.lang.String label,
java.awt.Paint paint)
label - the label (null not permitted).paint - the paint (null not permitted).public LegendItem(java.lang.String label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape shape,
java.awt.Paint fillPaint)
label - the label (null not permitted).description - the description (null permitted).toolTipText - the tool tip text (null permitted).urlText - the URL text (null permitted).shape - the shape (null not permitted).fillPaint - the paint used to fill the shape (null
not permitted).public LegendItem(java.lang.String label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape shape,
java.awt.Paint fillPaint,
java.awt.Stroke outlineStroke,
java.awt.Paint outlinePaint)
label - the label (null not permitted).description - the description (null permitted).toolTipText - the tool tip text (null permitted).urlText - the URL text (null permitted).shape - the shape (null not permitted).fillPaint - the paint used to fill the shape (null
not permitted).outlineStroke - the outline stroke (null not
permitted).outlinePaint - the outline paint (null not
permitted).public LegendItem(java.lang.String label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape line,
java.awt.Stroke lineStroke,
java.awt.Paint linePaint)
label - the label (null not permitted).description - the description (null permitted).toolTipText - the tool tip text (null permitted).urlText - the URL text (null permitted).line - the line (null not permitted).lineStroke - the line stroke (null not permitted).linePaint - the line paint (null not permitted).public LegendItem(java.lang.String label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
boolean shapeVisible,
java.awt.Shape shape,
boolean shapeFilled,
java.awt.Paint fillPaint,
boolean shapeOutlineVisible,
java.awt.Paint outlinePaint,
java.awt.Stroke outlineStroke,
boolean lineVisible,
java.awt.Shape line,
java.awt.Stroke lineStroke,
java.awt.Paint linePaint)
label - the label (null not permitted).description - the description (not currently used,
null permitted).toolTipText - the tool tip text (null permitted).urlText - the URL text (null permitted).shapeVisible - a flag that controls whether or not the shape is
displayed.shape - the shape (null permitted).shapeFilled - a flag that controls whether or not the shape is
filled.fillPaint - the fill paint (null not permitted).shapeOutlineVisible - a flag that controls whether or not the
shape is outlined.outlinePaint - the outline paint (null not permitted).outlineStroke - the outline stroke (null not
permitted).lineVisible - a flag that controls whether or not the line is
visible.line - the line.lineStroke - the stroke (null not permitted).linePaint - the line paint (null not permitted).public LegendItem(java.text.AttributedString label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape shape,
java.awt.Paint fillPaint)
label - the label (null not permitted).description - the description (null permitted).toolTipText - the tool tip text (null permitted).urlText - the URL text (null permitted).shape - the shape (null not permitted).fillPaint - the paint used to fill the shape (null
not permitted).public LegendItem(java.text.AttributedString label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape shape,
java.awt.Paint fillPaint,
java.awt.Stroke outlineStroke,
java.awt.Paint outlinePaint)
label - the label (null not permitted).description - the description (null permitted).toolTipText - the tool tip text (null permitted).urlText - the URL text (null permitted).shape - the shape (null not permitted).fillPaint - the paint used to fill the shape (null
not permitted).outlineStroke - the outline stroke (null not
permitted).outlinePaint - the outline paint (null not
permitted).public LegendItem(java.text.AttributedString label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
java.awt.Shape line,
java.awt.Stroke lineStroke,
java.awt.Paint linePaint)
label - the label (null not permitted).description - the description (null permitted).toolTipText - the tool tip text (null permitted).urlText - the URL text (null permitted).line - the line (null not permitted).lineStroke - the line stroke (null not permitted).linePaint - the line paint (null not permitted).public LegendItem(java.text.AttributedString label,
java.lang.String description,
java.lang.String toolTipText,
java.lang.String urlText,
boolean shapeVisible,
java.awt.Shape shape,
boolean shapeFilled,
java.awt.Paint fillPaint,
boolean shapeOutlineVisible,
java.awt.Paint outlinePaint,
java.awt.Stroke outlineStroke,
boolean lineVisible,
java.awt.Shape line,
java.awt.Stroke lineStroke,
java.awt.Paint linePaint)
label - the label (null not permitted).description - the description (not currently used,
null permitted).toolTipText - the tool tip text (null permitted).urlText - the URL text (null permitted).shapeVisible - a flag that controls whether or not the shape is
displayed.shape - the shape (null permitted).shapeFilled - a flag that controls whether or not the shape is
filled.fillPaint - the fill paint (null not permitted).shapeOutlineVisible - a flag that controls whether or not the
shape is outlined.outlinePaint - the outline paint (null not permitted).outlineStroke - the outline stroke (null not
permitted).lineVisible - a flag that controls whether or not the line is
visible.line - the line (null not permitted).lineStroke - the stroke (null not permitted).linePaint - the line paint (null not permitted).private java.lang.String characterIteratorToString(java.text.CharacterIterator iterator)
iterator - the iterator (null not permitted).public Dataset getDataset()
setDatasetIndex(int)public void setDataset(Dataset dataset)
dataset - the dataset.public int getDatasetIndex()
setDatasetIndex(int),
getDataset()public void setDatasetIndex(int index)
index - the index.getDatasetIndex()public java.lang.Comparable getSeriesKey()
setSeriesKey(Comparable)public void setSeriesKey(java.lang.Comparable key)
key - the series key.public int getSeriesIndex()
public void setSeriesIndex(int index)
index - the index.public java.lang.String getLabel()
null).public java.awt.Font getLabelFont()
null).public void setLabelFont(java.awt.Font font)
font - the font (null permitted).public java.awt.Paint getLabelPaint()
null).public void setLabelPaint(java.awt.Paint paint)
paint - the paint (null permitted).public java.text.AttributedString getAttributedLabel()
null).public java.lang.String getDescription()
null).setDescription(java.lang.String)public void setDescription(java.lang.String text)
text - the description (null permitted).getDescription()public java.lang.String getToolTipText()
null).setToolTipText(java.lang.String)public void setToolTipText(java.lang.String text)
text - the text (null permitted).getToolTipText()public java.lang.String getURLText()
null).setURLText(java.lang.String)public void setURLText(java.lang.String text)
text - the text (null permitted).getURLText()public boolean isShapeVisible()
setShapeVisible(boolean)public void setShapeVisible(boolean visible)
visible - the new flag value.isShapeVisible(),
isLineVisible()public java.awt.Shape getShape()
null).setShape(java.awt.Shape)public void setShape(java.awt.Shape shape)
shape - the shape (null not permitted).getShape()public boolean isShapeFilled()
public java.awt.Paint getFillPaint()
null).public void setFillPaint(java.awt.Paint paint)
paint - the paint (null not permitted).public boolean isShapeOutlineVisible()
public java.awt.Stroke getLineStroke()
null).public void setLineStroke(java.awt.Stroke stroke)
stroke - the stroke (null not permitted).public java.awt.Paint getLinePaint()
null).public void setLinePaint(java.awt.Paint paint)
paint - the paint (null not permitted).public java.awt.Paint getOutlinePaint()
null).public void setOutlinePaint(java.awt.Paint paint)
paint - the paint (null not permitted).public java.awt.Stroke getOutlineStroke()
null).setOutlineStroke(java.awt.Stroke)public void setOutlineStroke(java.awt.Stroke stroke)
stroke - the stroke (null not permitted).getOutlineStroke()public boolean isLineVisible()
setLineVisible(boolean)public void setLineVisible(boolean visible)
visible - the new flag value.isLineVisible()public java.awt.Shape getLine()
null).setLine(java.awt.Shape),
isLineVisible()public void setLine(java.awt.Shape line)
line - the line (null not permitted).getLine()public org.jfree.ui.GradientPaintTransformer getFillPaintTransformer()
GradientPaint.null).setFillPaintTransformer(GradientPaintTransformer)public void setFillPaintTransformer(org.jfree.ui.GradientPaintTransformer transformer)
GradientPaint.transformer - the transformer (null not permitted).getFillPaintTransformer()public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
LegendItem).clone in class java.lang.Objectjava.lang.CloneNotSupportedException - if the legend item cannot be cloned.private void writeObject(java.io.ObjectOutputStream stream)
throws java.io.IOException
stream - the output stream (null not permitted).java.io.IOException - if there is an I/O error.private void readObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
stream - the input stream (null not permitted).java.io.IOException - if there is an I/O error.java.lang.ClassNotFoundException - if there is a classpath problem.