Class DefaultPage

    • Field Detail

      • url

        protected URL url
      • title

        protected String title
      • root

        protected Box root
      • width

        protected int width
      • height

        protected int height
      • pngImage

        protected byte[] pngImage
    • Constructor Detail

      • DefaultPage

        public DefaultPage​(URL url)
      • DefaultPage

        public DefaultPage​(Page src)
    • Method Detail

      • getArtifactType

        public org.eclipse.rdf4j.model.IRI getArtifactType()
        Description copied from interface: Artifact
        Gets the artifact type.
        Specified by:
        getArtifactType in interface Artifact
        Returns:
        the IRI of the artifact type.
      • getSourceURL

        public URL getSourceURL()
        Description copied from interface: Page
        Obtains the source URL of the page.
        Specified by:
        getSourceURL in interface Page
        Returns:
        the URL
      • getTitle

        public String getTitle()
        Description copied from interface: Page
        Obtains the page title specified using the <title> tag.
        Specified by:
        getTitle in interface Page
        Returns:
        the page title or an empty string when not set
      • setTitle

        public void setTitle​(String title)
      • getRoot

        public Box getRoot()
        Description copied from interface: Page
        Returns the root box of the page.
        Specified by:
        getRoot in interface Page
        Returns:
        the root box
      • setRoot

        public void setRoot​(Box root)
      • getWidth

        public int getWidth()
        Description copied from interface: Page
        Obtains the page width.
        Specified by:
        getWidth in interface Page
        Returns:
        the width in pixels
      • setWidth

        public void setWidth​(int width)
      • getHeight

        public int getHeight()
        Description copied from interface: Page
        Obtains the page height.
        Specified by:
        getHeight in interface Page
        Returns:
        the height in pixels
      • setHeight

        public void setHeight​(int height)
      • getPngImage

        public byte[] getPngImage()
        Description copied from interface: Page
        Gets the PNG image of the rendered page if provided by the renderer.
        Specified by:
        getPngImage in interface Page
        Returns:
        PNG image data array or null when the page image was not provided by the renderer.
      • setPngImage

        public void setPngImage​(byte[] pngImage)
      • getBoxesAt

        public List<Box> getBoxesAt​(int x,
                                    int y)
        Description copied from interface: Page
        Finds all the boxes that contain the given point within their visual bounds.
        Specified by:
        getBoxesAt in interface Page
        Parameters:
        x - The point X coordinate
        y - The point Y coordinate
        Returns:
        A list of boxes that contain [x, y] within their visual bounds.
      • getBoxesInRegion

        public List<Box> getBoxesInRegion​(Rectangular r)
        Description copied from interface: Page
        Finds the root boxes of subtrees that are fully contained in the given region based on their visual bounds.
        Specified by:
        getBoxesInRegion in interface Page
        Parameters:
        r - The region to be tested
        Returns:
        A list of subtree root boxes (possibly empty)
      • createBox

        public Box createBox()
        Description copied from interface: Page
        Creates a new empty box wihtin this page.
        Specified by:
        createBox in interface Page
        Returns:
        the new box
      • createBox

        public Box createBox​(Box src)
        Description copied from interface: Page
        Creates a new box within this page by copying an existing one.
        Specified by:
        createBox in interface Page
        Parameters:
        src - the source box to copy
        Returns:
        the new box
      • getNextBoxId

        protected int getNextBoxId()