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 boolean
A flag that controls whether or not the plot dimensions (in the 3D model) are adjusted automatically.protected Dimension3D
The plot dimensions in 3D space. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(Plot3DChangeListener listener) Registers an object for notification of changes to the plot.void
Receives notification of a dataset change, and passes this event on wrapped in aPlot3DChangeEvent
.boolean
Tests this plot for equality with an arbitrary object.protected void
fireChangeEvent
(boolean requiresWorldUpdate) Sends aPlot3DChangeEvent
to all registered listeners.abstract String
generateToolTipText
(ItemKey itemKey) Returns the tool tip text for the specified data item, ornull
if 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.boolean
Returns the flag that controls whether or not the plot dimensions are auto-adjusted when the dataset changes.boolean
isNotify()
Returns a flag that controls whether or not change events are sent to registered listeners.void
notifyListeners
(Plot3DChangeEvent event) Notifies all registered listeners that the plot has been modified.abstract void
receive
(ChartElementVisitor visitor) Accepts aChartElementVisitor
.void
removeChangeListener
(Plot3DChangeListener listener) Unregisters an object for notification of changes to the plot.void
Sets the chart that the plot is assigned to.void
setNotify
(boolean notify) Sets a flag that controls whether or not listeners receivePlot3DChangeEvent
notifications.Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getDimensions
in 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 (CategoryPlot3D
andXYZPlot
) while others will always auto-adjust the dimensions (PiePlot3D
).- Returns:
- A boolean.
-
generateToolTipText
Returns the tool tip text for the specified data item, ornull
if no tool tip is required.- Specified by:
generateToolTipText
in interfacePlot3D
- Parameters:
itemKey
- the item key (null
not 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:
receive
in 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 receivePlot3DChangeEvent
notifications.- Parameters:
notify
- a boolean.- See Also:
-
addChangeListener
Registers an object for notification of changes to the plot.- Specified by:
addChangeListener
in interfacePlot3D
- Parameters:
listener
- the object to be registered.- See Also:
-
removeChangeListener
Unregisters an object for notification of changes to the plot.- Specified by:
removeChangeListener
in 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 aPlot3DChangeEvent
to 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:
datasetChanged
in interfaceDataset3DChangeListener
- Parameters:
event
- the dataset change event.
-