Class RendererUtilities

java.lang.Object
armyc2.c5isr.renderer.utilities.RendererUtilities

public class RendererUtilities extends Object
  • Constructor Details

  • Method Details

    • getIdealOutlineColor

      public static Color getIdealOutlineColor(Color color)
      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

      public static Color setColorAlpha(Color color, float alpha)
      Create a copy of the object with the passed alpha value.
      Parameters:
      color - object used for RGB values
      alpha - value between 0 and 1
      Returns:
    • colorToHexString

      public static String colorToHexString(Color color, Boolean withAlpha)
    • getColorFromHexString

      public static Color getColorFromHexString(String hexValue)
      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

      public static float findWidestStrokeWidth(String svg)
    • scaleIcon

      public static SVGInfo scaleIcon(String symbolID, SVGInfo icon)
    • getDistanceBetweenPoints

      public static int getDistanceBetweenPoints(Point pt1, Point pt2)
    • setSVGSPCMColors

      public static String setSVGSPCMColors(String symbolID, String svg, Color strokeColor, Color fillColor)