Class CoreControls.DisplayMode
Represents a Display Mode.
Constructor Attributes | Constructor Name and Description |
---|---|
CoreControls.DisplayMode(docViewer, mode, scrollable)
Constructs a new Display Mode that specifies how the pages are displayed on the screen
|
Method Attributes | Method Name and Description |
---|---|
Creates the containers for all of the pages
|
|
GetPageOffset(pageIndex)
Returns the amount the amount the page is offset from its container
|
|
GetPageTransform(pageIndex)
Returns the amount the page is shifted relative to the viewport
|
|
GetSelectedPages(mousePt1, mousePt2)
Gets the indexes of the first and last pages selected.
|
|
GetVisiblePages(amountAhead)
Returns an array of page indexes that are visible on screen.
|
|
PageToWindow(pagePt, pageIndex)
Converts page coordinates to window coordinates.
|
|
SetParameters(nCols, nRows, currentRow, startRow, endRow)
Sets parameters of the display mode
|
|
storeContainerOffsets()
|
|
WindowToPage(windowPt, pageIndex)
Converts window coordinates to page coordinates.
|
Class Detail
CoreControls.DisplayMode(docViewer, mode, scrollable)
Constructs a new Display Mode that specifies how the pages are displayed on the screen
- Parameters:
- {object} docViewer
- The DocumentViewer instance
- {object} mode
- The display mode type
- {boolean} scrollable
- Whether the display mode is scrollable or not
Method Detail
CreatePageSections()
Creates the containers for all of the pages
{object}
GetPageOffset(pageIndex)
Returns the amount the amount the page is offset from its container
- Parameters:
- {number} pageIndex
- The index of the page
- Returns:
- {object} An object with x and y properties of the amount the page is offset from its container
{object}
GetPageTransform(pageIndex)
Returns the amount the page is shifted relative to the viewport
- Parameters:
- {number} pageIndex
- The index of the page
- Returns:
- {object} An object with x and y properties of the amount the page is shifted relative to the viewport and width and height properties of the page.
{object}
GetSelectedPages(mousePt1, mousePt2)
Gets the indexes of the first and last pages selected.
- Parameters:
- {object} mousePt1
- The starting mouse point, an object with x and y properties
- {object} mousePt2
- The ending mouse point, an object with x and y properties
- Returns:
- {object} An object with a 'first' property being the first page selected and a 'last' property being the last page selected. last must be >= first.
{number[]}
GetVisiblePages(amountAhead)
Returns an array of page indexes that are visible on screen.
- Parameters:
- {number} amountAhead Optional
- The amount of space ahead of the viewport to count as visible as a multiple of the screen height (default is 1)
- Returns:
- {number[]} an array of 0-indexed page numbers.
{object}
PageToWindow(pagePt, pageIndex)
Converts page coordinates to window coordinates.
- Parameters:
- {object} pagePt
- A object with x and y properties in page coordinates
- {number} pageIndex
- The page index
- Returns:
- {object} An object with the page index as well as x and y values in window coordinates
SetParameters(nCols, nRows, currentRow, startRow, endRow)
Sets parameters of the display mode
- Parameters:
- {number} nCols
- The number of columns
- {number} nRows
- The number of rows
- {number} currentRow
- The current row to be displayed
- {number} startRow
- The starting row to have in the DOM
- {number} endRow
- The ending row to have in the DOM
storeContainerOffsets()
{object}
WindowToPage(windowPt, pageIndex)
Converts window coordinates to page coordinates.
- Parameters:
- {object} windowPt
- A object with x and y properties in window coordinates
- {number} pageIndex
- The page index
- Returns:
- {object} An object with the page index as well as x and y values in page coordinates