Class MilitarySymbolStyle

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

public final class MilitarySymbolStyle extends Object implements AutoCloseable
Defines styling settings for visualizing military symbols.

Use MilitarySymbolStyle#newBuilder to create a new instance.

  • Method Details

    • finalize

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

      public void close()
      Specified by:
      close in interface AutoCloseable
    • newBuilder

      @NotNull public static MilitarySymbolStyle.Builder newBuilder()
      Creates a new builder for creating a MilitarySymbolStyle.
      Returns:
      a new builder for creating a MilitarySymbolStyle.
    • asBuilder

      @NotNull public MilitarySymbolStyle.Builder asBuilder()
      Creates a new builder with the same properties as this symbol style.
      Returns:
      a new builder with the same properties as this symbol style.
    • getColor

      @NotNull public android.graphics.Color getColor()
      Returns the color that is currently configured in the case that either affiliation colors are disabled.

      See isAffiliationColorEnabled or that the symbol has no affiliation by default.

      Returns:
      the color to be used if affiliation colors are disabled or if the symbol has no affiliation by default.
    • getIconSize

      public long getIconSize()
      Returns the size of icon symbols in pixels.
      Returns:
      the size of icon symbols in pixels.
    • isAffiliationColorEnabled

      public boolean isAffiliationColorEnabled()
      Returns whether the affiliation color mode is enabled.

      When this mode is enabled, the color for unframed icon symbols, line symbols and off-set lines of icon symbols will automatically be adapted to the affiliation of a symbol, as configured on this symbol style (see getAffiliationColor).

      Returns:
      true if the affiliation color mode is enabled.
    • getAffiliationColor

      @NotNull public android.graphics.Color getAffiliationColor(@NotNull MilitarySymbol.Affiliation affiliation)
      Returns the color that is configured for the given affiliation.

      This color is 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 isAffiliationColorEnabled).

      Parameters:
      affiliation - the affiliation.
      Returns:
      the affiliation color.
    • getAlternateFillColor

      @NotNull public android.graphics.Color getAlternateFillColor()
      Returns the color used to fill the part of the frame that is not covered by the fill percentage.
      Returns:
      the color used to fill the part of the frame that is not covered by the fill percentage.
    • getOverrideColor

      @Nullable public android.graphics.Color getOverrideColor()
      Returns the color that overrides the colors of icon or shape symbol.

      The difference with the getColor method is that it replaces any affiliation and/or special pattern colors in icons and tactical shapes. If there is no color override, this method returns null.

      Returns:
      the color that overrides the normal colors of the icon symbol.
    • getFillPercentage

      public double getFillPercentage()
      Returns the percentage ([0.0, 1.0]) of an icon symbol's frame that is painted with the regular fill color.

      The regular fill color is determined by its affiliation (see getAffiliationColor). The filled part begins at the bottom of the icon frame, up to the vertical position that corresponds with this 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.

      This factor is a value in the interval [0.0, 1.0].

      Returns:
      the fill percentage to fill the frame of icon symbols.
    • isFrameEnabled

      public boolean isFrameEnabled()
      Returns whether the frame of an icon symbol should be painted.
      Returns:
      whether the frame of an icon symbol should be painted.
    • isFillEnabled

      public boolean isFillEnabled()
      Returns whether an icon symbol should be painted filled.
      Returns:
      whether an icon symbol should be painted filled.
    • isIconEnabled

      public boolean isIconEnabled()
      Returns whether the internal icon in the frame of an icon symbol should be painted.
      Returns:
      whether the internal icon in the frame of an icon symbol should be painted.
    • isModifiersEnabled

      public boolean isModifiersEnabled()
      Returns whether modifiers are enabled.
      Returns:
      whether modifiers are enabled.
    • getTextStyle

      @NotNull public TextStyle getTextStyle()
      Returns the style parameters for texts part of the symbol.

      Note
      If the text style has not been overridden in MilitarySymbolStyle.Builder, symbols are rendered with a text style that has a font size slightly smaller than 1/5th of the icon size.
      Returns:
      the style parameters for texts part of the symbol.
    • getStrokeScaleFactor

      public double getStrokeScaleFactor()
      Returns 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.

      Returns:
      the factor by which line widths should be scaled.
    • isSurroundingRectangleEnabled

      public boolean isSurroundingRectangleEnabled()
      Returns whether icon symbols are painted with a surrounding rectangle.
      Returns:
      whether icon symbols are painted with a surrounding rectangle.
    • getSurroundingRectangleWidth

      public long getSurroundingRectangleWidth()
      Returns the width in pixels of the rectangle that is painted around icon symbols.

      This property is only used if the surrounding rectangle is enabled.

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

      Returns:
      the width in pixels of the rectangle that is painted around icon symbols.
    • getSurroundingRectangleColor

      @NotNull public android.graphics.Color getSurroundingRectangleColor()
      Returns the color of the rectangle that is painted around icon symbols.

      This property is only used if the surrounding rectangle is enabled.

      Returns:
      the color of the rectangle that is painted around icon symbols.
    • getCornerSmoothness

      public double getCornerSmoothness()
      Returns the smoothness (or rounding) factor that is used to render corners of polygons.

      This factor is a value in the interval [0.0, 1.0]. The default value is 0.5.

      Returns:
      the smoothness (or rounding) factor that is used to render corners of polygons.
    • getDefaultStyle

      @NotNull public static MilitarySymbolStyle getDefaultStyle()
      Returns the default style for a MilitarySymbol.
      Returns:
      the default style for a MilitarySymbol.
    • getDefaultTextStyle

      @NotNull public static TextStyle getDefaultTextStyle(long iconSize)
      Returns the default text style.

      The text style has a correctly scaled font size for a symbol with a specific icon size.

      Parameters:
      iconSize - length of width/height of symbol icon in pixel.
      Returns:
      the default text style.