java.lang.Object
org.jfree.chart3d.legend.StandardLegendBuilder
- All Implemented Interfaces:
Serializable,LegendBuilder
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.
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 Summary
ConstructorsConstructorDescriptionCreates a builder for a simple legend with no header and no footer.StandardLegendBuilder(String header, String footer) Creates a builder for a simple legend with the specified header and/or footer. -
Method Summary
Modifier and TypeMethodDescriptioncreateLegend(Plot3D plot, Anchor2D anchor, Orientation orientation, ChartStyle style) Creates and returns a legend (instance ofTableElement) that provides a visual key for the data series in the specified plot.booleanTests this legend builder for equality with an arbitrary object.Returns the column alignment.Returns the footer text.Returns the footer alignment.Returns the header text.Returns the header alignment.Returns the row alignment.voidsetColumnAlignment(VAlign alignment) Sets the column alignment (to override the default alignment that is derived from the legend anchor point).voidSets the footer text.voidsetFooterAlignment(HAlign align) Sets the footer alignment.voidSets the header text.voidsetHeaderAlignment(HAlign align) Sets the header alignment.voidsetRowAlignment(HAlign alignment) Sets the row alignment (to override the default alignment that is derived from the legend anchor point).
-
Constructor Details
-
StandardLegendBuilder
public StandardLegendBuilder()Creates a builder for a simple legend with no header and no footer. -
StandardLegendBuilder
Creates a builder for a simple legend with the specified header and/or footer.- Parameters:
header- the legend header (nullpermitted).footer- the legend footer (nullpermitted).
-
-
Method Details
-
getHeader
Returns the header text.- Returns:
- The header text (possibly
null).
-
setHeader
Sets the header text.- Parameters:
header- the header (nullpermitted).
-
getHeaderAlignment
Returns the header alignment.- Returns:
- The header alignment (never
null).
-
setHeaderAlignment
Sets the header alignment.- Parameters:
align- the header alignment (nullnot permitted).
-
getRowAlignment
Returns the row alignment. The default value isnullwhich 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
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 tonull.- Parameters:
alignment- the row alignment (nullpermitted).- Since:
- 1.1
-
getColumnAlignment
Returns the column alignment. The default value isnullwhich 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
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 tonull.- Parameters:
alignment- the column alignment (nullpermitted).- Since:
- 1.1
-
createLegend
public TableElement createLegend(Plot3D plot, Anchor2D anchor, Orientation orientation, ChartStyle style) Creates and returns a legend (instance ofTableElement) 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,CategoryPlot3DorXYZPlot.
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:
createLegendin interfaceLegendBuilder- Parameters:
plot- the plot (nullnot permitted).anchor- the anchor (nullnot permitted).orientation- the orientation (nullnot permitted).style- the chart style (nullnot permitted).- Returns:
- The legend.
- Since:
- 1.2
-
equals
Tests this legend builder for equality with an arbitrary object.
-