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.boolean
Tests 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.void
setColumnAlignment
(VAlign alignment) Sets the column alignment (to override the default alignment that is derived from the legend anchor point).void
Sets the footer text.void
setFooterAlignment
(HAlign align) Sets the footer alignment.void
Sets the header text.void
setHeaderAlignment
(HAlign align) Sets the header alignment.void
setRowAlignment
(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 (null
permitted).footer
- the legend footer (null
permitted).
-
-
Method Details
-
getHeader
Returns the header text.- Returns:
- The header text (possibly
null
).
-
setHeader
Sets the header text.- Parameters:
header
- the header (null
permitted).
-
getHeaderAlignment
Returns the header alignment.- Returns:
- The header alignment (never
null
).
-
setHeaderAlignment
Sets the header alignment.- Parameters:
align
- the header alignment (null
not permitted).
-
getRowAlignment
Returns the row alignment. The default value isnull
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
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 (null
permitted).- Since:
- 1.1
-
getColumnAlignment
Returns the column alignment. The default value isnull
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
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 (null
permitted).- 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
,CategoryPlot3D
orXYZPlot
.
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 interfaceLegendBuilder
- 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
Tests this legend builder for equality with an arbitrary object.
-