Class SECWebRenderer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class SECWebRenderer extends Applet
Author:
Administrator
See Also:
  • Field Details

  • Constructor Details

    • SECWebRenderer

      public SECWebRenderer()
  • Method Details

    • init

      public void init()
      Initialization method that will be called after the applet is loaded into the browser.
      Overrides:
      init in class Applet
    • getManifestInfoString

      public String getManifestInfoString()
    • setLoggingLevel

      public 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 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 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 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 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 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 String RenderSymbol(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, String modifiers, int format)
      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 - A JSON string representing all the possible symbol modifiers represented in the MIL-STD-2525C. Format of the string will be {"modifiers": {"attributeName":"value"[,"attributeNamen":"valuen"]...}} The quotes are literal in the above notation. Example: {"modifiers": {"quantity":"4","speed":"300","azimuth":[100,200]}}
      format - An enumeration: 0 for KML, 1 for JSON, 2 for GeoJSON.
      Returns:
      A JSON string representation of the graphic.
    • RenderSymbol

      public String RenderSymbol(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, String modifiers, 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 - A JSON string representing all the possible symbol modifiers represented in the MIL-STD-2525C. Format of the string will be {"modifiers": {"attributeName":"value"[,"attributeNamen":"valuen"]...}} The quotes are literal in the above notation. Example: {"modifiers": {"quantity":"4","speed":"300","azimuth":[100,200]}}
      format - An enumeration: 0 for KML, 1 for JSON, 2 for GeoJSON.
      symStd - An enumeration: 0 for 2525Bch2, 1 for 2525C.
      Returns:
      A JSON string representation of the graphic.
    • RenderSymbol2D

      public String RenderSymbol2D(String symbolCode, String name, String description, String controlPoints, int pixelWidth, int pixelHeight, String bbox, String modifiers)
      Renders all multi-point symbols, creating JSON that can be used to draw it on a 2D 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:
      symbolCode - A 15 character symbolID corresponding to one of the graphics in the MIL-STD-2525C
      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.
      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]]..."
      pixelWidth -
      pixelHeight -
      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 - A JSON string representing all the possible symbol modifiers represented in the MIL-STD-2525C. Format of the string will be {"modifiers": {"attributeName":"value"[,"attributeNamen":"valuen"]...}} The quotes are literal in the above notation. Example: {"modifiers": {"quantity":"4","speed":"300","azimuth":[100,200]}}
      Returns:
      A JSON string representation of the graphic.
    • RenderSymbol2D

      public String RenderSymbol2D(String id, String name, String description, String symbolCode, String controlPoints, int pixelWidth, int pixelHeight, String bbox, String modifiers, int format)
      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"
      format - An enumeration: 0 for KML, 1 for JSON, 2 for GeoJSON.
      symbolModifiers - A JSON string representing all the possible symbol modifiers represented in the MIL-STD-2525C. Format of the string will be {"modifiers": {"attributeName":"value"[,"attributeNamen":"valuen"]...}} The quotes are literal in the above notation. Example: {"modifiers": {"quantity":"4","speed":"300","azimuth":[100,200]}}
      Returns:
      A JSON (1) or KML (0) string representation of the graphic.
    • RenderSymbol2D

      public String RenderSymbol2D(String id, String name, String description, String symbolCode, String controlPoints, int pixelWidth, int pixelHeight, String bbox, String modifiers, 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"
      format - An enumeration: 0 for KML, 1 for JSON, 2 for GeoJSON.
      symStd - An enumeration: 0 for 2525Bch2, 1 for 2525C.
      symbolModifiers - A JSON string representing all the possible symbol modifiers represented in the MIL-STD-2525C. Format of the string will be {"modifiers": {"attributeName":"value"[,"attributeNamen":"valuen"]...}} The quotes are literal in the above notation. Example: {"modifiers": {"quantity":"4","speed":"300","azimuth":[100,200]}}
      Returns:
      A JSON (1) or KML (0) string representation of the graphic.
    • Render3dSymbol

      public 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.
      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]]}
      color - The fill color of the graphic
      Returns:
      A KML string that represents a placemark for the 3D shape
    • RenderMilStd3dSymbol

      public static String RenderMilStd3dSymbol(String name, String id, String symbolCode, String description, String altitudeMode, String controlPoints, String modifiers)
      Creates a 3D symbol from the MilStd2525B USAS or MIL-STD-2525C to be displayed on a 3D globe surface. Only certain symbols from the MIL-STD can be displayed in 3D. Most of these are graphics that fall under Fire Support. Any graphic that has an X modifier (altitude/depth) should have a 3D representation. 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]..."
      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.
      symbolCode - A 15 character ID of the type of symbol to draw. Only symbols with an X modifier from the standard will draw.
      description - A brief description of what the symbol represents. Generic text that does not require any format.
      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 ]..."
      Returns:
      A KML string that represents a placemark for the 3D shape
    • GetPortNumber

      public int GetPortNumber()
      gets the port number for the singlepoint server.
      Returns:
      0 if not running.
    • 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 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.
    • getSinglePointInfoBatch

      public String getSinglePointInfoBatch(String batch)
      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:
      batch - like {"iconURLs":["SFGP------*****?size=35invalid input: '&T'=Hello","SHGPE-----*****?size=50"]}
      Returns:
      like {"singlepoints":[{"x":0,"y":0,"boundsx":0,"boundsy":0,"boundswidth":35,"boundsheight":35,"iconwidth":35,"iconwidth":35}, ... ]}
    • SymbolDimensionsToJSON

      public static String SymbolDimensionsToJSON(Point2D anchor, Rectangle2D bounds, Dimension2D iconSize)
    • ShouldClipMultipointSymbol

      public 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:
    • GenerateSymbolAreaFillUrl

      public static String GenerateSymbolAreaFillUrl(Map<String,String> modifiers, ArrayList<ArmyC2.C2SD.Utilities.ShapeInfo> clip)
      Deprecated.
      use GenerateSymbolLineFillUrl
      Put this here rather than in multipointhandler so that I could get the port info from the single point server.
      Parameters:
      modifiers -
      clip -
      Returns:
    • GenerateSymbolLineFillUrl

      public static String GenerateSymbolLineFillUrl(Map<String,String> modifiers, ArrayList<Point2D> pixels, Rectangle2D 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:
    • GenerateSymbolAreaFillUrl

      public static String GenerateSymbolAreaFillUrl(String clipCoords, String SymbolIDs, int height, int width, int symbolSize)
      Deprecated.
      Only provide the end of the url like: "AREASYMBOLFILL?renderer=AreaSymbolFillRendererinvalid input: '&height'=300invalid input: '&width'=300invalid input: '&symbolIDs'=SFGP-----------,SHGP-----------" User need to provide the front: "http://127.0.0.1:6789/"
    • getSinglePointByteArray

      public 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.
    • destroy

      public void destroy()
      Overrides:
      destroy in class Applet