NASA World Wind

gov.nasa.worldwind.symbology
Class BasicTacticalGraphicAttributes

java.lang.Object
  extended by gov.nasa.worldwind.symbology.BasicTacticalGraphicAttributes
All Implemented Interfaces:
TacticalGraphicAttributes

public class BasicTacticalGraphicAttributes
extends Object
implements TacticalGraphicAttributes

Basic implementation of TacticalGraphicAttributes.


Field Summary
protected  Font font
          Indicates the font used to render text modifiers.
protected  Material interiorMaterial
          Indicates the material properties of the graphic's interior.
protected  Double interiorOpacity
          Indicates the opacity of the graphic's interior as a floating-point value in the range 0.0 to 1.0.
protected  Material outlineMaterial
          Indicates the material properties of the graphic's outline.
protected  Double outlineOpacity
          Indicates the opacity of the graphic's outline as a floating-point value in the range 0.0 to 1.0.
protected  double outlineWidth
          Indicates the line width (in pixels) used when rendering the shape's outline.
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  Material textMaterial
          Indicates the material used to render text modifiers.
 
Constructor Summary
BasicTacticalGraphicAttributes()
          Creates a new BasicTacticalGraphicAttributes.
BasicTacticalGraphicAttributes(TacticalGraphicAttributes attributes)
          Creates a new BasicTacticalGraphicAttributes configured with the specified attributes.
 
Method Summary
 TacticalGraphicAttributes copy()
          Returns a new TacticalGraphicAttributes instance of the same type as this TacticalGraphicAttributes who's properties are configured exactly as this TacticalGraphicAttributes.
 void copy(TacticalGraphicAttributes attributes)
          Copies the specified TacticalGraphicAttributes' properties into this object's properties.
 Material getInteriorMaterial()
          Indicates the material properties of the graphic's interior.
 Double getInteriorOpacity()
          Indicates the opacity of the graphic's interior as a floating-point value in the range 0.0 to 1.0.
 Material getOutlineMaterial()
          Indicates the material properties of the graphic's outline.
 Double getOutlineOpacity()
          Indicates the opacity of the graphic's outline as a floating-point value in the range 0.0 to 1.0.
 Double getOutlineWidth()
          Indicates the line width (in pixels) used when rendering the graphic's outline.
 Double getScale()
          Indicates the graphic scale as a ratio of the graphics's original size.
 Font getTextModifierFont()
          Indicates the font used to render text modifiers.
 Material getTextModifierMaterial()
          Indicates the material used to render text modifiers.
 void setInteriorMaterial(Material material)
          Specifies the material properties of the graphic's interior.
 void setInteriorOpacity(Double opacity)
          Specifies the opacity of the graphic's interior as a floating-point value in the range 0.0 to 1.0.
 void setOutlineMaterial(Material material)
          Specifies the material properties of the graphic's outline.
 void setOutlineOpacity(Double opacity)
          Specifies the opacity of the graphic's outline as a floating-point value in the range 0.0 to 1.0.
 void setOutlineWidth(Double width)
          Specifies the line width (in pixels) to use when rendering the graphic's outline.
 void setScale(Double scale)
          Specifies the graphic scale as a ratio of the graphics's original size.
 void setTextModifierFont(Font font)
          Specifies the font used to render text modifiers.
 void setTextModifierMaterial(Material material)
          Specifies the material used to render text modifiers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

font

protected Font font
Indicates the font used to render text modifiers.


interiorMaterial

protected Material interiorMaterial
Indicates the material properties of the graphic's interior. Initially null.


interiorOpacity

protected Double interiorOpacity
Indicates the opacity of the graphic's interior as a floating-point value in the range 0.0 to 1.0. Initially 0.0.


outlineMaterial

protected Material outlineMaterial
Indicates the material properties of the graphic's outline. Initially null.


outlineOpacity

protected Double outlineOpacity
Indicates the opacity of the graphic's outline as a floating-point value in the range 0.0 to 1.0. Initially 0.0.


outlineWidth

protected double outlineWidth
Indicates the line width (in pixels) used when rendering the shape's outline. Initially 0.0.


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.


textMaterial

protected Material textMaterial
Indicates the material used to render text modifiers.

Constructor Detail

BasicTacticalGraphicAttributes

public BasicTacticalGraphicAttributes()
Creates a new BasicTacticalGraphicAttributes.


BasicTacticalGraphicAttributes

public BasicTacticalGraphicAttributes(TacticalGraphicAttributes attributes)
Creates a new BasicTacticalGraphicAttributes configured with the specified attributes.

Parameters:
attributes - the attributes to configure the new BasicTacticalGraphicAttributes with.
Throws:
IllegalArgumentException - if attributes is null.
Method Detail

copy

public TacticalGraphicAttributes copy()
Returns a new TacticalGraphicAttributes instance of the same type as this TacticalGraphicAttributes who's properties are configured exactly as this TacticalGraphicAttributes.

Specified by:
copy in interface TacticalGraphicAttributes
Returns:
a copy of this TacticalGraphicAttributes.

copy

public void copy(TacticalGraphicAttributes attributes)
Copies the specified TacticalGraphicAttributes' properties into this object's properties. This does nothing if the specified attributes is null.

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

getInteriorMaterial

public Material getInteriorMaterial()
Indicates the material properties of the graphic's interior. See setInteriorMaterial for more information on how this material is interpreted.

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

getInteriorOpacity

public Double getInteriorOpacity()
Indicates the opacity of the graphic's interior as a floating-point value in the range 0.0 to 1.0.

Specified by:
getInteriorOpacity in interface TacticalGraphicAttributes
Returns:
the interior opacity as a floating-point value from 0.0 to 1.0.
See Also:
TacticalGraphicAttributes.setInteriorOpacity(Double)

getOutlineMaterial

public Material getOutlineMaterial()
Indicates the material properties of the graphic's outline. See setOutlineMaterial for more information on how this material is interpreted.

Specified by:
getOutlineMaterial in interface TacticalGraphicAttributes
Returns:
the material applied to the graphic's outline.
See Also:
TacticalGraphicAttributes.setOutlineMaterial(Material)

getOutlineOpacity

public Double getOutlineOpacity()
Indicates the opacity of the graphic's outline as a floating-point value in the range 0.0 to 1.0.

Specified by:
getOutlineOpacity in interface TacticalGraphicAttributes
Returns:
the outline opacity as a floating-point value from 0.0 to 1.0.
See Also:
TacticalGraphicAttributes.setOutlineOpacity(Double)

getOutlineWidth

public Double getOutlineWidth()
Indicates the line width (in pixels) used when rendering the graphic's outline. The returned value is either zero or a positive floating-point value.

Specified by:
getOutlineWidth in interface TacticalGraphicAttributes
Returns:
the line width in pixels.
See Also:
TacticalGraphicAttributes.setOutlineWidth(Double)

getScale

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

Scale directly affects the size of point graphics. Line and area graphics do not change size based on the scale, but if a line or area graphic includes a tactical symbol as part of a composite shape, the scale may be applied to the symbol.

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

getTextModifierFont

public Font getTextModifierFont()
Indicates the font used to render text modifiers.

Specified by:
getTextModifierFont in interface TacticalGraphicAttributes
Returns:
The font used to render text modifiers.

getTextModifierMaterial

public Material getTextModifierMaterial()
Indicates the material used to render text modifiers. See setTextModifierMaterial for a description of how the material is used.

Specified by:
getTextModifierMaterial in interface TacticalGraphicAttributes
Returns:
The material used to render text modifiers.

setInteriorMaterial

public void setInteriorMaterial(Material material)
Specifies the material properties of the graphic'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 graphic's constant interior color.

Specified by:
setInteriorMaterial in interface TacticalGraphicAttributes
Parameters:
material - the material to apply to the graphic's interior.
See Also:
TacticalGraphicAttributes.getInteriorMaterial()

setInteriorOpacity

public void setInteriorOpacity(Double opacity)
Specifies the opacity of the graphic's interior as a floating-point value in the range 0.0 to 1.0. A value of 1.0 specifies a completely opaque interior, and 0.0 specifies a completely transparent interior. Values in between specify a partially transparent interior.

Specified by:
setInteriorOpacity in interface TacticalGraphicAttributes
Parameters:
opacity - the interior opacity as a floating-point value from 0.0 to 1.0.
See Also:
TacticalGraphicAttributes.getInteriorOpacity()

setOutlineMaterial

public void setOutlineMaterial(Material material)
Specifies the material properties of the graphic's outline. If lighting is applied to the graphic, this indicates the outline's ambient, diffuse, and specular colors, its shininess, and the color of any emitted light. Otherwise, the material's diffuse color indicates the graphic's constant outline color.

Specified by:
setOutlineMaterial in interface TacticalGraphicAttributes
Parameters:
material - the material to apply to the graphic's outline.
See Also:
TacticalGraphicAttributes.getOutlineMaterial()

setOutlineOpacity

public void setOutlineOpacity(Double opacity)
Specifies the opacity of the graphic's outline as a floating-point value in the range 0.0 to 1.0. A value of 1.0 specifies a completely opaque outline, and 0.0 specifies a completely transparent outline. Values in between specify a partially transparent outline.

Specified by:
setOutlineOpacity in interface TacticalGraphicAttributes
Parameters:
opacity - the outline opacity as a floating-point value from 0.0 to 1.0.
See Also:
TacticalGraphicAttributes.getOutlineOpacity()

setOutlineWidth

public void setOutlineWidth(Double width)
Specifies the line width (in pixels) to use when rendering the graphic's outline. The specified width must be zero or a positive floating-point value. Specifying a line width of zero disables the graphic's outline. The width may be limited by an implementation-defined maximum during rendering. The maximum width is typically 10 pixels.

Specified by:
setOutlineWidth in interface TacticalGraphicAttributes
Parameters:
width - the line width in pixels.
See Also:
TacticalGraphicAttributes.getOutlineWidth()

setScale

public void setScale(Double scale)
Specifies the graphic scale as a ratio of the graphics's original size. The specified scale is a floating point number greater than 0.0: values less than 1.0 make the graphic smaller, while values greater than 1.0 make the symbol larger. The scale applies to both the graphic and the graphic modifiers. The specified scale must be either null or greater than or equal to 0.0.

Scale directly affects the size of point graphics. Line and area graphics do not change size based on the scale, but if a line or area graphic includes a tactical symbol as part of a composite shape, the scale may be applied to the symbol.

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

setTextModifierFont

public void setTextModifierFont(Font font)
Specifies the font used to render text modifiers.

Specified by:
setTextModifierFont in interface TacticalGraphicAttributes
Parameters:
font - New font.

setTextModifierMaterial

public void setTextModifierMaterial(Material material)
Specifies the material used to render text modifiers. How the material is used depends on the graphic implementation. For example, graphics 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 graphics use the diffuse component to specify the color of 2D text.

Specified by:
setTextModifierMaterial in interface TacticalGraphicAttributes
Parameters:
material - The new material.

NASA World Wind