Interface TacticalGraphicAttributes
-
- All Known Implementing Classes:
BasicTacticalGraphicAttributes
public interface TacticalGraphicAttributes
Holds attributes for aTacticalGraphic
. Changes made to the attributes are applied to the graphic when theWorldWindow
renders the next frame. Instances ofTacticalGraphicAttributes
may be shared by many graphics, thereby reducing the memory normally required to store attributes for each graphic.TacticalGraphicAttributes is used to override default attributes determined by a graphic's symbol set. Any non-null attributes will override the corresponding default attributes. Here's an example of overriding only the outline material of a graphic without affecting other styling specified by the symbol set:
TacticalGraphic graphic = ... TacticalGraphicAttributes attrs = new BasicTacticalGraphicAttributes(); // Set the outline to red. Leave all other fields null to retain the default values. attrs.setOutlineMaterial(Material.RED); // Apply the overrides to the graphic graphic.setAttributes(attrs);
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.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.Material
getOutlineMaterial()
Indicates the material properties of the graphic's outline.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.java.lang.Double
getOutlineWidth()
Indicates the line width (in pixels) used when rendering the graphic's outline.java.lang.Double
getScale()
Indicates the graphic scale as a ratio of the graphics's original size.java.awt.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(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.void
setOutlineMaterial(Material material)
Specifies the material properties of the graphic's outline.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.void
setOutlineWidth(java.lang.Double width)
Specifies the line width (in pixels) to use when rendering the graphic's outline.void
setScale(java.lang.Double scale)
Specifies the graphic scale as a ratio of the graphics's original size.void
setTextModifierFont(java.awt.Font font)
Specifies the font used to render text modifiers.void
setTextModifierMaterial(Material material)
Specifies the material used to render text modifiers.
-
-
-
Method Detail
-
copy
TacticalGraphicAttributes copy()
Returns a new TacticalGraphicAttributes instance of the same type as this TacticalGraphicAttributes who's properties are configured exactly as this TacticalGraphicAttributes.- Returns:
- a copy of this TacticalGraphicAttributes.
-
copy
void copy(TacticalGraphicAttributes attributes)
Copies the specified TacticalGraphicAttributes' properties into this object's properties. This does nothing if the specified attributes isnull
.- Parameters:
attributes
- the attributes to copy.
-
getScale
java.lang.Double getScale()
Indicates the graphic scale as a ratio of the graphics's original size. SeesetScale(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.
- Returns:
- the graphics's scale. May be
null
, indicating that the default scale is used.
-
setScale
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 eithernull
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.
- Parameters:
scale
- the graphic's scale. May benull
, indicating that the default scale should be used.- Throws:
java.lang.IllegalArgumentException
- if the scale is less than 0.0.
-
getTextModifierFont
java.awt.Font getTextModifierFont()
Indicates the font used to render text modifiers.- Returns:
- The font used to render text modifiers.
-
setTextModifierFont
void setTextModifierFont(java.awt.Font font)
Specifies the font used to render text modifiers.- Parameters:
font
- New font.
-
getTextModifierMaterial
Material getTextModifierMaterial()
Indicates the material used to render text modifiers. SeesetTextModifierMaterial
for a description of how the material is used.- Returns:
- The material used to render text modifiers.
-
setTextModifierMaterial
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.- Parameters:
material
- The new material.
-
getInteriorMaterial
Material getInteriorMaterial()
Indicates the material properties of the graphic's interior. SeesetInteriorMaterial
for more information on how this material is interpreted.- Returns:
- the material applied to the graphic's interior.
- See Also:
setInteriorMaterial(Material)
-
setInteriorMaterial
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.- Parameters:
material
- the material to apply to the graphic's interior.- See Also:
getInteriorMaterial()
-
getOutlineMaterial
Material getOutlineMaterial()
Indicates the material properties of the graphic's outline. SeesetOutlineMaterial
for more information on how this material is interpreted.- Returns:
- the material applied to the graphic's outline.
- See Also:
setOutlineMaterial(Material)
-
setOutlineMaterial
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.- Parameters:
material
- the material to apply to the graphic's outline.- See Also:
getOutlineMaterial()
-
getInteriorOpacity
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.- Returns:
- the interior opacity as a floating-point value from 0.0 to 1.0.
- See Also:
setInteriorOpacity(Double)
-
setInteriorOpacity
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.- Parameters:
opacity
- the interior opacity as a floating-point value from 0.0 to 1.0.- Throws:
java.lang.IllegalArgumentException
- ifopacity
is less than 0.0 or greater than 1.0.- See Also:
getInteriorOpacity()
-
getOutlineOpacity
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.- Returns:
- the outline opacity as a floating-point value from 0.0 to 1.0.
- See Also:
setOutlineOpacity(Double)
-
setOutlineOpacity
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.- Parameters:
opacity
- the outline opacity as a floating-point value from 0.0 to 1.0.- Throws:
java.lang.IllegalArgumentException
- ifopacity
is less than 0.0 or greater than 1.0.- See Also:
getOutlineOpacity()
-
getOutlineWidth
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.- Returns:
- the line width in pixels.
- See Also:
setOutlineWidth(Double)
-
setOutlineWidth
void setOutlineWidth(java.lang.Double width)
Specifies the line width (in pixels) to use when rendering the graphic's outline. The specifiedwidth
must be zero or a positive floating-point value. Specifying a line width of zero disables the graphic's outline. Thewidth
may be limited by an implementation-defined maximum during rendering. The maximum width is typically 10 pixels.- Parameters:
width
- the line width in pixels.- Throws:
java.lang.IllegalArgumentException
- ifwidth
is less than zero.- See Also:
getOutlineWidth()
-
-