Package org.jfree.chart.title
Class LegendGraphic
java.lang.Object
org.jfree.chart.block.AbstractBlock
org.jfree.chart.title.LegendGraphic
- All Implemented Interfaces:
Serializable,Cloneable,Block,Drawable,PublicCloneable
The graphical item within a legend item.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarrange(Graphics2D g2, RectangleConstraint constraint) Arranges the contents of the block, within the given constraints, and returns the block size.protected Size2DarrangeNN(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.booleanEnsures symmetry between super/subclass implementations of equals.clone()Returns a clone of thisLegendGraphicinstance.voiddraw(Graphics2D g2, Rectangle2D area) Draws the graphic item within the specified area.draw(Graphics2D g2, Rectangle2D area, Object params) Draws the block within the specified area.booleanTests thisLegendGraphicinstance for equality with an arbitrary object.Returns the paint used to fill the shape.Returns the transformer used when the fill paint is an instance ofGradientPaint.getLine()Returns the line centered about (0, 0).Returns the line paint.Returns the line stroke.Returns the outline paint.Returns the outline stroke.getShape()Returns the shape.Returns the shape anchor.Returns the shape location.inthashCode()Returns a hash code for this instance.booleanReturns the flag that controls whether or not the line is visible.booleanReturns a flag that controls whether or not the shapes are filled.booleanReturns a flag that controls whether the shape outline is visible.booleanReturns a flag that controls whether or not the shape is visible.voidsetFillPaint(Paint paint) Sets the paint used to fill the shape.voidsetFillPaintTransformer(GradientPaintTransformer transformer) Sets the transformer used when the fill paint is an instance ofGradientPaint.voidSets the line.voidsetLinePaint(Paint paint) Sets the line paint.voidsetLineStroke(Stroke stroke) Sets the line stroke.voidsetLineVisible(boolean visible) Sets the flag that controls whether or not the line is visible.voidsetOutlinePaint(Paint paint) Sets the outline paint.voidsetOutlineStroke(Stroke stroke) Sets the outline stroke.voidSets the shape.voidsetShapeAnchor(RectangleAnchor anchor) Sets the shape anchor.voidsetShapeFilled(boolean filled) Sets a flag that controls whether or not the shape is filled.voidsetShapeLocation(RectangleAnchor location) Sets the shape location.voidsetShapeOutlineVisible(boolean visible) Sets a flag that controls whether or not the shape outline is visible.voidsetShapeVisible(boolean visible) Sets a flag that controls whether or not the shape is visible.Methods inherited from class org.jfree.chart.block.AbstractBlock
arrange, calculateTotalHeight, calculateTotalWidth, drawBorder, getBounds, getContentXOffset, getContentYOffset, getFrame, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBounds, setFrame, setHeight, setID, setMargin, setMargin, setPadding, setPadding, setWidth, toContentConstraint, trimBorder, trimMargin, trimPadding, trimToContentHeight, trimToContentWidth
-
Constructor Details
-
LegendGraphic
Creates a new legend graphic.- Parameters:
shape- the shape (nullnot permitted).fillPaint- the fill paint (nullnot permitted).
-
-
Method Details
-
isShapeVisible
Returns a flag that controls whether or not the shape is visible.- Returns:
- A boolean.
- See Also:
-
setShapeVisible
Sets a flag that controls whether or not the shape is visible.- Parameters:
visible- the flag.- See Also:
-
getShape
Returns the shape.- Returns:
- The shape.
- See Also:
-
setShape
Sets the shape.- Parameters:
shape- the shape.- See Also:
-
isShapeFilled
Returns a flag that controls whether or not the shapes are filled.- Returns:
- A boolean.
- See Also:
-
setShapeFilled
Sets a flag that controls whether or not the shape is filled.- Parameters:
filled- the flag.- See Also:
-
getFillPaint
Returns the paint used to fill the shape.- Returns:
- The fill paint.
- See Also:
-
setFillPaint
Sets the paint used to fill the shape.- Parameters:
paint- the paint.- See Also:
-
getFillPaintTransformer
Returns the transformer used when the fill paint is an instance ofGradientPaint.- Returns:
- The transformer (never
null). - See Also:
-
setFillPaintTransformer
Sets the transformer used when the fill paint is an instance ofGradientPaint.- Parameters:
transformer- the transformer (nullnot permitted).- See Also:
-
isShapeOutlineVisible
Returns a flag that controls whether the shape outline is visible.- Returns:
- A boolean.
- See Also:
-
setShapeOutlineVisible
Sets a flag that controls whether or not the shape outline is visible.- Parameters:
visible- the flag.- See Also:
-
getOutlinePaint
Returns the outline paint.- Returns:
- The paint.
- See Also:
-
setOutlinePaint
Sets the outline paint.- Parameters:
paint- the paint.- See Also:
-
getOutlineStroke
Returns the outline stroke.- Returns:
- The stroke.
- See Also:
-
setOutlineStroke
Sets the outline stroke.- Parameters:
stroke- the stroke.- See Also:
-
getShapeAnchor
Returns the shape anchor.- Returns:
- The shape anchor.
- See Also:
-
setShapeAnchor
Sets the shape anchor. This defines a point on the shapes bounding rectangle that will be used to align the shape to a location.- Parameters:
anchor- the anchor (nullnot permitted).- See Also:
-
getShapeLocation
Returns the shape location.- Returns:
- The shape location.
- See Also:
-
setShapeLocation
Sets the shape location. This defines a point within the drawing area that will be used to align the shape to.- Parameters:
location- the location (nullnot permitted).- See Also:
-
isLineVisible
Returns the flag that controls whether or not the line is visible.- Returns:
- A boolean.
- See Also:
-
setLineVisible
Sets the flag that controls whether or not the line is visible.- Parameters:
visible- the flag.- See Also:
-
getLine
Returns the line centered about (0, 0).- Returns:
- The line.
- See Also:
-
setLine
Sets the line. A Shape is used here, because then you can use Line2D, GeneralPath or any other Shape to represent the line.- Parameters:
line- the line.- See Also:
-
getLinePaint
Returns the line paint.- Returns:
- The paint.
- See Also:
-
setLinePaint
Sets the line paint.- Parameters:
paint- the paint.- See Also:
-
getLineStroke
Returns the line stroke.- Returns:
- The stroke.
- See Also:
-
setLineStroke
Sets the line stroke.- Parameters:
stroke- the stroke.- See Also:
-
arrange
Arranges the contents of the block, within the given constraints, and returns the block size.- Specified by:
arrangein interfaceBlock- Overrides:
arrangein classAbstractBlock- Parameters:
g2- the graphics device.constraint- the constraint (nullnot permitted).- Returns:
- The block size (in Java2D units, never
null).
-
arrangeNN
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.- Parameters:
g2- the graphics device.- Returns:
- The content size.
-
draw
Draws the graphic item within the specified area. -
draw
Draws the block within the specified area. -
equals
Tests thisLegendGraphicinstance for equality with an arbitrary object.- Overrides:
equalsin classAbstractBlock- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
canEqual
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Overrides:
canEqualin classAbstractBlock- Parameters:
other- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
Returns a hash code for this instance.- Overrides:
hashCodein classAbstractBlock- Returns:
- A hash code.
-
clone
Returns a clone of thisLegendGraphicinstance.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractBlock- Returns:
- A clone of this
LegendGraphicinstance. - Throws:
CloneNotSupportedException- if there is a problem cloning.
-