org.jfree.chart
Class DrawableLegendItem

java.lang.Object
  |
  +--org.jfree.chart.DrawableLegendItem

public class DrawableLegendItem
extends java.lang.Object

Represents a single item within a legend.

Author:
David Gilbert

Constructor Summary
DrawableLegendItem(LegendItem item)
          Create a legend item.
 
Method Summary
 void draw(java.awt.Graphics2D g2, double xOffset, double yOffset)
          Draw the item.
 double getHeight()
          Get the height of this item.
 LegendItem getItem()
          Returns the legend item.
 java.awt.geom.Point2D getLabelPosition()
          Returns the label position.
 java.awt.Shape getMarker()
          Get the marker.
 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.
 void setBounds(double x, double y, double width, double height)
          Set the bounds of this item.
 void setLabelPosition(java.awt.geom.Point2D position)
          Sets the label position.
 void setMarker(java.awt.Shape marker)
          Set the marker.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawableLegendItem

public DrawableLegendItem(LegendItem item)
Create a legend item.

Parameters:
item - the legend item for display.
Method Detail

getItem

public LegendItem 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.

getMarker

public java.awt.Shape getMarker()
Get the marker.

Returns:
the shape used to indicate color on the legend for this item.

setMarker

public void setMarker(java.awt.Shape marker)
Set the marker.

Parameters:
marker - a shape used to indicate color on the legend for this item.

getLabelPosition

public java.awt.geom.Point2D getLabelPosition()
Returns the label position.

Returns:
the label position.

setLabelPosition

public void setLabelPosition(java.awt.geom.Point2D position)
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

public void draw(java.awt.Graphics2D g2,
                 double xOffset,
                 double yOffset)
Draw the item. Currently it does nothing.

Parameters:
g2 - the graphics device.
xOffset - offset for the x-coordinate.
yOffset - offset for the y-coordinate.