org.vizzini.util
Interface IDocument

All Superinterfaces:
Serializable
All Known Subinterfaces:
IGameState
All Known Implementing Classes:
AbstractDocument, AbstractGameState, DefaultGameState, DocumentSupport

public interface IDocument
extends Serializable

Defines methods required by documents.

Since:
v0.1
Version:
v0.1
Author:
Jeffrey M. Thompson

Method Summary
 void addDirtyListener(PropertyChangeListener listener)
          Add a PropertyChangeListener for the dirty property to the listener list.
 void addFileListener(PropertyChangeListener listener)
          Add a PropertyChangeListener for the file property to the listener list.
 File getFile()
          Return the file associated with this document.
 boolean isDirty()
          Return the flag indicating if this document has changed since the last save.
 boolean isFileAssociated()
          Return true if this document has an associated File.
 boolean isSaveable()
          Return true if this document needs to be saved.
 void open()
          Open the associated file, thereby populating this document.
 void removeDirtyListener(PropertyChangeListener listener)
          Remove a PropertyChangeListener for the dirty property from the listener list.
 void removeFileListener(PropertyChangeListener listener)
          Remove a PropertyChangeListener for the file property from the listener list.
 void reset()
          Reset this document.
 void save()
          Save this document to the associated file.
 void saveAs(File file)
          Save this document to the given file.
 void setDirty(boolean isDirty)
          Set the dirty flag.
 void setFile(File file)
          Set the associated file.
 

Method Detail

setDirty

void setDirty(boolean isDirty)
Set the dirty flag.

Since:
v0.1

isDirty

boolean isDirty()
Return the flag indicating if this document has changed since the last save.

Since:
v0.1

setFile

void setFile(File file)
Set the associated file.

Since:
v0.1

getFile

File getFile()
Return the file associated with this document.

Since:
v0.1

isFileAssociated

boolean isFileAssociated()
Return true if this document has an associated File.

Since:
v0.1

isSaveable

boolean isSaveable()
Return true if this document needs to be saved.

Since:
v0.1

addDirtyListener

void addDirtyListener(PropertyChangeListener listener)
Add a PropertyChangeListener for the dirty property to the listener list.

Parameters:
listener - The PropertyChangeListener to be added.
Since:
v0.1

addFileListener

void addFileListener(PropertyChangeListener listener)
Add a PropertyChangeListener for the file property to the listener list.

Parameters:
listener - The PropertyChangeListener to add.
Since:
v0.1

open

void open()
          throws FileNotFoundException,
                 IOException,
                 ClassNotFoundException
Open the associated file, thereby populating this document. File is a required property.

Throws:
FileNotFoundException
IOException
ClassNotFoundException
Since:
v0.1

removeDirtyListener

void removeDirtyListener(PropertyChangeListener listener)
Remove a PropertyChangeListener for the dirty property from the listener list.

Parameters:
listener - The PropertyChangeListener to remove.
Since:
v0.1

removeFileListener

void removeFileListener(PropertyChangeListener listener)
Remove a PropertyChangeListener for the file property from the listener list.

Parameters:
listener - The PropertyChangeListener to remove.
Since:
v0.1

reset

void reset()
Reset this document.

Since:
v0.1

save

void save()
          throws FileNotFoundException,
                 IOException
Save this document to the associated file. File is a required property.

Throws:
FileNotFoundException
IOException
Since:
v0.1

saveAs

void saveAs(File file)
            throws FileNotFoundException,
                   IOException
Save this document to the given file.

Throws:
FileNotFoundException
IOException
Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02