Package org.jfree.chart
Class ChartRenderingInfo
- java.lang.Object
-
- org.jfree.chart.ChartRenderingInfo
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class ChartRenderingInfo extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
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 anyGraphics2D
. It is assumed that client code will sometimes render the same chart in more than one view, so theJFreeChart
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 toJFreeChart.draw()
, by passing an instance of thisChartRenderingInfo
class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.geom.Rectangle2D
chartArea
The area in which the chart is drawn.private EntityCollection
entities
Storage for the chart entities.private PlotRenderingInfo
plotInfo
Rendering info for the chart's plot (and subplots, if any).private static long
serialVersionUID
For serialization.
-
Constructor Summary
Constructors Constructor Description ChartRenderingInfo()
Constructs 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the information recorded by this object.ChartRenderingInfo
clone()
Returns a clone of this object.boolean
equals(java.lang.Object obj)
Tests this object for equality with an arbitrary object.java.awt.geom.Rectangle2D
getChartArea()
Returns the area in which the chart was drawn.EntityCollection
getEntityCollection()
Returns the collection of entities maintained by this instance.PlotRenderingInfo
getPlotInfo()
Returns the rendering info for the chart's plot.int
hashCode()
private void
readObject(java.io.ObjectInputStream stream)
Provides serialization support.void
setChartArea(java.awt.geom.Rectangle2D area)
Sets the area in which the chart was drawn.void
setEntityCollection(EntityCollection entities)
Sets the entity collection.private void
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
chartArea
private transient java.awt.geom.Rectangle2D chartArea
The area in which the chart is drawn.
-
plotInfo
private PlotRenderingInfo plotInfo
Rendering info for the chart's plot (and subplots, if any).
-
entities
private EntityCollection 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 tonull
to prevent the information being collected.
-
-
Constructor Detail
-
ChartRenderingInfo
public ChartRenderingInfo()
Constructs a new ChartRenderingInfo structure that can be used to collect information about the dimensions of a rendered chart.
-
ChartRenderingInfo
public ChartRenderingInfo(EntityCollection entities)
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 (null
permitted).
-
-
Method Detail
-
getChartArea
public java.awt.geom.Rectangle2D getChartArea()
Returns the area in which the chart was drawn.- Returns:
- The area in which the chart was drawn.
- See Also:
setChartArea(Rectangle2D)
-
setChartArea
public void setChartArea(java.awt.geom.Rectangle2D area)
Sets the area in which the chart was drawn.- Parameters:
area
- the chart area.- See Also:
getChartArea()
-
getEntityCollection
public EntityCollection getEntityCollection()
Returns the collection of entities maintained by this instance.- Returns:
- The entity collection (possibly
null
). - See Also:
setEntityCollection(EntityCollection)
-
setEntityCollection
public void setEntityCollection(EntityCollection entities)
Sets the entity collection.- Parameters:
entities
- the entity collection (null
permitted).- See Also:
getEntityCollection()
-
clear
public void clear()
Clears the information recorded by this object.
-
getPlotInfo
public PlotRenderingInfo getPlotInfo()
Returns the rendering info for the chart's plot.- Returns:
- The rendering info for the plot.
-
equals
public boolean equals(java.lang.Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object to test against (null
permitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
clone
public ChartRenderingInfo clone() throws java.lang.CloneNotSupportedException
Returns a clone of this object.- Overrides:
clone
in classjava.lang.Object
- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException
- if the object cannot be cloned.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException
Provides serialization support.- Parameters:
stream
- the output stream.- Throws:
java.io.IOException
- if there is an I/O error.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
Provides serialization support.- Parameters:
stream
- the input stream.- Throws:
java.io.IOException
- if there is an I/O error.java.lang.ClassNotFoundException
- if there is a classpath problem.
-
-