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 double
DEFAULT_WIDTH
Default line width
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearPrecisionStyles()
Clear the propagated grid type precision stylesint
compareTo(Grid other)
boolean
equals(Object obj)
Color
getColor(GridType gridType)
Get the grid type precision line colorGridLabeler
getLabeler()
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 zoneint
getPrecision()
Get the precision in metersint
getPrecisionCompare()
Get the precision in metersGridStyle
getStyle(GridType gridType)
Get the grid type precision line style for the grid typeGridType
getType()
Get the grid typedouble
getWidth(GridType gridType)
Get the grid type precision line widthint
hashCode()
boolean
isType(GridType type)
Is the provided grid typevoid
setColor(GridType gridType, Color color)
Set the grid type precision line colorprotected void
setLabeler(GridLabeler labeler)
Set the grid labelervoid
setStyle(GridType gridType, GridStyle style)
Set the grid type precision line stylevoid
setWidth(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:
getLabeler
in 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:
compareTo
in interfaceComparable<Grid>
-
getPrecisionCompare
public int getPrecisionCompare()
Get the precision in meters- Returns:
- precision meters
-
-