Package org.jfree.chart
Class DrawableLegendItem
java.lang.Object
org.jfree.chart.DrawableLegendItem
public class DrawableLegendItem extends Object
Represents a single item within a legend.
-
Constructor Summary
Constructors Constructor Description DrawableLegendItem(LegendItem item)
Create a legend item. -
Method Summary
Modifier and Type Method Description void
draw(Graphics2D g2, double xOffset, double yOffset)
Draw the item.double
getHeight()
Get the height of this item.LegendItem
getItem()
Returns the legend item.Point2D
getLabelPosition()
Returns the label position.Line2D
getLine()
Returns the list.Stroke
getLineStroke()
Returns the stroke used to render the line for this series.Shape
getMarker()
Get the marker.double
getMaxX()
Returns the largest X coordinate of the framing rectangle of this legend item.double
getMaxY()
Returns the largest Y coordinate of the framing rectangle of this legend item.double
getWidth()
Get the width of this item.double
getX()
Get the x-coordinate for the item's location.double
getY()
Get the y-coordinate for the item's location.boolean
isMarkerFilled()
Returns a flag that controls whether or not the marker is filled.void
setBounds(double x, double y, double width, double height)
Set the bounds of this item.void
setLabelPosition(Point2D position)
Sets the label position.void
setLine(Line2D l)
Sets the line used to label this series.void
setLineStroke(Stroke s)
Sets the line stroke used to render the line for this series.void
setMarker(Shape marker)
Set the marker.void
setMarkerFilled(boolean filled)
Sets a flag that controls whether or not the marker is filled.void
setX(double x)
Set the x-coordinate for the item's location.void
setY(double y)
Set the y-coordinate for the item's location.
-
Constructor Details
-
DrawableLegendItem
Create a legend item.- Parameters:
item
- the legend item for display.
-
-
Method Details
-
getItem
Returns the legend item.- Returns:
- the legend item.
-
getX
public double getX()Get the x-coordinate for the item's location.- Returns:
- the x-coordinate for the item's location.
-
setX
public void setX(double x)Set the x-coordinate for the item's location.- Parameters:
x
- the x-coordinate.
-
getY
public double getY()Get the y-coordinate for the item's location.- Returns:
- the y-coordinate for the item's location.
-
setY
public void setY(double y)Set the y-coordinate for the item's location.- Parameters:
y
- the y-coordinate.
-
getWidth
public double getWidth()Get the width of this item.- Returns:
- the width.
-
getHeight
public double getHeight()Get the height of this item.- Returns:
- the height.
-
getMaxX
public double getMaxX()Returns the largest X coordinate of the framing rectangle of this legend item.- Returns:
- the largest x coordinate of the framing rectangle of this legend item.
-
getMaxY
public double getMaxY()Returns the largest Y coordinate of the framing rectangle of this legend item.- Returns:
- the largest Y coordinate of the framing rectangle of this legend item.
-
getMarker
Get the marker.- Returns:
- the shape used to indicate color on the legend for this item.
-
setMarker
Set the marker.- Parameters:
marker
- a shape used to indicate color on the legend for this item.
-
isMarkerFilled
public boolean isMarkerFilled()Returns a flag that controls whether or not the marker is filled.- Returns:
- A boolean.
-
setMarkerFilled
public void setMarkerFilled(boolean filled)Sets a flag that controls whether or not the marker is filled.- Parameters:
filled
- the flag.
-
getLineStroke
Returns the stroke used to render the line for this series.- Returns:
- The stroke.
-
setLineStroke
Sets the line stroke used to render the line for this series.- Parameters:
s
- the new stroke to use.
-
setLine
Sets the line used to label this series.- Parameters:
l
- the new line to use.
-
getLine
Returns the list.- Returns:
- The line.
-
getLabelPosition
Returns the label position.- Returns:
- the label position.
-
setLabelPosition
Sets the label position.- Parameters:
position
- the label position.
-
setBounds
public void setBounds(double x, double y, double width, double height)Set the bounds of this item.- Parameters:
x
- x-coordinate for the item's location.y
- y-coordinate for the item's location.width
- the width of this item.height
- the height of this item.
-
draw
Draw the item. Currently it does nothing.- Parameters:
g2
- the graphics device.xOffset
- offset for the x-coordinate.yOffset
- offset for the y-coordinate.
-