Package org.jfree.chart
Class ChartRenderingInfo
java.lang.Object
org.jfree.chart.ChartRenderingInfo
- All Implemented Interfaces:
Serializable,Cloneable
A structure for storing rendering information from one call to the
JFreeChart.draw() method.
An instance of the JFreeChart class can draw itself within an
arbitrary rectangle on any Graphics2D. It is assumed that
client code will sometimes render the same chart in more than one view, so
the JFreeChart instance does not retain any information about its
rendered dimensions. This information can be useful sometimes, so you have
the option to collect the information at each call to
JFreeChart.draw(), by passing an instance of this
ChartRenderingInfo class.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Rectangle2DThe area in which the chart is drawn.private EntityCollectionStorage for the chart entities.private PlotRenderingInfoRendering info for the chart's plot (and subplots, if any).private static final longFor serialization. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new ChartRenderingInfo structure that can be used to collect information about the dimensions of a rendered chart.ChartRenderingInfo(EntityCollection entities) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the information recorded by this object.clone()Returns a clone of this object.booleanTests this object for equality with an arbitrary object.Returns the area in which the chart was drawn.Returns the collection of entities maintained by this instance.Returns the rendering info for the chart's plot.inthashCode()private voidreadObject(ObjectInputStream stream) Provides serialization support.voidsetChartArea(Rectangle2D area) Sets the area in which the chart was drawn.voidsetEntityCollection(EntityCollection entities) Sets the entity collection.private voidwriteObject(ObjectOutputStream stream) Provides serialization support.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization.- See Also:
-
chartArea
The area in which the chart is drawn. -
plotInfo
Rendering info for the chart's plot (and subplots, if any). -
entities
Storage for the chart entities. Since retaining entity information for charts with a large number of data points consumes a lot of memory, it is intended that you can set this tonullto prevent the information being collected.
-
-
Constructor Details
-
ChartRenderingInfo
public ChartRenderingInfo()Constructs a new ChartRenderingInfo structure that can be used to collect information about the dimensions of a rendered chart. -
ChartRenderingInfo
Constructs a new instance. If an entity collection is supplied, it will be populated with information about the entities in a chart. If it isnull, no entity information (including tool tips) will be collected.- Parameters:
entities- an entity collection (nullpermitted).
-
-
Method Details
-
getChartArea
Returns the area in which the chart was drawn.- Returns:
- The area in which the chart was drawn.
- See Also:
-
setChartArea
Sets the area in which the chart was drawn.- Parameters:
area- the chart area.- See Also:
-
getEntityCollection
Returns the collection of entities maintained by this instance.- Returns:
- The entity collection (possibly
null). - See Also:
-
setEntityCollection
Sets the entity collection.- Parameters:
entities- the entity collection (nullpermitted).- See Also:
-
clear
public void clear()Clears the information recorded by this object. -
getPlotInfo
Returns the rendering info for the chart's plot.- Returns:
- The rendering info for the plot.
-
equals
Tests this object for equality with an arbitrary object. -
hashCode
public int hashCode() -
clone
Returns a clone of this object.- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if the object cannot be cloned.
-
writeObject
Provides serialization support.- Parameters:
stream- the output stream.- Throws:
IOException- if there is an I/O error.
-
readObject
Provides serialization support.- Parameters:
stream- the input stream.- Throws:
IOException- if there is an I/O error.ClassNotFoundException- if there is a classpath problem.
-