Interface Area

    • Method Detail

      • setName

        void setName​(String name)
        Sets the name of the area that may be later used for its identification using getName().
        Parameters:
        name - the name to be set
      • getName

        String getName()
        Obtains the area name.
        Returns:
        the area name set previously using setName(String) or a default name when nothing has been previously set.
      • getAreaTree

        AreaTree getAreaTree()
        Obtains the tree the node belongs to.
        Returns:
        the tree or null when the node does not form part of any tree.
      • setAreaTree

        void setAreaTree​(AreaTree tree)
      • addBox

        void addBox​(Box box)
        Adds a new box to the area.
        Parameters:
        box - the box to add
      • getBoxes

        List<Box> getBoxes()
        Returns the list of boxes that belong directly to this area.
        Returns:
        the list of boxes (possibly empty)
      • getAllBoxes

        List<Box> getAllBoxes()
        Obtains all the boxes from this area and all the child areas.
        Returns:
        The list of boxes
      • getText

        String getText​(String separator)
        Deprecated.
        Deprecated in favor of getText(AreaConcatenator)
        Returns the complete text contained in this area and its sub area. The individual areas are separated by the given string separator.
        Parameters:
        separator - the string separating the individual areas
        Returns:
        A text string (possibly empty)
      • getText

        String getText​(AreaConcatenator concatenator)
        Returns the complete text contained in this area and its sub areas concatenated using the specified concatenator.
        Parameters:
        concatenator - The concatenator to be used to join the areas (and boxes in leaf areas)
        Returns:
        A text string (possibly empty)
      • isReplaced

        boolean isReplaced()
        Checks whether this area is formed by replaced boxes.
        Returns:
        true if the area contains replaced boxes only
      • getLevel

        int getLevel()
        Area grouping level. Area level 0 corresponds to the areas formed by boxes, greater numbers represent greater level of grouping (artificial areas).
        Returns:
        the area level
      • setLevel

        void setLevel​(int level)
        Sets the area level. Area level 0 corresponds to the areas formed by boxes, greater numbers represent greater level of grouping (artificial areas).
        Parameters:
        level - the new level to set.
      • setBorderStyle

        void setBorderStyle​(Border.Side side,
                            Border style)
        Sets the style of the box border at the given side.
        Parameters:
        side - the border side.
        style - the new border style
      • getTopology

        AreaTopology getTopology()
        Returns the topology of this area.
        Returns:
        The area topology.
      • setGridPosition

        void setGridPosition​(Rectangular gp)
        Sets the grid position of this area within the parent topology.
        Parameters:
        gp - the new grid position
      • getGridPosition

        Rectangular getGridPosition()
        Gets the grid position of this area within the parent topology.
        Returns:
        the grid position or a unit rectangle when there is no parent
      • updateTopologies

        void updateTopologies()
        Updates the topologies of the child areas. This should be called when some nodes have been inserted, removed or changed in this area.
      • getEffectiveBackgroundColor

        Color getEffectiveBackgroundColor()
        Obtains the effective background color visible under the area.
        Returns:
        The background color.
      • isHorizontalSeparator

        boolean isHorizontalSeparator()
        Checks whether the area can be interpreted as a horizontal separator.
        Returns:
        true when this area is a horizontal separator
      • isVerticalSeparator

        boolean isVerticalSeparator()
        Checks whether the area can be interpreted as a vertical separator.
        Returns:
        true when this area is a vertical separator
      • isSeparator

        boolean isSeparator()
        Checks whether the area can be interpreted as any kind of separator.
        Returns:
        true when this area is a separator
      • isExplicitlySeparated

        boolean isExplicitlySeparated()
        When set to true, the area is considered to be separated from other areas explicitly, i.e. independently on its real borders or background. This is usually used for some new superareas.
        Returns:
        true, if the area is explicitly separated
      • setExplicitlySeparated

        void setExplicitlySeparated​(boolean explicitlySeparated)
        When set to true, the area is considered to be separated from other areas explicitly, i.e. independently on its real borders or background. This is usually used for some new superareas.
        Parameters:
        explicitlySeparated - true, if the area should be explicitly separated
      • createSuperArea

        Area createSuperArea​(Rectangular gp,
                             List<Area> selected,
                             String name)
        Creates a new subarea from a specified region of the area and moves the selected child nodes to the new area.
        Parameters:
        gp - the subarea bounds
        selected - nodes to be moved to the new area
        name - the name (identification) of the new area
        Returns:
        the new AreaNode created in the tree or null, if nothing was created
      • insertParent

        void insertParent​(Area newParent,
                          Area child)
        Inserts a new area as a new parent of the given child area. The given area is replaced by the new parent and it becomes a child area of the parent.
        Parameters:
        newParent - the new parent area (replacement)
        child - the child area that should be replaced
      • copy

        Area copy()
        Creates a copy of the area and makes it a next sibling of the source area.
        Returns:
        the new area