Interface JadicePageView

  • All Superinterfaces:
    com.google.gwt.user.client.ui.IsWidget, MenuContributor, ViewComponent
    All Known Subinterfaces:
    PageView

    public interface JadicePageView
    extends com.google.gwt.user.client.ui.IsWidget, ViewComponent
    Original interface as it is known from the Jadice document platform.
    • Method Detail

      • setDocument

        void setDocument​(Document doc)
        Changes the document reference to be displayed within this page view instance.
        Parameters:
        doc - the document to set
        Throws:
        IllegalStateException - if the calling thread is not the @ link EventQueue Event Dispatch Thread}
      • getRenderControlsInventory

        RenderControlInventory getRenderControlsInventory()
        Returns the currently used RenderControlInventory by this JadicePageView.

        To support multi viewer usage of one single document instance, viewers always works on snapshots of document render control inventories. As a consequence, changes done to this snapshot inventory are not recognized by any other JadicePageView instance and the lifetime of this snapshot ends when the document will be exchanged with a call of setDocument(Document).

        If developers want to change render settings in a render control inventory, it is strongly recommended to use only one of the two following recommended ways:
        Recommendation
        Document is used in at least in one viewer? Recommended way to do changes
        Yes Use getRenderControlsInventory() method of the target JadicePageView instance and do the changes.
        It is not a guaranteed feature that the concluded changes are recognized by the target JadicePageView instance. It is up to the developer to decide based on the type of changes whether to force a JadicePageView update or not.
        Returns:
        the currently used RenderControlInventory instance
      • getCurrentPage

        Page getCurrentPage()
        Return the current page.
        Returns:
        the current page or null if there is none.
      • getPageAt

        com.levigo.jadice.web.client.viewer.internal.LaidOutPage getPageAt​(Point p)
        Get the LaidOutPage at the given position or null if there is no such page.
        Parameters:
        p - Point in px coordinates
        Returns:
        an ArrangedPage
      • getPageAt

        com.levigo.jadice.web.client.viewer.internal.LaidOutPage getPageAt​(Point p,
                                                                           boolean ignoreDistantPages)
        Get the LaidOutPage at the given position or null if there is no such page.
        Parameters:
        p - Point in px coordinates
        ignoreDistantPages - whether pages should be ignored which are far away from the given point
        Returns:
        an LaidOutPage
      • getDocumentControls

        RenderControls getDocumentControls()
        Returns the render controls for the current document. If no current document is available, a default render controls object will be returned.

        Modifications of the render controls are allowed, but should be done carefully. The recommended way to change render controls should be done via a reference of a RenderControlInventory. See the getRenderControlsInventory() comment for the recommended ways.

        Returns:
        the document controls
      • getCurrentPageControls

        RenderControls getCurrentPageControls()

        Returns the render controls of the current page. Modifications of the render controls are allowed, but should be done carefully. The recommended way to change render controls should be done via the RenderControlInventory.

        If no render control is available for the current page, the document render control will be returned.

        Returns:
        the render controls reference of the current page, either based on a per-page controls instance or the document controls.
      • getPageControls

        RenderControls getPageControls​(Page page)

        Returns the render controls of the given page. Modifications of the render controls are allowed, but should be done carefully. The recommended way to change render controls should be done via the RenderControlInventory.

        If no render control is available for the given page, the document render control will be returned.

        Parameters:
        page - the page the lookup should be done for
        Returns:
        the render controls reference of the given page, either based on a per-page controls instance or the document controls.
      • getPageControls

        RenderControls getPageControls​(Page Page,
                                       boolean create)
        Returns the render controls of the given page.

        If no render controls is available for given page, the create parameter decides whether it should be created and returned. If the create parameter is false and no page render controls is available, the document render controls will be returned.

        Modifications of the render controls are allowed, but should be done carefully. The recommended way to change render controls should be done via a reference of a RenderControlInventory. See getRenderControlsInventory() comment for the recommended ways.

        Parameters:
        Page - the page the lookup should be done for
        create - whether a render controls instance should be created if not available
        Returns:
        the render controls reference of the given page. If no render controls instance is available for the given page, the parameter create decides, whether a new one should be created or not. If not available and it should not be created, the document render controls will be returned.
        Throws:
        IllegalArgumentException - if the given page is null
      • setCurrentPageIndex

        @Deprecated
        void setCurrentPageIndex​(int i)
        Deprecated.
        Use setCurrentPage() instead (in order to support filtered documents)
        Navigate to the given page number. This is a zero-based index.
        Parameters:
        i - the page index to be navigated to
        Throws:
        NullPointerException - if there is no document to be displayed
        IllegalStateException - if the calling thread is not the @ link EventQueue Event Dispatch Thread}
      • setCurrentPage

        void setCurrentPage​(Page page)
        Navigate to the given page.
        Parameters:
        page - the page to be navigated to
      • getCurrentPageIndex

        int getCurrentPageIndex()
        Return the current page index. This is a zero-based value.
        It is up to the page layout to determine the current page index. Please note that, depending on the page layout, the current page number may or may not be the one you most recently navigated to.
        In other words:
        pageView.setCurrentPageIndex(x); assert pageView.getCurrentPageIndex() == x; Does not necessarily hold.
        Returns:
        the current page number as determined by the current page layout.
      • getPageCount

        int getPageCount()
        Convenience getter for the total number of pages. If there is a document, it is equivalent to getDocument().getPageCount(). Otherwise it returns 0.
        Returns:
        the document's page count or 0
      • getPanPoint

        Point getPanPoint()
        Return the coordinate of the top left point of the current page's visible area in document units. This is equivalent to getCurrentPageVisibleBounds() .getLocation() .
        Returns:
        the pan point
      • getCurrentPageVisibleBounds

        Rectangle getCurrentPageVisibleBounds()
        Get the bounds of the viewport with respect to the currently focused page. The bounds are normalized to document space.
        Returns:
        Rectangle the intersection of the viewport bounds and visible page part
      • repaint

        void repaint()
        Description copied from interface: ViewComponent
        Repaints this component.

        If this component is a lightweight component, this method causes a call to this component's paint method as soon as possible. Otherwise, this method causes a call to this component's update method as soon as possible.

        Specified by:
        repaint in interface ViewComponent
      • repaint

        void repaint​(Page p)
        Repaint all of the given page.
        Specified by:
        repaint in interface ViewComponent
        Parameters:
        p - the page to repaint
      • repaint

        void repaint​(Page p,
                     Rectangle2D boundsDU)
        Repaint all of the given page.
        Specified by:
        repaint in interface ViewComponent
        Parameters:
        p - the page to repaint
        boundsDU - the bounds within the page to repaint.
      • cleanup

        void cleanup()
        Clean up this view by removing a document currently being displayed. Also multiple ressources are freed. When removing the viewer associated with this page view this method should be called to prevent a memory leak.
        Specified by:
        cleanup in interface ViewComponent
      • getPresentationRuleManager

        PresentationRuleManager getPresentationRuleManager()
        Returns:
        the PresentationRuleManager