Package mil.nga.grid

Class BaseGrids<TGrid extends BaseGrid,​TZoomGrids extends BaseZoomGrids<TGrid>>

  • Type Parameters:
    TGrid - grid type
    TZoomGrids - zoom grids type

    public abstract class BaseGrids<TGrid extends BaseGrid,​TZoomGrids extends BaseZoomGrids<TGrid>>
    extends Object
    Grids
    Author:
    osbornb
    • Field Detail

      • properties

        protected final GridProperties properties
        Grid properties
    • Constructor Detail

      • BaseGrids

        public BaseGrids​(GridProperties properties)
        Constructor
        Parameters:
        properties - grid properties
    • Method Detail

      • getDefaultWidth

        public abstract double getDefaultWidth()
        Get the default grid line width
        Returns:
        width
      • grids

        public abstract Collection<TGrid> grids()
        Get the grids
        Returns:
        grids
      • newZoomGrids

        protected abstract TZoomGrids newZoomGrids​(int zoom)
        Create a new zoom grids
        Parameters:
        zoom - zoom level
        Returns:
        zoom grids
      • loadGrid

        protected void loadGrid​(TGrid grid,
                                String gridKey,
                                Boolean enabled,
                                Labeler labeler)
        Load the grid
        Parameters:
        grid - name
        gridKey - grid name key
        enabled - enable created grids
        labeler - grid labeler
      • loadGridStyleColor

        protected Color loadGridStyleColor​(String gridKey,
                                           String gridKey2)
        Load the grid style color
        Parameters:
        gridKey - grid name key
        gridKey2 - second grid name key
        Returns:
        color
      • loadGridStyleWidth

        protected Double loadGridStyleWidth​(String gridKey,
                                            String gridKey2)
        Load the grid style width
        Parameters:
        gridKey - grid name key
        gridKey2 - second grid name key
        Returns:
        width
      • getGridStyle

        protected GridStyle getGridStyle​(Color color,
                                         Double width,
                                         TGrid grid)
        Get a combined grid style from the provided color, width, and grid
        Parameters:
        color - color
        width - width
        grid - grid
        Returns:
        grid style
      • createZoomGrids

        protected void createZoomGrids()
        Create the zoom level grids
      • getGrids

        public TZoomGrids getGrids​(int zoom)
        Get the grids for the zoom level
        Parameters:
        zoom - zoom level
        Returns:
        grids
      • enableGrids

        public void enableGrids​(TGrid... grids)
        Enable grids
        Parameters:
        grids - grids
      • enableGrids

        public void enableGrids​(Collection<TGrid> grids)
        Enable grids
        Parameters:
        grids - grids
      • disableGrids

        public void disableGrids​(TGrid... grids)
        Disable grids
        Parameters:
        grids - grids
      • disableGrids

        public void disableGrids​(Collection<TGrid> grids)
        Disable grids
        Parameters:
        grids - grids
      • enable

        public void enable​(TGrid grid)
        Enable the grid
        Parameters:
        grid - grid
      • disable

        public void disable​(TGrid grid)
        Disable the grid
        Parameters:
        grid - grid
      • setMinZoom

        public void setMinZoom​(TGrid grid,
                               int minZoom)
        Set the grid minimum zoom
        Parameters:
        grid - grid
        minZoom - minimum zoom
      • setMaxZoom

        public void setMaxZoom​(TGrid grid,
                               Integer maxZoom)
        Set the grid maximum zoom
        Parameters:
        grid - grid
        maxZoom - maximum zoom
      • setZoomRange

        public void setZoomRange​(TGrid grid,
                                 int minZoom,
                                 Integer maxZoom)
        Set the grid zoom range
        Parameters:
        grid - grid
        minZoom - minimum zoom
        maxZoom - maximum zoom
      • enableAllLabelers

        public void enableAllLabelers()
        Enable all grid labelers
      • setAllLabelBuffers

        public void setAllLabelBuffers​(double buffer)
        Set all label grid edge buffers
        Parameters:
        buffer - label buffer (greater than or equal to 0.0 and less than 0.5)