Package com.luciad.view.map.mgrs
Class TLcdMGRSGridStyle.Builder<B extends TLcdMGRSGridStyle.Builder<B>>
java.lang.Object
com.luciad.view.map.mgrs.TLcdMGRSGridStyle.Builder<B>
- Enclosing class:
TLcdMGRSGridStyle
public static class TLcdMGRSGridStyle.Builder<B extends TLcdMGRSGridStyle.Builder<B>>
extends Object
Builder for MGRS styles.
- Since:
- 2015.1
-
Method Summary
Modifier and TypeMethodDescriptionall
(TLcdMGRSGridStyle aMGRSStyle) Sets all parameters on the builder based on the given MGRS style.body()
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid lines.body
(TLcdMGRSGridStyle.MGRSLevel aMGRSLevel) After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid lines of the given level.body
(TLcdMGRSGridStyle.MGRSType aMgrsType) After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid lines of the given type (UTM or UPS).body
(TLcdMGRSGridStyle.MGRSType aMgrsType, TLcdMGRSGridStyle.MGRSLevel aMGRSLevel) After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid lines of the given type/level combination.build()
Creates a newTLcdMGRSGridStyle
from this builder.Creates a new default style with MGRS labels.Creates a new default style with UTM/UPS labels.This method specifies the font to use for the current MGRS type/level/interval combination.This method specifies the format pattern to use for the labels of the current MGRS type/level/interval combination.interval
(double aMin, double aMax) After calling this method, all subsequentlineColor()
,labelColor()
, ... calls will only apply to the given scale interval.label()
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid labels.label
(TLcdMGRSGridStyle.MGRSLevel aMGRSLevel) After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid labels of the given level.label
(TLcdMGRSGridStyle.MGRSType aMgrsType) After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid labels of the given type (UTM or UPS).label
(TLcdMGRSGridStyle.MGRSType aMgrsType, TLcdMGRSGridStyle.MGRSLevel aMGRSLevel) After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid labels of the given type/level combination.labelAntiAliasing
(boolean aAntiAliasing) This method specifies whether to use anti-aliasing during the painting of grid labels.labelColor
(Color aTextColor) This method specifies the text color to use for the current MGRS type/level/interval combination.labelHaloColor
(Color aLabelHaloColor) This method specifies the label halo color to use for the current MGRS type/level/interval combination.labelHaloThickness
(int aLabelHaloThickness) This method specifies the label halo thickness to use for the current MGRS type/level/interval combination.lineAntiAliasing
(boolean aAntiAliasing) This method specifies whether to use anti-aliasing during the painting of grid lines.This method specifies the line color to use for the current MGRS type/level/interval combination.lineWidth
(double aLineWidth) This method specifies the line width to use for the current MGRS type/level/interval combination.overlay()
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will only apply to all overlay labels.
-
Method Details
-
defaultMGRSGridStyle
Creates a new default style with MGRS labels.- Returns:
- a new default style with MGRS labels.
-
defaultUtmUpsGridStyle
Creates a new default style with UTM/UPS labels.- Returns:
- a new default style with UTM/UPS labels.
-
body
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid lines. This includes UTM as well as UPS, and all grid levels. For an example of how to use this method, seeTLcdMGRSGridStyle
.- Returns:
- this builder
-
body
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid lines of the given type (UTM or UPS). For an example of how to use this method, seeTLcdMGRSGridStyle
.- Parameters:
aMgrsType
- the MGRS type (UPS or UTM)- Returns:
- this builder
-
body
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid lines of the given level. For example, to all UTM 100K lines, and to all UPS 100K lines. For an example of how to use this method, seeTLcdMGRSGridStyle
.- Parameters:
aMGRSLevel
- the MGRS level- Returns:
- this builder
-
body
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid lines of the given type/level combination. For example, to all UTM 100K lines. For an example of how to use this method, seeTLcdMGRSGridStyle
.- Parameters:
aMgrsType
- the MGRS type (UTM or UPS)aMGRSLevel
- the MGRS level- Returns:
- this builder
-
label
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid labels. This includes UTM as well as UPS, and all grid levels. For an example of how to use this method, seeTLcdMGRSGridStyle
.- Returns:
- this builder
-
label
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid labels of the given type (UTM or UPS). For an example of how to use this method, seeTLcdMGRSGridStyle
.- Parameters:
aMgrsType
- the MGRS type (UPS or UTM)- Returns:
- this builder
-
label
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid labels of the given level. For example, to all UTM 100K labels, and to all UPS 100K labels. For an example of how to use this method, seeTLcdMGRSGridStyle
.- Parameters:
aMGRSLevel
- the MGRS level- Returns:
- this builder
-
label
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will apply to all grid labels of the given type/level combination. For example, to all UTM 100K labels. For an example of how to use this method, seeTLcdMGRSGridStyle
.- Parameters:
aMgrsType
- the MGRS type (UTM or UPS)aMGRSLevel
- the MGRS level- Returns:
- this builder
-
overlay
After calling this method, all subsequentinterval()
,lineColor()
,labelColor()
, ... calls will only apply to all overlay labels. See alsoTLcdMGRSGridOverlayLabelBuilder
. For an example of how to use this method, seeTLcdMGRSGridStyle
.- Returns:
- this builder
-
interval
After calling this method, all subsequentlineColor()
,labelColor()
, ... calls will only apply to the given scale interval. It is possible to define multiple scale intervals for every line or label type/level. In order to do this, the interval method (and its subsequent calls) can be called multiple times. When not calling this method after calling one of thebody
orlabel
methods, an interval from0
(completely zoomed out) toDouble.MAX_VALUE
(completely zoomed in ) is used. So if you want to use the same styles for every scale, this method should not be called. When specifying overlapping intervals, it's not specified, which styles will be used. It is advised to only specify non-overlapping intervals for the same (mgrs type/level/body or label) combination. For an example of how to use this method, seeTLcdMGRSGridStyle
.- Parameters:
aMin
- the minimum scaleaMax
- the maximum scale- Returns:
- this builder
-
lineWidth
This method specifies the line width to use for the current MGRS type/level/interval combination. For an example of how to use this method, seeTLcdMGRSGridStyle
. This method should be called at least once after calling one of thebody
orinterval
methods. Otherwise, default styling is used.- Parameters:
aLineWidth
- the line width to use.- Returns:
- this builder
-
lineColor
This method specifies the line color to use for the current MGRS type/level/interval combination. For an example of how to use this method, seeTLcdMGRSGridStyle
. This method should be called at least once after calling one of thebody
orinterval
methods. Otherwise, default styling is used.- Parameters:
aLineColor
- the line color to use.- Returns:
- this builder
-
font
This method specifies the font to use for the current MGRS type/level/interval combination. For an example of how to use this method, seeTLcdMGRSGridStyle
. This method should be called at least once after calling one of thelabel
orinterval
methods. Otherwise, a default font is used.- Parameters:
aFont
- the font to use.- Returns:
- this builder
-
labelColor
This method specifies the text color to use for the current MGRS type/level/interval combination. For an example of how to use this method, seeTLcdMGRSGridStyle
. This method should be called at least once after calling one of thelabel
orinterval
methods. Otherwise, a default text color is used.- Parameters:
aTextColor
- the text color to use.- Returns:
- this builder
-
labelHaloColor
This method specifies the label halo color to use for the current MGRS type/level/interval combination. For an example of how to use this method, seeTLcdMGRSGridStyle
. This method should be called at least once after calling one of thelabel
orinterval
methods. Otherwise, default styling is used.- Parameters:
aLabelHaloColor
- the halo color to use for the label text.- Returns:
- this builder
- See Also:
-
labelHaloThickness
This method specifies the label halo thickness to use for the current MGRS type/level/interval combination. To disable halos, this value can be set to 0. For an example of how to use this method, seeTLcdMGRSGridStyle
. This method should be called at least once after calling one of thelabel
orinterval
methods. Otherwise, a default label halo thickness is used.- Parameters:
aLabelHaloThickness
- the halo thickness to use for the label text.- Returns:
- this builder
- See Also:
-
lineAntiAliasing
This method specifies whether to use anti-aliasing during the painting of grid lines. The default istrue
.- Parameters:
aAntiAliasing
-true
to enable anti-aliasing when painting grid lines.- Returns:
- this builder
-
labelAntiAliasing
This method specifies whether to use anti-aliasing during the painting of grid labels. The default istrue
.- Parameters:
aAntiAliasing
-true
to enable anti-aliasing when painting grid labels.- Returns:
- this builder
-
format
This method specifies the format pattern to use for the labels of the current MGRS type/level/interval combination. This method has no effect for bodies. This pattern can be used to specify MGRS coordinates or UTM/UPS coordinates. If this method is not called, a default format is used. The format in BNF notation (expressions enclosed in[]
brackets are optional, expressions enclosed in{}
brackets may be omitted or repeated):<pattern> ::= [<zone>] [<separator> <band>] [<coordinates>] <zone> ::= "Z" <band> ::= "B" <coordinates> ::= <mgrs_coordinates> | <utm_coordinates> <mgrs_coordinates> ::= [<separator> <id100k>] [<separator> <x> <separator> <y>] <utm_coordinates> ::= [<separator> <u> <separator> <v>] <id100k> ::= "S" <x> ::= "X" <mgrs_precision> <y> ::= "Y" <mgrs_precision> <mgrs_precision> ::= "0" | "1" | "2" | "3" | "4" | "5" <u> ::= "U" <utm_precision> <v> ::= "V" <utm_precision> <utm_precision> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" <separator> ::= { ? any character ? }
For example:- "33UES 12345 54321" has format "ZBS X5 Y5"
- "33U 123456 7654321" has format "ZB U6 V7"
"12345"
or"1234"
is displayed).- Parameters:
aCoordinatePattern
- the pattern used to format the label text- Returns:
- this builder.
-
all
Sets all parameters on the builder based on the given MGRS style. This is useful for example to create a new style that has almost all properties equal to another style.- Parameters:
aMGRSStyle
- the MGRS style to copy- Returns:
- this styler
-
build
Creates a newTLcdMGRSGridStyle
from this builder.- Returns:
- a new
TLcdMGRSGridStyle
-