diva.whiteboard
Class SketchStoragePolicy
java.lang.Object
diva.gui.AbstractStoragePolicy
diva.gui.DefaultStoragePolicy
diva.whiteboard.SketchStoragePolicy
- All Implemented Interfaces:
- StoragePolicy
public class SketchStoragePolicy
- extends DefaultStoragePolicy
A SketchStoragePolicy implements methods of closing, opening, and
saving sketch documents. Only the saveAs method is overwritten,
the rest of the methods are the same as DefaultStoragePolicy.
- Version:
- $Revision: 1.8 $
- Author:
- Heloise Hse (hwawen@eecs.berkeley.edu)
Field Summary |
static String |
JPEG
The file extension for JPEG images. |
static String |
SML
The file extension for sketch documents. |
Method Summary |
boolean |
saveAs(Document d)
Save the document to a user-specified location. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SML
public static final String SML
- The file extension for sketch documents.
- See Also:
- Constant Field Values
JPEG
public static final String JPEG
- The file extension for JPEG images.
- See Also:
- Constant Field Values
SketchStoragePolicy
public SketchStoragePolicy()
saveAs
public boolean saveAs(Document d)
- Save the document to a user-specified location. Open a file
chooser and forward the request to the document. Don't change
the document's file object. Do nothing if the document is
null. Return true if successul, otherwise false.
File extension is checked and modified in the following way:
- If the selected file filter is "*.*", then the file
will be saved in .sml format. If the file name does not have a
".sml" extension, it is appended with ".sml".
- If the selected file filter is ".gif" or ".sml", the
corresponding file extension will be appended if the file name
lacks the extension.
- Specified by:
saveAs
in interface StoragePolicy
- Overrides:
saveAs
in class DefaultStoragePolicy
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.