|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCH.ifa.draw.util.StandardStorageFormat
CH.ifa.draw.util.SerializationStorageFormat
public class SerializationStorageFormat
A SerializationStorageFormat is a straight-forward file format to store and restore Drawings. It uses Java's serialization mechanism to store Drawings. The SerializationStorageFormat has the file extension "ser" (e.g. my_picasso.ser).
Constructor Summary | |
---|---|
SerializationStorageFormat()
Create a SerialzationStorageFormat for storing and restoring Drawings. |
Method Summary | |
---|---|
java.lang.String |
createFileDescription()
Factory method to create a file description for the file type when displaying the associated FileFilter. |
protected java.lang.String |
createFileExtension()
Factory method to create the file extension recognized by the FileFilter for this SerializationStorageFormat. |
Drawing |
restore(java.lang.String fileName)
Restore a Drawing from a file with a given name. |
java.lang.String |
store(java.lang.String fileName,
Drawing saveDrawing)
Store a Drawing under a given name. |
Methods inherited from class CH.ifa.draw.util.StandardStorageFormat |
---|
adjustFileName, createFileFilter, equals, getFileDescription, getFileExtension, getFileFilter, hasCorrectFileExtension, setFileDescription, setFileExtension, setFileFilter |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SerializationStorageFormat()
Method Detail |
---|
protected java.lang.String createFileExtension()
createFileExtension
in class StandardStorageFormat
public java.lang.String createFileDescription()
createFileDescription
in class StandardStorageFormat
public java.lang.String store(java.lang.String fileName, Drawing saveDrawing) throws java.io.IOException
store
in interface StorageFormat
store
in class StandardStorageFormat
fileName
- file name of the Drawing under which it should be storedsaveDrawing
- drawing to be saved
java.io.IOException
public Drawing restore(java.lang.String fileName) throws java.io.IOException
restore
in interface StorageFormat
restore
in class StandardStorageFormat
name
- of the file in which the Drawing has been saved
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |