Package mil.nga.grid
Class BaseGrids<TGrid extends BaseGrid,TZoomGrids extends BaseZoomGrids<TGrid>>
- java.lang.Object
 - 
- mil.nga.grid.BaseGrids<TGrid,TZoomGrids>
 
 
- 
- Type Parameters:
 TGrid- grid typeTZoomGrids- zoom grids type
public abstract class BaseGrids<TGrid extends BaseGrid,TZoomGrids extends BaseZoomGrids<TGrid>> extends Object
Grids- Author:
 - osbornb
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected GridPropertiespropertiesGrid properties 
- 
Constructor Summary
Constructors Constructor Description BaseGrids(GridProperties properties)Constructor 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcreateZoomGrids()Create the zoom level gridsvoiddisable(TGrid grid)Disable the gridvoiddisableGrids(Collection<TGrid> grids)Disable gridsvoiddisableGrids(TGrid... grids)Disable gridsvoidenable(TGrid grid)Enable the gridvoidenableAllLabelers()Enable all grid labelersvoidenableGrids(Collection<TGrid> grids)Enable gridsvoidenableGrids(TGrid... grids)Enable gridsabstract doublegetDefaultWidth()Get the default grid line widthTZoomGridsgetGrids(int zoom)Get the grids for the zoom levelprotected GridStylegetGridStyle(Color color, Double width, TGrid grid)Get a combined grid style from the provided color, width, and gridabstract Collection<TGrid>grids()Get the gridsprotected voidloadGrid(TGrid grid, String gridKey, Boolean enabled, Labeler labeler)Load the gridprotected ColorloadGridStyleColor(String gridKey, String gridKey2)Load the grid style colorprotected DoubleloadGridStyleWidth(String gridKey, String gridKey2)Load the grid style widthprotected abstract TZoomGridsnewZoomGrids(int zoom)Create a new zoom gridsvoidsetAllLabelBuffers(double buffer)Set all label grid edge buffersvoidsetMaxZoom(TGrid grid, Integer maxZoom)Set the grid maximum zoomvoidsetMinZoom(TGrid grid, int minZoom)Set the grid minimum zoomvoidsetZoomRange(TGrid grid, int minZoom, Integer maxZoom)Set the grid zoom range 
 - 
 
- 
- 
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- namegridKey- grid name keyenabled- enable created gridslabeler- grid labeler
 
- 
loadGridStyleColor
protected Color loadGridStyleColor(String gridKey, String gridKey2)
Load the grid style color- Parameters:
 gridKey- grid name keygridKey2- second grid name key- Returns:
 - color
 
 
- 
loadGridStyleWidth
protected Double loadGridStyleWidth(String gridKey, String gridKey2)
Load the grid style width- Parameters:
 gridKey- grid name keygridKey2- 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- colorwidth- widthgrid- 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- gridminZoom- minimum zoom
 
- 
setMaxZoom
public void setMaxZoom(TGrid grid, Integer maxZoom)
Set the grid maximum zoom- Parameters:
 grid- gridmaxZoom- maximum zoom
 
- 
setZoomRange
public void setZoomRange(TGrid grid, int minZoom, Integer maxZoom)
Set the grid zoom range- Parameters:
 grid- gridminZoom- minimum zoommaxZoom- 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)
 
 - 
 
 -