Class MilitarySymbolStyle.Builder

java.lang.Object
com.luciad.symbology.military.MilitarySymbolStyle.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
MilitarySymbolStyle

public static final class MilitarySymbolStyle.Builder extends Object implements AutoCloseable
  • Constructor Details Link icon

  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class Object
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
    • build Link icon

      @NotNull public MilitarySymbolStyle build()
      Creates a new MilitarySymbolStyle with the properties set on this builder.
      Returns:
      a new MilitarySymbolStyle with the properties set on this builder.
    • color Link icon

      @NotNull public MilitarySymbolStyle.Builder color(@NotNull android.graphics.Color unaffiliatedColor)
      Sets the color to be used if affiliation colors have been disabled (see affiliationColorEnabled) or if the symbol has no affiliation by default.

      The default value is black.

      Parameters:
      unaffiliatedColor - The color.
      Returns:
      this builder.
    • iconSize Link icon

      @NotNull public MilitarySymbolStyle.Builder iconSize(long size)
      Sets the size of icon symbols in pixels.

      This value must be > 0. The default value is 64.

      Parameters:
      size - the size of icon symbols in pixels.
      Returns:
      this builder.
    • affiliationColorEnabled Link icon

      @NotNull public MilitarySymbolStyle.Builder affiliationColorEnabled(boolean affiliationColorEnabled)
      Sets the affiliation color mode.

      When this mode is enabled, the color for unframed icon symbols, line symbols and off-set lines of icon symbols are automatically be adapted to the affiliation of a symbol.

      The default value is false.

      Parameters:
      affiliationColorEnabled - The affiliation color mode.
      Returns:
      this builder.
    • affiliationColor Link icon

      @NotNull public MilitarySymbolStyle.Builder affiliationColor(@NotNull MilitarySymbol.Affiliation affiliation, @NotNull android.graphics.Color affiliationColor)
      Sets the color for the given affiliation.

      These colors are used as fill color for framed icon symbols. For unframed icon symbols and line symbols, affiliation colors are only used when the affiliation color mode has been enabled (see affiliationColorEnabled).

      Parameters:
      affiliation - The affiliation for which a color is set.
      affiliationColor - The color to be used for the given affiliation.
      Returns:
      this builder.
    • overrideColor Link icon

      @NotNull public MilitarySymbolStyle.Builder overrideColor(@NotNull android.graphics.Color color)
      Sets the color to be used for the icon symbol.

      This overrides the affiliation and/or pattern colors in icons and tactical shapes. If this method is not invoked, there's no override color.

      Parameters:
      color - The color to be used for the icon symbol.
      Returns:
      this builder.
    • fillPercentage Link icon

      @NotNull public MilitarySymbolStyle.Builder fillPercentage(double fillPercentage)
      Sets the percentage ([0.0, 1.0]) of an icon symbol's frame that is painted with the regular fill color, as determined by its affiliation (see affiliationColor).

      The filled part begins at the bottom of the icon frame, up to the vertical position that corresponds with the given fill percentage. In other words, a fill percentage of 0.5 results in an icon symbol of which only the bottom half is filled with the regular fill color. The remaining (top) part of the icon is filled with the alternate fill color.

      The default value is 1.0f.

      Parameters:
      fillPercentage - the fill percentage to fill the frame of icon symbols.
      Returns:
      this builder.
    • alternateFillColor Link icon

      @NotNull public MilitarySymbolStyle.Builder alternateFillColor(@NotNull android.graphics.Color alternateFillColor)
      Sets the alternate color to fill the part of the frame that is not covered by the fill percentage.

      The default value is transparent (i.e. no fill).

      Parameters:
      alternateFillColor - the color to fill the part of the frame that is not covered by the fill percentage.
      Returns:
      this builder.
    • frameEnabled Link icon

      @NotNull public MilitarySymbolStyle.Builder frameEnabled(boolean frameEnabled)
      Sets whether the frame of an icon symbol should be painted.

      The default value is true.

      Parameters:
      frameEnabled - whether the frame of an icon symbol should be painted.
      Returns:
      this builder.
    • fillEnabled Link icon

      @NotNull public MilitarySymbolStyle.Builder fillEnabled(boolean fillEnabled)
      Sets whether an icon symbol should be painted filled.

      The default value is true.

      Parameters:
      fillEnabled - whether an icon symbol should be painted filled.
      Returns:
      this builder.
    • iconEnabled Link icon

      @NotNull public MilitarySymbolStyle.Builder iconEnabled(boolean iconEnabled)
      Sets whether the internal icon in the frame of an icon symbol should be painted.

      The default value is true.

      Parameters:
      iconEnabled - whether the internal icon in the frame of an icon symbol should be painted.
      Returns:
      this builder.
    • modifiersEnabled Link icon

      @NotNull public MilitarySymbolStyle.Builder modifiersEnabled(boolean modifiersEnabled)
      Sets whether modifiers should be enabled.

      The default value is true.

      Parameters:
      modifiersEnabled - whether modifiers should be enabled.
      Returns:
      this builder.
    • textStyle Link icon

      @NotNull public MilitarySymbolStyle.Builder textStyle(@NotNull TextStyle textStyle)
      Sets the new text style to be used for all texts part of the symbol.

      Note
      Ideally, the font size for the text style should be less than 1/5th of the icon size. By default, the icon size is 64 and the font size is 12. You can use MilitarySymbolStyle#getDefaultTextStyle to get a correctly sized TextStyle.
      Parameters:
      textStyle - new text style to be used for all texts part of the symbol.
      Returns:
      this builder.
    • strokeScaleFactor Link icon

      @NotNull public MilitarySymbolStyle.Builder strokeScaleFactor(double strokeScaleFactor)
      Sets the factor by which line widths should be scaled.

      This setting can be used to increase or decrease the width of stroked lines in icons and tactical graphics. It also affects decoration sizes in tactical graphics.

      The default value is 1.

      Parameters:
      strokeScaleFactor - the factor by which line widths should be scaled.
      Returns:
      this builder.
    • surroundingRectangleEnabled Link icon

      @NotNull public MilitarySymbolStyle.Builder surroundingRectangleEnabled(boolean enabled)
      Sets whether icon symbols should be painted with a surrounding rectangle.

      The default value is false.

      Parameters:
      enabled - whether icon symbols should be painted with a surrounding rectangle.
      Returns:
      this builder.
    • surroundingRectangleWidth Link icon

      @NotNull public MilitarySymbolStyle.Builder surroundingRectangleWidth(long width)
      Sets the line width in pixels of the rectangle that is painted around icon symbols.

      This value must be larger than 0.

      The default value is 1.

      A pixel is defined as 1/96th of 1 inch (https://www.w3.org/TR/css-values-4/#absolute-lengths).

      Parameters:
      width - the line width in pixels of the rectangle that is painted around icon symbols.
      Returns:
      this builder.
      See Also:
    • surroundingRectangleColor Link icon

      @NotNull public MilitarySymbolStyle.Builder surroundingRectangleColor(@NotNull android.graphics.Color color)
      Sets the color of the rectangle that is painted around icon symbols.
      Parameters:
      color - the color of the rectangle that is painted around icon symbols.
      Returns:
      this builder.
      See Also:
    • cornerSmoothness Link icon

      @NotNull public MilitarySymbolStyle.Builder cornerSmoothness(double smoothness)
      Sets the smoothness (or rounding) factor for polygon corners.

      This factor must be a value inside the interval [0.0, 1.0].

      By default, the smoothness is set to 0.5.

      Parameters:
      smoothness - the smoothness (or rounding) factor for polygon corners.
      Returns:
      this builder.