Class BasicTacticalSymbolAttributes

    • 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, or null 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), or null 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, or null to use the symbol's default scale.
      protected java.awt.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

      Constructors 
      Constructor Description
      BasicTacticalSymbolAttributes()
      Constructs a BasicTacticalSymbolAttributes with all attributes set to null.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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, or null to use the symbol's default scale. Initially null.
      • 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 java.lang.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.
      • textModifierFont

        protected java.awt.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​(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 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:
        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 is null.
        Specified by:
        copy in interface TacticalSymbolAttributes
        Parameters:
        attributes - the attributes to copy.
      • 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 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.
      • 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​(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 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.
      • setTextModifierFont

        public void setTextModifierFont​(java.awt.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.