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 Details

    • defaultMGRSGridStyle

      public B defaultMGRSGridStyle()
      Creates a new default style with MGRS labels.
      Returns:
      a new default style with MGRS labels.
    • defaultUtmUpsGridStyle

      public B defaultUtmUpsGridStyle()
      Creates a new default style with UTM/UPS labels.
      Returns:
      a new default style with UTM/UPS labels.
    • body

      public B body()
      After calling this method, all subsequent interval(), 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, see TLcdMGRSGridStyle.

      Returns:
      this builder
    • body

      public B body(TLcdMGRSGridStyle.MGRSType aMgrsType)
      After calling this method, all subsequent interval(), 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, see TLcdMGRSGridStyle.

      Parameters:
      aMgrsType - the MGRS type (UPS or UTM)
      Returns:
      this builder
    • body

      public B body(TLcdMGRSGridStyle.MGRSLevel aMGRSLevel)
      After calling this method, all subsequent interval(), 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, see TLcdMGRSGridStyle.

      Parameters:
      aMGRSLevel - the MGRS level
      Returns:
      this builder
    • body

      public B body(TLcdMGRSGridStyle.MGRSType aMgrsType, TLcdMGRSGridStyle.MGRSLevel aMGRSLevel)
      After calling this method, all subsequent interval(), 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, see TLcdMGRSGridStyle.

      Parameters:
      aMgrsType - the MGRS type (UTM or UPS)
      aMGRSLevel - the MGRS level
      Returns:
      this builder
    • label

      public B label()
      After calling this method, all subsequent interval(), 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, see TLcdMGRSGridStyle.

      Returns:
      this builder
    • label

      public B label(TLcdMGRSGridStyle.MGRSType aMgrsType)
      After calling this method, all subsequent interval(), 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, see TLcdMGRSGridStyle.

      Parameters:
      aMgrsType - the MGRS type (UPS or UTM)
      Returns:
      this builder
    • label

      public B label(TLcdMGRSGridStyle.MGRSLevel aMGRSLevel)
      After calling this method, all subsequent interval(), 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, see TLcdMGRSGridStyle.

      Parameters:
      aMGRSLevel - the MGRS level
      Returns:
      this builder
    • label

      public B label(TLcdMGRSGridStyle.MGRSType aMgrsType, TLcdMGRSGridStyle.MGRSLevel aMGRSLevel)
      After calling this method, all subsequent interval(), 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, see TLcdMGRSGridStyle.

      Parameters:
      aMgrsType - the MGRS type (UTM or UPS)
      aMGRSLevel - the MGRS level
      Returns:
      this builder
    • overlay

      public B overlay()
      After calling this method, all subsequent interval(), lineColor(), labelColor(), ... calls will only apply to all overlay labels. See also TLcdMGRSGridOverlayLabelBuilder.

      For an example of how to use this method, see TLcdMGRSGridStyle.

      Returns:
      this builder
    • interval

      public B interval(double aMin, double aMax)
      After calling this method, all subsequent lineColor(), 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 the body or label methods, an interval from 0 (completely zoomed out) to Double.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, see TLcdMGRSGridStyle.

      Parameters:
      aMin - the minimum scale
      aMax - the maximum scale
      Returns:
      this builder
    • lineWidth

      public B lineWidth(double aLineWidth)
      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, see TLcdMGRSGridStyle.

      This method should be called at least once after calling one of the body or interval methods. Otherwise, default styling is used.

      Parameters:
      aLineWidth - the line width to use.
      Returns:
      this builder
    • lineColor

      public B lineColor(Color aLineColor)
      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, see TLcdMGRSGridStyle.

      This method should be called at least once after calling one of the body or interval methods. Otherwise, default styling is used.

      Parameters:
      aLineColor - the line color to use.
      Returns:
      this builder
    • font

      public B font(Font aFont)
      This method specifies the font to use for the current MGRS type/level/interval combination.

      For an example of how to use this method, see TLcdMGRSGridStyle.

      This method should be called at least once after calling one of the label or interval methods. Otherwise, a default font is used.

      Parameters:
      aFont - the font to use.
      Returns:
      this builder
    • labelColor

      public B labelColor(Color aTextColor)
      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, see TLcdMGRSGridStyle.

      This method should be called at least once after calling one of the label or interval methods. Otherwise, a default text color is used.

      Parameters:
      aTextColor - the text color to use.
      Returns:
      this builder
    • labelHaloColor

      public B labelHaloColor(Color aLabelHaloColor)
      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, see TLcdMGRSGridStyle.

      This method should be called at least once after calling one of the label or interval methods. Otherwise, default styling is used.

      Parameters:
      aLabelHaloColor - the halo color to use for the label text.
      Returns:
      this builder
      See Also:
    • labelHaloThickness

      public B labelHaloThickness(int aLabelHaloThickness)
      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, see TLcdMGRSGridStyle.

      This method should be called at least once after calling one of the label or interval 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

      public B lineAntiAliasing(boolean aAntiAliasing)
      This method specifies whether to use anti-aliasing during the painting of grid lines.

      The default is true.

      Parameters:
      aAntiAliasing - true to enable anti-aliasing when painting grid lines.
      Returns:
      this builder
    • labelAntiAliasing

      public B labelAntiAliasing(boolean aAntiAliasing)
      This method specifies whether to use anti-aliasing during the painting of grid labels.

      The default is true.

      Parameters:
      aAntiAliasing - true to enable anti-aliasing when painting grid labels.
      Returns:
      this builder
    • format

      public B format(String aCoordinatePattern)
      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"

      Depending on the label, only some parts of the format string will be used. For example, when displaying grid line labels, only the X or Y part of the format string will be used (e.g. it can be used to specify if "12345" or "1234" is displayed).

      Parameters:
      aCoordinatePattern - the pattern used to format the label text
      Returns:
      this builder.
    • all

      public B all(TLcdMGRSGridStyle aMGRSStyle)
      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

      public TLcdMGRSGridStyle build()
      Creates a new TLcdMGRSGridStyle from this builder.
      Returns:
      a new TLcdMGRSGridStyle