|
|||||||||
| 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 documetn view. The AbstractDocumentViewModel also stores an list of PageViewComponetnts who's state is update as the model changes. The AbstractDocumentViewModel can be swapped into different page views quickly and efficently.
DocumentViewModelImpl| Field Summary | |
|---|---|
protected org.icepdf.core.views.swing.AnnotationComponentImpl |
currentAnnotation
|
protected org.icepdf.core.pobjects.Document |
currentDocument
|
protected int |
currentPageIndex
|
protected static int |
MAX_PAGE_SIZE_READ_AHEAD
|
protected static int |
maxPageInitThreads
|
protected static int |
maxPainterThreads
|
protected int |
oldPageIndex
|
protected float |
oldUserRotation
|
protected int |
oldUserToolModeFlag
|
protected float |
oldUserZoom
|
protected int |
pageBoundary
|
protected java.util.List<org.icepdf.core.views.swing.AbstractPageViewComponent> |
pageComponents
|
protected java.util.concurrent.ThreadPoolExecutor |
pageInitilizationThreadPool
|
protected java.util.concurrent.ThreadPoolExecutor |
pagePainterThreadPool
|
protected UndoCaretaker |
undoCaretaker
|
protected float |
userRotation
|
protected int |
userToolModeFlag
|
protected float |
userZoom
|
| Fields inherited from interface org.icepdf.core.views.DocumentViewModel |
|---|
DISPLAY_TOOL_LINK_ANNOTATION, DISPLAY_TOOL_NONE, DISPLAY_TOOL_PAN, DISPLAY_TOOL_SELECTION, DISPLAY_TOOL_TEXT_SELECTION, DISPLAY_TOOL_WAIT, DISPLAY_TOOL_ZOOM_IN, DISPLAY_TOOL_ZOOM_OUT |
| Constructor Summary | |
|---|---|
AbstractDocumentViewModel(org.icepdf.core.pobjects.Document currentDocument)
|
|
| Method Summary | |
|---|---|
void |
addMemento(org.icepdf.core.Memento oldMementoState,
org.icepdf.core.Memento newMementoState)
|
void |
addSelectedPageText(org.icepdf.core.views.swing.AbstractPageViewComponent pageViewComponent)
Adds the specified page to selected page cache. |
void |
clearSelectedPageText()
Clears cache used to store which pages have selected state. |
void |
dispose()
|
void |
executePageInitialization(java.lang.Runnable runnable)
|
void |
executePagePainter(java.lang.Runnable runnable)
|
UndoCaretaker |
getAnnotationCareTaker()
Gets annotation caretaker responsible for saving states as defined by the momento pattern. |
org.icepdf.core.views.swing.AnnotationComponentImpl |
getCurrentAnnotation()
Gets the currently selected annotation in the document model. |
org.icepdf.core.pobjects.Document |
getDocument()
|
int |
getPageBoundary()
|
java.awt.Rectangle |
getPageBounds(int pageIndex)
|
java.util.List<org.icepdf.core.views.swing.AbstractPageViewComponent> |
getPageComponents()
|
java.util.ArrayList<java.lang.ref.WeakReference<org.icepdf.core.views.swing.AbstractPageViewComponent>> |
getSelectedPageText()
Gets the list of components that have a selected state. |
int |
getViewCurrentPageIndex()
|
float |
getViewRotation()
Returns the zoom factor of the page visualization. |
int |
getViewToolMode()
|
float |
getViewZoom()
|
void |
invalidate()
Invalidate the underlying Document Page models. |
boolean |
isSelectAll()
Gets the selected all state of the doucment pages view. |
boolean |
isViewToolModeSelected(int viewToolMode)
|
void |
setCurrentAnnotation(org.icepdf.core.views.swing.AnnotationComponentImpl currentAnnotation)
Sets the current annotation. |
void |
setPageBoundary(int pageBoundary)
Sets the page boundtry used to paint a page. |
void |
setSelectAll(boolean selectAll)
Sets the select all state of the text in the document. |
boolean |
setViewCurrentPageIndex(int pageIndex)
|
boolean |
setViewRotation(float viewRotation)
|
boolean |
setViewToolMode(int viewToolMode)
|
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<org.icepdf.core.views.swing.AbstractPageViewComponent> pageComponents
protected UndoCaretaker undoCaretaker
protected org.icepdf.core.views.swing.AnnotationComponentImpl 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 java.util.concurrent.ThreadPoolExecutor pageInitilizationThreadPool
protected java.util.concurrent.ThreadPoolExecutor pagePainterThreadPool
protected static final int MAX_PAGE_SIZE_READ_AHEAD
protected static int maxPainterThreads
protected static int maxPageInitThreads
| Constructor Detail |
|---|
public AbstractDocumentViewModel(org.icepdf.core.pobjects.Document currentDocument)
| Method Detail |
|---|
public org.icepdf.core.pobjects.Document getDocument()
getDocument in interface org.icepdf.core.views.DocumentViewModel
public void executePageInitialization(java.lang.Runnable runnable)
throws java.lang.InterruptedException
executePageInitialization in interface org.icepdf.core.views.DocumentViewModeljava.lang.InterruptedException
public void executePagePainter(java.lang.Runnable runnable)
throws java.lang.InterruptedException
executePagePainter in interface org.icepdf.core.views.DocumentViewModeljava.lang.InterruptedExceptionpublic java.util.List<org.icepdf.core.views.swing.AbstractPageViewComponent> getPageComponents()
getPageComponents in interface org.icepdf.core.views.DocumentViewModelpublic boolean setViewCurrentPageIndex(int pageIndex)
setViewCurrentPageIndex in interface org.icepdf.core.views.DocumentViewModelpublic int getViewCurrentPageIndex()
getViewCurrentPageIndex in interface org.icepdf.core.views.DocumentViewModelpublic java.util.ArrayList<java.lang.ref.WeakReference<org.icepdf.core.views.swing.AbstractPageViewComponent>> getSelectedPageText()
getSelectedPageText in interface org.icepdf.core.views.DocumentViewModelpublic boolean isSelectAll()
isSelectAll in interface org.icepdf.core.views.DocumentViewModelpublic void setSelectAll(boolean selectAll)
setSelectAll in interface org.icepdf.core.views.DocumentViewModelselectAll - to to specify all text is selected, false to sepcify
no text is selectedpublic void addSelectedPageText(org.icepdf.core.views.swing.AbstractPageViewComponent pageViewComponent)
addSelectedPageText in interface org.icepdf.core.views.DocumentViewModelpageViewComponent - pageview component to add to list.public void clearSelectedPageText()
clearSelectedPageText in interface org.icepdf.core.views.DocumentViewModelpublic boolean setViewZoom(float viewZoom)
setViewZoom in interface org.icepdf.core.views.DocumentViewModelviewZoom - zoom factor
public void invalidate()
invalidate in interface org.icepdf.core.views.DocumentViewModelpublic float getViewZoom()
getViewZoom in interface org.icepdf.core.views.DocumentViewModelpublic boolean setViewRotation(float viewRotation)
setViewRotation in interface org.icepdf.core.views.DocumentViewModelpublic float getViewRotation()
getViewRotation in interface org.icepdf.core.views.DocumentViewModelpublic boolean setViewToolMode(int viewToolMode)
setViewToolMode in interface org.icepdf.core.views.DocumentViewModelpublic int getViewToolMode()
getViewToolMode in interface org.icepdf.core.views.DocumentViewModelpublic boolean isViewToolModeSelected(int viewToolMode)
isViewToolModeSelected in interface org.icepdf.core.views.DocumentViewModelpublic void setPageBoundary(int pageBoundary)
setPageBoundary in interface org.icepdf.core.views.DocumentViewModelpageBoundary - page boundspublic int getPageBoundary()
getPageBoundary in interface org.icepdf.core.views.DocumentViewModelpublic java.awt.Rectangle getPageBounds(int pageIndex)
getPageBounds in interface org.icepdf.core.views.DocumentViewModelpublic void dispose()
dispose in interface org.icepdf.core.views.DocumentViewModelpublic org.icepdf.core.views.swing.AnnotationComponentImpl getCurrentAnnotation()
getCurrentAnnotation in interface org.icepdf.core.views.DocumentViewModelpublic void setCurrentAnnotation(org.icepdf.core.views.swing.AnnotationComponentImpl currentAnnotation)
setCurrentAnnotation in interface org.icepdf.core.views.DocumentViewModelcurrentAnnotation - annotation to make current.public UndoCaretaker getAnnotationCareTaker()
public void addMemento(org.icepdf.core.Memento oldMementoState,
org.icepdf.core.Memento newMementoState)
addMemento in interface org.icepdf.core.views.DocumentViewModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||