-
- All Known Implementing Classes:
AbstractDocumentViewModel,DocumentViewModelImpl
public interface DocumentViewModelThe DocumentViewModel interface contains common accessors and modifiers needed to represent a document view state.- Since:
- 2.5
- See Also:
AbstractDocumentViewModel
-
-
Field Summary
Fields Modifier and Type Field Description static intDISPLAY_TOOL_CIRCLE_ANNOTATIONDisplay tool constant for creating new circle annotation.static intDISPLAY_TOOL_FREE_TEXT_ANNOTATIONDisplay tool constant for creating new free text annotation.static intDISPLAY_TOOL_HIGHLIGHT_ANNOTATIONDisplay tool constant for creating new highlight annotation.static intDISPLAY_TOOL_INK_ANNOTATIONDisplay tool constant for creating new ink annotation.static intDISPLAY_TOOL_LINE_ANNOTATIONDisplay tool constant for creating new line annotation.static intDISPLAY_TOOL_LINE_ARROW_ANNOTATIONDisplay tool constant for creating new line arrow annotation.static intDISPLAY_TOOL_LINK_ANNOTATIONDisplay tool constant for creating new link annotation.static intDISPLAY_TOOL_NONEDisplay tool constant for setting no toolsstatic intDISPLAY_TOOL_PANDisplay tool constant for adding a pan tool.static intDISPLAY_TOOL_REDACTION_ANNOTATIONstatic intDISPLAY_TOOL_SELECTIONDisplay tool constant for adding a selection tool.static intDISPLAY_TOOL_SIGNATURE_ANNOTATIONstatic intDISPLAY_TOOL_SQUARE_ANNOTATIONDisplay tool constant for creating new square annotation.static intDISPLAY_TOOL_SQUIGGLY_ANNOTATIONDisplay tool constant for creating new squiggly annotation.static intDISPLAY_TOOL_STRIKEOUT_ANNOTATIONDisplay tool constant for creating new strikeout annotation.static intDISPLAY_TOOL_TEXT_ANNOTATIONDisplay tool constant for creating new text annotation.static intDISPLAY_TOOL_TEXT_SELECTIONDisplay tool constant for adding a text selection tool.static intDISPLAY_TOOL_UNDERLINE_ANNOTATIONDisplay tool constant for creating new underline annotation.static intDISPLAY_TOOL_WAITDisplay tool constant for showing user that gui is busystatic intDISPLAY_TOOL_ZOOM_DYNAMICDisplay tool constant for adding a zoom out tool.static intDISPLAY_TOOL_ZOOM_INDisplay tool constant for adding a zoom in tool.static intDISPLAY_TOOL_ZOOM_OUTDisplay tool constant for adding a zoom out tool.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDocumentViewAnnotationComponent(AbstractPageViewComponent pageViewComponent, PageViewAnnotationComponent annotationComponent)Adds an annotation component the list of floating annotation components that are painted in the DocumentView.voidaddMemento(Memento oldMementoState, Memento newMementoState)Adds memento state to the care taker.voidaddSelectedPageText(AbstractPageViewComponent pageComponent)Adds the specified page to the list of selected pages.voidclearSelectedPageText()Clears all pages in a selected state.voiddispose()Free resources associated with this model.UndoCaretakergetAnnotationCareTaker()AnnotationComponentgetCurrentAnnotation()Gets the currently selected annotationDocumentgetDocument()Gets the PDF document object associated with this views.HashMap<AbstractPageViewComponent,ArrayList<PageViewAnnotationComponent>>getDocumentViewAnnotationComponents()ArrayList<PageViewAnnotationComponent>getDocumentViewAnnotationComponents(AbstractPageViewComponent pageViewComponent)Gets all the annotation components that float in the DocumentView and are not bound by page dimensions.JScrollPanegetDocumentViewScrollPane()intgetPageBoundary()Gets the page boundary used to paint document pages.RectanglegetPageBounds(int pageIndex)Gets the page bound of the specified page Index.List<AbstractPageViewComponent>getPageComponents()Gets the page components associated with this view model.ArrayList<AbstractPageViewComponent>getSelectedPageText()Gets a list of document pages that have selected text elements.intgetViewCurrentPageIndex()Gets the current page index represented in this model.floatgetViewRotation()Gets the view rotation of the model.intgetViewToolMode()Gets the tool mode.floatgetViewZoom()Gets the view model zoom level.booleanisSelectAll()Returns true if all text in the document should be in a selected state.booleanisViewToolModeSelected(int viewToolMode)Checks if the specified tool mode is set in the view model.voidremoveAllFloatingAnnotationComponent(AbstractPageViewComponent pageViewComponent)voidremoveDocumentViewAnnotationComponent(DocumentView parentDocumentView, AbstractPageViewComponent pageViewComponent, PageViewAnnotationComponent annotationComponent)Removes an annotation component the list of floating annotation components that are painted in the DocumentView.voidremoveSelectedPageText(AbstractPageViewComponent pageComponent)Remove the specified page to the list of selected pages.voidsetCurrentAnnotation(AnnotationComponent currentAnnotation)Sets teh current annotationvoidsetDocumentViewScrollPane(JScrollPane documentViewScrollPane)voidsetPageBoundary(int pageBoundary)Sets the page boundry used to paint a page.voidsetSelectAll(boolean selectAll)Sets the selected all text state.booleansetViewCurrentPageIndex(int pageIndex)Sets the view model current page index.booleansetViewRotation(float viewRotation)Sets the view rotation of this model.booleansetViewToolMode(int viewToolMode)Sets the view tool mode.booleansetViewZoom(float viewZoom)Sets the models zoom level.
-
-
-
Field Detail
-
DISPLAY_TOOL_PAN
static final int DISPLAY_TOOL_PAN
Display tool constant for adding a pan tool.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_ZOOM_IN
static final int DISPLAY_TOOL_ZOOM_IN
Display tool constant for adding a zoom in tool.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_ZOOM_OUT
static final int DISPLAY_TOOL_ZOOM_OUT
Display tool constant for adding a zoom out tool.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_ZOOM_DYNAMIC
static final int DISPLAY_TOOL_ZOOM_DYNAMIC
Display tool constant for adding a zoom out tool.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_TEXT_SELECTION
static final int DISPLAY_TOOL_TEXT_SELECTION
Display tool constant for adding a text selection tool.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_SELECTION
static final int DISPLAY_TOOL_SELECTION
Display tool constant for adding a selection tool.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_LINK_ANNOTATION
static final int DISPLAY_TOOL_LINK_ANNOTATION
Display tool constant for creating new link annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_HIGHLIGHT_ANNOTATION
static final int DISPLAY_TOOL_HIGHLIGHT_ANNOTATION
Display tool constant for creating new highlight annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_UNDERLINE_ANNOTATION
static final int DISPLAY_TOOL_UNDERLINE_ANNOTATION
Display tool constant for creating new underline annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_SQUIGGLY_ANNOTATION
static final int DISPLAY_TOOL_SQUIGGLY_ANNOTATION
Display tool constant for creating new squiggly annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_STRIKEOUT_ANNOTATION
static final int DISPLAY_TOOL_STRIKEOUT_ANNOTATION
Display tool constant for creating new strikeout annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_LINE_ANNOTATION
static final int DISPLAY_TOOL_LINE_ANNOTATION
Display tool constant for creating new line annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_LINE_ARROW_ANNOTATION
static final int DISPLAY_TOOL_LINE_ARROW_ANNOTATION
Display tool constant for creating new line arrow annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_SQUARE_ANNOTATION
static final int DISPLAY_TOOL_SQUARE_ANNOTATION
Display tool constant for creating new square annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_CIRCLE_ANNOTATION
static final int DISPLAY_TOOL_CIRCLE_ANNOTATION
Display tool constant for creating new circle annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_INK_ANNOTATION
static final int DISPLAY_TOOL_INK_ANNOTATION
Display tool constant for creating new ink annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_FREE_TEXT_ANNOTATION
static final int DISPLAY_TOOL_FREE_TEXT_ANNOTATION
Display tool constant for creating new free text annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_TEXT_ANNOTATION
static final int DISPLAY_TOOL_TEXT_ANNOTATION
Display tool constant for creating new text annotation.- See Also:
- Constant Field Values
-
DISPLAY_TOOL_REDACTION_ANNOTATION
static final int DISPLAY_TOOL_REDACTION_ANNOTATION
- See Also:
- Constant Field Values
-
DISPLAY_TOOL_SIGNATURE_ANNOTATION
static final int DISPLAY_TOOL_SIGNATURE_ANNOTATION
- See Also:
- Constant Field Values
-
DISPLAY_TOOL_NONE
static final int DISPLAY_TOOL_NONE
Display tool constant for setting no tools- See Also:
- Constant Field Values
-
DISPLAY_TOOL_WAIT
static final int DISPLAY_TOOL_WAIT
Display tool constant for showing user that gui is busy- See Also:
- Constant Field Values
-
-
Method Detail
-
getDocument
Document getDocument()
Gets the PDF document object associated with this views.- Returns:
- PDF document which is associated with this view.
-
getSelectedPageText
ArrayList<AbstractPageViewComponent> getSelectedPageText()
Gets a list of document pages that have selected text elements. The pages are referenced so that they will be removed automatically if the memory manage needs to dispose of a page.- Returns:
- list Weakly referenced pages
-
addSelectedPageText
void addSelectedPageText(AbstractPageViewComponent pageComponent)
Adds the specified page to the list of selected pages.- Parameters:
pageComponent- pageView component to add to list.
-
removeSelectedPageText
void removeSelectedPageText(AbstractPageViewComponent pageComponent)
Remove the specified page to the list of selected pages.- Parameters:
pageComponent- pageView component to add to list.
-
isSelectAll
boolean isSelectAll()
Returns true if all text in the document should be in a selected state.- Returns:
- true if document is in select all text text state, false otherwise.
-
setSelectAll
void setSelectAll(boolean selectAll)
Sets the selected all text state.- Parameters:
selectAll- true to select all text, false otherwise.
-
clearSelectedPageText
void clearSelectedPageText()
Clears all pages in a selected state.
-
getPageComponents
List<AbstractPageViewComponent> getPageComponents()
Gets the page components associated with this view model.- Returns:
- vector of page components.
-
getDocumentViewAnnotationComponents
HashMap<AbstractPageViewComponent,ArrayList<PageViewAnnotationComponent>> getDocumentViewAnnotationComponents()
-
getDocumentViewAnnotationComponents
ArrayList<PageViewAnnotationComponent> getDocumentViewAnnotationComponents(AbstractPageViewComponent pageViewComponent)
Gets all the annotation components that float in the DocumentView and are not bound by page dimensions.- Returns:
- list of annotation components that should be added the document view
-
addDocumentViewAnnotationComponent
void addDocumentViewAnnotationComponent(AbstractPageViewComponent pageViewComponent, PageViewAnnotationComponent annotationComponent)
Adds an annotation component the list of floating annotation components that are painted in the DocumentView.- Parameters:
annotationComponent- annotation component to add
-
removeDocumentViewAnnotationComponent
void removeDocumentViewAnnotationComponent(DocumentView parentDocumentView, AbstractPageViewComponent pageViewComponent, PageViewAnnotationComponent annotationComponent)
Removes an annotation component the list of floating annotation components that are painted in the DocumentView.- Parameters:
annotationComponent- annotation component to remove
-
removeAllFloatingAnnotationComponent
void removeAllFloatingAnnotationComponent(AbstractPageViewComponent pageViewComponent)
-
setViewCurrentPageIndex
boolean setViewCurrentPageIndex(int pageIndex)
Sets the view model current page index.- Parameters:
pageIndex- zero based current pages page index of the document.- Returns:
- true if the page index could be set, false otherwise.
-
getViewCurrentPageIndex
int getViewCurrentPageIndex()
Gets the current page index represented in this model.- Returns:
- zero based page page index.
-
setViewZoom
boolean setViewZoom(float viewZoom)
Sets the models zoom level.- Parameters:
viewZoom- zoom value- Returns:
- true if the view zoom was set correctly otherwise, false.
-
getViewZoom
float getViewZoom()
Gets the view model zoom level.- Returns:
- zoom level of this view model
-
setViewRotation
boolean setViewRotation(float viewRotation)
Sets the view rotation of this model.- Parameters:
viewRotation- rotation in degrees- Returns:
- true if the view rotation was set correctly, otherwise false.
-
getViewRotation
float getViewRotation()
Gets the view rotation of the model.- Returns:
- view rotation of the model
-
setViewToolMode
boolean setViewToolMode(int viewToolMode)
Sets the view tool mode.- Parameters:
viewToolMode- selected tool mode, pan, zoom and et.- Returns:
- true if the view tool was set correctly, false otherwise.
-
getViewToolMode
int getViewToolMode()
Gets the tool mode.- Returns:
- tool mode.
-
isViewToolModeSelected
boolean isViewToolModeSelected(int viewToolMode)
Checks if the specified tool mode is set in the view model.- Parameters:
viewToolMode- tool model to check if selected.- Returns:
- true if specified tool mode is selected, otherwise false.
-
getPageBounds
Rectangle getPageBounds(int pageIndex)
Gets the page bound of the specified page Index.- Parameters:
pageIndex- zero based page index.- Returns:
- bounds of specified page. If page index. is not valid, null is returned.
-
dispose
void dispose()
Free resources associated with this model.
-
setPageBoundary
void setPageBoundary(int pageBoundary)
Sets the page boundry used to paint a page.- Parameters:
pageBoundary- page bounds
-
getPageBoundary
int getPageBoundary()
Gets the page boundary used to paint document pages.- Returns:
- page boundary type as defined in the class Page.
-
getCurrentAnnotation
AnnotationComponent getCurrentAnnotation()
Gets the currently selected annotation- Returns:
- currently selected annotations.
-
setCurrentAnnotation
void setCurrentAnnotation(AnnotationComponent currentAnnotation)
Sets teh current annotation- Parameters:
currentAnnotation- annotation to set as current
-
addMemento
void addMemento(Memento oldMementoState, Memento newMementoState)
Adds memento state to the care taker.- Parameters:
oldMementoState- original state.newMementoState- new state.
-
getDocumentViewScrollPane
JScrollPane getDocumentViewScrollPane()
-
setDocumentViewScrollPane
void setDocumentViewScrollPane(JScrollPane documentViewScrollPane)
-
getAnnotationCareTaker
UndoCaretaker getAnnotationCareTaker()
-
-