Package sec.web.renderer
Class SECRenderer
java.lang.Object
sec.web.renderer.SECRenderer
Provides a simpler interface to all the supporting rendering classes. From
here the user can start the single point server or use this class to create
their own, specify the location of which plugins to load, get an image from a
url string or a collections of parameters, or generate kml or json for
multipoint symbology.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SECRendererGets a list of the loaded pluginsgetMilStdSymbolasIcon(String symbolID, int iconSize, Boolean showDisplayModifiers) Makes an icon for use in things like nodes on a tree view.getMilStdSymbolImage(String symbolId, Map<String, String> symbolInfoMap) Generates an image for a milstd symbolgetMilStdSymbolImage(String symbolID, Map<String, String> properties, int imageSize, Boolean keepUnitRatio) Deprecated.Generates an image for a milstd symbolGenerates kml for single point milstd symbologyintGets the port # the multi point server is currently using.intGets the port # the single point server is currently using.getSymbolImage(String symbolId, Map<String, String> symbolInfoMap) Works the same as getMilStdSymbolImage but if you specify a renderer, the function will tried to get the image from the specified renderer plugin.Works the same as getMilStdSymbolImageFromURL but if you specify a renderer, the function will tried to get the image from the specified renderer plugin.Generates kml for single point milstd or plugin symbologyChecks if the MultiPointServer is runningisMultiPointSymbol(String symbolID) Determines in the symbol is a multipoint symbol.isMultiPointSymbol(String symbolID, int symStd) Determines in the symbol is a multipoint symbol.Checks if the SinglePointServer is runningvoidloadPluginsFromDirectory(File directory) Scans a directory and loads any plugins located there.voidloadPluginsFromFile(File file) Attemps to Load a specfic file as a plugin Call refreshPlugins() after you've loaded all the plugins you want the service to make available.voidloadPluginsFromUrl(String url) Will attempt to download and load a plugin given a specific url Call refreshPlugins() after you've loaded all the plugins you want the service to make available.voidDeprecated.voidvoidAfter loading plugins, you need to refresh the service so that it's aware of the plugins that were made available.ArmyC2.C2SD.Utilities.MilStdSymbolRenderMultiPointAsMilStdSymbol(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, String modifiers, int symStd) Renders all multi-point symbols, creating KML that can be used to draw it on a Google map.RenderMultiPointSymbol(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.RenderMultiPointSymbol2D(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.voidsetDefaultSymbologyStandard(int symStd) Not meant to be changed on the fly.voidsetLoggingLevel(int level) \ Set minimum level at which an item can be logged.voidsetLoggingLevel(Level level) \ Set minimum level at which an item can be logged.voidsetSinglePointTacticalGraphicFontSize(int size) Determines size of the symbol assuming no pixel size is specifiedvoidsetSinglePointUnitsFontSize(int size) Determines size of the symbol assuming no pixel size is specifiedShouldClipMultipointSymbol(String symbolID) voidvoidstartMultiPointServer(int port) Starts multi point server on specified port numbervoidstartMultiPointServer(int port, int backlog) Starts multi point server on specified port numbervoidvoidstartSinglePointServer(int port) Starts single point server on specified port numbervoidstartSinglePointServer(int port, int backlog) Starts single point server on specified port numbervoidStops the multi point servervoidStops the single point server
-
Method Details
-
getInstance
-
getManifest
-
getManifestInfoString
-
printManifestInfo
public void printManifestInfo() -
matchSECWebRendererAppletDefaultRendererSettings
public void matchSECWebRendererAppletDefaultRendererSettings()Deprecated.Sets the rendering settings defaults to match the defaults that are set in the SECWebRenderer applet. -
setDefaultSymbologyStandard
public void setDefaultSymbologyStandard(int symStd) Not meant to be changed on the fly. Let's user choose between 2525Bch2 and 2525C. 2525Bch2 = 0, 2525C = 1.- Parameters:
symStd-
-
setLoggingLevel
\ 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 SECRenderer.setLoggingLevel(Level.INFO); or Use like SECRenderer.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 SECRenderer.setLoggingLevel(Level.INFO); or Use like SECRenderer.setLoggingLevel(800);- Parameters:
level- int
-
setSinglePointUnitsFontSize
public void setSinglePointUnitsFontSize(int size) Determines size of the symbol assuming no pixel size is specified- Parameters:
size- default 50
-
setSinglePointTacticalGraphicFontSize
public void setSinglePointTacticalGraphicFontSize(int size) Determines size of the symbol assuming no pixel size is specified- Parameters:
size- default 60
-
startSinglePointServer
public void startSinglePointServer() -
startSinglePointServer
public void startSinglePointServer(int port) Starts single point server on specified port number- Parameters:
port-
-
startSinglePointServer
public void startSinglePointServer(int port, int backlog) Starts single point server on specified port number- Parameters:
port-backlog- An integer value of '0' means use the system default
-
getSinglePointServerPort
public int getSinglePointServerPort()Gets the port # the single point server is currently using.- Returns:
-
isSinglePointServerRunning
Checks if the SinglePointServer is running- Returns:
-
stopSinglePointServer
public void stopSinglePointServer()Stops the single point server -
startMultiPointServer
public void startMultiPointServer() -
startMultiPointServer
public void startMultiPointServer(int port) Starts multi point server on specified port number- Parameters:
port-
-
startMultiPointServer
public void startMultiPointServer(int port, int backlog) Starts multi point server on specified port number- Parameters:
port-backlog- An integer value of '0' means use the system default
-
getMultiPointServerPort
public int getMultiPointServerPort()Gets the port # the multi point server is currently using.- Returns:
-
isMultiPointServerRunning
Checks if the MultiPointServer is running- Returns:
-
stopMultiPointServer
public void stopMultiPointServer()Stops the multi point server -
loadPluginsFromUrl
Will attempt to download and load a plugin given a specific url Call refreshPlugins() after you've loaded all the plugins you want the service to make available.- Parameters:
url-
-
loadPluginsFromFile
Attemps to Load a specfic file as a plugin Call refreshPlugins() after you've loaded all the plugins you want the service to make available.- Parameters:
file-
-
loadPluginsFromDirectory
Scans a directory and loads any plugins located there. Call refreshPlugins() after you've loaded all the plugins you want the service to make available.- Parameters:
directory-
-
refreshPlugins
public void refreshPlugins()After loading plugins, you need to refresh the service so that it's aware of the plugins that were made available. -
getListOfLoadedPlugins
Gets a list of the loaded plugins- Returns:
- a list of the currently loaded plugins.
-
getMilStdSymbolImageFromURL
Generates an image for a milstd symbol- Parameters:
url- assumes url ends like: "/SFGP-----------?T=uniquedesignation_1invalid input: '&H'=blahinvalid input: '&H1'=etc"- Returns:
-
getMilStdSymbolImage
Generates an image for a milstd symbol- Returns:
DocFlavor.BYTE_ARRAY
-
getSymbolImageFromURL
Works the same as getMilStdSymbolImageFromURL but if you specify a renderer, the function will tried to get the image from the specified renderer plugin.- Returns:
-
getSymbolImage
Works the same as getMilStdSymbolImage but if you specify a renderer, the function will tried to get the image from the specified renderer plugin.- Returns:
DocFlavor.BYTE_ARRAY
-
getMilStdSymbolImage
public PNGInfo getMilStdSymbolImage(String symbolID, Map<String, String> properties, int imageSize, Boolean keepUnitRatio) Deprecated.Generates an image for a milstd symbol- Parameters:
symbolID-properties- keyed on values like ModifiersUnits.T_UNIQUE_DESIGNATION_1 OR ModifiersTG.Q_DIRECTION_OF_MOVEMENTimageSize-keepUnitRatio-- Returns:
- PNGInfo which has the buffered image as well as offset information so the image can be place properly on the map.
-
getMilStdSymbolasIcon
public BufferedImage getMilStdSymbolasIcon(String symbolID, int iconSize, Boolean showDisplayModifiers) Makes an icon for use in things like nodes on a tree view.- Parameters:
symbolID-iconSize- height invalid input: '&' width in pixels that you want the icon to be.showDisplayModifiers- things like echelon, mobility, HQ, feint, etc.- Returns:
-
getMilStdSymbolImageKML
Generates kml for single point milstd symbology- Parameters:
fullURL-symbolID-params- include "id", "name", "description", "lat", "lon", and "alt" if you'd like to seem them in the resultant KML. They are not used for the actual rendering.- Returns:
-
getSymbolImageKML
Generates kml for single point milstd or plugin symbology- Parameters:
fullURL-symbolID-params- include "id", "name", "description", "lat", "lon", and "alt" if you'd like to seem them in the resultant KML. They are not used for the actual rendering.- Returns:
-
RenderMultiPointSymbol
public String RenderMultiPointSymbol(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-2525CcontrolPoints- 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.symStd- An enumeration: 0 for 2525Bch2, 1 for 2525C.- Returns:
- A JSON string representation of the graphic.
-
RenderMultiPointAsMilStdSymbol
public ArmyC2.C2SD.Utilities.MilStdSymbol RenderMultiPointAsMilStdSymbol(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, String modifiers, 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-2525CcontrolPoints- 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]}}symStd- An enumeration: 0 for 2525Bch2, 1 for 2525C.- Returns:
- A JSON string representation of the graphic.
-
RenderMultiPointSymbol2D
public String RenderMultiPointSymbol2D(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-2525CcontrolPoints- 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 areapixelHeight- pixel dimensions of the viewable map areabbox- 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]}}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.
-
ShouldClipMultipointSymbol
- Parameters:
symbolID-- Returns:
- true if it's advisable that the symbol be clipped
-
isMultiPointSymbol
Determines in the symbol is a multipoint symbol. This includes circular invalid input: '&' rectangular symbols that may have only 1 actual point but has AM, AN, width or height defined that's lets the renderer derive the remaining point.- Parameters:
symbolID-- Returns:
-
isMultiPointSymbol
Determines in the symbol is a multipoint symbol. This includes circular invalid input: '&' rectangular symbols that may have only 1 actual point but has AM, AN, width or height defined that's lets the renderer derive the remaining point.- Parameters:
symbolID-symStd- Like RendererSettings.Symbology_2525C- Returns:
-