Package chemaxon.marvin.beans
Class MSketch
- java.lang.Object
-
- chemaxon.marvin.beans.MSketch
-
- All Implemented Interfaces:
Externalizable
,Serializable
@PublicAPI public class MSketch extends Object implements 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
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MSketch()
Constructor used for deserialization.MSketch(MSketchPane p)
Constructor used for serialization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MSketchPane
getMSketchPane()
void
readExternal(ObjectInput in)
Restores the sketcher's state.void
writeExternal(ObjectOutput out)
Saves the sketcher's state.
-
-
-
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(ObjectInput in) throws IOException, ClassNotFoundException
Restores the sketcher's state.- Specified by:
readExternal
in interfaceExternalizable
- Parameters:
in
- the stream to read data from in order to restore the object- Throws:
IOException
- if I/O errors occurClassNotFoundException
- If the class for an object being restored cannot be found.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
Saves the sketcher's state.- Specified by:
writeExternal
in interfaceExternalizable
- Parameters:
out
- the stream to write the object to- Throws:
IOException
- Includes any I/O exceptions that may occur
-
-