edu.berkeley.guir.lib.gesture
Class GestureFile
java.lang.Object
|
+--edu.berkeley.guir.lib.gesture.GestureFile
- public class GestureFile
- extends Object
An abstraction for reading & writing files containing GesturePackages
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VERSION
public final String VERSION
UNKNOWN
public final int UNKNOWN
- unknown file type
ASCII
public final int ASCII
- the file was in ASCII format (deprecated)
BINARY
public final int BINARY
- the file was in binary format (deprecated)
PACKAGE
public final int PACKAGE
- the file was in package format (also ASCII)
gesturePackage
protected GesturePackage gesturePackage
file
protected File file
fileType
protected int fileType
autoSaveWasRead
protected boolean autoSaveWasRead
useAutoSave
protected boolean useAutoSave
GestureFile
public GestureFile(File f,
GesturePackage gp)
GestureFile
public GestureFile(File f)
setGesturePackage
public void setGesturePackage(GesturePackage gp)
getGesturePackage
public GesturePackage getGesturePackage()
setUseAutosave
public void setUseAutosave(boolean useIt)
isUseAutosave
public boolean isUseAutosave()
write
public void write()
throws IOException
- Write the gesturePackage to its file. Overwrites any existing
file.
writeAutoSave
public void writeAutoSave()
throws IOException
read
public void read()
throws ClassNotFoundException,
InvalidClassException,
InvalidObjectException,
IOException,
FileNotFoundException,
ParseException
- Read the gesture set from the file. If useAutoSave is true,
reads autosave file if it exists and is newer.
- Throws:
ClassNotFoundException
- indicates a problem with deserializationInvalidClassException
- indicates a problem with deserializationInvalidObjectException
- indicates a problem with deserializationParseException
- probably a problem with ill-formed numbers
canReadVersion
public boolean canReadVersion(String versionString)
getAutoSaveFile
public static File getAutoSaveFile(File f)
getAutoSaveFile
public File getAutoSaveFile()
doesAutoSaveExist
public boolean doesAutoSaveExist()
doesNewerAutoSaveExist
public boolean doesNewerAutoSaveExist()
getFile
public File getFile()
wasAutoSaveRead
public boolean wasAutoSaveRead()
getFileFilter
public static FileFilter getFileFilter()