Package ArmyC2.C2SD.Rendering
Class JavaRenderer
java.lang.Object
ArmyC2.C2SD.Rendering.JavaRenderer
- All Implemented Interfaces:
IJavaRenderer
- Author:
- michael.spinelli
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionCanRender(ArmyC2.C2SD.Utilities.MilStdSymbol symbol) Takes a symbol and determines if it is renderableCanRender(String symbolCode, ArrayList<Point2D.Double> coords) Checks if the Renderer can build the symbol with the given informationCanRender(String symbolCode, ArrayList<Point2D.Double> coords, int symStd) takes symbol properties and determines if they can be rendered as a symbolvoidDraw(ArmyC2.C2SD.Utilities.MilStdSymbol symbol, Graphics2D destination) Does the actual drawing of the Symbol.voidDraw(ArrayList<ArmyC2.C2SD.Utilities.MilStdSymbol> symbols, Graphics2D destination) Does the actual drawing of the Symbol.voidDrawDB(ArmyC2.C2SD.Utilities.MilStdSymbol symbol, Graphics2D destination, Rectangle clip) Does the actual drawing of the Symbol.voidDrawDB(ArrayList<ArmyC2.C2SD.Utilities.MilStdSymbol> symbols, Graphics2D destination, Rectangle clip) Does the actual drawing of the Symbol.static JavaRendererInstance of the JavaRendererintReturns size currently being used to draw single point Tactical GraphicsgetSupportedFETypes(int symStd) Get a Map of the supported Unit or Force Element symbolsgetSupportedTGTypes(int symStd) Get a Map of the supported Tactical Graphic symbols.intReturns size currently being used to draw unitsvoidinitialize(Map<String, String> arg0) Deprecated.ArmyC2.C2SD.Utilities.MilStdSymbolRender(ArmyC2.C2SD.Utilities.MilStdSymbol symbol, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) Populates the Symbol invalid input: '&' Modifier Shape collection of the milstdsymbolArmyC2.C2SD.Utilities.MilStdSymbolRender(String symbolCode, String UUID, ArrayList<Point2D.Double> coords, Map<String, String> Modifiers, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) Populates the Symbol invalid input: '&' Modifier Shape collection of the milstdsymbolArrayList<ArmyC2.C2SD.Utilities.MilStdSymbol> Render(ArrayList<ArmyC2.C2SD.Utilities.MilStdSymbol> symbols, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) Populates the Symbol invalid input: '&' Modifier Shape collection of the milstdsymbolRenderMilStdSymbolAsIcon(String symbolID, int iconSize, Boolean showDisplayModifiers) Doesn't support multipoints yet.RenderMilStdSymbolAsIcon(String symbolID, int iconSize, Boolean showDisplayModifiers, int symStd) ArmyC2.C2SD.Utilities.ImageInfoRenderMilStdSymbolAsImageInfo(ArmyC2.C2SD.Utilities.MilStdSymbol symbol, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) Generates an imageInfo objectArmyC2.C2SD.Utilities.ImageInfoRenderMilStdSymbolAsImageInfo(String symbolCode, String UUID, ArrayList<Point2D.Double> coords, Map<String, String> Modifiers, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) Given parameters, generates an ImageInfo object.ArmyC2.C2SD.Utilities.ImageInfoRenderSinglePointAsImageInfo(String symbolCode, Map<String, String> Modifiers, int unitSize, boolean keepUnitRatio) Requires less information than RenderMilStdSymbolAsImageInfo.ArmyC2.C2SD.Utilities.ImageInfoRenderSinglePointAsImageInfo(String symbolCode, Map<String, String> Modifiers, int unitSize, boolean keepUnitRatio, int symStd) static voidsetLoggingLevel(Level newLevel) Set minimum level at which an item can be logged.voidsetModifierFont(String name, int type, int size) Set the label font to be used in the renderer Default tracking to TextAttribute.TRACKING_LOOSE and kerning to off.voidsetModifierFont(String name, int type, int size, float tracking, Boolean kerning) Set the label font to be used in the renderervoidsetSinglePointTGSymbolSize(int size) determines size of single point tactical graphicsvoidsetUnitSymbolSize(int size) determines size of units (force elements)
-
Field Details
-
UnitSizeMedium
public static final int UnitSizeMedium- See Also:
-
UnitSizeSmall
public static final int UnitSizeSmall- See Also:
-
UnitSizeLarge
public static final int UnitSizeLarge- See Also:
-
UnitSizeXL
public static final int UnitSizeXL- See Also:
-
SymbolSizeMedium
public static final int SymbolSizeMedium- See Also:
-
SymbolSizeSmall
public static final int SymbolSizeSmall- See Also:
-
SymbolSizeLarge
public static final int SymbolSizeLarge- See Also:
-
SymbolSizeXL
public static final int SymbolSizeXL- See Also:
-
-
Method Details
-
getInstance
Instance of the JavaRenderer- Returns:
- the instance
-
CanRender
Takes a symbol and determines if it is renderable- Specified by:
CanRenderin interfaceIJavaRenderer- Parameters:
symbol-- Returns:
- true if symbol can be rendered based on provided information
-
CanRender
Description copied from interface:IJavaRendererChecks if the Renderer can build the symbol with the given information- Specified by:
CanRenderin interfaceIJavaRenderer- Parameters:
symbolCode-coords-- Returns:
- true if symbol can be rendered based on provided information
-
CanRender
takes symbol properties and determines if they can be rendered as a symbol- Specified by:
CanRenderin interfaceIJavaRenderer- Parameters:
symbolCode-coords-symStd- Like RendererSettings.Symbology_2525CsymbologyStandard- like RendererSettings.Symbology_2525C- Returns:
- true if symbol can be rendered based on provided information
-
Render
public ArmyC2.C2SD.Utilities.MilStdSymbol Render(ArmyC2.C2SD.Utilities.MilStdSymbol symbol, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) throws ArmyC2.C2SD.Utilities.RendererException Populates the Symbol invalid input: '&' Modifier Shape collection of the milstdsymbol- Specified by:
Renderin interfaceIJavaRenderer- Parameters:
symbol-converter- does point conversion between pixels invalid input: '&' lat/lon coordinates.clipBounds- dimensions of drawing surface. needed to do clipping.- Returns:
- drawable symbol populated with shape data
- Throws:
ArmyC2.C2SD.Utilities.RendererException
-
Render
public ArrayList<ArmyC2.C2SD.Utilities.MilStdSymbol> Render(ArrayList<ArmyC2.C2SD.Utilities.MilStdSymbol> symbols, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) throws ArmyC2.C2SD.Utilities.RendererException Populates the Symbol invalid input: '&' Modifier Shape collection of the milstdsymbol- Specified by:
Renderin interfaceIJavaRenderer- Parameters:
symbols-converter- does point conversion between pixels invalid input: '&' lat/lon coordinates.clipBounds- dimensions of drawing surface. needed to do clipping.- Returns:
- drawable symbols populated with shape data
- Throws:
ArmyC2.C2SD.Utilities.TBCRendererExceptionArmyC2.C2SD.Utilities.RendererException
-
Render
public ArmyC2.C2SD.Utilities.MilStdSymbol Render(String symbolCode, String UUID, ArrayList<Point2D.Double> coords, Map<String, String> Modifiers, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) throws ArmyC2.C2SD.Utilities.RendererExceptionPopulates the Symbol invalid input: '&' Modifier Shape collection of the milstdsymbol- Specified by:
Renderin interfaceIJavaRenderer- Parameters:
symbolCode-UUID-coords-Modifiers-converter- does point conversion between pixels invalid input: '&' lat/lon coordinates.clipBounds- dimensions of drawing surface. needed to do clipping.- Returns:
- drawable symbol populated with shape data
- Throws:
ArmyC2.C2SD.Utilities.TBCRendererExceptionArmyC2.C2SD.Utilities.RendererException
-
RenderSinglePointAsImageInfo
public ArmyC2.C2SD.Utilities.ImageInfo RenderSinglePointAsImageInfo(String symbolCode, Map<String, String> Modifiers, int unitSize, boolean keepUnitRatio) Description copied from interface:IJavaRendererRequires less information than RenderMilStdSymbolAsImageInfo. Can only be used for singlepoint graphics.- Specified by:
RenderSinglePointAsImageInfoin interfaceIJavaRenderer- Parameters:
symbolCode-Modifiers- keyed on values from ModifiersUnits, ModifiersTG, and MilStdAttributes.unitSize- 35 would make a an image where the core symbol is 35x35. label modifiers and display modifiers may fall outside of that area and final image may be bigger than 35x35. use getSinglePointTGSymbolSize or getUnitSymbolSize.keepUnitRatio- Recommend setting to true when drawing on a map. Only applies to force elements (units). If KeepUnitRatio is set, Symbols will be drawn with respect to each other. Unknown unit is the all around biggest, neutral unit is the smallest. if size is 35, neutral would be (35/1.5)*1.1=25.7- Returns:
- ImageInfo, which has the image and all the information needed to position it properly.
-
RenderSinglePointAsImageInfo
public ArmyC2.C2SD.Utilities.ImageInfo RenderSinglePointAsImageInfo(String symbolCode, Map<String, String> Modifiers, int unitSize, boolean keepUnitRatio, int symStd) - Parameters:
symbolCode-Modifiers-unitSize- 35 would make a an image where the core symbol is 35x35. label modifiers and display modifiers may fall outside of that area and final image may be bigger than 35x35. use getSinglePointTGSymbolSize or getUnitSymbolSize.keepUnitRatio- Recommend setting to true when drawing on a map. Only applies to force elements (units). If KeepUnitRatio is set, Symbols will be drawn with respect to each other. Unknown unit is the all around biggest, neutral unit is the smallest. if size is 35, neutral would be (35/1.5)*1.1=25.7- Returns:
- ImageInfo, which has the image and all the information needed to position it properly.
-
RenderMilStdSymbolAsImageInfo
public ArmyC2.C2SD.Utilities.ImageInfo RenderMilStdSymbolAsImageInfo(String symbolCode, String UUID, ArrayList<Point2D.Double> coords, Map<String, String> Modifiers, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) Given parameters, generates an ImageInfo object. Works for all symbols- Parameters:
symbolCode-UUID-coords-Modifiers-converter-clipBounds-- Returns:
-
RenderMilStdSymbolAsImageInfo
public ArmyC2.C2SD.Utilities.ImageInfo RenderMilStdSymbolAsImageInfo(ArmyC2.C2SD.Utilities.MilStdSymbol symbol, ArmyC2.C2SD.Utilities.IPointConversion converter, Rectangle2D clipBounds) Generates an imageInfo object- Parameters:
symbol-converter-clipBounds-- Returns:
-
RenderMilStdSymbolAsIcon
public BufferedImage RenderMilStdSymbolAsIcon(String symbolID, int iconSize, Boolean showDisplayModifiers) Doesn't support multipoints yet. Renders using the default symbology Standard specified here: RendererSettings.getInstance().getSymbologyStandard());- Specified by:
RenderMilStdSymbolAsIconin interfaceIJavaRenderer- Parameters:
symbolID-iconSize-showDisplayModifiers-- Returns:
-
RenderMilStdSymbolAsIcon
public BufferedImage RenderMilStdSymbolAsIcon(String symbolID, int iconSize, Boolean showDisplayModifiers, int symStd) - Parameters:
symbolID-iconSize-showDisplayModifiers-symStd-- Returns:
-
DrawDB
public void DrawDB(ArmyC2.C2SD.Utilities.MilStdSymbol symbol, Graphics2D destination, Rectangle clip) throws ArmyC2.C2SD.Utilities.RendererException Does the actual drawing of the Symbol. MilstdSymbol need to be properly populated via the Render call first. Draws to an offscreen image that blits the result to the desination Graphics2D object.- Specified by:
DrawDBin interfaceIJavaRenderer- Parameters:
symbol-destination- surface to draw toclip- Cannot be null. This function does not apply it to the destination object. Clip dimesions are used to determine the size of the back buffer. Also useful for making sure only an specfic area is being redrawn. It shouldn't be bigger than the drawing area, but it can be a section of the drawing area. like if the draw area is 400x400 and the clip is x200,y200,w200,h200; the bottom right quadrant is the only part that will be drawn and the back buffer will only be 200x200. Or you can simply have the dimensions of the clip match the dimensions of the draw area.- Throws:
ArmyC2.C2SD.Utilities.RendererException
-
DrawDB
public void DrawDB(ArrayList<ArmyC2.C2SD.Utilities.MilStdSymbol> symbols, Graphics2D destination, Rectangle clip) throws ArmyC2.C2SD.Utilities.RendererException Does the actual drawing of the Symbol. MilstdSymbol need to be properly populated via the Render call first. Draws to an offscreen image that blits the result to the destination Graphics2D object.- Specified by:
DrawDBin interfaceIJavaRenderer- Parameters:
symbols-destination- surface to draw toclip- Cannot be null. This function does not apply it to the destination object. Clip dimensions are used to determine the size of the back buffer. Also useful for making sure only a specific area is being redrawn. It shouldn't be bigger than the drawing area, but it can be a section of the drawing area. like if the draw area is 400x400 and the clip is x200,y200,w200,h200; the bottom right quadrant is the only part that will be drawn and the back buffer will only be 200x200. Or you can simply have the dimensions of the clip match the dimensions of the draw area.- Throws:
ArmyC2.C2SD.Utilities.RendererException
-
Draw
public void Draw(ArmyC2.C2SD.Utilities.MilStdSymbol symbol, Graphics2D destination) throws ArmyC2.C2SD.Utilities.RendererException Does the actual drawing of the Symbol. MilstdSymbol need to be properly populated via the Render call first.- Specified by:
Drawin interfaceIJavaRenderer- Parameters:
symbol-destination- surface to draw to- Throws:
ArmyC2.C2SD.Utilities.RendererException
-
Draw
public void Draw(ArrayList<ArmyC2.C2SD.Utilities.MilStdSymbol> symbols, Graphics2D destination) throws ArmyC2.C2SD.Utilities.RendererException Does the actual drawing of the Symbol. MilstdSymbol need to be properly populated via the Render call first.- Specified by:
Drawin interfaceIJavaRenderer- Parameters:
symbols-destination- surface to draw to- Throws:
ArmyC2.C2SD.Utilities.RendererException
-
getSupportedFETypes
Get a Map of the supported Unit or Force Element symbols- Specified by:
getSupportedFETypesin interfaceIJavaRenderer- Parameters:
symStd- RendererSettings.Symbology_2525C- Returns:
- a Map of UnitDefs keyed by symbol code.
-
getSupportedTGTypes
Get a Map of the supported Tactical Graphic symbols.- Specified by:
getSupportedTGTypesin interfaceIJavaRenderer- Parameters:
symStd- RendererSettings.Symbology_2525C- Returns:
- a Map of SymbolDefs keyed by symbol code.
-
initialize
Deprecated.- Parameters:
arg0-
-
setLoggingLevel
Set minimum level at which an item can be logged. In descending order: Severe Warning Info Config Fine Finer Finest- Parameters:
newLevel-
-
getSinglePointTGSymbolSize
public int getSinglePointTGSymbolSize()Description copied from interface:IJavaRendererReturns size currently being used to draw single point Tactical Graphics- Specified by:
getSinglePointTGSymbolSizein interfaceIJavaRenderer
-
getUnitSymbolSize
public int getUnitSymbolSize()Description copied from interface:IJavaRendererReturns size currently being used to draw units- Specified by:
getUnitSymbolSizein interfaceIJavaRenderer
-
setSinglePointTGSymbolSize
public void setSinglePointTGSymbolSize(int size) Description copied from interface:IJavaRendererdetermines size of single point tactical graphics- Specified by:
setSinglePointTGSymbolSizein interfaceIJavaRenderer- Parameters:
size- like JavaRenderer.SymbolSizeMedium or any positive integer
-
setUnitSymbolSize
public void setUnitSymbolSize(int size) Description copied from interface:IJavaRendererdetermines size of units (force elements)- Specified by:
setUnitSymbolSizein interfaceIJavaRenderer- Parameters:
size- JavaRenderer.SymbolSizeMedium or positive any integer
-
setModifierFont
Set the label font to be used in the renderer Default tracking to TextAttribute.TRACKING_LOOSE and kerning to off.- Specified by:
setModifierFontin interfaceIJavaRenderer- Parameters:
name- like "arial"type- like Font.BOLDsize- like 12
-
setModifierFont
Set the label font to be used in the renderer- Specified by:
setModifierFontin interfaceIJavaRenderer- Parameters:
name- like "arial"type- like Font.BOLDsize- like 12tracking- like TextAttribute.TRACKING_LOOSE (0.04f)kerning- default false.
-