Package mil.nga.mgrs.grid
Class Grid
- java.lang.Object
 - 
- mil.nga.grid.BaseGrid
 - 
- mil.nga.mgrs.grid.Grid
 
 
 
- 
- All Implemented Interfaces:
 Comparable<Grid>
public class Grid extends BaseGrid implements Comparable<Grid>
Grid- Author:
 - wnewman, osbornb
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_WIDTHDefault line width 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearPrecisionStyles()Clear the propagated grid type precision stylesintcompareTo(Grid other)booleanequals(Object obj)ColorgetColor(GridType gridType)Get the grid type precision line colorGridLabelergetLabeler()Get the grid labelerList<GridLabel>getLabels(int zoom, Bounds tileBounds, GridZone zone)Get the labels for the zoom, tile bounds, and zoneList<GridLabel>getLabels(GridTile tile, GridZone zone)Get the labels for the tile and zoneList<GridLine>getLines(int zoom, Bounds tileBounds, GridZone zone)Get the lines for the zoom, tile bounds, and zoneList<GridLine>getLines(Bounds tileBounds, GridZone zone)Get the lines for the tile bounds and zoneList<GridLine>getLines(GridTile tile, GridZone zone)Get the lines for the tile and zoneintgetPrecision()Get the precision in metersintgetPrecisionCompare()Get the precision in metersGridStylegetStyle(GridType gridType)Get the grid type precision line style for the grid typeGridTypegetType()Get the grid typedoublegetWidth(GridType gridType)Get the grid type precision line widthinthashCode()booleanisType(GridType type)Is the provided grid typevoidsetColor(GridType gridType, Color color)Set the grid type precision line colorprotected voidsetLabeler(GridLabeler labeler)Set the grid labelervoidsetStyle(GridType gridType, GridStyle style)Set the grid type precision line stylevoidsetWidth(GridType gridType, double width)Set the grid type precision line width- 
Methods inherited from class mil.nga.grid.BaseGrid
getColor, getLabelBuffer, getLinesMaxZoom, getLinesMinZoom, getMaxZoom, getMinZoom, getStyle, getWidth, hasLabeler, hasLinesMaxZoom, hasLinesMinZoom, hasMaxZoom, isEnabled, isLabelerWithin, isLinesWithin, isWithin, setColor, setEnabled, setLabeler, setLinesMaxZoom, setLinesMinZoom, setMaxZoom, setMinZoom, setStyle, setWidth 
 - 
 
 - 
 
- 
- 
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
 
 
- 
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 typestyle- grid line style
 
- 
clearPrecisionStyles
public void clearPrecisionStyles()
Clear the propagated grid type precision styles 
- 
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 typecolor- 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 typewidth- grid line width
 
- 
getLabeler
public GridLabeler getLabeler()
Get the grid labeler- Overrides:
 getLabelerin classBaseGrid- Returns:
 - grid labeler
 
 
- 
setLabeler
protected void setLabeler(GridLabeler labeler)
Set the grid labeler- Parameters:
 labeler- grid labeler
 
- 
getLines
public List<GridLine> getLines(GridTile tile, GridZone zone)
Get the lines for the tile and zone- Parameters:
 tile- tilezone- grid zone- Returns:
 - lines
 
 
- 
getLines
public List<GridLine> getLines(int zoom, Bounds tileBounds, GridZone zone)
Get the lines for the zoom, tile bounds, and zone- Parameters:
 zoom- zoom leveltileBounds- tile boundszone- grid zone- Returns:
 - lines
 
 
- 
getLines
public List<GridLine> getLines(Bounds tileBounds, GridZone zone)
Get the lines for the tile bounds and zone- Parameters:
 tileBounds- tile boundszone- grid zone- Returns:
 - lines
 
 
- 
getLabels
public List<GridLabel> getLabels(GridTile tile, GridZone zone)
Get the labels for the tile and zone- Parameters:
 tile- tilezone- grid zone- Returns:
 - labels
 
 
- 
getLabels
public List<GridLabel> getLabels(int zoom, Bounds tileBounds, GridZone zone)
Get the labels for the zoom, tile bounds, and zone- Parameters:
 zoom- zoom leveltileBounds- tile boundszone- grid zone- Returns:
 - labels
 
 
- 
compareTo
public int compareTo(Grid other)
- Specified by:
 compareToin interfaceComparable<Grid>
 
- 
getPrecisionCompare
public int getPrecisionCompare()
Get the precision in meters- Returns:
 - precision meters
 
 
 - 
 
 -