Class RendererSettings


  • public class RendererSettings
    extends java.lang.Object
    Static class that holds the setting for the JavaRenderer. Allows different parts of the renderer to know what values are being used.
    • Field Detail

      • TextBackgroundMethod_NONE

        public static final int TextBackgroundMethod_NONE
        There will be no background for text
        See Also:
        Constant Field Values
      • TextBackgroundMethod_COLORFILL

        public static final int TextBackgroundMethod_COLORFILL
        There will be a colored box behind the text
        See Also:
        Constant Field Values
      • TextBackgroundMethod_OUTLINE

        public static final int TextBackgroundMethod_OUTLINE
        There will be an adjustable outline around the text (expensive) Outline width of 4 is recommended.
        See Also:
        Constant Field Values
      • TextBackgroundMethod_OUTLINE_QUICK

        public static final int TextBackgroundMethod_OUTLINE_QUICK
        A different approach for outline which is quicker and seems to use less memory. Also, you may do well with a lower outline thickness setting compared to the regular outlining approach. Outline Width of 1 is recommended.
        See Also:
        Constant Field Values
      • OperationalConditionModifierType_SLASH

        public static int OperationalConditionModifierType_SLASH
      • OperationalConditionModifierType_BAR

        public static int OperationalConditionModifierType_BAR
      • SeaMineRenderMethod_MEDAL

        public static final int SeaMineRenderMethod_MEDAL
        See Also:
        Constant Field Values
      • SeaMineRenderMethod_ALT

        public static final int SeaMineRenderMethod_ALT
        See Also:
        Constant Field Values
      • _SeaMineRenderMethod

        public static int _SeaMineRenderMethod
    • Method Detail

      • addEventListener

        public void addEventListener​(armyc2.c5isr.renderer.utilities.SettingsEventListener sel)
      • setTextBackgroundMethod

        public void setTextBackgroundMethod​(int textBackgroundMethod)
        None, outline (default), or filled background. If set to OUTLINE, TextOutlineWidth changed to default of 4. If set to OUTLINE_QUICK, TextOutlineWidth changed to default of 1. Use setTextOutlineWidth if you'd like a different value.
        Parameters:
        textBackgroundMethod - like RenderSettings.TextBackgroundMethod_NONE
      • getTextBackgroundMethod

        public int getTextBackgroundMethod()
        None, outline (default), or filled background.
        Returns:
        method like RenderSettings.TextBackgroundMethod_NONE
      • setDefaultPixelSize

        public void setDefaultPixelSize​(int size)
        default size single point icons will render on the map
        Parameters:
        size - Integer
      • getDefaultPixelSize

        public int getDefaultPixelSize()
        default size single point icons will render on the map
        Returns:
        Integer
      • setOperationalConditionModifierType

        public void setOperationalConditionModifierType​(int value)
        Set the operational condition modifier to be slashes or bars
        Parameters:
        value - like RendererSettings.OperationalConditionModifierType_SLASH
      • getOperationalConditionModifierType

        public int getOperationalConditionModifierType()
      • setSeaMineRenderMethod

        public void setSeaMineRenderMethod​(int method)
      • getSeaMineRenderMethod

        public int getSeaMineRenderMethod()
      • setUseLineInterpolation

        public void setUseLineInterpolation​(boolean value)
        For lines symbols with "decorations" like FLOT or LOC, when points are too close together, we will start dropping points until we get enough space between 2 points to draw the decoration. Without this, when points are too close together, you run the chance that the decorated line will look like a plain line because there was no room between points to draw the decoration.
        Parameters:
        value - Boolean
      • getUseLineInterpolation

        public boolean getUseLineInterpolation()
        Returns the current setting for Line Interpolation.
        Returns:
        Boolean
      • setDeviceDPI

        public void setDeviceDPI​(int value)
        set the screen DPI so the renderer can take DPI into account when rendering for things like dashed lines and decorated lines.
        Parameters:
        value - Integer
      • getDeviceDPI

        public int getDeviceDPI()
      • setAutoCollapseModifiers

        public void setAutoCollapseModifiers​(boolean value)
        Collapse Modifiers for fire support areas when the symbol isn't large enough to show all the labels. Identifying label will always be visible. Zooming in, to make the symbol larger, will make more modifiers visible. Resizing the symbol can also make more modifiers visible.
        Parameters:
        value - Boolean
      • getAutoCollapseModifiers

        public boolean getAutoCollapseModifiers()
      • setCenterOnHQStaff

        public void setCenterOnHQStaff​(java.lang.Boolean value)
        if true (default), when HQ Staff is present, location will be indicated by the free end of the staff
        Parameters:
        value -
      • getCenterOnHQStaff

        public java.lang.Boolean getCenterOnHQStaff()
        if true (default), when HQ Staff is present, location will be indicated by the free end of the staff
      • getTextOutlineWidth

        public int getTextOutlineWidth()
        Deprecated.
        if RenderSettings.TextBackgroundMethod_OUTLINE is used, the outline will be this many pixels wide.
        Returns:
      • setTextBackgroundAutoColorThreshold

        public void setTextBackgroundAutoColorThreshold​(int value)
        Value from 0 to 255. The closer to 0 the lighter the text color has to be to have the outline be black. Default value is 160.
        Parameters:
        value -
      • getTextBackgroundAutoColorThreshold

        public int getTextBackgroundAutoColorThreshold()
        Value from 0 to 255. The closer to 0 the lighter the text color has to be to have the outline be black. Default value is 160.
        Returns:
      • setSinglePointSymbolOutlineWidth

        public void setSinglePointSymbolOutlineWidth​(int width)
        Deprecated.
        This applies to Single Point Tactical Graphics. Setting this will determine the default value for milStdSymbols when created. 0 for no outline, 1 for outline thickness of 1 pixel, 2 for outline thickness of 2 pixels, greater than 2 is not currently recommended.
        Parameters:
        width -
      • getSinglePointSymbolOutlineWidth

        public int getSinglePointSymbolOutlineWidth()
        Deprecated.
        This applies to Single Point Tactical Graphics.
        Returns:
      • setOutlineSPControlMeasures

        public void setOutlineSPControlMeasures​(boolean value)
      • getOutlineSPControlMeasures

        public boolean getOutlineSPControlMeasures()
      • setActionPointDefaultFill

        public void setActionPointDefaultFill​(boolean value)
        If true, set fill based on affiliation color for Action Points, Sonobuoys, ACP, CCP, PUP. False means there is no fill.
        Parameters:
        value -
      • getActionPointDefaultFill

        public boolean getActionPointDefaultFill()
      • setScaleEchelon

        public void setScaleEchelon​(boolean value)
        false to use label font size true to scale it using symbolPixelBounds / 3.5
        Parameters:
        value -
      • getScaleEchelon

        public boolean getScaleEchelon()
        Returns the value determining if we scale the echelon font size or just match the font size specified by the label font.
        Returns:
        true or false
      • setDrawAffiliationModifierAsLabel

        public void setDrawAffiliationModifierAsLabel​(boolean value)
        Determines how to draw the Affiliation modifier. True to draw as modifier label in the "E/F" location. False to draw at the top right corner of the symbol
      • getDrawAffiliationModifierAsLabel

        public boolean getDrawAffiliationModifierAsLabel()
        True to draw as modifier label in the "E/F" location. False to draw at the top right corner of the symbol
      • setLabelFont

        public void setLabelFont​(java.lang.String name,
                                 int type,
                                 int size)
        Sets the font to be used for modifier labels
        Parameters:
        name - Like "arial"
        type - Like Font.TRUETYPE_FONT
        size - Like 12
      • setMPLabelFont

        public void setMPLabelFont​(java.lang.String name,
                                   int type,
                                   int size)
      • setMPLabelFont

        public void setMPLabelFont​(java.lang.String name,
                                   int type,
                                   int size,
                                   float kmlScale)
      • getMPLabelFontName

        public java.lang.String getMPLabelFontName()
        the font name to be used for modifier labels
        Returns:
        name of the label font
      • getMPLabelFontType

        public int getMPLabelFontType()
        Like Font.BOLD
        Returns:
        type of the label font
      • getMPLabelFontSize

        public int getMPLabelFontSize()
        get font point size
        Returns:
        size of the label font
      • setLabelFont

        public void setLabelFont​(java.lang.String name,
                                 int type,
                                 int size,
                                 java.lang.Boolean kerning,
                                 float tracking)
        Parameters:
        name - Like "arial"
        type - Like Font.BOLD
        size - Like 12
        kerning - - default false. The default advances of single characters are not appropriate for some character sequences, for example "To" or "AWAY". Without kerning the adjacent characters appear to be separated by too much space. Kerning causes selected sequences of characters to be spaced differently for a more pleasing visual appearance.
        tracking - - default 0.04 (TextAttribute.TRACKING_LOOSE). The tracking value is multiplied by the font point size and passed through the font transform to determine an additional amount to add to the advance of each glyph cluster. Positive tracking values will inhibit formation of optional ligatures. Tracking values are typically between -0.1 and 0.3 values outside this range are generally not desirable.
      • getLabelFontName

        public java.lang.String getLabelFontName()
        the font name to be used for modifier labels
        Returns:
        name of the label font
      • getLabelFontType

        public int getLabelFontType()
        Like Font.BOLD
        Returns:
        type of the label font
      • getLabelFontSize

        public int getLabelFontSize()
        get font point size
        Returns:
        size of the label font
      • getLabelFontKerning

        public int getLabelFontKerning()
        Returns:
        0=off, 1=on.
      • getLabelFontTracking

        public float getLabelFontTracking()
        Returns:
      • getLabelFont

        public java.awt.Font getLabelFont()
        get font object used for labels
        Returns:
        Font object
      • getMPLabelFont

        public java.awt.Font getMPLabelFont()
        get font object used for labels
        Returns:
        Font object
      • getKMLLabelScale

        public float getKMLLabelScale()
      • setCacheEnabled

        public void setCacheEnabled​(boolean active)
      • getCacheEnabled

        public boolean getCacheEnabled()
      • getTwoLabelOnly

        public boolean getTwoLabelOnly()
        Deprecated.
        Get a boolean indicating between the use of supply routes labels in all segments (false) or to only set 2 labels one at the north and the other one at the south of the graphic (true).
        Returns:
        {boolean}
      • setTwoLabelOnly

        public void setTwoLabelOnly​(boolean TwoLabelOnly)
        Deprecated.
        Set a boolean indicating between the use of supply routes labels in all segments (false) or to only set 2 labels one at the north and the other one at the south of the graphic (true).
        Parameters:
        TwoLabelOnly -
      • setScaleMainIcon

        public void setScaleMainIcon​(boolean scaleMainIcon)
        When true, if the main icon is normally small to allow room for sector modifiers, make it larger when no sector modifiers are present for better visibility.
        Parameters:
        scaleMainIcon -
      • getScaleMainIcon

        public boolean getScaleMainIcon()
        When true, if the main icon is normally small to allow room for sector modifiers, main icon is made larger when no sector modifiers are present for better visibility.
      • setPatternScale

        public void setPatternScale​(double patternScale)
        Multipoint features and patterns scale with line width (MilStdAttributes.LineWidth). patternScale is the ratio of how much to increase features and patterns by with line width. default value is 1.0. Can be overwritten on render with MilStdAttributes.PatternScale
        Parameters:
        patternScale -
      • getPatternScale

        public double getPatternScale()
      • getFriendlyUnitFillColor

        public java.awt.Color getFriendlyUnitFillColor()
        get the preferred fill affiliation color for units.
        Returns:
        Color like Color(255, 255, 255)
      • setFriendlyUnitFillColor

        public void setFriendlyUnitFillColor​(java.awt.Color friendlyUnitFillColor)
        Set the preferred fill affiliation color for units
        Parameters:
        friendlyUnitFillColor - Color like Color(255, 255, 255)
      • getHostileUnitFillColor

        public java.awt.Color getHostileUnitFillColor()
        get the preferred fill affiliation color for units.
        Returns:
        Color like Color(255, 255, 255)
      • setHostileUnitFillColor

        public void setHostileUnitFillColor​(java.awt.Color hostileUnitFillColor)
        Set the preferred fill affiliation color for units
        Parameters:
        hostileUnitFillColor - Color like Color(255, 255, 255)
      • getNeutralUnitFillColor

        public java.awt.Color getNeutralUnitFillColor()
        get the preferred fill affiliation color for units.
        Returns:
        Color like Color(255, 255, 255)
      • setNeutralUnitFillColor

        public void setNeutralUnitFillColor​(java.awt.Color neutralUnitFillColor)
        Set the preferred line affiliation color for units
        Parameters:
        neutralUnitFillColor - Color like Color(255, 255, 255)
      • getUnknownUnitFillColor

        public java.awt.Color getUnknownUnitFillColor()
        get the preferred fill affiliation color for units.
        Returns:
        Color like Color(255, 255, 255)
      • setUnknownUnitFillColor

        public void setUnknownUnitFillColor​(java.awt.Color unknownUnitFillColor)
        Set the preferred fill affiliation color for units
        Parameters:
        unknownUnitFillColor - Color like Color(255, 255, 255)
      • getHostileGraphicFillColor

        public java.awt.Color getHostileGraphicFillColor()
        get the preferred fill affiliation color for graphics.
        Returns:
        Color like Color(255, 255, 255)
      • setHostileGraphicFillColor

        public void setHostileGraphicFillColor​(java.awt.Color hostileGraphicFillColor)
        Set the preferred fill affiliation color for graphics
        Parameters:
        hostileGraphicFillColor - Color like Color(255, 255, 255)
      • getFriendlyGraphicFillColor

        public java.awt.Color getFriendlyGraphicFillColor()
        get the preferred fill affiliation color for graphics.
        Returns:
        Color like Color(255, 255, 255)
      • setFriendlyGraphicFillColor

        public void setFriendlyGraphicFillColor​(java.awt.Color friendlyGraphicFillColor)
        Set the preferred fill affiliation color for graphics
        Parameters:
        friendlyGraphicFillColor - Color like Color(255, 255, 255)
      • getNeutralGraphicFillColor

        public java.awt.Color getNeutralGraphicFillColor()
        get the preferred fill affiliation color for graphics.
        Returns:
        Color like Color(255, 255, 255)
      • setNeutralGraphicFillColor

        public void setNeutralGraphicFillColor​(java.awt.Color neutralGraphicFillColor)
        Set the preferred fill affiliation color for graphics
        Parameters:
        neutralGraphicFillColor - Color like Color(255, 255, 255)
      • getUnknownGraphicFillColor

        public java.awt.Color getUnknownGraphicFillColor()
        get the preferred fill affiliation color for graphics.
        Returns:
        Color like Color(255, 255, 255)
      • setUnknownGraphicFillColor

        public void setUnknownGraphicFillColor​(java.awt.Color unknownGraphicFillColor)
        Set the preferred fill affiliation color for graphics
        Parameters:
        unknownGraphicFillColor - Color like Color(255, 255, 255)
      • getFriendlyUnitLineColor

        public java.awt.Color getFriendlyUnitLineColor()
        get the preferred line affiliation color for units.
        Returns:
        Color like Color(255, 255, 255)
      • setFriendlyUnitLineColor

        public void setFriendlyUnitLineColor​(java.awt.Color friendlyUnitLineColor)
        Set the preferred line affiliation color for units
        Parameters:
        friendlyUnitLineColor - Color like Color(255, 255, 255)
      • getHostileUnitLineColor

        public java.awt.Color getHostileUnitLineColor()
        get the preferred line affiliation color for units.
        Returns:
        Color like Color(255, 255, 255)
      • setHostileUnitLineColor

        public void setHostileUnitLineColor​(java.awt.Color hostileUnitLineColor)
        Set the preferred line affiliation color for units
        Parameters:
        hostileUnitLineColor - Color like Color(255, 255, 255)
      • getNeutralUnitLineColor

        public java.awt.Color getNeutralUnitLineColor()
        get the preferred line affiliation color for units.
        Returns:
        Color like Color(255, 255, 255)
      • setNeutralUnitLineColor

        public void setNeutralUnitLineColor​(java.awt.Color neutralUnitLineColor)
        Set the preferred line affiliation color for units
        Parameters:
        neutralUnitLineColor - Color like Color(255, 255, 255)
      • getUnknownUnitLineColor

        public java.awt.Color getUnknownUnitLineColor()
        get the preferred line affiliation color for units.
        Returns:
        Color like Color(255, 255, 255)
      • setUnknownUnitLineColor

        public void setUnknownUnitLineColor​(java.awt.Color unknownUnitLineColor)
        Set the preferred line affiliation color for units
        Parameters:
        unknownUnitLineColor - Color like Color(255, 255, 255)
      • getFriendlyGraphicLineColor

        public java.awt.Color getFriendlyGraphicLineColor()
        get the preferred line affiliation color for graphics.
        Returns:
        Color like Color(255, 255, 255)
      • setFriendlyGraphicLineColor

        public void setFriendlyGraphicLineColor​(java.awt.Color friendlyGraphicLineColor)
        Set the preferred line affiliation color for graphics
        Parameters:
        friendlyGraphicLineColor - Color like Color(255, 255, 255)
      • getHostileGraphicLineColor

        public java.awt.Color getHostileGraphicLineColor()
        get the preferred line affiliation color for graphics.
        Returns:
        Color like Color(255, 255, 255)
      • setHostileGraphicLineColor

        public void setHostileGraphicLineColor​(java.awt.Color hostileGraphicLineColor)
        Set the preferred line affiliation color for graphics
        Parameters:
        hostileGraphicLineColor - Color like Color(255, 255, 255)
      • getNeutralGraphicLineColor

        public java.awt.Color getNeutralGraphicLineColor()
        get the preferred line affiliation color for graphics.
        Returns:
        Color like Color(255, 255, 255)
      • setNeutralGraphicLineColor

        public void setNeutralGraphicLineColor​(java.awt.Color neutralGraphicLineColor)
        Set the preferred line affiliation color for graphics
        Parameters:
        neutralGraphicLineColor - Color like Color(255, 255, 255)
      • getUnknownGraphicLineColor

        public java.awt.Color getUnknownGraphicLineColor()
        get the preferred line affiliation color for graphics.
        Returns:
        Color like Color(255, 255, 255)
      • setUnknownGraphicLineColor

        public void setUnknownGraphicLineColor​(java.awt.Color unknownGraphicLineColor)
        Set the preferred line affiliation color for graphics
        Parameters:
        unknownGraphicLineColor - Color like Color(255, 255, 255)
      • setGraphicPreferredAffiliationColors

        public void setGraphicPreferredAffiliationColors​(java.awt.Color friendlyGraphicLineColor,
                                                         java.awt.Color hostileGraphicLineColor,
                                                         java.awt.Color neutralGraphicLineColor,
                                                         java.awt.Color unknownGraphicLineColor,
                                                         java.awt.Color friendlyGraphicFillColor,
                                                         java.awt.Color hostileGraphicFillColor,
                                                         java.awt.Color neutralGraphicFillColor,
                                                         java.awt.Color unknownGraphicFillColor)
        Set the preferred line and fill affiliation color for tactical graphics.
        Parameters:
        friendlyGraphicLineColor - Color
        hostileGraphicLineColor - Color
        neutralGraphicLineColor - Color
        unknownGraphicLineColor - Color
        friendlyGraphicFillColor - Color
        hostileGraphicFillColor - Color
        neutralGraphicFillColor - Color
        unknownGraphicFillColor - Color
      • setUnitPreferredAffiliationColors

        public void setUnitPreferredAffiliationColors​(java.awt.Color friendlyUnitLineColor,
                                                      java.awt.Color hostileUnitLineColor,
                                                      java.awt.Color neutralUnitLineColor,
                                                      java.awt.Color unknownUnitLineColor,
                                                      java.awt.Color friendlyUnitFillColor,
                                                      java.awt.Color hostileUnitFillColor,
                                                      java.awt.Color neutralUnitFillColor,
                                                      java.awt.Color unknownUnitFillColor)
        Set the preferred line and fill affiliation color for units and tactical graphics.
        Parameters:
        friendlyUnitLineColor - Color like Color(255, 255, 255). Set to null to ignore setting
        hostileUnitLineColor - Color
        neutralUnitLineColor - Color
        unknownUnitLineColor - Color
        friendlyUnitFillColor - Color
        hostileUnitFillColor - Color
        neutralUnitFillColor - Color
        unknownUnitFillColor - Color