Class GroupAnalyzerByStyles


  • public class GroupAnalyzerByStyles
    extends GroupAnalyzer
    This group analyzer tries to expand the selected box to all directions stopping on whitespace separators. Only the areas with the same font properties are connected.
    Author:
    burgetr
    • Constructor Detail

      • GroupAnalyzerByStyles

        public GroupAnalyzerByStyles​(Area parent,
                                     int maxlevel,
                                     boolean matchstyles)
        Creates a new area analyzer.
        Parameters:
        parent - the area processed by the analyzer
        maxlevel - maximal level of the areas that can be joined into a super area
        matchstyles - defines whether to compare the element styles while expanding
    • Method Detail

      • findSuperArea

        public Area findSuperArea​(Area sub,
                                  List<Area> selected)
        Description copied from class: GroupAnalyzer
        Starts with a specified subarea and finds all the subareas that may be joined with the first one. Returns an empty area and the vector of the areas inside. The subareas are not automatically added to the new area because this would cause their removal from the parent area.
        Overrides:
        findSuperArea in class GroupAnalyzer
        Parameters:
        sub - the subnode to start with
        selected - a vector that will be filled with the selected subnodes that should be contained in the new area
        Returns:
        the new empty area