java.lang.Object
org.jfree.chart3d.plot.AbstractPlot3D
- All Implemented Interfaces:
Serializable,EventListener,ChartElement,Dataset3DChangeListener,Plot3D
- Direct Known Subclasses:
CategoryPlot3D,PiePlot3D,XYZPlot
public abstract class AbstractPlot3D
extends Object
implements Plot3D, Dataset3DChangeListener, Serializable
A base class that can be used to create classes that implement
A mechanism is provided for registering change listeners on the plot. Whenever some attribute of the plot changes, all the registered listeners are notified. The
Typically a plot registers itself as a change listener on its dataset and whenever a dataset change notification is received, the plot will pass 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.
Plot3D.
A mechanism is provided for registering change listeners on the plot. Whenever some attribute of the plot changes, all the registered listeners are notified. The
Chart3D instance that owns
the plot will be automatically registered as a listener so that it receives
notification whenever the plot (or some other object managed by the plot)
changes.
Typically a plot registers itself as a change listener on its dataset and whenever a dataset change notification is received, the plot will pass on a
Plot3DChangeEvent to all *its* listeners. If the plot
has axes, then the same approach is used to listen for changes to the axes.
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
FieldsModifier and TypeFieldDescriptionprotected booleanA flag that controls whether or not the plot dimensions (in the 3D model) are adjusted automatically.protected Dimension3DThe plot dimensions in 3D space. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(Plot3DChangeListener listener) Registers an object for notification of changes to the plot.voidReceives notification of a dataset change, and passes this event on wrapped in aPlot3DChangeEvent.booleanTests this plot for equality with an arbitrary object.protected voidfireChangeEvent(boolean requiresWorldUpdate) Sends aPlot3DChangeEventto all registered listeners.abstract StringgenerateToolTipText(ItemKey itemKey) Returns the tool tip text for the specified data item, ornullif no tool tip is required.getChart()Returns the chart that the plot is assigned to, if any.Returns the dimensions of the box in 3D space into which the plot will be composed.booleanReturns the flag that controls whether or not the plot dimensions are auto-adjusted when the dataset changes.booleanisNotify()Returns a flag that controls whether or not change events are sent to registered listeners.voidnotifyListeners(Plot3DChangeEvent event) Notifies all registered listeners that the plot has been modified.abstract voidreceive(ChartElementVisitor visitor) Accepts aChartElementVisitor.voidremoveChangeListener(Plot3DChangeListener listener) Unregisters an object for notification of changes to the plot.voidSets the chart that the plot is assigned to.voidsetNotify(boolean notify) Sets a flag that controls whether or not listeners receivePlot3DChangeEventnotifications.Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.chart3d.plot.Plot3D
compose, getLegendInfo
-
Field Details
-
dimensions
The plot dimensions in 3D space. By default, this is auto-adjusted according to the dataset, but the user can override this. -
autoAdjustDimensions
A flag that controls whether or not the plot dimensions (in the 3D model) are adjusted automatically.
-
-
Constructor Details
-
AbstractPlot3D
protected AbstractPlot3D()Default constructor.
-
-
Method Details
-
getChart
Returns the chart that the plot is assigned to, if any. -
setChart
Sets the chart that the plot is assigned to. -
getDimensions
Returns the dimensions of the box in 3D space into which the plot will be composed. The dimension can change according to the shape of the data.- Specified by:
getDimensionsin interfacePlot3D- Returns:
- The dimensions of the plot (never
null). - See Also:
-
isAutoAdjustDimensions
Returns the flag that controls whether or not the plot dimensions are auto-adjusted when the dataset changes. Certain subclasses will allow this flag to be changed (CategoryPlot3DandXYZPlot) while others will always auto-adjust the dimensions (PiePlot3D).- Returns:
- A boolean.
-
generateToolTipText
Returns the tool tip text for the specified data item, ornullif no tool tip is required.- Specified by:
generateToolTipTextin interfacePlot3D- Parameters:
itemKey- the item key (nullnot permitted).- Returns:
- The tool tip text (possibly
null). - Since:
- 1.3
-
receive
Accepts aChartElementVisitor. This is part of a general purpose mechanism for traversing the chart structure, you won't normally call this method directly.- Specified by:
receivein interfaceChartElement- Parameters:
visitor- the visitor (nevernull).
-
equals
Tests this plot for equality with an arbitrary object. -
isNotify
Returns a flag that controls whether or not change events are sent to registered listeners.- Returns:
- A boolean.
- See Also:
-
setNotify
Sets a flag that controls whether or not listeners receivePlot3DChangeEventnotifications.- Parameters:
notify- a boolean.- See Also:
-
addChangeListener
Registers an object for notification of changes to the plot.- Specified by:
addChangeListenerin interfacePlot3D- Parameters:
listener- the object to be registered.- See Also:
-
removeChangeListener
Unregisters an object for notification of changes to the plot.- Specified by:
removeChangeListenerin interfacePlot3D- Parameters:
listener- the object to be unregistered.- See Also:
-
notifyListeners
Notifies all registered listeners that the plot has been modified.- Parameters:
event- information about the change event.
-
fireChangeEvent
Sends aPlot3DChangeEventto all registered listeners.- Parameters:
requiresWorldUpdate- requires the world to be updated?
-
datasetChanged
Receives notification of a dataset change, and passes this event on wrapped in aPlot3DChangeEvent.- Specified by:
datasetChangedin interfaceDataset3DChangeListener- Parameters:
event- the dataset change event.
-