org.jfree.chart.title
Class LegendGraphic

java.lang.Object
  extended byorg.jfree.chart.block.AbstractBlock
      extended byorg.jfree.chart.title.LegendGraphic
All Implemented Interfaces:
Block, java.io.Serializable

public class LegendGraphic
extends AbstractBlock
implements Block

The graphical item within a legend item.

See Also:
Serialized Form

Constructor Summary
LegendGraphic(java.awt.Shape shape, java.awt.Paint fillPaint)
          Creates a new legend graphic.
 
Method Summary
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
          Draws the graphic item within the specified area.
 java.awt.Paint getFillPaint()
          Returns the paint used to fill the shape.
 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.
 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.
 void setFillPaint(java.awt.Paint paint)
          Sets the paint used to fill the shape.
 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(RectangleAnchor anchor)
          Sets the shape anchor.
 void setShapeFilled(boolean filled)
          Sets a flag that controls whether or not the shape is filled.
 void setShapeLocation(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.
 
Methods inherited from class org.jfree.chart.block.AbstractBlock
arrange, arrange, calculateTotalHeight, calculateTotalWidth, drawBorder, equals, getBorder, getBounds, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBounds, setHeight, setID, setMargin, setPadding, setWidth, toContentConstraint, trimBorder, trimMargin, trimPadding, trimToContentHeight, trimToContentWidth
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.chart.block.Block
arrange, arrange, getBounds, getID, setBounds, setID
 

Constructor Detail

LegendGraphic

public LegendGraphic(java.awt.Shape shape,
                     java.awt.Paint fillPaint)
Creates a new legend graphic.

Parameters:
shape - the shape (null not permitted).
fillPaint - the fill paint (null not permitted).
Method Detail

setShapeAnchor

public void setShapeAnchor(RectangleAnchor anchor)
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 (null not permitted).

setShapeLocation

public void setShapeLocation(RectangleAnchor location)
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 (null not permitted).

isShapeVisible

public boolean isShapeVisible()
Returns a flag that controls whether or not the shape is visible.

Returns:
A boolean.

setShapeVisible

public void setShapeVisible(boolean visible)
Sets a flag that controls whether or not the shape is visible.

Parameters:
visible - the flag.

getShape

public java.awt.Shape getShape()
Returns the shape.

Returns:
The shape.

setShape

public void setShape(java.awt.Shape shape)
Sets the shape.

Parameters:
shape - the shape.

isShapeFilled

public boolean isShapeFilled()
Returns a flag that controls whether or not the shapes are filled.

Returns:
A boolean.

setShapeFilled

public void setShapeFilled(boolean filled)
Sets a flag that controls whether or not the shape is filled.

Parameters:
filled - the flag.

getFillPaint

public java.awt.Paint getFillPaint()
Returns the paint used to fill the shape.

Returns:
The fill paint.

setFillPaint

public void setFillPaint(java.awt.Paint paint)
Sets the paint used to fill the shape.

Parameters:
paint - the paint.

isShapeOutlineVisible

public boolean isShapeOutlineVisible()
Returns a flag that controls whether the shape outline is visible.

Returns:
A boolean.

setShapeOutlineVisible

public void setShapeOutlineVisible(boolean visible)
Sets a flag that controls whether or not the shape outline is visible.

Parameters:
visible - the flag.

getOutlinePaint

public java.awt.Paint getOutlinePaint()
Returns the outline paint.

Returns:
The paint.

setOutlinePaint

public void setOutlinePaint(java.awt.Paint paint)
Sets the outline paint.

Parameters:
paint - the paint.

getOutlineStroke

public java.awt.Stroke getOutlineStroke()
Returns the outline stroke.

Returns:
The stroke.

setOutlineStroke

public void setOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke.

Parameters:
stroke - the stroke.

isLineVisible

public boolean isLineVisible()
Returns the flag that controls whether or not the line is visible.

Returns:
A boolean.

setLineVisible

public void setLineVisible(boolean visible)
Sets the flag that controls whether or not the line is visible.

Parameters:
visible - the flag.

getLine

public java.awt.Shape getLine()
Returns the line centered about (0, 0).

Returns:
The line.

setLine

public void setLine(java.awt.Shape line)
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.

getLinePaint

public java.awt.Paint getLinePaint()
Returns the line paint.

Returns:
The paint.

setLinePaint

public void setLinePaint(java.awt.Paint paint)
Sets the line paint.

Parameters:
paint - the paint.

getLineStroke

public java.awt.Stroke getLineStroke()
Returns the line stroke.

Returns:
The stroke.

setLineStroke

public void setLineStroke(java.awt.Stroke stroke)
Sets the line stroke.

Parameters:
stroke - the stroke.

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Rectangle2D area)
Draws the graphic item within the specified area.

Parameters:
g2 - the graphics device.
area - the area.