|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.ri.common.views.AbstractDocumentViewModel
public abstract class AbstractDocumentViewModel
The AbstractDocumentViewModel is responsible for keeping the state of the document view. The AbstractDocumentViewModel also stores an list of PageViewComponents who's state is update as the model changes. The AbstractDocumentViewModel can be swapped into different page views quickly and efficiently.
DocumentViewModelImpl| Field Summary | |
|---|---|
protected AnnotationComponent |
currentAnnotation
|
protected org.icepdf.core.pobjects.Document |
currentDocument
|
protected int |
currentPageIndex
|
protected static int |
MAX_PAGE_SIZE_READ_AHEAD
|
protected int |
oldPageIndex
|
protected float |
oldUserRotation
|
protected int |
oldUserToolModeFlag
|
protected float |
oldUserZoom
|
protected int |
pageBoundary
|
protected java.util.List<AbstractPageViewComponent> |
pageComponents
|
protected UndoCaretaker |
undoCaretaker
|
protected float |
userRotation
|
protected int |
userToolModeFlag
|
protected float |
userZoom
|
| Constructor Summary | |
|---|---|
AbstractDocumentViewModel(org.icepdf.core.pobjects.Document currentDocument)
|
|
| Method Summary | |
|---|---|
void |
addMemento(org.icepdf.core.Memento oldMementoState,
org.icepdf.core.Memento newMementoState)
Adds memento state to the care taker. |
void |
addSelectedPageText(AbstractPageViewComponent pageViewComponent)
Adds the specified page to selected page cache. |
void |
clearSelectedPageText()
Clears cache used to store which pages have selected state. |
void |
dispose()
Free resources associated with this model. |
UndoCaretaker |
getAnnotationCareTaker()
Gets annotation caretaker responsible for saving states as defined by the memento pattern. |
AnnotationComponent |
getCurrentAnnotation()
Gets the currently selected annotation in the document model. |
javax.swing.Timer |
getDirtyTimer()
Get an instance of the dirty Timer use by all child PageComponents. |
org.icepdf.core.pobjects.Document |
getDocument()
Gets the PDF document object associated with this views. |
int |
getPageBoundary()
Gets the page boundary used to paint document pages. |
java.awt.Rectangle |
getPageBounds(int pageIndex)
Gets the page bound of the specified page Index. |
java.util.List<AbstractPageViewComponent> |
getPageComponents()
Gets the page components associated with this view model. |
java.util.ArrayList<AbstractPageViewComponent> |
getSelectedPageText()
Gets the list of components that have a selected state. |
int |
getViewCurrentPageIndex()
Gets the current page index represented in this model. |
float |
getViewRotation()
Returns the zoom factor of the page visualization. |
int |
getViewToolMode()
Gets the tool mode. |
float |
getViewZoom()
Gets the view model zoom level. |
void |
invalidate()
Invalidate the underlying Document Page models. |
boolean |
isSelectAll()
Gets the selected all state of the document pages view. |
boolean |
isViewToolModeSelected(int viewToolMode)
Checks if the specified tool mode is set in the view model. |
void |
removeSelectedPageText(AbstractPageViewComponent pageViewComponent)
Removes the specified page to selected page cache. |
void |
setCurrentAnnotation(AnnotationComponent currentAnnotation)
Sets the current annotation. |
void |
setPageBoundary(int pageBoundary)
Sets the page boundary used to paint a page. |
void |
setSelectAll(boolean selectAll)
Sets the select all state of the text in the document. |
boolean |
setViewCurrentPageIndex(int pageIndex)
Sets the view model current page index. |
boolean |
setViewRotation(float viewRotation)
Sets the view rotation of this model. |
boolean |
setViewToolMode(int viewToolMode)
Sets the view tool mode. |
boolean |
setViewZoom(float viewZoom)
Sets the zoom factor of the page visualization. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.icepdf.core.pobjects.Document currentDocument
protected java.util.List<AbstractPageViewComponent> pageComponents
protected UndoCaretaker undoCaretaker
protected AnnotationComponent currentAnnotation
protected float userZoom
protected float oldUserZoom
protected float userRotation
protected float oldUserRotation
protected int currentPageIndex
protected int oldPageIndex
protected int pageBoundary
protected int userToolModeFlag
protected int oldUserToolModeFlag
protected static final int MAX_PAGE_SIZE_READ_AHEAD
| Constructor Detail |
|---|
public AbstractDocumentViewModel(org.icepdf.core.pobjects.Document currentDocument)
| Method Detail |
|---|
public org.icepdf.core.pobjects.Document getDocument()
DocumentViewModel
getDocument in interface DocumentViewModelpublic java.util.List<AbstractPageViewComponent> getPageComponents()
DocumentViewModel
getPageComponents in interface DocumentViewModelpublic boolean setViewCurrentPageIndex(int pageIndex)
DocumentViewModel
setViewCurrentPageIndex in interface DocumentViewModelpageIndex - zero based current pages page index of the document.
public int getViewCurrentPageIndex()
DocumentViewModel
getViewCurrentPageIndex in interface DocumentViewModelpublic java.util.ArrayList<AbstractPageViewComponent> getSelectedPageText()
getSelectedPageText in interface DocumentViewModelpublic boolean isSelectAll()
isSelectAll in interface DocumentViewModelpublic void setSelectAll(boolean selectAll)
setSelectAll in interface DocumentViewModelselectAll - to to specify all text is selected, false to specify
no text is selectedpublic void addSelectedPageText(AbstractPageViewComponent pageViewComponent)
addSelectedPageText in interface DocumentViewModelpageViewComponent - pageView component to add to list.public void removeSelectedPageText(AbstractPageViewComponent pageViewComponent)
removeSelectedPageText in interface DocumentViewModelpageViewComponent - pageView component to add to list.public void clearSelectedPageText()
clearSelectedPageText in interface DocumentViewModelpublic boolean setViewZoom(float viewZoom)
setViewZoom in interface DocumentViewModelviewZoom - zoom factor
public void invalidate()
invalidate in interface DocumentViewModelpublic float getViewZoom()
DocumentViewModel
getViewZoom in interface DocumentViewModelpublic boolean setViewRotation(float viewRotation)
DocumentViewModel
setViewRotation in interface DocumentViewModelviewRotation - rotation in degrees
public float getViewRotation()
getViewRotation in interface DocumentViewModelpublic boolean setViewToolMode(int viewToolMode)
DocumentViewModel
setViewToolMode in interface DocumentViewModelviewToolMode - selected tool mode, pan, zoom and et.
public int getViewToolMode()
DocumentViewModel
getViewToolMode in interface DocumentViewModelpublic boolean isViewToolModeSelected(int viewToolMode)
DocumentViewModel
isViewToolModeSelected in interface DocumentViewModelviewToolMode - tool model to check if selected.
public void setPageBoundary(int pageBoundary)
setPageBoundary in interface DocumentViewModelpageBoundary - page boundspublic int getPageBoundary()
DocumentViewModel
getPageBoundary in interface DocumentViewModelpublic java.awt.Rectangle getPageBounds(int pageIndex)
DocumentViewModel
getPageBounds in interface DocumentViewModelpageIndex - zero based page index.
public void dispose()
DocumentViewModel
dispose in interface DocumentViewModelpublic AnnotationComponent getCurrentAnnotation()
getCurrentAnnotation in interface DocumentViewModelpublic void setCurrentAnnotation(AnnotationComponent currentAnnotation)
setCurrentAnnotation in interface DocumentViewModelcurrentAnnotation - annotation to make current.public UndoCaretaker getAnnotationCareTaker()
public void addMemento(org.icepdf.core.Memento oldMementoState,
org.icepdf.core.Memento newMementoState)
DocumentViewModel
addMemento in interface DocumentViewModeloldMementoState - original state.newMementoState - new state.public javax.swing.Timer getDirtyTimer()
DocumentViewModel
getDirtyTimer in interface DocumentViewModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||