Class Grid

    • Field Detail

      • DEFAULT_WIDTH

        public static final double DEFAULT_WIDTH
        Default line width
    • Constructor Detail

      • Grid

        protected Grid​(GridType type)
        Constructor
        Parameters:
        type - grid type
    • Method Detail

      • getType

        public GridType getType()
        Get the grid type
        Returns:
        grid type
      • isType

        public boolean isType​(GridType type)
        Is the provided grid type
        Parameters:
        type - grid type
        Returns:
        true if the type
      • getPrecision

        public int getPrecision()
        Get the precision in meters
        Returns:
        precision meters
      • isEnabled

        public boolean isEnabled()
        Is the grid enabled
        Returns:
        enabled flag
      • setEnabled

        protected void setEnabled​(boolean enabled)
        Set the enabled flag
        Parameters:
        enabled - enabled flag
      • getMinZoom

        public int getMinZoom()
        Get the minimum zoom level
        Returns:
        minimum zoom level
      • setMinZoom

        protected void setMinZoom​(int minZoom)
        Set the minimum zoom level
        Parameters:
        minZoom - minimum zoom level
      • getMaxZoom

        public Integer getMaxZoom()
        Get the maximum zoom level
        Returns:
        maximum zoom level
      • hasMaxZoom

        public boolean hasMaxZoom()
        Has a maximum zoom level
        Returns:
        true if has a maximum, false if unbounded
      • setMaxZoom

        protected void setMaxZoom​(Integer maxZoom)
        Set the maximum zoom level
        Parameters:
        maxZoom - maximum zoom level
      • isWithin

        public boolean isWithin​(int zoom)
        Is the zoom level within the grid zoom range
        Parameters:
        zoom - zoom level
        Returns:
        true if within range
      • getLinesMinZoom

        public int getLinesMinZoom()
        Get the minimum zoom level for drawing grid lines
        Returns:
        minimum zoom level
      • hasLinesMinZoom

        public boolean hasLinesMinZoom()
        Has a minimum zoom level override for drawing grid lines
        Returns:
        true if has a minimum, false if not overridden
      • setLinesMinZoom

        public void setLinesMinZoom​(Integer linesMinZoom)
        Set the minimum level override for drawing grid lines
        Parameters:
        linesMinZoom - minimum zoom level or null to remove
      • getLinesMaxZoom

        public Integer getLinesMaxZoom()
        Get the maximum zoom level for drawing grid lines
        Returns:
        maximum zoom level
      • hasLinesMaxZoom

        public boolean hasLinesMaxZoom()
        Has a maximum zoom level override for drawing grid lines
        Returns:
        true if has a maximum, false if not overridden
      • setLinesMaxZoom

        public void setLinesMaxZoom​(Integer linesMaxZoom)
        Set the maximum level override for drawing grid lines
        Parameters:
        linesMaxZoom - maximum zoom level or null to remove
      • isLinesWithin

        public boolean isLinesWithin​(int zoom)
        Is the zoom level within the grid lines zoom range
        Parameters:
        zoom - zoom level
        Returns:
        true if within range
      • getStyle

        public GridStyle getStyle()
        Get the grid line style
        Returns:
        grid line style
      • setStyle

        public void setStyle​(GridStyle style)
        Set the grid line style
        Parameters:
        style - grid line style
      • getColor

        public Color getColor()
        Get the grid line color
        Returns:
        grid line color
      • setColor

        public void setColor​(Color color)
        Set the grid line color
        Parameters:
        color - grid line color
      • getWidth

        public double getWidth()
        Get the grid line width
        Returns:
        grid line width
      • setWidth

        public void setWidth​(double width)
        Set the grid line width
        Parameters:
        width - grid line width
      • getStyle

        public GridStyle getStyle​(GridType gridType)
        Get the grid type precision line style for the grid type
        Parameters:
        gridType - grid type
        Returns:
        grid type line style
      • setStyle

        public void setStyle​(GridType gridType,
                             GridStyle style)
        Set the grid type precision line style
        Parameters:
        gridType - grid type
        style - grid line style
      • getColor

        public Color getColor​(GridType gridType)
        Get the grid type precision line color
        Parameters:
        gridType - grid type
        Returns:
        grid type line color
      • setColor

        public void setColor​(GridType gridType,
                             Color color)
        Set the grid type precision line color
        Parameters:
        gridType - grid type
        color - grid line color
      • getWidth

        public double getWidth​(GridType gridType)
        Get the grid type precision line width
        Parameters:
        gridType - grid type
        Returns:
        grid type line width
      • setWidth

        public void setWidth​(GridType gridType,
                             double width)
        Set the grid type precision line width
        Parameters:
        gridType - grid type
        width - grid line width
      • getLabeler

        public Labeler getLabeler()
        Get the grid labeler
        Returns:
        grid labeler
      • hasLabeler

        public boolean hasLabeler()
        Has a grid labeler
        Returns:
        true if has a grid labeler
      • setLabeler

        protected void setLabeler​(Labeler labeler)
        Set the grid labeler
        Parameters:
        labeler - grid labeler
      • getLines

        public List<Line> getLines​(MGRSTile tile,
                                   GridZone zone)
        Get the lines for the tile and zone
        Parameters:
        tile - tile
        zone - grid zone
        Returns:
        lines
      • getLines

        public List<Line> getLines​(int zoom,
                                   Bounds tileBounds,
                                   GridZone zone)
        Get the lines for the zoom, tile bounds, and zone
        Parameters:
        zoom - zoom level
        tileBounds - tile bounds
        zone - grid zone
        Returns:
        lines
      • getLines

        public List<Line> getLines​(Bounds tileBounds,
                                   GridZone zone)
        Get the lines for the tile bounds and zone
        Parameters:
        tileBounds - tile bounds
        zone - grid zone
        Returns:
        lines
      • getLabels

        public List<Label> getLabels​(MGRSTile tile,
                                     GridZone zone)
        Get the labels for the tile and zone
        Parameters:
        tile - tile
        zone - grid zone
        Returns:
        labels
      • getLabels

        public List<Label> getLabels​(int zoom,
                                     Bounds tileBounds,
                                     GridZone zone)
        Get the labels for the zoom, tile bounds, and zone
        Parameters:
        zoom - zoom level
        tileBounds - tile bounds
        zone - grid zone
        Returns:
        labels
      • getLabelBuffer

        public double getLabelBuffer()
        Get the label grid zone edge buffer
        Returns:
        label buffer (greater than or equal to 0.0 and less than 0.5)
      • getPrecisionCompare

        public int getPrecisionCompare()
        Get the precision in meters
        Returns:
        precision meters
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object