@PublicAPI public class MSketch extends java.lang.Object implements java.io.Externalizable
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.
Constructor and Description |
---|
MSketch()
Constructor used for deserialization.
|
MSketch(MSketchPane p)
Constructor used for serialization.
|
Modifier and Type | Method and Description |
---|---|
MSketchPane |
getMSketchPane() |
void |
readExternal(java.io.ObjectInput in)
Restores the sketcher's state.
|
void |
writeExternal(java.io.ObjectOutput out)
Saves the sketcher's state.
|
public MSketch()
public MSketch(MSketchPane p)
p
- the sketcher bean to serializepublic MSketchPane getMSketchPane()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- the stream to read data from in order to restore the objectjava.io.IOException
- if I/O errors occurjava.lang.ClassNotFoundException
- If the class for an object being restored cannot be found.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- the stream to write the object tojava.io.IOException
- Includes any I/O exceptions that may occur