Package gov.nasa.worldwind.symbology
Class BasicTacticalSymbolAttributes
- java.lang.Object
-
- gov.nasa.worldwind.symbology.BasicTacticalSymbolAttributes
-
- All Implemented Interfaces:
TacticalSymbolAttributes
public class BasicTacticalSymbolAttributes extends java.lang.Object implements TacticalSymbolAttributes
Basic implementation of theTacticalSymbolAttributes
interface.
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_OPACITY
static double
DEFAULT_SCALE
static java.awt.Font
DEFAULT_TEXT_MODIFIER_FONT
static Material
DEFAULT_TEXT_MODIFIER_MATERIAL
protected Material
interiorMaterial
Indicates the material used to draw the symbol's interior, ornull
to use the symbol's default interior material.protected java.lang.Double
opacity
Indicates the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive), ornull
to use the symbol's default scale.protected java.lang.Double
scale
Indicates the symbol scale as a ratio of the symbol's original size, ornull
to use the symbol's default scale.protected java.awt.Font
textModifierFont
Indicates the font used to draw text modifiers, ornull
to use the symbol's default scale.protected Material
textModifierMaterial
Indicates the material used to draw text modifiers, ornull
to use the symbol's default scale.
-
Constructor Summary
Constructors Constructor Description BasicTacticalSymbolAttributes()
Constructs a BasicTacticalSymbolAttributes with all attributes set tonull
.BasicTacticalSymbolAttributes(java.lang.Double scale, Material interiorMaterial, java.lang.Double opacity, java.awt.Font textModifierFont, Material textModifierMaterial)
Constructs a BasicTacticalSymbolAttributes with the specified scale, interior material, opacity, text modifier font, and text modifier material.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copy(TacticalSymbolAttributes attributes)
Copies the specified TacticalSymbolAttributes' properties into this object's properties.Material
getInteriorMaterial()
Indicates the material properties of the symbols's interior.java.lang.Double
getOpacity()
Indicates the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive).java.lang.Double
getScale()
Indicates the symbol scale as a ratio of the symbol's original size.java.awt.Font
getTextModifierFont()
Indicates the font used to draw text modifiers.Material
getTextModifierMaterial()
Indicates the material used to draw text modifiers.void
setInteriorMaterial(Material material)
Specifies the material properties of the symbols's interior.void
setOpacity(java.lang.Double opacity)
Specifies the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive).void
setScale(java.lang.Double scale)
Specifies the symbol scale as a ratio of the symbol's original size.void
setTextModifierFont(java.awt.Font font)
Specifies the font to use when drawing text modifiers.void
setTextModifierMaterial(Material material)
Specifies the material to use when drawing text modifiers.
-
-
-
Field Detail
-
DEFAULT_SCALE
public static final double DEFAULT_SCALE
- See Also:
- Constant Field Values
-
DEFAULT_OPACITY
public static final double DEFAULT_OPACITY
- See Also:
- Constant Field Values
-
DEFAULT_TEXT_MODIFIER_FONT
public static final java.awt.Font DEFAULT_TEXT_MODIFIER_FONT
-
DEFAULT_TEXT_MODIFIER_MATERIAL
public static final Material DEFAULT_TEXT_MODIFIER_MATERIAL
-
scale
protected java.lang.Double scale
Indicates the symbol scale as a ratio of the symbol's original size, ornull
to use the symbol's default scale. Initiallynull
.
-
interiorMaterial
protected Material interiorMaterial
Indicates the material used to draw the symbol's interior, ornull
to use the symbol's default interior material. Initiallynull
.
-
opacity
protected java.lang.Double opacity
Indicates the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive), ornull
to use the symbol's default scale. Initiallynull
.
-
textModifierFont
protected java.awt.Font textModifierFont
Indicates the font used to draw text modifiers, ornull
to use the symbol's default scale. Initiallynull
.
-
textModifierMaterial
protected Material textModifierMaterial
Indicates the material used to draw text modifiers, ornull
to use the symbol's default scale. Initiallynull
.
-
-
Constructor Detail
-
BasicTacticalSymbolAttributes
public BasicTacticalSymbolAttributes()
Constructs a BasicTacticalSymbolAttributes with all attributes set tonull
.
-
BasicTacticalSymbolAttributes
public BasicTacticalSymbolAttributes(java.lang.Double scale, Material interiorMaterial, java.lang.Double opacity, java.awt.Font textModifierFont, Material textModifierMaterial)
Constructs a BasicTacticalSymbolAttributes with the specified scale, interior material, opacity, text modifier font, and text modifier material. The scale specifies the symbol scale as a ratio of the symbol's original size, the opacity specifies the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive). The specified scale must be eithernull
or greater than or equal to 0.0, and the opacity must eithernull
or a value between 0.0 and 1.0 (inclusive). The textModifierFont and textModifierMaterial specify the font and material to use when drawing a symbol's text modifiers.- Parameters:
scale
- the symbol's scale. May benull
, indicating that the default scale should be used.interiorMaterial
- the interior material. May benull
, indicating that the default material should be used.opacity
- the symbol opacity. May benull
, indicating that the default opacity should be used.textModifierFont
- the text modifier font. May benull
, indicating that the default font should be used.textModifierMaterial
- the text modifier material. May benull
, indicating that the default material should be used.- Throws:
java.lang.IllegalArgumentException
- if the scale is less than 0.0, or if the opacity is less than 0.0 or greater than 1.0.
-
-
Method Detail
-
copy
public void copy(TacticalSymbolAttributes attributes)
Copies the specified TacticalSymbolAttributes' properties into this object's properties. This does nothing if the specified attributes isnull
.- Specified by:
copy
in interfaceTacticalSymbolAttributes
- Parameters:
attributes
- the attributes to copy.
-
getScale
public java.lang.Double getScale()
Indicates the symbol scale as a ratio of the symbol's original size. SeeTacticalSymbolAttributes.setScale(Double)
for a description of how scale is used.- Specified by:
getScale
in interfaceTacticalSymbolAttributes
- Returns:
- the symbol's scale. May be
null
, indicating that the default scale is used.
-
setScale
public void setScale(java.lang.Double scale)
Specifies the symbol scale as a ratio of the symbol's original size. The specified scale is a floating point number greater than 0.0: values less than 1.0 make the symbol smaller, while values greater than 1.0 make the symbol larger. The scale applies to both the symbol graphic and the symbol modifiers. The specified scale must be eithernull
or greater than or equal to 0.0.- Specified by:
setScale
in interfaceTacticalSymbolAttributes
- Parameters:
scale
- the symbol's scale. May benull
, indicating that the default scale should be used.
-
getInteriorMaterial
public Material getInteriorMaterial()
Description copied from interface:TacticalSymbolAttributes
Indicates the material properties of the symbols's interior. SeesetInteriorMaterial
for more information on how this material is interpreted.- Specified by:
getInteriorMaterial
in interfaceTacticalSymbolAttributes
- Returns:
- the material applied to the symbols's interior.
- See Also:
TacticalSymbolAttributes.setInteriorMaterial(Material)
-
setInteriorMaterial
public void setInteriorMaterial(Material material)
Description copied from interface:TacticalSymbolAttributes
Specifies the material properties of the symbols's interior. If lighting is applied to the graphic, this indicates the interior's ambient, diffuse, and specular colors, its shininess, and the color of any emitted light. Otherwise, the material's diffuse color indicates the symbols's constant interior color.- Specified by:
setInteriorMaterial
in interfaceTacticalSymbolAttributes
- Parameters:
material
- the material to apply to the symbol's interior.- See Also:
TacticalSymbolAttributes.getInteriorMaterial()
-
getOpacity
public java.lang.Double getOpacity()
Indicates the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive). SeeTacticalSymbolAttributes.setOpacity(Double)
for a description of how opacity is used.- Specified by:
getOpacity
in interfaceTacticalSymbolAttributes
- Returns:
- the symbol's opacity. May be
null
, indicating that the default opacity is used.
-
setOpacity
public void setOpacity(java.lang.Double opacity)
Specifies the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive). An opacity of 0.0 is completely transparent and an opacity of 1.0 is completely opaque. The opacity applies to both the symbol graphic and the symbol modifiers. The specified opacity must eithernull
or a value between 0.0 and 1.0 (inclusive).- Specified by:
setOpacity
in interfaceTacticalSymbolAttributes
- Parameters:
opacity
- the symbol opacity. May benull
, indicating that the default opacity should be used.
-
getTextModifierFont
public java.awt.Font getTextModifierFont()
Indicates the font used to draw text modifiers. SeeTacticalSymbolAttributes.setTextModifierFont(java.awt.Font)
for a description of how the text modifier font is used.- Specified by:
getTextModifierFont
in interfaceTacticalSymbolAttributes
- Returns:
- the text modifier font. May be
null
, indicating that the default font is used.
-
setTextModifierFont
public void setTextModifierFont(java.awt.Font font)
Specifies the font to use when drawing text modifiers. If the specified font isnull
, the symbol implementation determines an default font appropriate for the symbol's size and scale. MIL-STD-2525 tactical symbols determine a default font that who's height is approximately 0.3*H, where H is the symbol's scaled frame height.- Specified by:
setTextModifierFont
in interfaceTacticalSymbolAttributes
- Parameters:
font
- the text modifier font. May benull
, indicating that the default font should be used.
-
getTextModifierMaterial
public Material getTextModifierMaterial()
Indicates the material used to draw text modifiers. SeeTacticalSymbolAttributes.setTextModifierMaterial(gov.nasa.worldwind.render.Material)
for a description of how the text modifier material is used.- Specified by:
getTextModifierMaterial
in interfaceTacticalSymbolAttributes
- Returns:
- the text modifier material. May be
null
, indicating that the default material is used.
-
setTextModifierMaterial
public void setTextModifierMaterial(Material material)
Specifies the material to use when drawing text modifiers. How the material is used depends on the symbol implementation. For example, symbols may draw 3D text that uses all of the specified material components, or draw 2D text that uses only the diffuse component. MIL-STD-2525 tactical symbols use the diffuse component to specify the color of 2D text.- Specified by:
setTextModifierMaterial
in interfaceTacticalSymbolAttributes
- Parameters:
material
- the text modifier material. May benull
, indicating that the default material should be used.
-
-