Package org.jfree.chart.plot
Class PlotRenderingInfo
- java.lang.Object
-
- org.jfree.chart.plot.PlotRenderingInfo
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class PlotRenderingInfo extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableStores information about the dimensions of a plot and its subplots.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.geom.Rectangle2DdataAreaThe data area.private ChartRenderingInfoownerThe owner of this info.private java.awt.geom.Rectangle2DplotAreaThe plot area.private static longserialVersionUIDFor serialization.private java.util.ListsubplotInfoStorage for the plot rendering info objects belonging to the subplots.
-
Constructor Summary
Constructors Constructor Description PlotRenderingInfo(ChartRenderingInfo owner)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSubplotInfo(PlotRenderingInfo info)Adds the info for a subplot.java.lang.Objectclone()Returns a clone of this object.booleanequals(java.lang.Object obj)Tests this instance for equality against an arbitrary object.java.awt.geom.Rectangle2DgetDataArea()Returns the plot's data area (in Java2D space).ChartRenderingInfogetOwner()Returns the owner (as specified in the constructor).java.awt.geom.Rectangle2DgetPlotArea()Returns the plot area (in Java2D space).intgetSubplotCount()Returns the number of subplots (possibly zero).intgetSubplotIndex(java.awt.geom.Point2D source)Returns the index of the subplot that contains the specified (x, y) point (the "source" point).PlotRenderingInfogetSubplotInfo(int index)Returns the info for a subplot.inthashCode()private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.voidsetDataArea(java.awt.geom.Rectangle2D area)Sets the data area.voidsetPlotArea(java.awt.geom.Rectangle2D area)Sets the plot area.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
owner
private ChartRenderingInfo owner
The owner of this info.
-
plotArea
private transient java.awt.geom.Rectangle2D plotArea
The plot area.
-
dataArea
private transient java.awt.geom.Rectangle2D dataArea
The data area.
-
subplotInfo
private java.util.List subplotInfo
Storage for the plot rendering info objects belonging to the subplots.
-
-
Constructor Detail
-
PlotRenderingInfo
public PlotRenderingInfo(ChartRenderingInfo owner)
Creates a new instance.- Parameters:
owner- the owner (nullpermitted).
-
-
Method Detail
-
getOwner
public ChartRenderingInfo getOwner()
Returns the owner (as specified in the constructor).- Returns:
- The owner (possibly
null).
-
getPlotArea
public java.awt.geom.Rectangle2D getPlotArea()
Returns the plot area (in Java2D space).- Returns:
- The plot area (possibly
null). - See Also:
setPlotArea(Rectangle2D)
-
setPlotArea
public void setPlotArea(java.awt.geom.Rectangle2D area)
Sets the plot area.- Parameters:
area- the plot area (in Java2D space,nullpermitted but discouraged)- See Also:
getPlotArea()
-
getDataArea
public java.awt.geom.Rectangle2D getDataArea()
Returns the plot's data area (in Java2D space).- Returns:
- The data area (possibly
null). - See Also:
setDataArea(Rectangle2D)
-
setDataArea
public void setDataArea(java.awt.geom.Rectangle2D area)
Sets the data area.- Parameters:
area- the data area (in Java2D space,nullpermitted but discouraged).- See Also:
getDataArea()
-
getSubplotCount
public int getSubplotCount()
Returns the number of subplots (possibly zero).- Returns:
- The subplot count.
-
addSubplotInfo
public void addSubplotInfo(PlotRenderingInfo info)
Adds the info for a subplot.- Parameters:
info- the subplot info.- See Also:
getSubplotInfo(int)
-
getSubplotInfo
public PlotRenderingInfo getSubplotInfo(int index)
Returns the info for a subplot.- Parameters:
index- the subplot index.- Returns:
- The info.
- See Also:
addSubplotInfo(PlotRenderingInfo)
-
getSubplotIndex
public int getSubplotIndex(java.awt.geom.Point2D source)
Returns the index of the subplot that contains the specified (x, y) point (the "source" point). The source point will usually come from a mouse click on aChartPanel, and this method is then used to determine the subplot that contains the source point.- Parameters:
source- the source point (in Java2D space,nullnot permitted).- Returns:
- The subplot index (or -1 if no subplot contains
source).
-
equals
public boolean equals(java.lang.Object obj)
Tests this instance for equality against an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of this object.- Overrides:
clonein classjava.lang.Object- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if there is a problem cloning.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionProvides 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.ClassNotFoundExceptionProvides 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.
-
-