NASA World Wind

gov.nasa.worldwind.symbology
Class BasicTacticalSymbolAttributes

java.lang.Object
  extended by gov.nasa.worldwind.symbology.BasicTacticalSymbolAttributes
All Implemented Interfaces:
TacticalSymbolAttributes

public class BasicTacticalSymbolAttributes
extends Object
implements TacticalSymbolAttributes

Basic implementation of the TacticalSymbolAttributes interface.


Field Summary
static double DEFAULT_OPACITY
           
static double DEFAULT_SCALE
           
static Font DEFAULT_TEXT_MODIFIER_FONT
           
static Material DEFAULT_TEXT_MODIFIER_MATERIAL
           
protected  Material interiorMaterial
          Indicates the material used to draw the symbol's interior, or null to use the symbol's default interior material.
protected  Double opacity
          Indicates the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive), or null to use the symbol's default scale.
protected  Double scale
          Indicates the symbol scale as a ratio of the symbol's original size, or null to use the symbol's default scale.
protected  Font textModifierFont
          Indicates the font used to draw text modifiers, or null to use the symbol's default scale.
protected  Material textModifierMaterial
          Indicates the material used to draw text modifiers, or null to use the symbol's default scale.
 
Constructor Summary
BasicTacticalSymbolAttributes()
          Constructs a BasicTacticalSymbolAttributes with all attributes set to null.
BasicTacticalSymbolAttributes(Double scale, Material interiorMaterial, Double opacity, Font textModifierFont, Material textModifierMaterial)
          Constructs a BasicTacticalSymbolAttributes with the specified scale, interior material, opacity, text modifier font, and text modifier material.
 
Method Summary
 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.
 Double getOpacity()
          Indicates the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive).
 Double getScale()
          Indicates the symbol scale as a ratio of the symbol's original size.
 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(Double opacity)
          Specifies the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive).
 void setScale(Double scale)
          Specifies the symbol scale as a ratio of the symbol's original size.
 void setTextModifierFont(Font font)
          Specifies the font to use when drawing text modifiers.
 void setTextModifierMaterial(Material material)
          Specifies the material to use when drawing text modifiers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_OPACITY

public static final double DEFAULT_OPACITY
See Also:
Constant Field Values

DEFAULT_SCALE

public static final double DEFAULT_SCALE
See Also:
Constant Field Values

DEFAULT_TEXT_MODIFIER_FONT

public static final Font DEFAULT_TEXT_MODIFIER_FONT

DEFAULT_TEXT_MODIFIER_MATERIAL

public static final Material DEFAULT_TEXT_MODIFIER_MATERIAL

interiorMaterial

protected Material interiorMaterial
Indicates the material used to draw the symbol's interior, or null to use the symbol's default interior material. Initially null.


opacity

protected Double opacity
Indicates the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive), or null to use the symbol's default scale. Initially null.


scale

protected Double scale
Indicates the symbol scale as a ratio of the symbol's original size, or null to use the symbol's default scale. Initially null.


textModifierFont

protected Font textModifierFont
Indicates the font used to draw text modifiers, or null to use the symbol's default scale. Initially null.


textModifierMaterial

protected Material textModifierMaterial
Indicates the material used to draw text modifiers, or null to use the symbol's default scale. Initially null.

Constructor Detail

BasicTacticalSymbolAttributes

public BasicTacticalSymbolAttributes()
Constructs a BasicTacticalSymbolAttributes with all attributes set to null.


BasicTacticalSymbolAttributes

public BasicTacticalSymbolAttributes(Double scale,
                                     Material interiorMaterial,
                                     Double opacity,
                                     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 either null or greater than or equal to 0.0, and the opacity must either null 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 be null, indicating that the default scale should be used.
interiorMaterial - the interior material. May be null, indicating that the default material should be used.
opacity - the symbol opacity. May be null, indicating that the default opacity should be used.
textModifierFont - the text modifier font. May be null, indicating that the default font should be used.
textModifierMaterial - the text modifier material. May be null, indicating that the default material should be used.
Throws:
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 is null.

Specified by:
copy in interface TacticalSymbolAttributes
Parameters:
attributes - the attributes to copy.

getInteriorMaterial

public Material getInteriorMaterial()
Description copied from interface: TacticalSymbolAttributes
Indicates the material properties of the symbols's interior. See setInteriorMaterial for more information on how this material is interpreted.

Specified by:
getInteriorMaterial in interface TacticalSymbolAttributes
Returns:
the material applied to the symbols's interior.
See Also:
TacticalSymbolAttributes.setInteriorMaterial(Material)

getOpacity

public Double getOpacity()
Indicates the symbol opacity as a floating point number between 0.0 and 1.0 (inclusive). See TacticalSymbolAttributes.setOpacity(Double) for a description of how opacity is used.

Specified by:
getOpacity in interface TacticalSymbolAttributes
Returns:
the symbol's opacity. May be null, indicating that the default opacity is used.

getScale

public Double getScale()
Indicates the symbol scale as a ratio of the symbol's original size. See TacticalSymbolAttributes.setScale(Double) for a description of how scale is used.

Specified by:
getScale in interface TacticalSymbolAttributes
Returns:
the symbol's scale. May be null, indicating that the default scale is used.

getTextModifierFont

public Font getTextModifierFont()
Indicates the font used to draw text modifiers. See TacticalSymbolAttributes.setTextModifierFont(java.awt.Font) for a description of how the text modifier font is used.

Specified by:
getTextModifierFont in interface TacticalSymbolAttributes
Returns:
the text modifier font. May be null, indicating that the default font is used.

getTextModifierMaterial

public Material getTextModifierMaterial()
Indicates the material used to draw text modifiers. See TacticalSymbolAttributes.setTextModifierMaterial(gov.nasa.worldwind.render.Material) for a description of how the text modifier material is used.

Specified by:
getTextModifierMaterial in interface TacticalSymbolAttributes
Returns:
the text modifier material. May be null, indicating that the default material is used.

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 interface TacticalSymbolAttributes
Parameters:
material - the material to apply to the symbol's interior.
See Also:
TacticalSymbolAttributes.getInteriorMaterial()

setOpacity

public void setOpacity(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 either null or a value between 0.0 and 1.0 (inclusive).

Specified by:
setOpacity in interface TacticalSymbolAttributes
Parameters:
opacity - the symbol opacity. May be null, indicating that the default opacity should be used.

setScale

public void setScale(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 either null or greater than or equal to 0.0.

Specified by:
setScale in interface TacticalSymbolAttributes
Parameters:
scale - the symbol's scale. May be null, indicating that the default scale should be used.

setTextModifierFont

public void setTextModifierFont(Font font)
Specifies the font to use when drawing text modifiers. If the specified font is null, 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 interface TacticalSymbolAttributes
Parameters:
font - the text modifier font. May be null, indicating that the default font should be 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 interface TacticalSymbolAttributes
Parameters:
material - the text modifier material. May be null, indicating that the default material should be used.

NASA World Wind