Package armyc2.c5isr.renderer.utilities
Class RendererUtilities
java.lang.Object
armyc2.c5isr.renderer.utilities.RendererUtilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
colorToHexString
(Color color, Boolean withAlpha) static float
static Color
getColorFromHexString
(String hexValue) static int
getDistanceBetweenPoints
(Point pt1, Point pt2) static Color
getIdealOutlineColor
(Color color) static void
renderSymbolCharacter
(Canvas ctx, String symbol, int x, int y, Paint paint, Color color, int outlineWidth) static SVGInfo
static Color
setColorAlpha
(Color color, float alpha) Create a copy of the object with the passed alpha value.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 valuesstatic String
setSVGSPCMColors
(String symbolID, String svg, Color strokeColor, Color fillColor) static String
setSVGSPCMColors
(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
-
scaleIcon
-
getDistanceBetweenPoints
-
setSVGSPCMColors
-