Class LegendItem

java.lang.Object
org.jfree.chart.LegendItem
All Implemented Interfaces:
Serializable

public class LegendItem
extends Object
implements Serializable
A legend item. Records all the properties of a legend item, but is not concerned about the display location. Instances of this class are immutable.
See Also:
Serialized Form
  • Constructor Details

    • LegendItem

      public LegendItem​(String label, Paint paint)
      Creates a new legend item.
      Parameters:
      label - the label (null not permitted).
      paint - the fill paint (null not permitted).
    • LegendItem

      public LegendItem​(String label, String description, Shape shape, boolean shapeFilled, Paint paint, Stroke stroke, Paint outlinePaint, Stroke outlineStroke)
      Creates a new legend item.
      Parameters:
      label - the label (null not permitted).
      description - the description (not currently used, null permitted).
      shape - the shape (null permitted).
      shapeFilled - a flag that controls whether or not the shape is filled.
      paint - the paint (null not permitted).
      stroke - the stroke (null not permitted).
      outlinePaint - the outline paint (null not permitted).
      outlineStroke - the outline stroke (null not permitted).
    • LegendItem

      public LegendItem​(String label, String description, Shape shape, Paint paint, Paint outlinePaint, Stroke stroke)
      Deprecated.
      Use the other constructor.
      Creates a new legend item.
      Parameters:
      label - the label.
      description - the description (not used).
      shape - the shape.
      paint - the paint.
      outlinePaint - the outline paint.
      stroke - the stroke.
    • LegendItem

      public LegendItem​(String label, String description, Shape shape, boolean shapeFilled, Paint paint, Paint outlinePaint, Stroke stroke)
      Deprecated.
      Use other constructor.
      Creates a new legend item.
      Parameters:
      label - the label.
      description - the description (not used).
      shape - the shape.
      shapeFilled - a flag that controls whether or not the shape is filled.
      paint - the paint.
      outlinePaint - the outline paint.
      stroke - the stroke.
  • Method Details

    • getLabel

      public String getLabel()
      Returns the label.
      Returns:
      The label (never null).
    • getShape

      public Shape getShape()
      Returns the shape used to label the series represented by this legend item.
      Returns:
      The shape (never null).
    • isShapeFilled

      public boolean isShapeFilled()
      Returns a flag that controls whether or not the shape is filled.
      Returns:
      A boolean.
    • getPaint

      public Paint getPaint()
      Returns the paint.
      Returns:
      The paint (never null.
    • getStroke

      public Stroke getStroke()
      Returns the stroke used to render the shape for this series.
      Returns:
      The stroke (never null).
    • getOutlinePaint

      public Paint getOutlinePaint()
      Returns the outline paint.
      Returns:
      The outline paint (never null).
    • getOutlineStroke

      public Stroke getOutlineStroke()
      Returns the outline stroke.
      Returns:
      The outline stroke (never null).
    • equals

      public boolean equals​(Object obj)
      Tests this item for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.