Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.chart.block.AbstractBlock
org.jfree.chart.title.LegendGraphic
Constructor Summary | |
|
Method Summary | |
Size2D |
|
protected Size2D |
|
Object |
|
void |
|
Object |
|
boolean |
|
Paint |
|
GradientPaintTransformer |
|
Shape |
|
Paint |
|
Stroke |
|
Paint |
|
Stroke |
|
Shape |
|
RectangleAnchor |
|
RectangleAnchor |
|
int |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
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 |
public LegendGraphic(Shape shape, Paint fillPaint)
Creates a new legend graphic.
- Parameters:
shape
- the shape (null
not permitted).fillPaint
- the fill paint (null
not permitted).
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and returns the block size.
- Overrides:
- arrange in interface AbstractBlock
- Parameters:
g2
- the graphics device.constraint
- the constraint (null
not permitted).
- Returns:
- The block size (in Java2D units, never
null
).
protected Size2D arrangeNN(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.
- Parameters:
g2
- the graphics device.
- Returns:
- The content size.
public Object clone() throws CloneNotSupportedException
Returns a clone of thisLegendGraphic
instance.
- Overrides:
- clone in interface AbstractBlock
- Returns:
- A clone of this
LegendGraphic
instance.
public void draw(Graphics2D g2, Rectangle2D area)
Draws the graphic item within the specified area.
- Parameters:
g2
- the graphics device.area
- the area.
public Object draw(Graphics2D g2, Rectangle2D area, Object params)
Draws the block within the specified area.
- Parameters:
g2
- the graphics device.area
- the area.params
- ignored (null
permitted).
- Returns:
- Always
null
.
public boolean equals(Object obj)
Tests thisLegendGraphic
instance for equality with an arbitrary object.
- Overrides:
- equals in interface AbstractBlock
- Parameters:
obj
- the object (null
permitted).
- Returns:
- A boolean.
public Paint getFillPaint()
Returns the paint used to fill the shape.
- Returns:
- The fill paint.
public GradientPaintTransformer getFillPaintTransformer()
Returns the transformer used when the fill paint is an instance ofGradientPaint
.
- Returns:
- The transformer (never
null
).
- Since:
- 1.0.4.
public RectangleAnchor getShapeAnchor()
Returns the shape anchor.
- Returns:
- The shape anchor.
public RectangleAnchor getShapeLocation()
Returns the shape location.
- Returns:
- The shape location.
public boolean isLineVisible()
Returns the flag that controls whether or not the line is visible.
- Returns:
- A boolean.
public boolean isShapeFilled()
Returns a flag that controls whether or not the shapes are filled.
- Returns:
- A boolean.
public boolean isShapeOutlineVisible()
Returns a flag that controls whether the shape outline is visible.
- Returns:
- A boolean.
public boolean isShapeVisible()
Returns a flag that controls whether or not the shape is visible.
- Returns:
- A boolean.
public void setFillPaint(Paint paint)
Sets the paint used to fill the shape.
- Parameters:
paint
- the paint.
public void setFillPaintTransformer(GradientPaintTransformer transformer)
Sets the transformer used when the fill paint is an instance ofGradientPaint
.
- Parameters:
transformer
- the transformer (null
not permitted).
- Since:
- 1.0.4
public void setLine(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.
public void setLinePaint(Paint paint)
Sets the line paint.
- Parameters:
paint
- the paint.
public void setLineStroke(Stroke stroke)
Sets the line stroke.
- Parameters:
stroke
- the stroke.
public void setLineVisible(boolean visible)
Sets the flag that controls whether or not the line is visible.
- Parameters:
visible
- the flag.
public void setOutlinePaint(Paint paint)
Sets the outline paint.
- Parameters:
paint
- the paint.
public void setOutlineStroke(Stroke stroke)
Sets the outline stroke.
- Parameters:
stroke
- the stroke.
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).
public void setShapeFilled(boolean filled)
Sets a flag that controls whether or not the shape is filled.
- Parameters:
filled
- the flag.
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).
public void setShapeOutlineVisible(boolean visible)
Sets a flag that controls whether or not the shape outline is visible.
- Parameters:
visible
- the flag.
public void setShapeVisible(boolean visible)
Sets a flag that controls whether or not the shape is visible.
- Parameters:
visible
- the flag.