Package mil.nga.mgrs.grid
Class Grids
- java.lang.Object
-
- mil.nga.mgrs.grid.Grids
-
public class Grids extends Object
Grids- Author:
- osbornb
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Gridscreate()Create with all grid types enabledstatic Gridscreate(Collection<GridType> types)Create with grids to enablestatic Gridscreate(GridType... types)Create with grids to enablestatic GridscreateGZD()Create only Grid Zone Designator gridsvoiddisable(Grid grid)Disable the gridvoiddisable(GridType type)Disable the grid typevoiddisableAllLabelers()Disable all grid labelersvoiddisableGrids(Collection<Grid> grids)Disable gridsvoiddisableGrids(Grid... grids)Disable gridsvoiddisableLabeler(GridType type)Disable the grid type labelervoiddisableLabelers(Collection<GridType> types)Disable the labelers for the grid typesvoiddisableLabelers(GridType... types)Disable the labelers for the grid typesvoiddisableTypes(Collection<GridType> types)Disable grid typesvoiddisableTypes(GridType... types)Disable grid typesvoidenable(Grid grid)Enable the gridvoidenable(GridType type)Enable the grid typevoidenableAllLabelers()Enable all grid labelersvoidenableGrids(Collection<Grid> grids)Enable gridsvoidenableGrids(Grid... grids)Enable gridsvoidenableLabeler(GridType type)Enable the grid type labelervoidenableLabelers(Collection<GridType> types)Enable the labelers for the grid typesvoidenableLabelers(GridType... types)Enable the labelers for the grid typesvoidenableTypes(Collection<GridType> types)Enable grid typesvoidenableTypes(GridType... types)Enable grid typesGridgetGrid(GridType type)Get the gridZoomGridsgetGrids(int zoom)Get the grids for the zoom leveldoublegetLabelBuffer(GridType type)Get the label grid zone edge bufferLabelergetLabeler(GridType type)Get the labeler for the grid typeGridTypegetPrecision(int zoom)Get the grid precision for the zoom levelbooleanhasLabeler(GridType type)Has a labeler for the grid typebooleanisEnabled(GridType type)Is the grid type enabledbooleanisLabelerEnabled(GridType type)Is a labeler enabled for the grid typeprotected GridnewGrid(GridType type)Create a new grid, override to create a specialized gridprotected ZoomGridsnewZoomGrids(int zoom)Create a new zoom grids, override for specialized gridsvoidsetAllColors(Color color)Set all grid line colorsvoidsetAllLabelBuffers(double buffer)Set all label grid zone edge buffersvoidsetAllLabelColors(Color color)Set all label colorsvoidsetAllLabelTextSizes(double textSize)Set all label text sizesvoidsetAllWidths(double width)Set all grid line widthsvoidsetColor(Collection<GridType> types, Color color)Set the grid line color for the grid typesvoidsetColor(Collection<GridType> types, GridType precisionType, Color color)Set the grid type precision line color for the grid typesvoidsetColor(Color color, GridType... types)Set the grid line color for the grid typesvoidsetColor(GridType type, Collection<GridType> precisionTypes, Color color)Set the grid type precision line colors for the grid typevoidsetColor(GridType type, Color color)Set the grid line color for the grid typevoidsetColor(GridType type, Color color, GridType... precisionTypes)Set the grid type precision line colors for the grid typevoidsetColor(GridType type, GridType precisionType, Color color)Set the grid type precision line color for the grid typevoidsetGrids(Collection<Grid> grids)Set the active gridsvoidsetGrids(Grid... grids)Set the active gridsvoidsetGrids(GridType... types)Set the active grid typesvoidsetGridTypes(Collection<GridType> types)Set the active grid typesvoidsetLabelBuffer(double buffer, GridType... types)Set the label grid zone edge buffer for the grid typesvoidsetLabelBuffer(Collection<GridType> types, double buffer)Set the label grid zone edge buffer for the grid typesvoidsetLabelBuffer(GridType type, double buffer)Set the label grid zone edge buffervoidsetLabelColor(Collection<GridType> types, Color color)Set the label color for the grid typesvoidsetLabelColor(Color color, GridType... types)Set the label color for the grid typesvoidsetLabelColor(GridType type, Color color)Set the label colorvoidsetLabeler(GridType type, Labeler labeler)Set the labeler for the grid typevoidsetLabelMaxZoom(GridType type, Integer maxZoom)Set the grid maximum zoomvoidsetLabelMinZoom(GridType type, int minZoom)Set the grid minimum zoomvoidsetLabelTextSize(double textSize, GridType... types)Set the label text size for the grid typesvoidsetLabelTextSize(Collection<GridType> types, double textSize)Set the label text size for the grid typesvoidsetLabelTextSize(GridType type, double textSize)Set the label text sizevoidsetLabelZoomRange(GridType type, int minZoom, Integer maxZoom)Set the grid zoom rangevoidsetLinesMaxZoom(GridType type, Integer maxZoom)Set the grid maximum level override for drawing grid linesvoidsetLinesMinZoom(GridType type, Integer minZoom)Set the grid minimum level override for drawing grid linesvoidsetMaxZoom(Grid grid, Integer maxZoom)Set the grid maximum zoomvoidsetMaxZoom(GridType type, Integer maxZoom)Set the grid maximum zoomvoidsetMinZoom(Grid grid, int minZoom)Set the grid minimum zoomvoidsetMinZoom(GridType type, int minZoom)Set the grid minimum zoomvoidsetWidth(double width, GridType... types)Set the grid line width for the grid typesvoidsetWidth(Collection<GridType> types, double width)Set the grid line width for the grid typesvoidsetWidth(Collection<GridType> types, GridType precisionType, double width)Set the grid type precision line width for the grid typesvoidsetWidth(GridType type, double width)Set the grid line width for the grid typevoidsetWidth(GridType type, double width, GridType... precisionTypes)Set the grid type precision line widths for the grid typevoidsetWidth(GridType type, Collection<GridType> precisionTypes, double width)Set the grid type precision line widths for the grid typevoidsetWidth(GridType type, GridType precisionType, double width)Set the grid type precision line width for the grid typevoidsetZoomRange(Grid grid, int minZoom, Integer maxZoom)Set the grid zoom rangevoidsetZoomRange(GridType type, int minZoom, Integer maxZoom)Set the grid zoom range
-
-
-
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
-
newGrid
protected Grid newGrid(GridType type)
Create a new grid, override to create a specialized grid- Parameters:
type- grid type- Returns:
- grid
-
getGrids
public ZoomGrids getGrids(int zoom)
Get the grids for the zoom level- Parameters:
zoom- zoom level- Returns:
- grids
-
newZoomGrids
protected ZoomGrids newZoomGrids(int zoom)
Create a new zoom grids, override for specialized grids- Parameters:
zoom- zoom level- Returns:
- zoom grids
-
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
-
enableGrids
public void enableGrids(Grid... grids)
Enable grids- Parameters:
grids- grids
-
enableTypes
public void enableTypes(Collection<GridType> types)
Enable grid types- Parameters:
types- grid types
-
enableGrids
public void enableGrids(Collection<Grid> grids)
Enable grids- Parameters:
grids- grids
-
disableTypes
public void disableTypes(GridType... types)
Disable grid types- Parameters:
types- grid types
-
disableGrids
public void disableGrids(Grid... grids)
Disable grids- Parameters:
grids- grids
-
disableTypes
public void disableTypes(Collection<GridType> types)
Disable grid types- Parameters:
types- grid types
-
disableGrids
public void disableGrids(Collection<Grid> grids)
Disable grids- Parameters:
grids- grids
-
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
-
enable
public void enable(Grid grid)
Enable the grid- Parameters:
grid- grid
-
disable
public void disable(GridType type)
Disable the grid type- Parameters:
type- grid type
-
disable
public void disable(Grid grid)
Disable the grid- Parameters:
grid- grid
-
setMinZoom
public void setMinZoom(GridType type, int minZoom)
Set the grid minimum zoom- Parameters:
type- grid typeminZoom- minimum zoom
-
setMinZoom
public void setMinZoom(Grid grid, int minZoom)
Set the grid minimum zoom- Parameters:
grid- gridminZoom- minimum zoom
-
setMaxZoom
public void setMaxZoom(GridType type, Integer maxZoom)
Set the grid maximum zoom- Parameters:
type- grid typemaxZoom- maximum zoom
-
setMaxZoom
public void setMaxZoom(Grid grid, Integer maxZoom)
Set the grid maximum zoom- Parameters:
grid- gridmaxZoom- 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
-
setZoomRange
public void setZoomRange(Grid grid, int minZoom, Integer maxZoom)
Set the grid zoom range- Parameters:
grid- gridminZoom- 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
-
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 Labeler 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, Labeler labeler)
Set the labeler for the grid type- Parameters:
type- grid typelabeler- labeler
-
enableAllLabelers
public void enableAllLabelers()
Enable all grid labelers
-
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
-
setAllLabelBuffers
public void setAllLabelBuffers(double buffer)
Set all label grid zone edge buffers- Parameters:
buffer- label buffer (greater than or equal to 0.0 and less than 0.5)
-
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
-
-