uk.ac.essex.ia.opview
Class OperationFileOp

java.lang.Object
  extended by uk.ac.essex.common.io.FileOp<T>
      extended by uk.ac.essex.common.io.FileOpImpl<OperationFile>
          extended by uk.ac.essex.ia.opview.OperationFileOp

public class OperationFileOp
extends FileOpImpl<OperationFile>

Handles the reading/writing of OperationFiles to disk

See Also:
OperationJFileChooser

Field Summary
 
Fields inherited from class uk.ac.essex.common.io.FileOpImpl
currentCaller, fileChooser, LAST_DIR, lastDir
 
Fields inherited from class uk.ac.essex.common.io.FileOp
file
 
Constructor Summary
OperationFileOp()
           
 
Method Summary
 java.lang.String getDefaultEnding()
          Gets the default file ending to postfix to the file name, this is only used if the file to save to has not been given by the user.
 OperationFile openFile(java.io.File fileToOpen)
          Opens the given OperationGraph from disk
 void save(OperationFile applicationFile)
          Save the given OperationGraph to the specified file on disk
protected  void saveFile()
          Saves the data stored in source, in the File stored in file.
 
Methods inherited from class uk.ac.essex.common.io.FileOpImpl
getFileChooser, hasEnding, open, saveAs, setFileChooser
 
Methods inherited from class uk.ac.essex.common.io.FileOp
getFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationFileOp

public OperationFileOp()
Method Detail

openFile

public OperationFile openFile(java.io.File fileToOpen)
Opens the given OperationGraph from disk

Specified by:
openFile in class FileOpImpl<OperationFile>
Returns:
the open file if no problems, null if an error occurred

save

public void save(OperationFile applicationFile)
Save the given OperationGraph to the specified file on disk

Specified by:
save in class FileOp<OperationFile>
Parameters:
applicationFile - - The object to be saved should be of type OperationGraph
See Also:
saveFile()

getDefaultEnding

public java.lang.String getDefaultEnding()
Gets the default file ending to postfix to the file name, this is only used if the file to save to has not been given by the user.

Specified by:
getDefaultEnding in class FileOpImpl<OperationFile>
Returns:
String - The default file ending to postfix to the file name

saveFile

protected void saveFile()
Saves the data stored in source, in the File stored in file. This is done by starting a seperate thread to do the work so it shouldn't lock up the GUI waiting for this method to return.

See Also:
source, FileOp.file