Package diva.gui
Class MultipageDocument
- java.lang.Object
-
- diva.gui.AbstractDocument
-
- diva.gui.MultipageDocument
-
- All Implemented Interfaces:
Document
public abstract class MultipageDocument extends AbstractDocument
A document that contains a linear sequence of Pages. This class is useful for documents which their data into logical pages. Generally this class is most useful for partitioned documents where all the partitions are stored together. For partitions that are stored separately, it is probably easiest to just use separate documents. Note that a page can contain any kind of data, and the interpretation and graphical representation of a list of page is up to the concrete document class and the corresponding application. Other than containing a sequence of pages, this class is used the same as AbstractDocument and provides the same abstract methods.- Version:
- $Id$
- Author:
- John Reekie
-
-
Constructor Summary
Constructors Constructor Description MultipageDocument(java.lang.String title, Application a, ModelParser parser, ModelWriter writer)Construct a multipage document that is owned by the given application
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the document.MultipageModelgetMultipageModel()Return the model associated with this document.java.lang.StringgetTitle()Return the title of this document.voidopen()Open the document from its current file.voidsave()Save the document to the current file.voidsaveAs(java.io.File file)Save the document to the given file.voidsaveAs(java.net.URL url)Throw an exception, as save to URLs is not supported.-
Methods inherited from class diva.gui.AbstractDocument
addPropertyChangeListener, getApplication, getEditSupport, getFile, getShortTitle, getUndoManager, getURL, isDirty, isEditable, isWritable, removePropertyChangeListener, setDirty, setEditable, setFile, setURL, setWritable
-
-
-
-
Constructor Detail
-
MultipageDocument
public MultipageDocument(java.lang.String title, Application a, ModelParser parser, ModelWriter writer)Construct a multipage document that is owned by the given application
-
-
Method Detail
-
close
public void close() throws java.lang.ExceptionClose the document. This method doesn't do anything, as graph data doesn't change.- Specified by:
closein interfaceDocument- Overrides:
closein classAbstractDocument- Throws:
java.lang.Exception- If the close operation fails.
-
getTitle
public java.lang.String getTitle()
Return the title of this document.- Specified by:
getTitlein interfaceDocument- Overrides:
getTitlein classAbstractDocument- Returns:
- The title.
-
getMultipageModel
public MultipageModel getMultipageModel()
Return the model associated with this document.
-
open
public void open() throws java.lang.ExceptionOpen the document from its current file. If successful, add a new Page to the document containing the model parsed from the current file.- Specified by:
openin interfaceDocument- Specified by:
openin classAbstractDocument- Throws:
java.lang.Exception- If there is no file, or if the I/O operation failed.
-
save
public void save() throws java.lang.ExceptionSave the document to the current file.- Specified by:
savein interfaceDocument- Specified by:
savein classAbstractDocument- Throws:
java.lang.Exception- If there is no file, or if the I/O operation failed.
-
saveAs
public void saveAs(java.io.File file) throws java.lang.ExceptionSave the document to the given file. Do not change the file attribute to the new File object.- Specified by:
saveAsin interfaceDocument- Specified by:
saveAsin classAbstractDocument- Throws:
java.lang.Exception- If the I/O operation failed.- See Also:
AbstractDocument.save()
-
saveAs
public void saveAs(java.net.URL url)
Throw an exception, as save to URLs is not supported.- Specified by:
saveAsin interfaceDocument- Specified by:
saveAsin classAbstractDocument- Throws:
java.lang.UnsupportedOperationException- Always thrown.- See Also:
AbstractDocument.save()
-
-