public class LegendGraphic extends AbstractBlock implements Block, org.jfree.util.PublicCloneable
| Modifier and Type | Field and Description |
|---|---|
private java.awt.Paint |
fillPaint
The fill paint for the shape.
|
private org.jfree.ui.GradientPaintTransformer |
fillPaintTransformer
The fill paint transformer (used if the fillPaint is an instance of
GradientPaint).
|
private java.awt.Shape |
line
The line.
|
private java.awt.Paint |
linePaint
The line paint.
|
private java.awt.Stroke |
lineStroke
The line stroke.
|
private boolean |
lineVisible
A flag that controls whether or not the line is visible - see also
shapeVisible.
|
private java.awt.Paint |
outlinePaint
The outline paint for the shape.
|
private java.awt.Stroke |
outlineStroke
The outline stroke for the shape.
|
(package private) static long |
serialVersionUID
For serialization.
|
private java.awt.Shape |
shape
The shape to display.
|
private org.jfree.ui.RectangleAnchor |
shapeAnchor
Defines the point on the shape's bounding rectangle that will be
aligned to the drawing location when the shape is rendered.
|
private boolean |
shapeFilled
A flag that controls whether or not the shape is filled.
|
private org.jfree.ui.RectangleAnchor |
shapeLocation
Defines the location within the block to which the shape will be aligned.
|
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 - see also
lineVisible.
|
| Constructor and Description |
|---|
LegendGraphic(java.awt.Shape shape,
java.awt.Paint fillPaint)
Creates a new legend graphic.
|
| Modifier and Type | Method and Description |
|---|---|
org.jfree.ui.Size2D |
arrange(java.awt.Graphics2D g2,
RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and
returns the block size.
|
protected org.jfree.ui.Size2D |
arrangeNN(java.awt.Graphics2D g2)
Performs the layout with no constraint, so the content size is
determined by the bounds of the shape and/or line drawn to represent
the series.
|
java.lang.Object |
clone()
Returns a clone of this
LegendGraphic instance. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Draws the graphic item within the specified area.
|
java.lang.Object |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area,
java.lang.Object params)
Draws the block within the specified area.
|
boolean |
equals(java.lang.Object obj)
Tests this
LegendGraphic instance for equality with an
arbitrary object. |
java.awt.Paint |
getFillPaint()
Returns the paint used to fill the shape.
|
org.jfree.ui.GradientPaintTransformer |
getFillPaintTransformer()
Returns the transformer used when the fill paint is an instance of
GradientPaint. |
java.awt.Shape |
getLine()
Returns the line centered about (0, 0).
|
java.awt.Paint |
getLinePaint()
Returns the line paint.
|
java.awt.Stroke |
getLineStroke()
Returns the line stroke.
|
java.awt.Paint |
getOutlinePaint()
Returns the outline paint.
|
java.awt.Stroke |
getOutlineStroke()
Returns the outline stroke.
|
java.awt.Shape |
getShape()
Returns the shape.
|
org.jfree.ui.RectangleAnchor |
getShapeAnchor()
Returns the shape anchor.
|
org.jfree.ui.RectangleAnchor |
getShapeLocation()
Returns the shape location.
|
int |
hashCode()
Returns a hash code for this instance.
|
boolean |
isLineVisible()
Returns the flag that controls whether or not the line is visible.
|
boolean |
isShapeFilled()
Returns a flag that controls whether or not the shapes
are filled.
|
boolean |
isShapeOutlineVisible()
Returns a flag that controls whether the shape outline is visible.
|
boolean |
isShapeVisible()
Returns a flag that controls whether or not the shape
is visible.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
void |
setFillPaint(java.awt.Paint paint)
Sets the paint used to fill the shape.
|
void |
setFillPaintTransformer(org.jfree.ui.GradientPaintTransformer transformer)
Sets the transformer used when the fill paint is an instance of
GradientPaint. |
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 is visible.
|
void |
setOutlinePaint(java.awt.Paint paint)
Sets the outline paint.
|
void |
setOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke.
|
void |
setShape(java.awt.Shape shape)
Sets the shape.
|
void |
setShapeAnchor(org.jfree.ui.RectangleAnchor anchor)
Sets the shape anchor.
|
void |
setShapeFilled(boolean filled)
Sets a flag that controls whether or not the shape is
filled.
|
void |
setShapeLocation(org.jfree.ui.RectangleAnchor location)
Sets the shape location.
|
void |
setShapeOutlineVisible(boolean visible)
Sets a flag that controls whether or not the shape outline
is visible.
|
void |
setShapeVisible(boolean visible)
Sets a flag that controls whether or not the shape is
visible.
|
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
arrange, calculateTotalHeight, calculateTotalWidth, drawBorder, 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, trimToContentWidthstatic final long serialVersionUID
private boolean shapeVisible
private transient java.awt.Shape shape
private org.jfree.ui.RectangleAnchor shapeLocation
private org.jfree.ui.RectangleAnchor shapeAnchor
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
public LegendGraphic(java.awt.Shape shape,
java.awt.Paint fillPaint)
shape - the shape (null not permitted).fillPaint - the fill paint (null not permitted).public boolean isShapeVisible()
setShapeVisible(boolean)public void setShapeVisible(boolean visible)
visible - the flag.isShapeVisible()public java.awt.Shape getShape()
setShape(Shape)public void setShape(java.awt.Shape shape)
shape - the shape.getShape()public boolean isShapeFilled()
setShapeFilled(boolean)public void setShapeFilled(boolean filled)
filled - the flag.isShapeFilled()public java.awt.Paint getFillPaint()
setFillPaint(Paint)public void setFillPaint(java.awt.Paint paint)
paint - the paint.getFillPaint()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 isShapeOutlineVisible()
setShapeOutlineVisible(boolean)public void setShapeOutlineVisible(boolean visible)
visible - the flag.isShapeOutlineVisible()public java.awt.Paint getOutlinePaint()
setOutlinePaint(Paint)public void setOutlinePaint(java.awt.Paint paint)
paint - the paint.getOutlinePaint()public java.awt.Stroke getOutlineStroke()
setOutlineStroke(Stroke)public void setOutlineStroke(java.awt.Stroke stroke)
stroke - the stroke.getOutlineStroke()public org.jfree.ui.RectangleAnchor getShapeAnchor()
getShapeAnchor()public void setShapeAnchor(org.jfree.ui.RectangleAnchor anchor)
anchor - the anchor (null not permitted).setShapeAnchor(RectangleAnchor)public org.jfree.ui.RectangleAnchor getShapeLocation()
setShapeLocation(RectangleAnchor)public void setShapeLocation(org.jfree.ui.RectangleAnchor location)
location - the location (null not permitted).getShapeLocation()public boolean isLineVisible()
setLineVisible(boolean)public void setLineVisible(boolean visible)
visible - the flag.isLineVisible()public java.awt.Shape getLine()
setLine(Shape)public void setLine(java.awt.Shape line)
line - the line.getLine()public java.awt.Paint getLinePaint()
setLinePaint(Paint)public void setLinePaint(java.awt.Paint paint)
paint - the paint.getLinePaint()public java.awt.Stroke getLineStroke()
setLineStroke(Stroke)public void setLineStroke(java.awt.Stroke stroke)
stroke - the stroke.getLineStroke()public org.jfree.ui.Size2D arrange(java.awt.Graphics2D g2,
RectangleConstraint constraint)
arrange in interface Blockarrange in class AbstractBlockg2 - the graphics device.constraint - the constraint (null not permitted).null).protected org.jfree.ui.Size2D arrangeNN(java.awt.Graphics2D g2)
g2 - the graphics device.public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
draw in interface org.jfree.ui.Drawableg2 - the graphics device.area - the area.public java.lang.Object draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area,
java.lang.Object params)
public boolean equals(java.lang.Object obj)
LegendGraphic instance for equality with an
arbitrary object.equals in class AbstractBlockobj - the object (null permitted).public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
LegendGraphic instance.clone in interface org.jfree.util.PublicCloneableclone in class AbstractBlockLegendGraphic instance.java.lang.CloneNotSupportedException - if there is a problem cloning.private void writeObject(java.io.ObjectOutputStream stream)
throws java.io.IOException
stream - the output stream.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.java.io.IOException - if there is an I/O error.java.lang.ClassNotFoundException - if there is a classpath problem.