Package armyc2.c2sd.renderer.utilities
Class RendererSettings
java.lang.Object
armyc2.c2sd.renderer.utilities.RendererSettings
Static class that holds the setting for the JavaRenderer.
Allows different parts of the renderer to know what
values are being used.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic intstatic final intAdds a level of complexity to the rendering but is much faster for certain objects.static final intEverything that comes back from the Renderer is a Java Shape.static final int2525Bch2 and USAS 11-12 symbologystatic final intDeprecated.use 2525Bstatic final int2525C, which includes 2525C & USAS COEv3static final intThere will be a colored box behind the textstatic final intThere will be no background for textstatic final intThere will be an adjustable outline around the text Outline width of 4 is recommended.static final intDeprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanbooleanintif true (default), when HQ Staff is present, location will be indicated by the free end of the staffintintbooleanTrue to draw as modifier label in the "E/F" location.get the preferred fill affiliation color for graphics.get the preferred line affiliation color for graphics.get the preferred fill affiliation color for units.get the preferred line affiliation color for units.get the preferred fill affiliation color for graphics.get the preferred line affiliation color for graphics.get the preferred fill affiliation color for units.get the preferred line affiliation color for units.static RendererSettingsfloatintRefers to background color of modifier labelsintRefers to text color of modifier labelsget font object used for labelsget font object used for labelsthe font name to be used for modifier labelsintget font point sizeintLike Font.BOLDget the preferred fill affiliation color for graphics.get the preferred line affiliation color for graphics.get the preferred fill affiliation color for units.get the preferred line affiliation color for units.intdoublebooleanReturns the value determining if we scale the echelon font size or just match the font size specified by the label font.intThis applies to Single Point Tactical Graphics.floatintCurrent symbology standardintValue from 0 to 255.intNone, outline (default), or filled background.intif RenderSettings.TextBackgroundMethod_OUTLINE is used, the outline will be this many pixels wide.intMaps to RendererSetting.RenderMethod_SHAPES or RendererSetting.RenderMethod_NATIVEbooleanGet 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).floatintMaps to RendererSetting.RenderMethod_SHAPES or RendererSetting.RenderMethod_NATIVEget the preferred fill affiliation color for graphics.get the preferred line affiliation color for graphics.get the preferred fill affiliation color for units.get the preferred line affiliation color for units.booleanReturns the current setting for Line Interpolation.voidsetAutoAdjustScale(boolean autoAdjustScale) Will attempt to adjust the scale if it doesn't seem to make sense with the passed in bbox.voidsetAutoCollapseModifiers(boolean value) Collapse Modifiers for fire support areas when the symbol isn't large enough to show all the labels.voidsetCacheEnabled(boolean active) voidsetCacheSize(float percentage) Set the cache size as a percentage of VM memory available to the app.voidsetCacheSize(int bytes) Set the cache size in bytes.voidsetCenterOnHQStaff(Boolean value) if true (default), when HQ Staff is present, location will be indicated by the free end of the staffvoidsetDefaultPixelSize(int size) voidsetDeviceDPI(int size) voidsetDrawAffiliationModifierAsLabel(boolean value) Determines how to draw the Affiliation modifier.voidsetFriendlyGraphicFillColor(Color friendlyGraphicFillColor) Set the preferred fill affiliation color for graphicsvoidsetFriendlyGraphicLineColor(Color friendlyGraphicLineColor) Set the preferred line affiliation color for graphicsvoidsetFriendlyUnitFillColor(Color friendlyUnitFillColor) Set the preferred fill affiliation color for unitsvoidsetFriendlyUnitLineColor(Color friendlyUnitLineColor) Set the preferred line affiliation color for unitsvoidsetGraphicPreferredAffiliationColors(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.voidsetHostileGraphicFillColor(Color hostileGraphicFillColor) Set the preferred fill affiliation color for graphicsvoidsetHostileGraphicLineColor(Color hostileGraphicLineColor) Set the preferred line affiliation color for graphicsvoidsetHostileUnitFillColor(Color hostileUnitFillColor) Set the preferred fill affiliation color for unitsvoidsetHostileUnitLineColor(Color hostileUnitLineColor) Set the preferred line affiliation color for unitsvoidsetLabelBackgroundColor(int value) Refers to text color of modifier labels Default Color is White.voidsetLabelForegroundColor(int value) Refers to text color of modifier labels Default Color is Black.voidsetModifierFont(String name, int type, int size) voidsetModifierFont(String name, int type, int size, Boolean kerning, float tracking) Deprecated.voidsetMPModifierFont(String name, int type, int size) Sets the font to be used for multipoint modifier labelsvoidsetMPModifierFont(String name, int type, int size, float kmlScale) Sets the font to be used for multipoint modifier labelsvoidsetNeutralGraphicFillColor(Color neutralGraphicFillColor) Set the preferred fill affiliation color for graphicsvoidsetNeutralGraphicLineColor(Color neutralGraphicLineColor) Set the preferred line affiliation color for graphicsvoidsetNeutralUnitFillColor(Color neutralUnitFillColor) Set the preferred line affiliation color for unitsvoidsetNeutralUnitLineColor(Color neutralUnitLineColor) Set the preferred line affiliation color for unitsvoidsetOperationalConditionModifierType(int value) Set the operational condition modifier to be slashes or barsvoidsetOverscanScale(double overscanScale) Optionally expand multipoint rendering outside bounding box by a scale factor.voidsetScaleEchelon(boolean value) false to use label font size true to scale it using symbolPixelBounds / 3.5voidsetSinglePointSymbolOutlineWidth(int width) This applies to Single Point Tactical Graphics.voidsetSymbologyStandard(int standard) Controls what symbols are supported.voidsetTextBackgroundAutoColorThreshold(int value) Value from 0 to 255.voidsetTextBackgroundMethod(int textBackgroundMethod) None, outline (default), or filled background.voidsetTextOutlineWidth(int width) if RenderSettings.TextBackgroundMethod_OUTLINE is used, the outline will be this many pixels wide.voidsetTextRenderMethod(int symbolRenderMethod) determines what kind of java objects will be generated when processing a symbol.voidsetTwoLabelOnly(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).voidsetUnitPreferredAffiliationColors(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.voidsetUnitRenderMethod(int symbolRenderMethod) determines what kind of java objects will be generated when processing a symbol.voidsetUnknownGraphicFillColor(Color unknownGraphicFillColor) Set the preferred fill affiliation color for graphicsvoidsetUnknownGraphicLineColor(Color unknownGraphicLineColor) Set the preferred line affiliation color for graphicsvoidsetUnknownUnitFillColor(Color unknownUnitFillColor) Set the preferred fill affiliation color for unitsvoidsetUnknownUnitLineColor(Color unknownUnitLineColor) Set the preferred line affiliation color for unitsvoidsetUseLineInterpolation(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.
-
Field Details
-
TextBackgroundMethod_NONE
There will be no background for text- See Also:
-
TextBackgroundMethod_COLORFILL
There will be a colored box behind the text- See Also:
-
TextBackgroundMethod_OUTLINE
There will be an adjustable outline around the text Outline width of 4 is recommended.- See Also:
-
TextBackgroundMethod_OUTLINE_QUICK
Deprecated.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 2 is recommended. Only works with RenderMethod_NATIVE.- See Also:
-
RenderMethod_SHAPES
Everything that comes back from the Renderer is a Java Shape. Simpler, but can be slower when rendering modifiers or a large number of single point symbols. Not recommended- See Also:
-
RenderMethod_NATIVE
Adds a level of complexity to the rendering but is much faster for certain objects. Modifiers and single point graphics will render faster. MultiPoints will still be shapes. Recommended- See Also:
-
Symbology_2525B
2525Bch2 and USAS 11-12 symbology- See Also:
-
Symbology_2525Bch2_USAS_13_14
Deprecated.use 2525B2525Bch2 and USAS 13/14 symbology- See Also:
-
Symbology_2525C
2525C, which includes 2525C & USAS COEv3- See Also:
-
OperationalConditionModifierType_SLASH
-
OperationalConditionModifierType_BAR
-
-
Method Details
-
getInstance
-
addEventListener
-
setTextBackgroundMethod
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
-
getSPFontSize
-
setDefaultPixelSize
-
getDefaultPixelSize
-
getDeviceDPI
-
setDeviceDPI
-
setSymbologyStandard
Controls what symbols are supported. Set this before loading the renderer.- Parameters:
standard- Like RendererSettings.Symbology_2525Bch2_USAS_13_14
-
getSymbologyStandard
Current symbology standard- Returns:
- symbologyStandard Like RendererSettings.Symbology_2525Bch2_USAS_13_14
-
setOperationalConditionModifierType
Set the operational condition modifier to be slashes or bars- Parameters:
value- like RendererSettings.OperationalConditionModifierType_SLASH
-
getOperationalConditionModifierType
-
setUseLineInterpolation
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
Returns the current setting for Line Interpolation.- Returns:
-
setAutoCollapseModifiers
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
-
setUnitRenderMethod
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
Maps to RendererSetting.RenderMethod_SHAPES or RendererSetting.RenderMethod_NATIVE- Returns:
- method like RendererSetting.RenderMethod_NATIVE
-
setCenterOnHQStaff
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
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
Maps to RendererSetting.RenderMethod_SHAPES or RendererSetting.RenderMethod_NATIVE- Returns:
-
setTextOutlineWidth
if RenderSettings.TextBackgroundMethod_OUTLINE is used, the outline will be this many pixels wide.- Parameters:
width-
-
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
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
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
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
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
false to use label font size true to scale it using symbolPixelBounds / 3.5- Parameters:
value-
-
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
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
Deprecated.- Parameters:
name- Like "arial"type- Like Font.BOLDsize- Like 12kerning- - 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.1and0.3; values outside this range are generally not desireable.
-
setModifierFont
- Parameters:
name-type- Typefacesize-
-
setMPModifierFont
Sets the font to be used for multipoint modifier labels- Parameters:
name- Like "arial"type- Like Font.TRUETYPE_FONTsize- Like 12
-
setMPModifierFont
Sets the font to be used for multipoint modifier labels- Parameters:
name- Like "arial"type- Like Font.TRUETYPE_FONTsize- Like 12kmlScale- 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
Like Font.BOLD- Returns:
- type of the label font
-
getMPModifierFontSize
get font point size- Returns:
- size of the label font
-
getKMLLabelScale
-
setCacheSize
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
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
-
setCacheEnabled
-
getCacheEnabled
-
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
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
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
-
setAutoAdjustScale
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
-
getFriendlyUnitFillColor
get the preferred fill affiliation color for units.- Returns:
- Color like Color(255, 255, 255)
-
setFriendlyUnitFillColor
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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- ColorhostileGraphicLineColor- ColorneutralGraphicLineColor- ColorunknownGraphicLineColor- ColorfriendlyGraphicFillColor- ColorhostileGraphicFillColor- ColorneutralGraphicFillColor- ColorunknownGraphicFillColor- 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 settinghostileUnitLineColor- ColorneutralUnitLineColor- ColorunknownUnitLineColor- ColorfriendlyUnitFillColor- ColorhostileUnitFillColor- ColorneutralUnitFillColor- ColorunknownUnitFillColor- Color
-