Package mil.nga.mgrs.grid
Class Grids
- java.lang.Object
-
- mil.nga.grid.BaseGrids<Grid,ZoomGrids>
-
- mil.nga.mgrs.grid.Grids
-
-
Field Summary
-
Fields inherited from class mil.nga.grid.BaseGrids
properties
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Grids
create()
Create with all grid types enabledstatic Grids
create(Collection<GridType> types)
Create with grids to enablestatic Grids
create(GridType... types)
Create with grids to enablestatic Grids
createGZD()
Create only Grid Zone Designator gridsvoid
deletePropagatedStyles()
Delete propagated stylesvoid
deletePropagatedStyles(Collection<GridType> types)
Delete propagated styles for the grid typesvoid
deletePropagatedStyles(GridType type)
Delete propagated styles for the grid typevoid
deletePropagatedStyles(GridType... types)
Delete propagated styles for the grid typesvoid
disable(GridType type)
Disable the grid typevoid
disableAllLabelers()
Disable all grid labelersvoid
disableLabeler(GridType type)
Disable the grid type labelervoid
disableLabelers(Collection<GridType> types)
Disable the labelers for the grid typesvoid
disableLabelers(GridType... types)
Disable the labelers for the grid typesvoid
disableTypes(Collection<GridType> types)
Disable grid typesvoid
disableTypes(GridType... types)
Disable grid typesvoid
enable(GridType type)
Enable the grid typevoid
enableLabeler(GridType type)
Enable the grid type labelervoid
enableLabelers(Collection<GridType> types)
Enable the labelers for the grid typesvoid
enableLabelers(GridType... types)
Enable the labelers for the grid typesvoid
enableTypes(Collection<GridType> types)
Enable grid typesvoid
enableTypes(GridType... types)
Enable grid typesdouble
getDefaultWidth()
Grid
getGrid(GridType type)
Get the griddouble
getLabelBuffer(GridType type)
Get the label grid zone edge bufferGridLabeler
getLabeler(GridType type)
Get the labeler for the grid typeGridType
getPrecision(int zoom)
Get the grid precision for the zoom levelCollection<Grid>
grids()
boolean
hasLabeler(GridType type)
Has a labeler for the grid typeboolean
isEnabled(GridType type)
Is the grid type enabledboolean
isLabelerEnabled(GridType type)
Is a labeler enabled for the grid typeprotected Grid
newGrid(GridType type)
Create a new grid, override to create a specialized gridprotected ZoomGrids
newZoomGrids(int zoom)
void
setAllColors(Color color)
Set all grid line colorsvoid
setAllLabelColors(Color color)
Set all label colorsvoid
setAllLabelTextSizes(double textSize)
Set all label text sizesvoid
setAllWidths(double width)
Set all grid line widthsvoid
setColor(Collection<GridType> types, Color color)
Set the grid line color for the grid typesvoid
setColor(Collection<GridType> types, GridType precisionType, Color color)
Set the grid type precision line color for the grid typesvoid
setColor(Color color, GridType... types)
Set the grid line color for the grid typesvoid
setColor(GridType type, Collection<GridType> precisionTypes, Color color)
Set the grid type precision line colors for the grid typevoid
setColor(GridType type, Color color)
Set the grid line color for the grid typevoid
setColor(GridType type, Color color, GridType... precisionTypes)
Set the grid type precision line colors for the grid typevoid
setColor(GridType type, GridType precisionType, Color color)
Set the grid type precision line color for the grid typevoid
setGrids(Collection<Grid> grids)
Set the active gridsvoid
setGrids(Grid... grids)
Set the active gridsvoid
setGrids(GridType... types)
Set the active grid typesvoid
setGridTypes(Collection<GridType> types)
Set the active grid typesvoid
setLabelBuffer(double buffer, GridType... types)
Set the label grid zone edge buffer for the grid typesvoid
setLabelBuffer(Collection<GridType> types, double buffer)
Set the label grid zone edge buffer for the grid typesvoid
setLabelBuffer(GridType type, double buffer)
Set the label grid zone edge buffervoid
setLabelColor(Collection<GridType> types, Color color)
Set the label color for the grid typesvoid
setLabelColor(Color color, GridType... types)
Set the label color for the grid typesvoid
setLabelColor(GridType type, Color color)
Set the label colorvoid
setLabeler(GridType type, GridLabeler labeler)
Set the labeler for the grid typevoid
setLabelMaxZoom(GridType type, Integer maxZoom)
Set the grid maximum zoomvoid
setLabelMinZoom(GridType type, int minZoom)
Set the grid minimum zoomvoid
setLabelTextSize(double textSize, GridType... types)
Set the label text size for the grid typesvoid
setLabelTextSize(Collection<GridType> types, double textSize)
Set the label text size for the grid typesvoid
setLabelTextSize(GridType type, double textSize)
Set the label text sizevoid
setLabelZoomRange(GridType type, int minZoom, Integer maxZoom)
Set the grid zoom rangevoid
setLinesMaxZoom(GridType type, Integer maxZoom)
Set the grid maximum level override for drawing grid linesvoid
setLinesMinZoom(GridType type, Integer minZoom)
Set the grid minimum level override for drawing grid linesvoid
setMaxZoom(GridType type, Integer maxZoom)
Set the grid maximum zoomvoid
setMinZoom(GridType type, int minZoom)
Set the grid minimum zoomvoid
setWidth(double width, GridType... types)
Set the grid line width for the grid typesvoid
setWidth(Collection<GridType> types, double width)
Set the grid line width for the grid typesvoid
setWidth(Collection<GridType> types, GridType precisionType, double width)
Set the grid type precision line width for the grid typesvoid
setWidth(GridType type, double width)
Set the grid line width for the grid typevoid
setWidth(GridType type, double width, GridType... precisionTypes)
Set the grid type precision line widths for the grid typevoid
setWidth(GridType type, Collection<GridType> precisionTypes, double width)
Set the grid type precision line widths for the grid typevoid
setWidth(GridType type, GridType precisionType, double width)
Set the grid type precision line width for the grid typevoid
setZoomRange(GridType type, int minZoom, Integer maxZoom)
Set the grid zoom range-
Methods inherited from class mil.nga.grid.BaseGrids
createZoomGrids, disable, disableGrids, disableGrids, enable, enableAllLabelers, enableGrids, enableGrids, getGrids, getGridStyle, loadGrid, loadGridStyleColor, loadGridStyleWidth, setAllLabelBuffers, setMaxZoom, setMinZoom, setZoomRange
-
-
-
-
Constructor Detail
-
Grids
public Grids()
Constructor, all grid types enabled per property configurations
-
Grids
public Grids(GridType... types)
Constructor- Parameters:
types
- grid types to enable
-
Grids
public Grids(Collection<GridType> types)
Constructor- Parameters:
types
- grid types to enable
-
-
Method Detail
-
create
public static Grids create()
Create with all grid types enabled- Returns:
- grids
-
create
public static Grids create(GridType... types)
Create with grids to enable- Parameters:
types
- grid types to enable- Returns:
- grids
-
create
public static Grids create(Collection<GridType> types)
Create with grids to enable- Parameters:
types
- grid types to enable- Returns:
- grids
-
createGZD
public static Grids createGZD()
Create only Grid Zone Designator grids- Returns:
- grids
-
getDefaultWidth
public double getDefaultWidth()
- Specified by:
getDefaultWidth
in classBaseGrids<Grid,ZoomGrids>
-
newGrid
protected Grid newGrid(GridType type)
Create a new grid, override to create a specialized grid- Parameters:
type
- grid type- Returns:
- grid
-
newZoomGrids
protected ZoomGrids newZoomGrids(int zoom)
- Specified by:
newZoomGrids
in classBaseGrids<Grid,ZoomGrids>
-
getPrecision
public GridType getPrecision(int zoom)
Get the grid precision for the zoom level- Parameters:
zoom
- zoom level- Returns:
- grid type precision
-
setGrids
public void setGrids(GridType... types)
Set the active grid types- Parameters:
types
- grid types
-
setGrids
public void setGrids(Grid... grids)
Set the active grids- Parameters:
grids
- grids
-
setGridTypes
public void setGridTypes(Collection<GridType> types)
Set the active grid types- Parameters:
types
- grid types
-
setGrids
public void setGrids(Collection<Grid> grids)
Set the active grids- Parameters:
grids
- grids
-
enableTypes
public void enableTypes(GridType... types)
Enable grid types- Parameters:
types
- grid types
-
enableTypes
public void enableTypes(Collection<GridType> types)
Enable grid types- Parameters:
types
- grid types
-
disableTypes
public void disableTypes(GridType... types)
Disable grid types- Parameters:
types
- grid types
-
disableTypes
public void disableTypes(Collection<GridType> types)
Disable grid types- Parameters:
types
- grid types
-
isEnabled
public boolean isEnabled(GridType type)
Is the grid type enabled- Parameters:
type
- grid type- Returns:
- true if enabled
-
enable
public void enable(GridType type)
Enable the grid type- Parameters:
type
- grid type
-
disable
public void disable(GridType type)
Disable the grid type- Parameters:
type
- grid type
-
setMinZoom
public void setMinZoom(GridType type, int minZoom)
Set the grid minimum zoom- Parameters:
type
- grid typeminZoom
- minimum zoom
-
setMaxZoom
public void setMaxZoom(GridType type, Integer maxZoom)
Set the grid maximum zoom- Parameters:
type
- grid typemaxZoom
- maximum zoom
-
setZoomRange
public void setZoomRange(GridType type, int minZoom, Integer maxZoom)
Set the grid zoom range- Parameters:
type
- grid typeminZoom
- minimum zoommaxZoom
- maximum zoom
-
setLinesMinZoom
public void setLinesMinZoom(GridType type, Integer minZoom)
Set the grid minimum level override for drawing grid lines- Parameters:
type
- grid typeminZoom
- minimum zoom level or null to remove
-
setLinesMaxZoom
public void setLinesMaxZoom(GridType type, Integer maxZoom)
Set the grid maximum level override for drawing grid lines- Parameters:
type
- grid typemaxZoom
- maximum zoom level or null to remove
-
setAllColors
public void setAllColors(Color color)
Set all grid line colors- Parameters:
color
- grid line color
-
setColor
public void setColor(Color color, GridType... types)
Set the grid line color for the grid types- Parameters:
color
- grid line colortypes
- grid types
-
setColor
public void setColor(Collection<GridType> types, Color color)
Set the grid line color for the grid types- Parameters:
types
- grid typescolor
- grid line color
-
setColor
public void setColor(GridType type, Color color)
Set the grid line color for the grid type- Parameters:
type
- grid typecolor
- grid line color
-
setAllWidths
public void setAllWidths(double width)
Set all grid line widths- Parameters:
width
- grid line width
-
setWidth
public void setWidth(double width, GridType... types)
Set the grid line width for the grid types- Parameters:
width
- grid line widthtypes
- grid types
-
setWidth
public void setWidth(Collection<GridType> types, double width)
Set the grid line width for the grid types- Parameters:
types
- grid typeswidth
- grid line width
-
setWidth
public void setWidth(GridType type, double width)
Set the grid line width for the grid type- Parameters:
type
- grid typewidth
- grid line width
-
deletePropagatedStyles
public void deletePropagatedStyles()
Delete propagated styles
-
deletePropagatedStyles
public void deletePropagatedStyles(GridType... types)
Delete propagated styles for the grid types- Parameters:
types
- grid types
-
deletePropagatedStyles
public void deletePropagatedStyles(Collection<GridType> types)
Delete propagated styles for the grid types- Parameters:
types
- grid types
-
deletePropagatedStyles
public void deletePropagatedStyles(GridType type)
Delete propagated styles for the grid type- Parameters:
type
- grid type
-
setColor
public void setColor(Collection<GridType> types, GridType precisionType, Color color)
Set the grid type precision line color for the grid types- Parameters:
types
- grid typesprecisionType
- precision grid typecolor
- grid line color
-
setColor
public void setColor(GridType type, Color color, GridType... precisionTypes)
Set the grid type precision line colors for the grid type- Parameters:
type
- grid typecolor
- grid line colorprecisionTypes
- precision grid types
-
setColor
public void setColor(GridType type, Collection<GridType> precisionTypes, Color color)
Set the grid type precision line colors for the grid type- Parameters:
type
- grid typeprecisionTypes
- precision grid typescolor
- grid line color
-
setColor
public void setColor(GridType type, GridType precisionType, Color color)
Set the grid type precision line color for the grid type- Parameters:
type
- grid typeprecisionType
- precision grid typecolor
- grid line color
-
setWidth
public void setWidth(Collection<GridType> types, GridType precisionType, double width)
Set the grid type precision line width for the grid types- Parameters:
types
- grid typesprecisionType
- precision grid typewidth
- grid line width
-
setWidth
public void setWidth(GridType type, double width, GridType... precisionTypes)
Set the grid type precision line widths for the grid type- Parameters:
type
- grid typewidth
- grid line widthprecisionTypes
- precision grid types
-
setWidth
public void setWidth(GridType type, Collection<GridType> precisionTypes, double width)
Set the grid type precision line widths for the grid type- Parameters:
type
- grid typeprecisionTypes
- precision grid typeswidth
- grid line width
-
setWidth
public void setWidth(GridType type, GridType precisionType, double width)
Set the grid type precision line width for the grid type- Parameters:
type
- grid typeprecisionType
- precision grid typewidth
- grid line width
-
getLabeler
public GridLabeler getLabeler(GridType type)
Get the labeler for the grid type- Parameters:
type
- grid type- Returns:
- labeler or null
-
hasLabeler
public boolean hasLabeler(GridType type)
Has a labeler for the grid type- Parameters:
type
- grid type- Returns:
- true if has labeler
-
setLabeler
public void setLabeler(GridType type, GridLabeler labeler)
Set the labeler for the grid type- Parameters:
type
- grid typelabeler
- labeler
-
disableAllLabelers
public void disableAllLabelers()
Disable all grid labelers
-
enableLabelers
public void enableLabelers(GridType... types)
Enable the labelers for the grid types- Parameters:
types
- grid types
-
enableLabelers
public void enableLabelers(Collection<GridType> types)
Enable the labelers for the grid types- Parameters:
types
- grid types
-
disableLabelers
public void disableLabelers(GridType... types)
Disable the labelers for the grid types- Parameters:
types
- grid types
-
disableLabelers
public void disableLabelers(Collection<GridType> types)
Disable the labelers for the grid types- Parameters:
types
- grid types
-
isLabelerEnabled
public boolean isLabelerEnabled(GridType type)
Is a labeler enabled for the grid type- Parameters:
type
- grid type- Returns:
- true if labeler enabled
-
enableLabeler
public void enableLabeler(GridType type)
Enable the grid type labeler- Parameters:
type
- grid type
-
disableLabeler
public void disableLabeler(GridType type)
Disable the grid type labeler- Parameters:
type
- grid type
-
setLabelMinZoom
public void setLabelMinZoom(GridType type, int minZoom)
Set the grid minimum zoom- Parameters:
type
- grid typeminZoom
- minimum zoom
-
setLabelMaxZoom
public void setLabelMaxZoom(GridType type, Integer maxZoom)
Set the grid maximum zoom- Parameters:
type
- grid typemaxZoom
- maximum zoom
-
setLabelZoomRange
public void setLabelZoomRange(GridType type, int minZoom, Integer maxZoom)
Set the grid zoom range- Parameters:
type
- grid typeminZoom
- minimum zoommaxZoom
- maximum zoom
-
setLabelBuffer
public void setLabelBuffer(double buffer, GridType... types)
Set the label grid zone edge buffer for the grid types- Parameters:
buffer
- label buffer (greater than or equal to 0.0 and less than 0.5)types
- grid types
-
setLabelBuffer
public void setLabelBuffer(Collection<GridType> types, double buffer)
Set the label grid zone edge buffer for the grid types- Parameters:
types
- grid typesbuffer
- label buffer (greater than or equal to 0.0 and less than 0.5)
-
getLabelBuffer
public double getLabelBuffer(GridType type)
Get the label grid zone edge buffer- Parameters:
type
- grid type- Returns:
- label buffer (greater than or equal to 0.0 and less than 0.5)
-
setLabelBuffer
public void setLabelBuffer(GridType type, double buffer)
Set the label grid zone edge buffer- Parameters:
type
- grid typebuffer
- label buffer (greater than or equal to 0.0 and less than 0.5)
-
setAllLabelColors
public void setAllLabelColors(Color color)
Set all label colors- Parameters:
color
- label color
-
setLabelColor
public void setLabelColor(Color color, GridType... types)
Set the label color for the grid types- Parameters:
color
- label colortypes
- grid types
-
setLabelColor
public void setLabelColor(Collection<GridType> types, Color color)
Set the label color for the grid types- Parameters:
types
- grid typescolor
- label color
-
setLabelColor
public void setLabelColor(GridType type, Color color)
Set the label color- Parameters:
type
- grid typecolor
- label color
-
setAllLabelTextSizes
public void setAllLabelTextSizes(double textSize)
Set all label text sizes- Parameters:
textSize
- label text size
-
setLabelTextSize
public void setLabelTextSize(double textSize, GridType... types)
Set the label text size for the grid types- Parameters:
textSize
- label text sizetypes
- grid types
-
setLabelTextSize
public void setLabelTextSize(Collection<GridType> types, double textSize)
Set the label text size for the grid types- Parameters:
types
- grid typestextSize
- label text size
-
setLabelTextSize
public void setLabelTextSize(GridType type, double textSize)
Set the label text size- Parameters:
type
- grid typetextSize
- label text size
-
-