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 GridProperties
properties
Grid 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 void
createZoomGrids()
Create the zoom level gridsvoid
disable(TGrid grid)
Disable the gridvoid
disableGrids(Collection<TGrid> grids)
Disable gridsvoid
disableGrids(TGrid... grids)
Disable gridsvoid
enable(TGrid grid)
Enable the gridvoid
enableAllLabelers()
Enable all grid labelersvoid
enableGrids(Collection<TGrid> grids)
Enable gridsvoid
enableGrids(TGrid... grids)
Enable gridsabstract double
getDefaultWidth()
Get the default grid line widthTZoomGrids
getGrids(int zoom)
Get the grids for the zoom levelprotected GridStyle
getGridStyle(Color color, Double width, TGrid grid)
Get a combined grid style from the provided color, width, and gridabstract Collection<TGrid>
grids()
Get the gridsprotected void
loadGrid(TGrid grid, String gridKey, Boolean enabled, Labeler labeler)
Load the gridprotected Color
loadGridStyleColor(String gridKey, String gridKey2)
Load the grid style colorprotected Double
loadGridStyleWidth(String gridKey, String gridKey2)
Load the grid style widthprotected abstract TZoomGrids
newZoomGrids(int zoom)
Create a new zoom gridsvoid
setAllLabelBuffers(double buffer)
Set all label grid edge buffersvoid
setMaxZoom(TGrid grid, Integer maxZoom)
Set the grid maximum zoomvoid
setMinZoom(TGrid grid, int minZoom)
Set the grid minimum zoomvoid
setZoomRange(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)
-
-