com.icesoft.pdf.views
Interface DocumentViewModel

All Known Implementing Classes:
AbstractDocumentViewModel

public interface DocumentViewModel

The DocumentViewModel interface contains common accessors and modifiers needed to represent a document view state.

Since:
2.5
See Also:
AbstractDocumentViewModel

Field Summary
static int DISPLAY_TOOL_NONE
          Display tool constant for setting no tools
static int DISPLAY_TOOL_PAN
          Display tool constant for adding a pan tool.
static int DISPLAY_TOOL_WAIT
          Display tool constant for showing user that gui is busy
static int DISPLAY_TOOL_ZOOM_IN
          Display tool constant for adding a zoom in tool.
static int DISPLAY_TOOL_ZOOM_OUT
          Display tool constant for adding a zoom out tool.
 
Method Summary
 void dispose()
          Free resources associated with this model.
 void executePageInitialization(Runnable runnable)
           
 void executePagePainter(Runnable runnable)
           
 Document getDocument()
          Gets the PDF document object associated with this views.
 Rectangle getPageBounds(int pageIndex)
          Gets the page bound of the specified page Index.
 Vector getPageComponents()
          Gets the page components associated with this view model.
 int getViewCurrentPageIndex()
          Gets the current page index represented in this model.
 float getViewRotation()
          Gets the view rotation of the model.
 int getViewToolMode()
          Gets the tool mode.
 float getViewZoom()
          Gets the view model zoom level.
 boolean isViewToolModeSelected(int viewToolMode)
          Checks if the specified tool mode is set in the view model.
 boolean setViewCurrentPageIndex(int pageIndex)
          Sets the view model current page index.
 boolean setViewRotation(float viewRotation)
          Sets the view rotaiton of this model.
 boolean setViewToolMode(int viewToolMode)
          Sets the view tool mode.
 boolean setViewZoom(float viewZoom)
          Sets the models zoom level.
 

Field Detail

DISPLAY_TOOL_PAN

public static final int DISPLAY_TOOL_PAN
Display tool constant for adding a pan tool.

See Also:
Constant Field Values

DISPLAY_TOOL_ZOOM_IN

public 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

public static final int DISPLAY_TOOL_ZOOM_OUT
Display tool constant for adding a zoom out tool.

See Also:
Constant Field Values

DISPLAY_TOOL_NONE

public static final int DISPLAY_TOOL_NONE
Display tool constant for setting no tools

See Also:
Constant Field Values

DISPLAY_TOOL_WAIT

public static final int DISPLAY_TOOL_WAIT
Display tool constant for showing user that gui is busy

See Also:
Constant Field Values
Method Detail

getDocument

public Document getDocument()
Gets the PDF document object associated with this views.

Returns:
PDF document which is associated with this view.

executePageInitialization

public void executePageInitialization(Runnable runnable)
                               throws InterruptedException
Throws:
InterruptedException

executePagePainter

public void executePagePainter(Runnable runnable)
                        throws InterruptedException
Throws:
InterruptedException

getPageComponents

public Vector getPageComponents()
Gets the page components associated with this view model.

Returns:
vector of page components.

setViewCurrentPageIndex

public 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

public int getViewCurrentPageIndex()
Gets the current page index represented in this model.

Returns:
zero based page page index.

setViewZoom

public boolean setViewZoom(float viewZoom)
Sets the models zoom level.

Parameters:
viewZoom -
Returns:
true if the view zoom was set correctly otherwise, false.

getViewZoom

public float getViewZoom()
Gets the view model zoom level.

Returns:
zoom level of this view model

setViewRotation

public boolean setViewRotation(float viewRotation)
Sets the view rotaiton of this model.

Parameters:
viewRotation -
Returns:
true if the view rotation was set correctly, otherwise false.

getViewRotation

public float getViewRotation()
Gets the view rotation of the model.

Returns:
view rotation of the model

setViewToolMode

public boolean setViewToolMode(int viewToolMode)
Sets the view tool mode.

Parameters:
viewToolMode -
Returns:
true if the view tool was set correctly, false otherwise.

getViewToolMode

public int getViewToolMode()
Gets the tool mode.

Returns:
tool mode.

isViewToolModeSelected

public 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

public 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

public void dispose()
Free resources associated with this model.