chemaxon.marvin.beans
Class MSketch

java.lang.Object
  extended by chemaxon.marvin.beans.MSketch
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class MSketch
extends java.lang.Object
implements java.io.Externalizable

Java independent serialization of the sketcher bean. Experimental!

The Swing and AWT ancestor classes of MSketchPane (like JComponent) have different serialVersionUID values in different Java versions, thus its simple serialization and deserialization with another Java version may not work. The workaround is to serialize class MSketch instead, which only extends Object and has a fixed serialVersionUID.

Since:
Marvin 3.5, 11/02/2004
Author:
Peter Csizmadia
See Also:
Serialized Form

Constructor Summary
MSketch()
          Constructor used for deserialization.
MSketch(MSketchPane p)
          Constructor used for serialization.
 
Method Summary
 MSketchPane getMSketchPane()
           
 void readExternal(java.io.ObjectInput in)
          Restores the sketcher's state.
 void writeExternal(java.io.ObjectOutput out)
          Saves the sketcher's state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MSketch

public MSketch()
Constructor used for deserialization.


MSketch

public MSketch(MSketchPane p)
Constructor used for serialization.

Parameters:
p - the sketcher bean to serialize
Method Detail

getMSketchPane

public MSketchPane getMSketchPane()

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restores the sketcher's state.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - the stream to read data from in order to restore the object
Throws:
java.io.IOException - if I/O errors occur
java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Saves the sketcher's state.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - the stream to write the object to
Throws:
java.io.IOException - Includes any I/O exceptions that may occur