jdraw.file
Class File

java.lang.Object
  |
  +--java.util.Observable
        |
        +--mvp.Model
              |
              +--jdraw.file.File
All Implemented Interfaces:
java.io.Serializable

public class File
extends mvp.Model

Class File is the Model class for file operations such as loading files, saving files, etc.

See Also:
Serialized Form

Field Summary
protected  JDraw jdraw
          Local reference to Top-Level object.
 
Fields inherited from class mvp.Model
view
 
Constructor Summary
File(mvp.View view, JDraw jdraw)
          Construct this with the given View object.
 
Method Summary
 void close()
          Close the active picture, offering to save if changed ....
 void exit()
          Exit the program ....
 void fileNew()
          Create a new picture....
 JDraw getJDraw()
           
 void open(java.lang.String filename)
          Open an existing JDraw picture ....
 void print()
          Print this picture ....
static void revert()
          Revert back to last saved picture....
 void save()
          Save this picture to a file....
 void saveAs(java.lang.String filename)
          Save this picture under a new filename....
 
Methods inherited from class mvp.Model
getView, setView
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jdraw

protected JDraw jdraw
Local reference to Top-Level object. Needed by File.new
Constructor Detail

File

public File(mvp.View view,
            JDraw jdraw)
Construct this with the given View object.
Parameters:
view - - The View object to be passed to the parent constructor
Method Detail

getJDraw

public JDraw getJDraw()

fileNew

public void fileNew()
Create a new picture....

revert

public static void revert()
Revert back to last saved picture....

open

public void open(java.lang.String filename)
Open an existing JDraw picture ....
Parameters:
filename - - The String object which holds the name of the JDraw file to be opened.

save

public void save()
Save this picture to a file....

saveAs

public void saveAs(java.lang.String filename)
Save this picture under a new filename....
Parameters:
filename - - The String object which holds the name of the file under which to save.

close

public void close()
Close the active picture, offering to save if changed ....

print

public void print()
Print this picture ....

exit

public void exit()
Exit the program ....