java.lang.Object
org.jfree.chart3d.plot.AbstractPlot3D
org.jfree.chart3d.plot.CategoryPlot3D
- All Implemented Interfaces:
Serializable,EventListener,Axis3DChangeListener,ChartElement,Dataset3DChangeListener,Plot3D,Renderer3DChangeListener
public class CategoryPlot3D
extends AbstractPlot3D
implements Axis3DChangeListener, Renderer3DChangeListener, Serializable
A 3D plot with two category axes (x and z) and a numerical y-axis that can
display data from a
The plot implements several listener interfaces so that it can receive notification of changes to its dataset, axes and renderer. When change events are received, the plot passes on a
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.
CategoryDataset3D.
The plot implements several listener interfaces so that it can receive notification of changes to its dataset, axes and renderer. When change events are received, the plot passes on a
Plot3DChangeEvent to the
Chart3D instance that owns the plot. This event chain is the
mechanism that ensures that charts are repainted whenever the dataset
changes, or when changes are made to the configuration of any chart
component.
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:
-
Field Summary
Fields inherited from class org.jfree.chart3d.plot.AbstractPlot3D
autoAdjustDimensions, dimensions -
Constructor Summary
ConstructorsConstructorDescriptionCategoryPlot3D(CategoryDataset3D dataset, CategoryRenderer3D renderer, CategoryAxis3D rowAxis, CategoryAxis3D columnAxis, ValueAxis3D valueAxis) Creates a new plot with the supplied dataset, renderer and axes. -
Method Summary
Modifier and TypeMethodDescriptionvoidaxisChanged(Axis3DChangeEvent event) Receives notification that one of the axes has been changed.voidAdds 3D objects representing the current data for the plot to the specified world.voidReceives notification of a change to the dataset and handles this by adjusting the plot dimensions (according to the setting of theautoAdjustDimensionsflag), reconfiguring the axes, and propagating aPlot3DChangeEvent.booleanTests this plot for equality with an arbitrary object.generateToolTipText(ItemKey itemKey) Returns the tool tip text for the specified data item, ornullif no tool tip is required.Returns the column axis.Returns the dataset for the chart.Returns the paint used to draw the grid lines for the column axis, if they are visible.Returns the paint used to draw the gridlines for the row axis, if they are visible.Returns the paint for the gridlines associated with the value axis.Returns the stroke for the gridlines associated with the column axis.Returns the stroke for the gridlines associated with the row axis.Returns the stroke for the gridlines associated with the value axis.booleanReturnstrueif gridlines are shown for the column axis andfalseotherwise.booleanReturnstrueif gridlines are shown for the column axis andfalseotherwise.booleanReturnstrueif gridlines are shown for the column axis andfalseotherwise.Returns a list containing legend item info, typically one item for each series in the chart.Returns the legend label generator, an object that converts key values in the dataset into corresponding strings for presentation in the chart.Returns the renderer (very often you will need to cast this to a specific class to make customisations).Returns the row axis.Returns the tool tip generator.Returns the value axis (the vertical axis in the plot).Returns the y-dimension override.voidreceive(ChartElementVisitor visitor) Accepts a visitor for the plot.voidReceives notification that the renderer has been modified in some way.voidsetAutoAdjustDimensions(boolean auto) Sets the flag that controls whether the plot's dimensions are automatically calculated and, iftrue, sends a change event to all registered listeners.voidsetColumnAxis(CategoryAxis3D axis) Sets the column axis and sends aPlot3DChangeEventto all registered listeners.voidsetDataset(CategoryDataset3D dataset) Sets the dataset and sends aPlot3DChangeEventto all registered listeners.voidsetDimensions(Dimension3D dimensions) Sets the dimensions (in 3D space) for the plot, resets theautoAdjustDimensionsflag tofalse, and sends aPlot3DChangeEventto all registered listeners.voidsetGridlinePaintForColumns(Paint paint) Sets the paint used to draw the grid lines for the column axis, if they are visible, and sends aPlot3DChangeEventto all registered listeners.voidsetGridlinePaintForRows(Paint paint) Sets the paint used for the row axis gridlines and sends aPlot3DChangeEventto all registered listeners.voidsetGridlinePaintForValues(Paint paint) Sets the paint used for the value axis gridlines and sends aPlot3DChangeEventto all registered listeners.voidsetGridlineStrokeForColumns(Stroke stroke) Sets the stroke used to draw the grid lines for the column axis, if they are visible, and sends aPlot3DChangeEventto all registered listeners.voidsetGridlineStrokeForRows(Stroke stroke) Sets the stroke used to draw the gridlines for the row axis, if they are visible, and sends aPlot3DChangeEventto all registered listeners.voidsetGridlineStrokeForValues(Stroke stroke) Sets the stroke used to draw the grid lines for the value axis, if they are visible, and sends aPlot3DChangeEventto all registered listeners.voidsetGridlinesVisibleForColumns(boolean visible) Sets the flag that controls whether or not gridlines are shown for the column axis and sends aPlot3DChangeEventto all registered listeners.voidsetGridlinesVisibleForRows(boolean visible) Sets the flag that controls whether or not gridlines are shown for the row axis and sends aPlot3DChangeEventto all registered listeners.voidsetGridlinesVisibleForValues(boolean visible) Sets the flag that controls whether or not gridlines are shown for the value axis and sends aPlot3DChangeEventto all registered listeners.voidsetLegendLabelGenerator(CategoryLabelGenerator generator) Sets the legend label generator and sends aPlot3DChangeEventto all registered listeners.voidsetRenderer(CategoryRenderer3D renderer) Sets the renderer and sends a change event to all registered listeners.voidsetRowAxis(CategoryAxis3D axis) Sets the row axis and sends aPlot3DChangeEventto all registered listeners.voidsetToolTipGenerator(CategoryItemLabelGenerator generator) Sets the tool tip generator and sends aPlot3DChangeEventto all registered listeners.voidsetValueAxis(ValueAxis3D axis) Sets the value axis and sends aPlot3DChangeEventto all registered listeners.voidSets the y-dimension override and, if theautoAdjustDimensionsflag is set, recalculates the dimensions and sends aPlot3DChangeEventto all registered listeners.Methods inherited from class org.jfree.chart3d.plot.AbstractPlot3D
addChangeListener, fireChangeEvent, getChart, getDimensions, isAutoAdjustDimensions, isNotify, notifyListeners, removeChangeListener, setChart, setNotify
-
Constructor Details
-
CategoryPlot3D
public CategoryPlot3D(CategoryDataset3D dataset, CategoryRenderer3D renderer, CategoryAxis3D rowAxis, CategoryAxis3D columnAxis, ValueAxis3D valueAxis) Creates a new plot with the supplied dataset, renderer and axes.- Parameters:
dataset- the dataset (nullnot permitted).renderer- the renderer (nullnot permitted).rowAxis- the row axis (nullnot permitted).columnAxis- the column axis (nullnot permitted).valueAxis- the value axis (nullnot permitted).
-
-
Method Details
-
setAutoAdjustDimensions
Sets the flag that controls whether the plot's dimensions are automatically calculated and, iftrue, sends a change event to all registered listeners.- Parameters:
auto- the new flag value.- Since:
- 1.2
-
setDimensions
Sets the dimensions (in 3D space) for the plot, resets theautoAdjustDimensionsflag tofalse, and sends aPlot3DChangeEventto all registered listeners.- Parameters:
dimensions- the dimensions (nullnot permitted).- See Also:
-
getDataset
Returns the dataset for the chart.- Returns:
- The dataset (never
null).
-
setDataset
Sets the dataset and sends aPlot3DChangeEventto all registered listeners. When you call this method, the axes will be reconfigured for the new data.- Parameters:
dataset- the dataset (nullnot permitted).
-
getRenderer
Returns the renderer (very often you will need to cast this to a specific class to make customisations).- Returns:
- The renderer (never
null).
-
setRenderer
Sets the renderer and sends a change event to all registered listeners.- Parameters:
renderer- the renderer (nullnot permitted).
-
getRowAxis
Returns the row axis.- Returns:
- The row axis.
-
setRowAxis
Sets the row axis and sends aPlot3DChangeEventto all registered listeners. The row axis is equivalent to the z-axis.- Parameters:
axis- the row axis (nullnot permitted).
-
getColumnAxis
Returns the column axis.- Returns:
- The column axis (never
null).
-
setColumnAxis
Sets the column axis and sends aPlot3DChangeEventto all registered listeners.- Parameters:
axis- the new axis (nullnot permitted).- See Also:
-
getValueAxis
Returns the value axis (the vertical axis in the plot).- Returns:
- The value axis (never
null).
-
setValueAxis
Sets the value axis and sends aPlot3DChangeEventto all registered listeners.- Parameters:
axis- the axis (nullnot permitted).
-
getGridlinesVisibleForRows
Returnstrueif gridlines are shown for the column axis andfalseotherwise. The default value isfalse.- Returns:
- A boolean.
-
setGridlinesVisibleForRows
Sets the flag that controls whether or not gridlines are shown for the row axis and sends aPlot3DChangeEventto all registered listeners.- Parameters:
visible- the new flag value.
-
getGridlinePaintForRows
Returns the paint used to draw the gridlines for the row axis, if they are visible.- Returns:
- The paint (never
null).
-
setGridlinePaintForRows
Sets the paint used for the row axis gridlines and sends aPlot3DChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).
-
getGridlineStrokeForRows
Returns the stroke for the gridlines associated with the row axis. The default value isBasicStroke(0.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f, new float[] { 3f, 3f }, 0f).- Returns:
- The stroke (never
null).
-
setGridlineStrokeForRows
Sets the stroke used to draw the gridlines for the row axis, if they are visible, and sends aPlot3DChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).
-
getGridlinesVisibleForColumns
Returnstrueif gridlines are shown for the column axis andfalseotherwise. The default value isfalse.- Returns:
- A boolean.
-
setGridlinesVisibleForColumns
Sets the flag that controls whether or not gridlines are shown for the column axis and sends aPlot3DChangeEventto all registered listeners.- Parameters:
visible- the new flag value.
-
getGridlinesVisibleForValues
Returnstrueif gridlines are shown for the column axis andfalseotherwise. The default value istrue.- Returns:
- A boolean.
-
setGridlinesVisibleForValues
Sets the flag that controls whether or not gridlines are shown for the value axis and sends aPlot3DChangeEventto all registered listeners.- Parameters:
visible- the new flag value.
-
getGridlinePaintForValues
Returns the paint for the gridlines associated with the value axis. The default value isColor.WHITE.- Returns:
- The paint for value axis gridlines (never
null).
-
setGridlinePaintForValues
Sets the paint used for the value axis gridlines and sends aPlot3DChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).
-
getGridlineStrokeForValues
Returns the stroke for the gridlines associated with the value axis. The default value isBasicStroke(0.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f, new float[] { 3f, 3f }, 0f).- Returns:
- The stroke (never
null).
-
setGridlineStrokeForValues
Sets the stroke used to draw the grid lines for the value axis, if they are visible, and sends aPlot3DChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).
-
getGridlinePaintForColumns
Returns the paint used to draw the grid lines for the column axis, if they are visible. The default value isColor.WHITE.- Returns:
- The paint (never
null).
-
setGridlinePaintForColumns
Sets the paint used to draw the grid lines for the column axis, if they are visible, and sends aPlot3DChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).
-
getGridlineStrokeForColumns
Returns the stroke for the gridlines associated with the column axis. The default value isBasicStroke(0.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f, new float[] { 3f, 3f }, 0f).- Returns:
- The stroke (never
null).
-
setGridlineStrokeForColumns
Sets the stroke used to draw the grid lines for the column axis, if they are visible, and sends aPlot3DChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).
-
getLegendLabelGenerator
Returns the legend label generator, an object that converts key values in the dataset into corresponding strings for presentation in the chart.- Returns:
- The legend label generator (never
null). - Since:
- 1.2
-
setLegendLabelGenerator
Sets the legend label generator and sends aPlot3DChangeEventto all registered listeners.- Parameters:
generator- the generator (nullnot permitted).- Since:
- 1.2
-
getYDimensionOverride
Returns the y-dimension override. The default value isnull, which means that when the plot dimensions are automatically calculated, the height of the plot will be set to the greater of the width and the depth.- Returns:
- The y-dimension override (possibly
null). - Since:
- 1.2
-
setYDimensionOverride
Sets the y-dimension override and, if theautoAdjustDimensionsflag is set, recalculates the dimensions and sends aPlot3DChangeEventto all registered listeners.- Parameters:
dim- the new y-dimension override (nullpermitted).- Since:
- 1.2
-
getToolTipGenerator
Returns the tool tip generator. This is an object that calculates and returns a string (that will be used as the tool tip) for any given data value in the dataset.- Returns:
- The tool tip generator (possibly
null). - Since:
- 1.3
-
setToolTipGenerator
Sets the tool tip generator and sends aPlot3DChangeEventto all registered listeners.- Parameters:
generator- the new generator (nullpermitted).- Since:
- 1.3
-
getLegendInfo
Returns a list containing legend item info, typically one item for each series in the chart. This is intended for use in the construction of a chart legend.- Specified by:
getLegendInfoin interfacePlot3D- Returns:
- A list containing legend item info (possibly empty but never
null).
-
compose
Description copied from interface:Plot3DAdds 3D objects representing the current data for the plot to the specified world. After the world has been populated (or constructed) in this way, it is ready for rendering. -
generateToolTipText
Description copied from class:AbstractPlot3DReturns the tool tip text for the specified data item, ornullif no tool tip is required.- Specified by:
generateToolTipTextin interfacePlot3D- Specified by:
generateToolTipTextin classAbstractPlot3D- Parameters:
itemKey- the item key (nullnot permitted).- Returns:
- The tool tip text (possibly
null).
-
receive
Accepts a visitor for the plot. This method first calls thereceive()method for each of the plot's axes and the renderer, then performs the visitor's function on the plot. This is a general purpose mechanism, but the main use is to apply chart style changes across all the elements of a chart.- Specified by:
receivein interfaceChartElement- Specified by:
receivein classAbstractPlot3D- Parameters:
visitor- the visitor (nullnot permitted).- Since:
- 1.2
-
equals
Tests this plot for equality with an arbitrary object.- Overrides:
equalsin classAbstractPlot3D- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
datasetChanged
Receives notification of a change to the dataset and handles this by adjusting the plot dimensions (according to the setting of theautoAdjustDimensionsflag), reconfiguring the axes, and propagating aPlot3DChangeEvent.- Specified by:
datasetChangedin interfaceDataset3DChangeListener- Overrides:
datasetChangedin classAbstractPlot3D- Parameters:
event- the change event.
-
axisChanged
Receives notification that one of the axes has been changed. This will trigger aPlot3DChangeEventthat will usually cause the chart to be repainted.- Specified by:
axisChangedin interfaceAxis3DChangeListener- Parameters:
event- the change event.
-
rendererChanged
Receives notification that the renderer has been modified in some way. This will trigger aPlot3DChangeEventthat will usually cause the chart to be repainted.- Specified by:
rendererChangedin interfaceRenderer3DChangeListener- Parameters:
event- information about the event.
-