Class AreaUtils


  • public class AreaUtils
    extends Object
    General purpose area analysis functions.
    Author:
    burgetr
    • Constructor Detail

      • AreaUtils

        public AreaUtils()
    • Method Detail

      • isNeighbor

        public static boolean isNeighbor​(Area a1,
                                         Area a2)
        Checks if the given areas are in the same visual group (i.e. "are near each other").
        Parameters:
        a1 -
        a2 -
        Returns:
      • isOnSameLine

        public static boolean isOnSameLine​(Area a1,
                                           Area a2)
        Checks if the given areas are on the same line.
        Parameters:
        a1 -
        a2 -
        Returns:
      • isOnSameLine

        public static boolean isOnSameLine​(Area a1,
                                           Area a2,
                                           int threshold)
        Checks if the given areas are on the same line.
        Parameters:
        a1 -
        a2 -
        Returns:
      • isOnSameLineRoughly

        public static boolean isOnSameLineRoughly​(Area a1,
                                                  Area a2)
      • isLink

        public static boolean isLink​(Area a)
        Checks if the given area has a target URL assigned (it acts as a link)
        Parameters:
        a -
        Returns:
      • createSuperAreaFromVerticalRegion

        public static Area createSuperAreaFromVerticalRegion​(Area root,
                                                             Rectangular region)