public ImageInfo Render(String symbolID, Dictionary <int, String> modifiers, Dictionary <int, String> attributes, CanvasDevice device) { SinglePointRenderer spr = SinglePointRenderer.getInstance(); int symStd = 1; if (modifiers != null && modifiers[MilStdAttributes.SymbologyStandard] != null) { symStd = Convert.ToInt32(modifiers[MilStdAttributes.SymbologyStandard]); } else { if (modifiers == null) { modifiers = new Dictionary <int, String>(); } modifiers[MilStdAttributes.SymbologyStandard] = Convert.ToString(RendererSettings.getInstance().getSymbologyStandard()); } var basicID = SymbolUtilities.getBasicSymbolIDStrict(symbolID); if (SymbolUtilities.isTacticalGraphic(symbolID)) { SymbolDef sd = SymbolDefTable.getInstance().getSymbolDef(basicID, symStd); if (sd == null) { sd = SymbolDefTable.getInstance().getSymbolDef(basicID, symStd); } if (sd != null && sd.getDrawCategory() == SymbolDef.DRAW_CATEGORY_POINT) { return(spr.RenderSPTG(symbolID, modifiers, attributes)); } else { Color color = RenderUtilities.DrawingColorToUIColor(SymbolUtilities.getLineColorOfAffiliation(symbolID)); int size = 35; if (attributes.ContainsKey(MilStdAttributes.PixelSize)) { size = int.Parse(attributes[MilStdAttributes.PixelSize]); } if (modifiers.ContainsKey(MilStdAttributes.LineColor)) { color = RenderUtilities.getColorFromHexString(modifiers[MilStdAttributes.LineColor]); } if (modifiers.ContainsKey(MilStdAttributes.PixelSize)) { size = int.Parse(modifiers[MilStdAttributes.PixelSize]); } return(TacticalGraphicIconRenderer.getIcon(symbolID, size, color, 0)); } } else if (UnitFontLookup.getInstance().getLookupInfo(basicID) != null) { return(spr.RenderUnit(symbolID, modifiers, attributes, device)); } else { //symbolID = SymbolUtilities.reconcileSymbolID(symbolID, false); return(spr.RenderUnit(symbolID, modifiers, attributes, null)); } }
/** * * */ private void Init() { try { SymbolDefTable sdTable = SymbolDefTable.getInstance(); Dictionary <String, SymbolDef> symbolDefs = sdTable.getAllSymbolDefs(); ICollection <SymbolDef> vc = symbolDefs.Values; IEnumerator <SymbolDef> enumerator = vc.GetEnumerator(); SymbolDef sdTemp = null; UnitDef udTemp = null; String item = null; while (enumerator.MoveNext()) { sdTemp = enumerator.Current; item = sdTemp.getDescription() + ":" + sdTemp.getBasicSymbolId(); if (sdTemp.getDrawCategory() != 0)//0 means category, not drawable { lbTGs.Items.Add(item); } } lbTGs.Sorted = true; //////////////////////////////////////////////////////////////////////// UnitDefTable udTable = UnitDefTable.getInstance(); Dictionary <String, UnitDef> unitDefs = udTable.GetAllUnitDefs(); ICollection <UnitDef> c = unitDefs.Values; IEnumerator <UnitDef> ude = c.GetEnumerator(); //SymbolDef temp = null; //String item = null; while (ude.MoveNext()) { udTemp = ude.Current; item = udTemp.getDescription() + ":" + udTemp.getBasicSymbolId(); lbFEs.Items.Add(item); } lbFEs.Sorted = true; ///////////////////////////////////////////////////////////////////////// cbAffiliation.SelectedIndex = 0; cbStatus.SelectedIndex = 1; cbModifiers.SelectedIndex = 0; cbSize.SelectedIndex = 0; cbOutlineType.SelectedIndex = 0; cbSpeedTestType.SelectedIndex = 1; cbDoubleBuffer.CheckState = CheckState.Checked; //RENDERER SETTINGS////////////////////////////////////////////////////// RendererSettings RS = RendererSettings.getInstance(); RS.setTextBackgroundMethod(RendererSettings.TextBackgroundMethod_OUTLINE_QUICK); //RS.setTextBackgroundMethod(RendererSettings.TextBackgroundMethod_OUTLINE); //RS.setTextBackgroundMethod(RendererSettings.TextBackgroundMethod_NONE); //RS.setTextBackgroundMethod(RendererSettings.TextBackgroundMethod_COLORFILL); } catch (Exception exc) { Console.WriteLine(exc.Message); Console.WriteLine(exc.StackTrace); } }