Package gov.nasa.worldwind.symbology
Class BasicTacticalGraphicAttributes
- java.lang.Object
-
- gov.nasa.worldwind.symbology.BasicTacticalGraphicAttributes
-
- All Implemented Interfaces:
TacticalGraphicAttributes
public class BasicTacticalGraphicAttributes extends java.lang.Object implements TacticalGraphicAttributes
Basic implementation ofTacticalGraphicAttributes.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.FontfontIndicates the font used to render text modifiers.protected MaterialinteriorMaterialIndicates the material properties of the graphic's interior.protected java.lang.DoubleinteriorOpacityIndicates the opacity of the graphic's interior as a floating-point value in the range 0.0 to 1.0.protected MaterialoutlineMaterialIndicates the material properties of the graphic's outline.protected java.lang.DoubleoutlineOpacityIndicates the opacity of the graphic's outline as a floating-point value in the range 0.0 to 1.0.protected doubleoutlineWidthIndicates the line width (in pixels) used when rendering the shape's outline.protected java.lang.DoublescaleIndicates the symbol scale as a ratio of the symbol's original size, ornullto use the symbol's default scale.protected MaterialtextMaterialIndicates the material used to render text modifiers.
-
Constructor Summary
Constructors Constructor Description BasicTacticalGraphicAttributes()Creates a newBasicTacticalGraphicAttributes.BasicTacticalGraphicAttributes(TacticalGraphicAttributes attributes)Creates a newBasicTacticalGraphicAttributesconfigured with the specifiedattributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TacticalGraphicAttributescopy()Returns a new TacticalGraphicAttributes instance of the same type as this TacticalGraphicAttributes who's properties are configured exactly as this TacticalGraphicAttributes.voidcopy(TacticalGraphicAttributes attributes)Copies the specified TacticalGraphicAttributes' properties into this object's properties.MaterialgetInteriorMaterial()Indicates the material properties of the graphic's interior.java.lang.DoublegetInteriorOpacity()Indicates the opacity of the graphic's interior as a floating-point value in the range 0.0 to 1.0.MaterialgetOutlineMaterial()Indicates the material properties of the graphic's outline.java.lang.DoublegetOutlineOpacity()Indicates the opacity of the graphic's outline as a floating-point value in the range 0.0 to 1.0.java.lang.DoublegetOutlineWidth()Indicates the line width (in pixels) used when rendering the graphic's outline.java.lang.DoublegetScale()Indicates the graphic scale as a ratio of the graphics's original size.java.awt.FontgetTextModifierFont()Indicates the font used to render text modifiers.MaterialgetTextModifierMaterial()Indicates the material used to render text modifiers.voidsetInteriorMaterial(Material material)Specifies the material properties of the graphic's interior.voidsetInteriorOpacity(java.lang.Double opacity)Specifies the opacity of the graphic's interior as a floating-point value in the range 0.0 to 1.0.voidsetOutlineMaterial(Material material)Specifies the material properties of the graphic's outline.voidsetOutlineOpacity(java.lang.Double opacity)Specifies the opacity of the graphic's outline as a floating-point value in the range 0.0 to 1.0.voidsetOutlineWidth(java.lang.Double width)Specifies the line width (in pixels) to use when rendering the graphic's outline.voidsetScale(java.lang.Double scale)Specifies the graphic scale as a ratio of the graphics's original size.voidsetTextModifierFont(java.awt.Font font)Specifies the font used to render text modifiers.voidsetTextModifierMaterial(Material material)Specifies the material used to render text modifiers.
-
-
-
Field Detail
-
scale
protected java.lang.Double scale
Indicates the symbol scale as a ratio of the symbol's original size, ornullto use the symbol's default scale. Initiallynull.
-
interiorMaterial
protected Material interiorMaterial
Indicates the material properties of the graphic's interior. Initiallynull.
-
outlineMaterial
protected Material outlineMaterial
Indicates the material properties of the graphic's outline. Initiallynull.
-
interiorOpacity
protected java.lang.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.
-
outlineOpacity
protected java.lang.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.
-
font
protected java.awt.Font font
Indicates the font used to render text modifiers.
-
textMaterial
protected Material textMaterial
Indicates the material used to render text modifiers.
-
-
Constructor Detail
-
BasicTacticalGraphicAttributes
public BasicTacticalGraphicAttributes()
Creates a newBasicTacticalGraphicAttributes.
-
BasicTacticalGraphicAttributes
public BasicTacticalGraphicAttributes(TacticalGraphicAttributes attributes)
Creates a newBasicTacticalGraphicAttributesconfigured with the specifiedattributes.- Parameters:
attributes- the attributes to configure the newBasicTacticalGraphicAttributeswith.- Throws:
java.lang.IllegalArgumentException- ifattributesisnull.
-
-
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:
copyin interfaceTacticalGraphicAttributes- 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 isnull.- Specified by:
copyin interfaceTacticalGraphicAttributes- Parameters:
attributes- the attributes to copy.
-
getScale
public java.lang.Double getScale()
Indicates the graphic scale as a ratio of the graphics's original size. SeeTacticalGraphicAttributes.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:
getScalein interfaceTacticalGraphicAttributes- Returns:
- the graphics's scale. May be
null, indicating that the default scale is used.
-
setScale
public void setScale(java.lang.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 eithernullor 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:
setScalein interfaceTacticalGraphicAttributes- Parameters:
scale- the graphic's scale. May benull, indicating that the default scale should be used.
-
getTextModifierFont
public java.awt.Font getTextModifierFont()
Indicates the font used to render text modifiers.- Specified by:
getTextModifierFontin interfaceTacticalGraphicAttributes- Returns:
- The font used to render text modifiers.
-
setTextModifierFont
public void setTextModifierFont(java.awt.Font font)
Specifies the font used to render text modifiers.- Specified by:
setTextModifierFontin interfaceTacticalGraphicAttributes- Parameters:
font- New font.
-
getTextModifierMaterial
public Material getTextModifierMaterial()
Indicates the material used to render text modifiers. SeesetTextModifierMaterialfor a description of how the material is used.- Specified by:
getTextModifierMaterialin interfaceTacticalGraphicAttributes- Returns:
- The material used to render text modifiers.
-
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:
setTextModifierMaterialin interfaceTacticalGraphicAttributes- Parameters:
material- The new material.
-
getInteriorMaterial
public Material getInteriorMaterial()
Indicates the material properties of the graphic's interior. SeesetInteriorMaterialfor more information on how this material is interpreted.- Specified by:
getInteriorMaterialin interfaceTacticalGraphicAttributes- Returns:
- the material applied to the graphic's interior.
- See Also:
TacticalGraphicAttributes.setInteriorMaterial(Material)
-
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:
setInteriorMaterialin interfaceTacticalGraphicAttributes- Parameters:
material- the material to apply to the graphic's interior.- See Also:
TacticalGraphicAttributes.getInteriorMaterial()
-
getOutlineMaterial
public Material getOutlineMaterial()
Indicates the material properties of the graphic's outline. SeesetOutlineMaterialfor more information on how this material is interpreted.- Specified by:
getOutlineMaterialin interfaceTacticalGraphicAttributes- Returns:
- the material applied to the graphic's outline.
- See Also:
TacticalGraphicAttributes.setOutlineMaterial(Material)
-
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:
setOutlineMaterialin interfaceTacticalGraphicAttributes- Parameters:
material- the material to apply to the graphic's outline.- See Also:
TacticalGraphicAttributes.getOutlineMaterial()
-
getInteriorOpacity
public java.lang.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:
getInteriorOpacityin interfaceTacticalGraphicAttributes- Returns:
- the interior opacity as a floating-point value from 0.0 to 1.0.
- See Also:
TacticalGraphicAttributes.setInteriorOpacity(Double)
-
setInteriorOpacity
public void setInteriorOpacity(java.lang.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:
setInteriorOpacityin interfaceTacticalGraphicAttributes- Parameters:
opacity- the interior opacity as a floating-point value from 0.0 to 1.0.- See Also:
TacticalGraphicAttributes.getInteriorOpacity()
-
getOutlineOpacity
public java.lang.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:
getOutlineOpacityin interfaceTacticalGraphicAttributes- Returns:
- the outline opacity as a floating-point value from 0.0 to 1.0.
- See Also:
TacticalGraphicAttributes.setOutlineOpacity(Double)
-
setOutlineOpacity
public void setOutlineOpacity(java.lang.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:
setOutlineOpacityin interfaceTacticalGraphicAttributes- Parameters:
opacity- the outline opacity as a floating-point value from 0.0 to 1.0.- See Also:
TacticalGraphicAttributes.getOutlineOpacity()
-
getOutlineWidth
public java.lang.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:
getOutlineWidthin interfaceTacticalGraphicAttributes- Returns:
- the line width in pixels.
- See Also:
TacticalGraphicAttributes.setOutlineWidth(Double)
-
setOutlineWidth
public void setOutlineWidth(java.lang.Double width)
Specifies the line width (in pixels) to use when rendering the graphic's outline. The specifiedwidthmust be zero or a positive floating-point value. Specifying a line width of zero disables the graphic's outline. Thewidthmay be limited by an implementation-defined maximum during rendering. The maximum width is typically 10 pixels.- Specified by:
setOutlineWidthin interfaceTacticalGraphicAttributes- Parameters:
width- the line width in pixels.- See Also:
TacticalGraphicAttributes.getOutlineWidth()
-
-