Class ColorScaleLegendBuilder

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

public class ColorScaleLegendBuilder extends Object implements LegendBuilder, Serializable
A legend builder that creates a legend representing a ColorScale. This builder will only create a legend if the plot uses a renderer that implements the ColorScaleRenderer interface.

The orientation and anchor point for the legend are properties of the Chart3D class.

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.
Since:
1.1
See Also:
  • Constructor Details

  • Method Details

    • getBarWidth

      public double getBarWidth()
      Returns the width of the bar displaying the color scale.
      Returns:
      The width (in Java2D units).
    • setBarWidth

      public void setBarWidth(double width)
      Sets the width of the bar displaying the color scale.
      Parameters:
      width - the width (in Java2D units).
    • getBarLength

      public double getBarLength()
      Returns the length of the bar displaying the color scale.
      Returns:
      The length (in Java2D units).
    • setBarLength

      public void setBarLength(double length)
      Sets the length of the bar displaying the color scale.
      Parameters:
      length - the length (in Java2D units).
    • getIgnoreFixedColorScale

      public boolean getIgnoreFixedColorScale()
      Returns the flag that controls whether or not a FixedColorScale will be ignored for the purposes of generating a legend.
      Returns:
      A boolean.
    • setIgnoreFixedColorScale

      public void setIgnoreFixedColorScale(boolean ignore)
      Sets the flag that controls whether or not a FixedColorScale will be ignored for the purposes of generating a legend.
      Parameters:
      ignore - the new flag value.
    • createLegend

      public TableElement createLegend(Plot3D plot, Anchor2D anchor, Orientation orientation, ChartStyle style)
      Creates a new color scale legend with the specified orientation. If the plot does not use a renderer that implements ColorScaleRenderer then this method will return null and no legend will be drawn on the chart.
      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:
      A color scale legend (possibly null).
    • equals

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