UC Berkeley Group for User Interface Research
Updated November 17, 2000

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


Inner Class Summary
 class GestureFile.UnsupportedVersionException
           
 
Field Summary
 int ASCII
          the file was in ASCII format (deprecated)
protected  boolean autoSaveWasRead
           
 int BINARY
          the file was in binary format (deprecated)
protected  File file
           
protected  int fileType
           
protected  GesturePackage gesturePackage
           
 int PACKAGE
          the file was in package format (also ASCII)
 int UNKNOWN
          unknown file type
protected  boolean useAutoSave
           
 String VERSION
           
 
Constructor Summary
GestureFile(File f)
           
GestureFile(File f, GesturePackage gp)
           
 
Method Summary
 boolean canReadVersion(String versionString)
           
 boolean doesAutoSaveExist()
           
 boolean doesNewerAutoSaveExist()
           
 File getAutoSaveFile()
           
static File getAutoSaveFile(File f)
           
 File getFile()
           
static FileFilter getFileFilter()
           
 GesturePackage getGesturePackage()
           
 boolean isUseAutosave()
           
 void read()
          Read the gesture set from the file.
 void setGesturePackage(GesturePackage gp)
           
 void setUseAutosave(boolean useIt)
           
 boolean wasAutoSaveRead()
           
 void write()
          Write the gesturePackage to its file.
 void writeAutoSave()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

GestureFile

public GestureFile(File f,
                   GesturePackage gp)

GestureFile

public GestureFile(File f)
Method Detail

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 deserialization
InvalidClassException - indicates a problem with deserialization
InvalidObjectException - indicates a problem with deserialization
ParseException - 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()

Copyright Information