Class StandardLegendBuilder

java.lang.Object
org.jfree.chart3d.legend.StandardLegendBuilder
All Implemented Interfaces:
Serializable, LegendBuilder

public final class StandardLegendBuilder extends Object implements LegendBuilder, Serializable
The standard legend builder, which creates a simple legend with a flow layout and optional header and footer text.

NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
See Also:
  • Constructor Details

    • StandardLegendBuilder

      Creates a builder for a simple legend with no header and no footer.
    • StandardLegendBuilder

      public StandardLegendBuilder(String header, String footer)
      Creates a builder for a simple legend with the specified header and/or footer.
      Parameters:
      header - the legend header (null permitted).
      footer - the legend footer (null permitted).
  • Method Details

    • getHeader

      public String getHeader()
      Returns the header text.
      Returns:
      The header text (possibly null).
    • setHeader

      public void setHeader(String header)
      Sets the header text.
      Parameters:
      header - the header (null permitted).
    • getHeaderAlignment

      Returns the header alignment.
      Returns:
      The header alignment (never null).
    • setHeaderAlignment

      public void setHeaderAlignment(HAlign align)
      Sets the header alignment.
      Parameters:
      align - the header alignment (null not permitted).
    • getFooter

      public String getFooter()
      Returns the footer text.
      Returns:
      The footer text (possibly null).
    • setFooter

      public void setFooter(String footer)
      Sets the footer text.
      Parameters:
      footer - the footer (null permitted).
    • getFooterAlignment

      Returns the footer alignment.
      Returns:
      The footer alignment (never null).
    • setFooterAlignment

      public void setFooterAlignment(HAlign align)
      Sets the footer alignment.
      Parameters:
      align - the footer alignment (null not permitted).
    • getRowAlignment

      Returns the row alignment. The default value is null which means that the row alignment is derived from the anchor point (left aligned for anchors on the left side, center alignment for anchors in the middle, and right aligned for anchors on the right side).
      Returns:
      The row alignment (possibly null).
      Since:
      1.1
    • setRowAlignment

      public void setRowAlignment(HAlign alignment)
      Sets the row alignment (to override the default alignment that is derived from the legend anchor point). In most circumstances you should be able to rely on the default behaviour, so leave this attribute set to null.
      Parameters:
      alignment - the row alignment (null permitted).
      Since:
      1.1
    • getColumnAlignment

      Returns the column alignment. The default value is null which means that the column alignment is derived from the anchor point (top aligned for anchors at the top, center alignment for anchors in the middle, and bottom aligned for anchors at the bottom).
      Returns:
      The column alignment (possibly null).
      Since:
      1.1
    • setColumnAlignment

      public void setColumnAlignment(VAlign alignment)
      Sets the column alignment (to override the default alignment that is derived from the legend anchor point). In most circumstances you should be able to rely on the default behaviour, so leave this attribute set to null.
      Parameters:
      alignment - the column alignment (null permitted).
      Since:
      1.1
    • createLegend

      public TableElement createLegend(Plot3D plot, Anchor2D anchor, Orientation orientation, ChartStyle style)
      Creates and returns a legend (instance of TableElement) that provides a visual key for the data series in the specified plot. The plot can be any of the built-in plot types: PiePlot3D, CategoryPlot3D or XYZPlot.

      Certain subelements will have the following properties set so that downstream code is able to identify which elements relate to particular data series: CLASS : 'LegendItem', SERIES_KEY : the series key.
      Specified by:
      createLegend in interface LegendBuilder
      Parameters:
      plot - the plot (null not permitted).
      anchor - the anchor (null not permitted).
      orientation - the orientation (null not permitted).
      style - the chart style (null not permitted).
      Returns:
      The legend.
      Since:
      1.2
    • equals

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