public final class MilitarySymbolStyle extends Object implements AutoCloseable
Use MilitarySymbolStyle#newBuilder
to create a new instance.
Modifier and Type | Class and Description |
---|---|
static class |
MilitarySymbolStyle.Builder
Builder for the MilitarySymbolStyle class. |
Modifier and Type | Method and Description |
---|---|
MilitarySymbolStyle.Builder |
asBuilder()
Creates a new builder with the same properties as this symbol style.
|
void |
close() |
protected void |
finalize() |
android.graphics.Color |
getAffiliationColor(MilitarySymbol.Affiliation affiliation)
Returns the color that is configured for the given affiliation.
|
android.graphics.Color |
getAlternateFillColor()
Returns the color used to fill the part of the frame that is not covered by the
fill percentage . |
android.graphics.Color |
getColor()
Returns the color that is currently configured in the case that either affiliation colors are disabled.
|
double |
getCornerSmoothness()
Returns the smoothness (or rounding) factor that is used to render corners of polygons.
|
static MilitarySymbolStyle |
getDefaultStyle()
Returns the default style for a
MilitarySymbol . |
static TextStyle |
getDefaultTextStyle(long iconSize)
Returns the default text style.
|
double |
getFillPercentage()
Returns the percentage ([0.0, 1.0]) of an icon symbol's frame that is painted with the regular fill color.
|
long |
getIconSize()
Returns the size of icon symbols in pixels.
|
android.graphics.Color |
getOverrideColor()
Returns the color that overrides the colors of icon or shape symbol.
|
double |
getStrokeScaleFactor()
Returns the factor by which line widths should be scaled.
|
android.graphics.Color |
getSurroundingRectangleColor()
Returns the color of the rectangle that is painted around icon symbols.
|
long |
getSurroundingRectangleWidth()
Returns the width in pixels of the rectangle that is painted around icon symbols.
|
TextStyle |
getTextStyle()
Returns the style parameters for texts part of the symbol.
|
boolean |
isAffiliationColorEnabled()
Returns whether the affiliation color mode is enabled.
|
boolean |
isFillEnabled() |
boolean |
isFrameEnabled() |
boolean |
isIconEnabled() |
boolean |
isModifiersEnabled() |
boolean |
isSurroundingRectangleEnabled() |
static MilitarySymbolStyle.Builder |
newBuilder()
Creates a new builder for creating a
MilitarySymbolStyle . |
public void close()
close
in interface AutoCloseable
@NotNull public static MilitarySymbolStyle.Builder newBuilder()
MilitarySymbolStyle
.MilitarySymbolStyle
.@NotNull public MilitarySymbolStyle.Builder asBuilder()
@NotNull public android.graphics.Color getColor()
See isAffiliationColorEnabled
or that the symbol has no affiliation by default.
public long getIconSize()
public boolean isAffiliationColorEnabled()
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
).
@NotNull public android.graphics.Color getAffiliationColor(@NotNull MilitarySymbol.Affiliation 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
).
affiliation
- the affiliation.@NotNull public android.graphics.Color getAlternateFillColor()
fill percentage
.fill percentage
.@Nullable public android.graphics.Color getOverrideColor()
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
.
public double getFillPercentage()
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]
.
public boolean isFrameEnabled()
public boolean isFillEnabled()
public boolean isIconEnabled()
public boolean isModifiersEnabled()
@NotNull public TextStyle getTextStyle()
MilitarySymbolStyle.Builder
, symbols are rendered with a text style that has a font size slightly smaller than 1/5th of the icon size.public double getStrokeScaleFactor()
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
.
public boolean isSurroundingRectangleEnabled()
public long getSurroundingRectangleWidth()
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).
@NotNull public android.graphics.Color getSurroundingRectangleColor()
This property is only used if the surrounding rectangle is enabled
.
public double getCornerSmoothness()
This factor is a value in the interval [0.0, 1.0]
. The default value is 0.5
.
@NotNull public static MilitarySymbolStyle getDefaultStyle()
MilitarySymbol
.MilitarySymbol
.@NotNull public static TextStyle getDefaultTextStyle(long iconSize)
The text style has a correctly scaled font size for a symbol with a specific icon size.
iconSize
- length of width/height of symbol icon in pixel.