Package armyc2.c5isr.renderer.utilities
Class RendererUtilities
java.lang.Object
armyc2.c5isr.renderer.utilities.RendererUtilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculateMapScale(int mapPixelWidth, double eastLon, double westLon) A starting point for calculating map scale.static doublecalculateMapScale(int mapPixelWidth, double eastLon, double westLon, int dpi) A starting point for calculating map scale.static StringcolorToHexString(Color color, Boolean withAlpha) static intfindInstIndIndex(String svg) static floatstatic ColorgetColorFromHexString(String hexValue) static intgetDistanceBetweenPoints(Point pt1, Point pt2) static ColorgetIdealOutlineColor(Color color) static voidrenderSymbolCharacter(Canvas ctx, String symbol, int x, int y, Paint paint, Color color, int outlineWidth) static SVGInfostatic ColorsetColorAlpha(Color color, float alpha) Create a copy of the object with the passed alpha value.static StringsetSVGFrameColors(String symbolID, String svg, Color strokeColor, Color fillColor) For Renderer Use Only Assumes a fresh SVG String from the SVGLookup with its default valuesstatic StringsetSVGSPCMColors(String symbolID, String svg, Color strokeColor, Color fillColor) static StringsetSVGSPCMColors(String symbolID, String svg, Color strokeColor, Color fillColor, boolean isOutline) For Renderer Use Only Changes colors for single point control measures
-
Constructor Details
-
RendererUtilities
public RendererUtilities()
-
-
Method Details
-
getIdealOutlineColor
- Parameters:
color- {String} color like "#FFFFFF"- Returns:
- {String}
-
renderSymbolCharacter
public static void renderSymbolCharacter(Canvas ctx, String symbol, int x, int y, Paint paint, Color color, int outlineWidth) -
setColorAlpha
Create a copy of the object with the passed alpha value.- Parameters:
color- object used for RGB valuesalpha- value between 0 and 1- Returns:
-
colorToHexString
-
getColorFromHexString
- Parameters:
hexValue- - String representing hex value (formatted "0xRRGGBB" i.e. "0xFFFFFF") OR formatted "0xAARRGGBB" i.e. "0x00FFFFFF" for a color with an alpha value I will also put up with "RRGGBB" and "AARRGGBB" without the starting "0x"- Returns:
-
setSVGFrameColors
public static String setSVGFrameColors(String symbolID, String svg, Color strokeColor, Color fillColor) For Renderer Use Only Assumes a fresh SVG String from the SVGLookup with its default values- Parameters:
symbolID-svg-strokeColor- hex value like "#FF0000";fillColor- hex value like "#FF0000";- Returns:
- SVG String
-
setSVGSPCMColors
public static String setSVGSPCMColors(String symbolID, String svg, Color strokeColor, Color fillColor, boolean isOutline) For Renderer Use Only Changes colors for single point control measures- Parameters:
symbolID-svg-strokeColor- hex value like "#FF0000";fillColor- hex value like "#FF0000";isOutline- true if this represents a thicker outline to render first beneath the normal symbol (the function must be called twice)- Returns:
- SVG String
-
findWidestStrokeWidth
-
findInstIndIndex
-
scaleIcon
-
getDistanceBetweenPoints
-
calculateMapScale
A starting point for calculating map scale. The User may prefer a different calculation depending on how their maps works.- Parameters:
mapPixelWidth- Width of your map in pixelseastLon- East Longitude of your mapwestLon- West Longitude of your map- Returns:
- Map scale value to use in the RenderSymbol function
WebRenderer.RenderSymbol(String, String, String, String, String, String, double, String, Map, Map, int)
-
calculateMapScale
A starting point for calculating map scale. The User may prefer a different calculation depending on how their maps works.- Parameters:
mapPixelWidth- Width of your map in pixelseastLon- East Longitude of your mapwestLon- West Longitude of your mapdpi- Dots Per Inch of your device- Returns:
- Map scale value to use in the RenderSymbol function
WebRenderer.RenderSymbol(String, String, String, String, String, String, double, String, Map, Map, int)
-
setSVGSPCMColors
-