org.jfree.chart
public class: ChartRenderingInfo [javadoc |
source]
java.lang.Object
org.jfree.chart.ChartRenderingInfo
All Implemented Interfaces:
Cloneable, 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 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.
| Constructor: |
public ChartRenderingInfo() {
this(new StandardEntityCollection());
}
Constructs a new ChartRenderingInfo structure that can be used to
collect information about the dimensions of a rendered chart. |
public ChartRenderingInfo(EntityCollection entities) {
this.chartArea = new Rectangle2D.Double();
this.plotInfo = new PlotRenderingInfo(this);
this.entities = 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 is
null, no entity information (including tool tips) will
be collected. Parameters:
entities - an entity collection (null permitted).
|
| Method from org.jfree.chart.ChartRenderingInfo Detail: |
public void clear() {
this.chartArea.setRect(0.0, 0.0, 0.0, 0.0);
this.plotInfo = new PlotRenderingInfo(this);
if (this.entities != null) {
this.entities.clear();
}
}
Clears the information recorded by this object. |
public Object clone() throws CloneNotSupportedException {
ChartRenderingInfo clone = (ChartRenderingInfo) super.clone();
if (this.chartArea != null) {
clone.chartArea = (Rectangle2D) this.chartArea.clone();
}
if (this.entities instanceof PublicCloneable) {
PublicCloneable pc = (PublicCloneable) this.entities;
clone.entities = (EntityCollection) pc.clone();
}
return clone;
}
Returns a clone of this object. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof ChartRenderingInfo)) {
return false;
}
ChartRenderingInfo that = (ChartRenderingInfo) obj;
if (!ObjectUtilities.equal(this.chartArea, that.chartArea)) {
return false;
}
if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo)) {
return false;
}
if (!ObjectUtilities.equal(this.entities, that.entities)) {
return false;
}
return true;
}
Tests this object for equality with an arbitrary object. |
public Rectangle2D getChartArea() {
return this.chartArea;
}
Returns the area in which the chart was drawn. |
public EntityCollection getEntityCollection() {
return this.entities;
}
Returns the collection of entities maintained by this instance. |
public PlotRenderingInfo getPlotInfo() {
return this.plotInfo;
}
Returns the rendering info for the chart's plot. |
public void setChartArea(Rectangle2D area) {
this.chartArea.setRect(area);
}
Sets the area in which the chart was drawn. |
public void setEntityCollection(EntityCollection entities) {
this.entities = entities;
}
Sets the entity collection. |