Class SECWebRenderer

java.lang.Object
sec.web.render.SECWebRenderer

public final class SECWebRenderer extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • init

      public static void init(Context context, String cacheDir)
    • setLoggingLevel

      public static void setLoggingLevel(Level level)
      \ Set minimum level at which an item can be logged. In descending order: OFF = Integer.MAX_VALUE Severe = 1000 Warning = 900 Info = 800 Config = 700 Fine = 500 Finer = 400 Finest = 300 All = Integer.MIN_VALUE Use like SECWebRenderer.setLoggingLevel(Level.INFO); or Use like SECWebRenderer.setLoggingLevel(800);
      Parameters:
      level - java.util.logging.level
    • setLoggingLevel

      public static void setLoggingLevel(int level)
      \ Set minimum level at which an item can be logged. In descending order: OFF = Integer.MAX_VALUE Severe = 1000 Warning = 900 Info = 800 Config = 700 Fine = 500 Finer = 400 Finest = 300 All = Integer.MIN_VALUE Use like SECWebRenderer.setLoggingLevel(Level.INFO); or Use like SECWebRenderer.setLoggingLevel(800);
      Parameters:
      level - int
    • setDefaultSymbologyStandard

      public static void setDefaultSymbologyStandard(int symStd)
      Let's user choose between 2525Bch2 and 2525C. Ideally, set only once at startup. 2525Bch2 = 0, 2525C = 1.
      Parameters:
      symStd -
    • setTacticalGraphicPointSize

      public static void setTacticalGraphicPointSize(int size)
      Single Point Tactical Graphics are rendered from font files. The font size you specify here determines how big the symbols will be rendered. This should be set once at startup.
      Parameters:
      size -
    • setUnitPointSize

      public static void setUnitPointSize(int size)
      Units are rendered from font files. The font size you specify here determines how big the symbols will be rendered. This should be set once at startup.
      Parameters:
      size -
    • setModifierTextColor

      public static void setModifierTextColor(String hexColor)
      Modifier Text Color will by default match the line color. This will override all modifier text color.
      Parameters:
      hexColor -
    • RenderSymbol

      public static String RenderSymbol(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, SparseArray<String> modifiers, SparseArray<String> attributes, int format, int symStd)
      Renders all multi-point symbols, creating KML that can be used to draw it on a Google map. Multipoint symbols cannot be draw the same at different scales. For instance, graphics with arrow heads will need to redraw arrowheads when you zoom in on it. Similarly, graphics like a Forward Line of Troops drawn with half circles can improve performance if clipped when the parts of the graphic that aren't on the screen. To help readjust graphics and increase performance, this function requires the scale and bounding box to help calculate the new locations.
      Parameters:
      id - A unique identifier used to identify the symbol by Google map. The id will be the folder name that contains the graphic.
      name - a string used to display to the user as the name of the graphic being created.
      description - a brief description about the graphic being made and what it represents.
      symbolCode - A 15 character symbolID corresponding to one of the graphics in the MIL-STD-2525C
      controlPoints - The vertices of the graphics that make up the graphic. Passed in the format of a string, using decimal degrees separating lat and lon by a comma, separating coordinates by a space. The following format shall be used "x1,y1[,z1] [xn,yn[,zn]]..."
      altitudeMode - Indicates whether the symbol should interpret altitudes as above sea level or above ground level. Options are "clampToGround", "relativeToGround" (from surface of earth), "absolute" (sea level), "relativeToSeaFloor" (from the bottom of major bodies of water).
      scale - A number corresponding to how many meters one meter of our map represents. A value "50000" would mean 1:50K which means for every meter of our map it represents 50000 meters of real world distance.
      bbox - The viewable area of the map. Passed in the format of a string "lowerLeftX,lowerLeftY,upperRightX,upperRightY." Not required but can speed up rendering in some cases. example: "-50.4,23.6,-42.2,24.2"
      modifiers - SparseArray, keyed using constants from ModifiersTG. Pass in comma delimited String for modifiers with multiple values like AM, AN & X
      attributes - SparseArray, keyed using constants from MilStdAttributes.
      format - An enumeration: 0 for KML, 1 for JSON.
      symStd - An enumeration: 0 for 2525Bch2, 1 for 2525C.
      Returns:
      A JSON string representation of the graphic.
    • RenderSymbol2D

      public static String RenderSymbol2D(String id, String name, String description, String symbolCode, String controlPoints, int pixelWidth, int pixelHeight, String bbox, SparseArray<String> modifiers, SparseArray<String> attributes, int format, int symStd)
      Renders all multi-point symbols, creating KML or JSON for the user to parse and render as they like. This function requires the bounding box to help calculate the new locations.
      Parameters:
      id - A unique identifier used to identify the symbol by Google map. The id will be the folder name that contains the graphic.
      name - a string used to display to the user as the name of the graphic being created.
      description - a brief description about the graphic being made and what it represents.
      symbolCode - A 15 character symbolID corresponding to one of the graphics in the MIL-STD-2525C
      controlPoints - The vertices of the graphics that make up the graphic. Passed in the format of a string, using decimal degrees separating lat and lon by a comma, separating coordinates by a space. The following format shall be used "x1,y1 [xn,yn]..."
      pixelWidth - pixel dimensions of the viewable map area
      pixelHeight - pixel dimensions of the viewable map area
      bbox - The viewable area of the map. Passed in the format of a string "lowerLeftX,lowerLeftY,upperRightX,upperRightY." example: "-50.4,23.6,-42.2,24.2"
      modifiers - SparseArray, keyed using constants from ModifiersTG. Pass in comma delimited String for modifiers with multiple values like AM, AN & X
      attributes - SparseArray, keyed using constants from MilStdAttributes.
      format - An enumeration: 0 for KML, 1 for JSON.
      symStd - An enumeration: 0 for 2525Bch2, 1 for 2525C.
      Returns:
      A JSON (1) or KML (0) string representation of the graphic.
    • Render3dSymbol

      public static String Render3dSymbol(String name, String id, String shapeType, String description, String lineColor, String fillColor, String altitudeMode, String controlPoints, String attributes)
      Creates a 3D symbol to be displayed on some 3D globe surface. Generates Keyhole Markup Language (KML) to return that specifies the points and format of the rendering.
      Control points should be of the format of: "x,y,z [x,y,z]..." Attributes should be passed in as a JSON array. If more than one set of parameters are passed in as an array or more than one item, they will map to the vertex specified in the control points. The attributes are of the format: {"attributes":[{"attribute1":value,...},{[optional]]}
      Parameters:
      name - The user displayed name for the symbol. Users will use this to identify with the symbol.
      id - An internally used unique id that developers can use to uniquely distinguish this symbol from others.
      shapeType - A 15 character ID of the type of symbol to draw.
      description - A brief description of what the symbol represents. Generic text that does not require any format.
      fillColor - The fill color of the graphic
      altitudeMode - Indicates whether the symbol should interpret altitudes as above sea level or above ground level. Options are "relativeToGround" (from surface of earth), "absolute" (sea level), "relativeToSeaFloor" (from the bottom of major bodies of water).
      controlPoints - The vertices of the shape. The number of required vertices varies based on the shapeType of the symbol. The simplest shape requires at least one point. Shapes that require more points than required will ignore extra points. Format for numbers is as follows:

      "x,y,z [x,y,z ]..."
      attributes - A JSON array holding the parameters for the shape. Attributes should be of the following format:

      {"attributes":[{"attribute1":value,...},{[optional]]}
      Returns:
      A KML string that represents a placemark for the 3D shape
    • RenderMultiPointAsMilStdSymbol

      public static MilStdSymbol RenderMultiPointAsMilStdSymbol(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, SparseArray<String> modifiers, SparseArray<String> attributes, int symStd)
      Renders all MilStd 2525 multi-point symbols, creating MilStdSymbol that contains the information needed to draw the symbol on the map. DOES NOT support RADARC, CAKE, TRACK etc... ArrayList milStdSymbol.getSymbolShapes.get(index).getPolylines() and ShapeInfo = milStdSymbol.getModifierShapes.get(index).
      Parameters:
      id - A unique identifier used to identify the symbol by Google map. The id will be the folder name that contains the graphic.
      name - a string used to display to the user as the name of the graphic being created.
      description - a brief description about the graphic being made and what it represents.
      symbolCode - A 15 character symbolID corresponding to one of the graphics in the MIL-STD-2525C
      controlPoints - The vertices of the graphics that make up the graphic. Passed in the format of a string, using decimal degrees separating lat and lon by a comma, separating coordinates by a space. The following format shall be used "x1,y1[,z1] [xn,yn[,zn]]..."
      altitudeMode - Indicates whether the symbol should interpret altitudes as above sea level or above ground level. Options are "clampToGround", "relativeToGround" (from surface of earth), "absolute" (sea level), "relativeToSeaFloor" (from the bottom of major bodies of water).
      scale - A number corresponding to how many meters one meter of our map represents. A value "50000" would mean 1:50K which means for every meter of our map it represents 50000 meters of real world distance.
      bbox - The viewable area of the map. Passed in the format of a string "lowerLeftX,lowerLeftY,upperRightX,upperRightY." Not required but can speed up rendering in some cases. example: "-50.4,23.6,-42.2,24.2"
      modifiers - Used like: modifiers.put(ModifiersTG.T_UNIQUE_DESIGNATION_1, "T"); Or modifiers.put(ModifiersTG.AM_DISTANCE, "1000,2000,3000");
      attributes - Used like: attributes.put(MilStdAttributes.LineWidth, "3"); Or attributes.put(MilStdAttributes.LineColor, "#00FF00");
      symStd - An enumeration: 0 for 2525Bch2, 1 for 2525C.
      Returns:
      MilStdSymbol
    • getSinglePointAnchor

      public String getSinglePointAnchor(String symbolID)
      Deprecated.
      Given a symbol code meant for a single point symbol, returns the anchor point at which to display that image based off the image returned from the URL of the SinglePointServer.
      Parameters:
      symbolID - - the 15 character symbolID of a single point MilStd2525 symbol.
      Returns:
      A pixel coordinate of the format "x,y". Returns an empty string if an error occurs.
    • getSinglePointInfo

      public static String getSinglePointInfo(String symbolID)
      Given a symbol code meant for a single point symbol, returns the anchor point at which to display that image based off the image returned from the URL of the SinglePointServer.
      Parameters:
      symbolID - - the 15 character symbolID of a single point MilStd2525 symbol.
      Returns:
      A pixel coordinate of the format "anchorX,anchorY,SymbolBoundsX, SymbolBoundsY,SymbolBoundsWidth,SymbolBoundsHeight,IconWidth,IconHeight". Anchor, represents the center point of the core symbol within the image. The image should be centered on this point. Symbol bounds represents the bounding rectangle of the core symbol within the image. IconWidth/Height represents the height and width of the image in its entirety. Returns an empty string if an error occurs.
    • ShouldClipMultipointSymbol

      public static String ShouldClipMultipointSymbol(String symbolID)
      Returns true if we recommend clipping a particular symbol. Would return false for and Ambush but would return true for a Line of Contact due to the decoration on the line.
      Parameters:
      symbolID -
      Returns:
    • getSinglePointByteArray

      public static byte[] getSinglePointByteArray(String symbolID)
      Given a symbol code meant for a single point symbol, returns the symbol as a byte array.
      Parameters:
      symbolID - - the 15 character symbolID of a single point MilStd2525 symbol.
      Returns:
      byte array.
    • GenerateSymbolLineFillUrl

      public static String GenerateSymbolLineFillUrl(SparseArray<String> modifiers, ArrayList<Point2D> pixels, Rectangle clip)
      Put this here rather than in multipointhandler so that I could get the port info from the single point server.
      Parameters:
      modifiers -
      clip -
      Returns: