Interface PageLayout


public interface PageLayout
PageLayouts are responsible for laying out pages to be displayed in a PageView.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    com.levigo.jadice.web.client.viewer.internal.LaidOutPage
    findPageNextTo(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.LaidOutPage
    getCurrentPage(Rectangle visibleRect, double percentage)
    Returns the rendered page belonging to the given rectangle.
    com.levigo.jadice.web.client.viewer.internal.LaidOutPage
    Return the rendered page for the given page, or null if 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.
    void
    init(PageView pageView)
    Initialize the Layout
    void
    setBorder(com.levigo.jadice.web.client.border.internal.BorderSettings<?> border)
    Sets the Border around the Pages
    void
    Set the index of the current page.
    void
     
    void
    setPageList(List<Page> pageList)
    Set the current document.
    void
    Sets the visible Rectangle of the Page
  • Method Details

    • init

      void init(PageView pageView)
      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 units
      percentage - 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

      com.levigo.jadice.web.client.viewer.internal.LaidOutPage getLaidOutPage(Page p)
      Return the rendered page for the given page, or null if 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

      void setPageList(List<Page> pageList)
      Set the current document.
      Parameters:
      pageList - the list of pages
    • setVisibleRect

      void setVisibleRect(Rectangle rect)
      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. Return null if 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()