Interface PageLayout
public interface PageLayout
PageLayouts are responsible for laying out pages to be displayed in a
PageView.-
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()com.levigo.jadice.web.client.viewer.internal.LaidOutPagefindPageNextTo(Point p, boolean ignoreDistantPages) Find the page closest to the given point.Return the bounds encompassing the bounds of all rendered pages.com.levigo.jadice.web.client.viewer.internal.LaidOutPagegetCurrentPage(Rectangle visibleRect, double percentage) Returns the rendered page belonging to the given rectangle.com.levigo.jadice.web.client.viewer.internal.LaidOutPageReturn the rendered page for the given page, ornullif the given page is not currently supposed to be rendered.List<com.levigo.jadice.web.client.viewer.internal.LaidOutPage> Return the list of rendered pages.voidInitialize the LayoutvoidsetBorder(com.levigo.jadice.web.client.border.internal.BorderSettings<?> border) Sets the Border around the PagesvoidsetCurrentPageIndex(int index) Set the index of the current page.voidsetDirty()voidsetPageList(List<Page> pageList) Set the current document.voidsetVisibleRect(Rectangle rect) Sets the visible Rectangle of the Page
-
Method Details
-
init
Initialize the Layout- Parameters:
pageView- the PageView, the Layout is added
-
setBorder
void setBorder(com.levigo.jadice.web.client.border.internal.BorderSettings<?> border) Sets the Border around the Pages- Parameters:
border- amount of Px around the Pages
-
setDirty
void setDirty() -
getAggregateBounds
Rectangle getAggregateBounds()Return the bounds encompassing the bounds of all rendered pages.- Returns:
- the bounds in display units
-
getCurrentPage
com.levigo.jadice.web.client.viewer.internal.LaidOutPage getCurrentPage(Rectangle visibleRect, double percentage) Returns the rendered page belonging to the given rectangle. Often, this is the current page. But sometimes, when a forced selection is performed instead of auto-selection, this page can differ from the current page.- Parameters:
visibleRect- the visible region in display unitspercentage- how far have we scrolled yet? 0.0 for the absolute top, 1.0 for the absolute bottom.- Returns:
- the RenderedPage or
null, if no page was found for the given area.
-
getLaidOutPages
List<com.levigo.jadice.web.client.viewer.internal.LaidOutPage> getLaidOutPages()Return the list of rendered pages. The RenderedPages are expected to be properly laid out, once they are returned by this method.- Returns:
- the list of rendered pages
-
getLaidOutPage
Return the rendered page for the given page, ornullif the given page is not currently supposed to be rendered.- Parameters:
p- the page for which the rendered page should be returned.- Returns:
- the rendered page corresponding to the given page or
null
-
setPageList
Set the current document.- Parameters:
pageList- the list of pages
-
setVisibleRect
Sets the visible Rectangle of the Page- Parameters:
rect- the visible rectangle
-
setCurrentPageIndex
void setCurrentPageIndex(int index) Set the index of the current page.- Parameters:
index- the page index
-
findPageNextTo
com.levigo.jadice.web.client.viewer.internal.LaidOutPage findPageNextTo(Point p, boolean ignoreDistantPages) Find the page closest to the given point. Returnnullif there is no page at all.- Parameters:
p- The given point.ignoreDistantPages- whether to ignore pages that are too far away- Returns:
- The rendered page.
-
cleanup
void cleanup()
-