|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.gui.MultipageModel
public class MultipageModel
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.
Field Summary | |
---|---|
private ListDataModel |
_pages
The support object for pages. |
private java.lang.String |
_title
The title of this model; |
Constructor Summary | |
---|---|
MultipageModel()
|
Method Summary | |
---|---|
void |
addPage(Page p)
Add a page to the document and notify page listeners. |
void |
addPageListener(javax.swing.event.ListDataListener listener)
Add a page listener to this document. |
Page |
getCurrentPage()
Get the current page. |
Page |
getPage(int index)
Get the page at the given index. |
Page |
getPage(java.lang.String title)
Get the page with the given title. |
int |
getPageCount()
Get the number of pages in this document. |
java.lang.String |
getTitle()
Return the title of this model |
int |
indexOf(Page p)
Get the index of the given page. -1 if it is not known. |
void |
insertPage(Page p,
int index)
Add a page to the document at the given index (between 0 and getPageCount()-1) and notify page listeners. |
java.util.Iterator |
pages()
Return an iterator over all pages |
void |
removePage(Page p)
Remove the given page from this document and notify listeners. |
void |
removePageListener(javax.swing.event.ListDataListener listener)
Remove a page listener from this document. |
void |
setCurrentPage(Page p)
Set the current page. |
void |
setTitle(java.lang.String title)
Set the title of this model to the given title. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ListDataModel _pages
private java.lang.String _title
Constructor Detail |
---|
public MultipageModel()
Method Detail |
---|
public void addPage(Page p)
public void insertPage(Page p, int index)
public void addPageListener(javax.swing.event.ListDataListener listener)
public Page getCurrentPage()
public Page getPage(int index)
public Page getPage(java.lang.String title)
public int getPageCount()
public java.lang.String getTitle()
public int indexOf(Page p)
public java.util.Iterator pages()
public void removePage(Page p)
public void removePageListener(javax.swing.event.ListDataListener listener)
public void setCurrentPage(Page p)
public void setTitle(java.lang.String title)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |