Class DefaultAreaTree

    • Constructor Detail

      • DefaultAreaTree

        public DefaultAreaTree​(org.eclipse.rdf4j.model.IRI pageIri)
        Creates an area tree from a page.
        Parameters:
        pageIri - the IRI of the source page
      • DefaultAreaTree

        public DefaultAreaTree​(org.eclipse.rdf4j.model.IRI parentIri,
                               org.eclipse.rdf4j.model.IRI pageIri)
        Creates an area tree from another artifact
        Parameters:
        parentIri - the parent artifact IRI
        pageIri - the associated page IRI
      • DefaultAreaTree

        public DefaultAreaTree​(AreaTree src)
        Creates a copy of an area tree.
        Parameters:
        src - the source area tree
    • 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.
      • getPageIri

        public org.eclipse.rdf4j.model.IRI getPageIri()
        Description copied from interface: AreaTree
        Gets the IRI of the page the area tree was build from. This may be equal to the parent IRI when the tree was built from the page directly.
        Specified by:
        getPageIri in interface AreaTree
        Returns:
        the source page IRI
      • setPageIri

        public void setPageIri​(org.eclipse.rdf4j.model.IRI pageIri)
      • getRoot

        public Area getRoot()
        Description copied from interface: AreaTree
        Obtains the root node of the area tree.
        Specified by:
        getRoot in interface AreaTree
        Returns:
        the root node of the tree of areas
      • setRoot

        public void setRoot​(Area root)
      • updateTopologies

        public void updateTopologies()
        Description copied from interface: AreaTree
        Updates the topology structures (e.g. grids) for all the areas in the tree.
        Specified by:
        updateTopologies in interface AreaTree
      • getAreaAt

        public Area getAreaAt​(int x,
                              int y)
        Description copied from interface: SearchableAreaContainer
        Finds the bottom-most area node present at the given coordinates in the area tree.
        Specified by:
        getAreaAt in interface SearchableAreaContainer
        Parameters:
        x - the X coordinate
        y - the Y coordinate
        Returns:
        the area node present at the given coordinates or null when no node is found.
      • getAreasAt

        public List<Area> getAreasAt​(int x,
                                     int y)
        Description copied from interface: SearchableAreaContainer
        Finds all the area nodes present at the given coordinates in the area tree.
        Specified by:
        getAreasAt in interface SearchableAreaContainer
        Parameters:
        x - the X coordinate
        y - the Y coordinate
        Returns:
        a list of the area nodes present at the given coordinates ordered from the topmost to the bottommost one.
      • createArea

        public Area createArea​(Rectangular r)
        Description copied from interface: AreaTree
        Creates a new empty area in the tree.
        Specified by:
        createArea in interface AreaTree
        Parameters:
        r - the new area bounds.
        Returns:
        the new area
      • createArea

        public Area createArea​(Box box)
        Description copied from interface: AreaTree
        Creates a new area in the tree from a box.
        Specified by:
        createArea in interface AreaTree
        Parameters:
        box - source box
        Returns:
        the new area containing the box.
      • createArea

        public Area createArea​(Area other)
        Description copied from interface: AreaTree
        Creates a new area in the tree by copying another area.
        Specified by:
        createArea in interface AreaTree
        Parameters:
        other - the other area to copy
        Returns:
        the new area containing the box.
      • createArea

        public Area createArea​(List<Box> boxes)
        Description copied from interface: AreaTree
        Creates a new area in the tree from a list of boxes.
        Specified by:
        createArea in interface AreaTree
        Parameters:
        boxes - a list of boxes
        Returns:
        the new area containing all the boxes.
      • getNextAreaId

        protected int getNextAreaId()
      • setNextAreaId

        public void setNextAreaId​(int nextId)
      • updateNextAreaId

        public void updateNextAreaId()
      • getMaxAreaId

        public int getMaxAreaId​(Area root)