Class AreaListGridTopology

    • Method Detail

      • getTopologyWidth

        public int getTopologyWidth()
        Description copied from interface: AreaTopology
        Obtains the total width of the topology used for placing the child areas within this area.
        Specified by:
        getTopologyWidth in interface AreaTopology
        Returns:
        the topology width; the units depend on the used topology
      • getTopologyHeight

        public int getTopologyHeight()
        Description copied from interface: AreaTopology
        Obtains the total height of the topology used for placing the child areas within this area.
        Specified by:
        getTopologyHeight in interface AreaTopology
        Returns:
        the topology height; the units depend on the topology
      • getTopologyPosition

        public Rectangular getTopologyPosition()
        Description copied from interface: AreaTopology
        Obtains the absolute position of the whole topology within the page.
        Specified by:
        getTopologyPosition in interface AreaTopology
        Returns:
        the absolute position of this topology
      • getPosition

        public Rectangular getPosition​(ContentRect area)
        Description copied from interface: AreaTopology
        Obtains the position of the given area within this topology.
        Specified by:
        getPosition in interface AreaTopology
        Parameters:
        area - The area whose position we want to obtain.
        Returns:
        The area position in this topology or null when the area position is not described by this topology.
      • setPosition

        public void setPosition​(ContentRect area,
                                Rectangular gp)
        Description copied from interface: AreaTopology
        Sets the position of the given area in this topology.
        Specified by:
        setPosition in interface AreaTopology
        Parameters:
        area - The area whose position we want to set.
        gp - The new position.
      • getPositionMap

        public Map<ContentRect,​Rectangular> getPositionMap()
        Description copied from interface: AreaTopology
        Obtains a map assigning a position to each area. Note that the efficiency of this method greatly depends on the topology implementation.
        Specified by:
        getPositionMap in interface AreaTopology
        Returns:
        A map assigning a position to the individual areas. The key set contains all the areas in the topology.
      • findAreaAt

        public ContentRect findAreaAt​(int x,
                                      int y)
        Description copied from interface: AreaTopology
        Finds an area at the specified position in the grid. If there are multiple areas sharing the same position, the first of them is returned in a non-deterministic way. Therefore, this method should be used for topologies that do not allow overlapping areas.
        Specified by:
        findAreaAt in interface AreaTopology
        Parameters:
        x - the x coordinate of the grid cell
        y - the y coordinate of the grid cell
        Returns:
        the area at the specified position or null when there is no such area
      • findAllAreasAt

        public Collection<ContentRect> findAllAreasAt​(int x,
                                                      int y)
        Description copied from interface: AreaTopology
        Finds all the areas at the specified position in the grid.
        Specified by:
        findAllAreasAt in interface AreaTopology
        Parameters:
        x - the x coordinate of the grid cell
        y - the y coordinate of the grid cell
        Returns:
        the collection of areas at the specified position or an empty collection when there is no such area
      • findAllAreasIntersecting

        public Collection<ContentRect> findAllAreasIntersecting​(Rectangular r)
        Description copied from interface: AreaTopology
        Finds all the areas that intersect with the specified rectangle in the grid.
        Specified by:
        findAllAreasIntersecting in interface AreaTopology
        Parameters:
        r - the the rectangle to intersect with
        Returns:
        the collection of areas at the specified position or an empty collection when there is no such area
      • toPixelPosition

        public Rectangular toPixelPosition​(Rectangular gp)
        Description copied from interface: AreaTopology
        Translates the bounds in the topology to pixel bounds.
        Specified by:
        toPixelPosition in interface AreaTopology
        Parameters:
        gp - the position within the topology
        Returns:
        the pixle position
      • toPixelPositionAbsolute

        public Rectangular toPixelPositionAbsolute​(Rectangular gp)
        Description copied from interface: AreaTopology
        Translates the bounds in the topology to absolute pixel bounds.
        Specified by:
        toPixelPositionAbsolute in interface AreaTopology
        Parameters:
        gp - the position within the topology
        Returns:
        the pixle position
      • toTopologyX

        public int toTopologyX​(int pixelX)
        Description copied from interface: AreaTopology
        Translates the X coordinate from pixels to topology position
        Specified by:
        toTopologyX in interface AreaTopology
        Parameters:
        pixelX - the pixel X coordinate
        Returns:
        the topology X coordinate
      • toTopologyY

        public int toTopologyY​(int pixelY)
        Description copied from interface: AreaTopology
        Translates the Y coordinate from pixels to topology position
        Specified by:
        toTopologyY in interface AreaTopology
        Parameters:
        pixelY - the pixel Y coordinate
        Returns:
        the topology Y coordinate
      • update

        public void update()
        Description copied from interface: AreaTopology
        Recomputes the topology. This should be used when the underlying areas have changed (some areas have been added, removed or resized).
        Specified by:
        update in interface AreaTopology
      • drawLayout

        public void drawLayout​(OutputDisplay disp)
        Description copied from interface: AreaTopology
        Graphically displays the topology on a graphical output device.
        Specified by:
        drawLayout in interface AreaTopology
        Parameters:
        disp - the ouptut display to be used
      • computeAreaBounds

        protected Rectangular computeAreaBounds()
        Obtains the absolute bounds of the parent area where the child areas are positioned.
        Returns:
        The absloute area bounds in pixels.