From: <mu...@us...> - 2008-05-08 13:07:53
|
Revision: 964 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=964&view=rev Author: mungady Date: 2008-05-08 06:07:02 -0700 (Thu, 08 May 2008) Log Message: ----------- 2008-05-08 David Gilbert <dav...@ob...> * source/org/jfree/chart/ChartPanel.java (chartMouseListeners): Marked this field transient, (chartBuffer): Likewise, (writeObject): New method, (readObject): Likewise. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog branches/jfreechart-1.0.x-branch/source/org/jfree/chart/ChartPanel.java Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2008-05-08 07:27:14 UTC (rev 963) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2008-05-08 13:07:02 UTC (rev 964) @@ -1,6 +1,14 @@ 2008-05-08 David Gilbert <dav...@ob...> * source/org/jfree/chart/ChartPanel.java + (chartMouseListeners): Marked this field transient, + (chartBuffer): Likewise, + (writeObject): New method, + (readObject): Likewise. + +2008-05-08 David Gilbert <dav...@ob...> + + * source/org/jfree/chart/ChartPanel.java (zoomPoint): Changed from Point to Point2D, (getPointInRectangle): Changed return type to Point2D, and no longer round the coordinates in the returned point, Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/ChartPanel.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/ChartPanel.java 2008-05-08 07:27:14 UTC (rev 963) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/ChartPanel.java 2008-05-08 13:07:02 UTC (rev 964) @@ -138,6 +138,7 @@ * 07-Nov-2007 : Fixed (rare) bug in refreshing off-screen image (DG); * 07-May-2008 : Fixed bug in zooming that triggered zoom for a rectangle * outside of the data area (DG); + * 08-May-2008 : Fixed serialization bug (DG); * */ @@ -166,6 +167,8 @@ import java.awt.print.PrinterJob; import java.io.File; import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.EventListener; import java.util.ResourceBundle; @@ -272,7 +275,7 @@ private JFreeChart chart; /** Storage for registered (chart) mouse listeners. */ - private EventListenerList chartMouseListeners; + private transient EventListenerList chartMouseListeners; /** A flag that controls whether or not the off-screen buffer is used. */ private boolean useBuffer; @@ -281,7 +284,7 @@ private boolean refreshBuffer; /** A buffer for the rendered chart. */ - private Image chartBuffer; + private transient Image chartBuffer; /** The height of the chart buffer. */ private int chartBufferHeight; @@ -2536,4 +2539,38 @@ super.updateUI(); } + /** + * Provides serialization support. + * + * @param stream the output stream. + * + * @throws IOException if there is an I/O error. + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + } + + /** + * Provides serialization support. + * + * @param stream the input stream. + * + * @throws IOException if there is an I/O error. + * @throws ClassNotFoundException if there is a classpath problem. + */ + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + + // we create a new but empty chartMouseListeners list + this.chartMouseListeners = new EventListenerList(); + + // register as a listener with sub-components... + if (this.chart != null) { + this.chart.addChangeListener(this); + } + + } + + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |