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, RectF bounds, int pixelSize, int outlineWidth)
      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
    • setAffiliationDashArray

      public static SVGInfo setAffiliationDashArray(String symbolID, SVGInfo siIcon)
      Sets SVG stroke-dasharray when action points are in planned status
      Parameters:
      symbolID -
      siIcon -
      Returns:
    • findWidestStrokeWidth

      public static float findWidestStrokeWidth(String svg)
    • findInstIndIndex

      public static int findInstIndIndex(String svg)
    • scaleIcon

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

      public static String increaseStrokeWidth(String svgString, int increaseBy)
      Takes an SVG string and increases all stroke-width values by the increaseBy value.
      Parameters:
      svgString - The raw SVG content.
      increaseBy - the number to add to the current stroke value
      Returns:
      The modified SVG content.
    • getDistanceBetweenPoints

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

      public static int calculateOutlineWidth()
    • calculateMapScale

      public static double calculateMapScale(int mapPixelWidth, double eastLon, double westLon)
      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 pixels
      eastLon - East Longitude of your map
      westLon - 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

      public static double calculateMapScale(int mapPixelWidth, double eastLon, double westLon, int dpi)
      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 pixels
      eastLon - East Longitude of your map
      westLon - West Longitude of your map
      dpi - 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

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