Class RendererSettings

java.lang.Object
armyc2.c2sd.renderer.utilities.RendererSettings

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

  • Method Details

    • getInstance

      public static RendererSettings getInstance()
    • addEventListener

    • 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 2. Use setTextOutlineWidth if you'd like a different value.
      Parameters:
      textBackgroundMethod -
    • getTextBackgroundMethod

      None, outline (default), or filled background.
      Returns:
      method like RenderSettings.TextBackgroundMethod_NONE
    • getUnitFontSize

      public float getUnitFontSize()
    • getSPFontSize

      public float getSPFontSize()
    • setDefaultPixelSize

      public void setDefaultPixelSize(int size)
    • getDefaultPixelSize

      public int getDefaultPixelSize()
    • getDeviceDPI

      public int getDeviceDPI()
    • setDeviceDPI

      public void setDeviceDPI(int size)
    • setSymbologyStandard

      public void setSymbologyStandard(int standard)
      Controls what symbols are supported. Set this before loading the renderer.
      Parameters:
      standard - Like RendererSettings.Symbology_2525Bch2_USAS_13_14
    • getSymbologyStandard

      public int getSymbologyStandard()
      Current symbology standard
      Returns:
      symbologyStandard Like RendererSettings.Symbology_2525Bch2_USAS_13_14
    • setOperationalConditionModifierType

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

    • 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 -
    • getUseLineInterpolation

      public boolean getUseLineInterpolation()
      Returns the current setting for Line Interpolation.
      Returns:
    • 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 -
    • getAutoCollapseModifiers

      public boolean getAutoCollapseModifiers()
    • setUnitRenderMethod

      public void setUnitRenderMethod(int symbolRenderMethod)
      determines what kind of java objects will be generated when processing a symbol. RenderMethod_SHAPES is simpler as everything is treated the same. RenderMethod_NATIVE is faster but, in addition to shapes, uses GlyphVectors and TextLayouts.
      Parameters:
      symbolRenderMethod -
    • getUnitRenderMethod

      public int getUnitRenderMethod()
      Maps to RendererSetting.RenderMethod_SHAPES or RendererSetting.RenderMethod_NATIVE
      Returns:
      method like RendererSetting.RenderMethod_NATIVE
    • setCenterOnHQStaff

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

      if true (default), when HQ Staff is present, location will be indicated by the free end of the staff
    • setTextRenderMethod

      public void setTextRenderMethod(int symbolRenderMethod)
      determines what kind of java objects will be generated when processing a symbol. RenderMethod_SHAPES is simpler as everything is treated the same. RenderMethod_NATIVE is faster but, in addition to shapes, uses GlyphVectors and TextLayouts. In the case of text, NATIVE tends to render sharper and clearer text.
      Parameters:
      symbolRenderMethod -
    • getTextRenderMethod

      public int getTextRenderMethod()
      Maps to RendererSetting.RenderMethod_SHAPES or RendererSetting.RenderMethod_NATIVE
      Returns:
    • setTextOutlineWidth

      public void setTextOutlineWidth(int width)
      if RenderSettings.TextBackgroundMethod_OUTLINE is used, the outline will be this many pixels wide.
      Parameters:
      width -
    • getTextOutlineWidth

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

      Refers to text color of modifier labels
      Returns:
    • setLabelForegroundColor

      public void setLabelForegroundColor(int value)
      Refers to text color of modifier labels Default Color is Black. If NULL, uses line color of symbol
      Parameters:
      value -
    • getLabelBackgroundColor

      Refers to background color of modifier labels
      Returns:
    • setLabelBackgroundColor

      public void setLabelBackgroundColor(int value)
      Refers to text color of modifier labels Default Color is White. Null value means the optimal background color (black or white) will be chose based on the color of the text.
      Parameters:
      value -
    • 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

      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)
      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

      This applies to Single Point Tactical Graphics.
      Returns:
    • 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

      True to draw as modifier label in the "E/F" location. False to draw at the top right corner of the symbol
    • setModifierFont

      public void setModifierFont(String name, int type, int size, Boolean kerning, float tracking)
      Deprecated.
      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 desireable.
    • setModifierFont

      public void setModifierFont(String name, int type, int size)
      Parameters:
      name -
      type - Typeface
      size -
    • setMPModifierFont

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

      public void setMPModifierFont(String name, int type, int size, float kmlScale)
      Sets the font to be used for multipoint modifier labels
      Parameters:
      name - Like "arial"
      type - Like Font.TRUETYPE_FONT
      size - Like 12
      kmlScale - only set if you're rendering in KML (default 1.0)
    • getModiferFont

      get font object used for labels
      Returns:
      Font object
    • getMPModifierFont

      get font object used for labels
      Returns:
      Font object
    • getMPModifierFontName

      the font name to be used for modifier labels
      Returns:
      name of the label font
    • getMPModifierFontType

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

      public int getMPModifierFontSize()
      get font point size
      Returns:
      size of the label font
    • getKMLLabelScale

      public float getKMLLabelScale()
    • setCacheSize

      public void setCacheSize(float percentage)
      Set the cache size as a percentage of VM memory available to the app. Renderer won't let you set a value greater than 10% of the available VM memory.
      Parameters:
      percentage -
    • setCacheSize

      public void setCacheSize(int bytes)
      Set the cache size in bytes. Renderer won't let you set a value greater than 10% of the available VM memory.
      Parameters:
      bytes -
    • getCacheSize

      public int getCacheSize()
    • setCacheEnabled

      public void setCacheEnabled(boolean active)
    • getCacheEnabled

      public boolean getCacheEnabled()
    • getTwoLabelOnly

      public boolean getTwoLabelOnly()
      Get a boolean indicating between the use of ENY 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).
    • setTwoLabelOnly

      public void setTwoLabelOnly(boolean TwoLabelOnly)
      Set a boolean indicating between the use of ENY 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 -
    • setOverscanScale

      public void setOverscanScale(double overscanScale)
      Optionally expand multipoint rendering outside bounding box by a scale factor. Useful when panning map before rendering with updated bounding box. Only referenced when bounding box is a valid rectangle. For example, setting overscanScale to 3 would render all shapes within range 3 * the width and 3 * the height of the bounding box
      Parameters:
      overscanScale - default is 1 and minimum is 1
    • getOverscanScale

      public double getOverscanScale()
    • setAutoAdjustScale

      public void setAutoAdjustScale(boolean autoAdjustScale)
      Will attempt to adjust the scale if it doesn't seem to make sense with the passed in bbox. If you wish to have absolute control over the scale, set to false.
      Parameters:
      autoAdjustScale - default true
    • getAutoAdjustScale

      public boolean getAutoAdjustScale()
    • getFriendlyUnitFillColor

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public void setGraphicPreferredAffiliationColors(Color friendlyGraphicLineColor, Color hostileGraphicLineColor, Color neutralGraphicLineColor, Color unknownGraphicLineColor, Color friendlyGraphicFillColor, Color hostileGraphicFillColor, Color neutralGraphicFillColor, 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(Color friendlyUnitLineColor, Color hostileUnitLineColor, Color neutralUnitLineColor, Color unknownUnitLineColor, Color friendlyUnitFillColor, Color hostileUnitFillColor, Color neutralUnitFillColor, 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