public ClassBreaksRendererDef(SymbolDef defaultSymbolDef, string field, ObservableCollection <ClassBreakInfoDef> infosDef) { DefaultSymbolDef = defaultSymbolDef; Field = field; InfosDef = infosDef; }
public virtual string NextMangled(ScopeOptions options, SymbolDef symbolDef) { var ext = Enclosed; while (true) { again: var m = Base54(options.Chars, Cname++); if (!OutputContext.IsIdentifier(m)) { continue; // skip over "do" } // https://github.com/mishoo/UglifyJS2/issues/242 -- do not // shadow a name reserved from mangling. if (options.Reserved.Contains(m)) { continue; } // we must ensure that the mangled name does not shadow a name // from some parent scope that is referenced in this or in // inner scopes. for (var i = 0u; i < ext.Count; i++) { var sym = ext[i]; var name = sym.MangledName ?? (sym.Unmangleable(options) ? sym.Name : null); if (m == name) { goto again; } } return(m); } }
public UniqueValueRendererDef(SymbolDef defaultSymbolDef, ObservableCollection<string> fields, ObservableCollection<UniqueValueInfoDef> infosDef) { DefaultSymbolDef = defaultSymbolDef; Fields = fields; InfosDef = infosDef; }
public UniqueValueRendererDef(SymbolDef defaultSymbolDef, ObservableCollection <string> fields, ObservableCollection <UniqueValueInfoDef> infosDef) { DefaultSymbolDef = defaultSymbolDef; Fields = fields; InfosDef = infosDef; }
private void btnTest_Click(object sender, EventArgs e) { try { //Graphics gg = this.CreateGraphics(); //gg.GetHdc(); //gg.DrawLine(new Pen(Color.Red), 0, 0, 900, 900); //gg.DrawArc(new Pen(Color.Red), 500, 500, 50, 50, 0, 90); //gg.ReleaseHdc(); Graphics g = this.CreateGraphics(); SVGRenderer.getInstance().renderSVGPathToGraphics(g); String symbolID = "SFZP------*****"; String spaceStation = "SFPPT-----*****"; String ambush = "GFGPSLA---*****"; String checkPoint = "GFGPGPPK--****X"; UnitDef ud = UnitDefTable.getInstance().getUnitDef(SymbolUtilities.getBasicSymbolID(symbolID)); Console.WriteLine(ud.getDescription()); SymbolDef sd = SymbolDefTable.getInstance().getSymbolDef(SymbolUtilities.getBasicSymbolID(ambush), 1); Console.WriteLine(sd.getDescription()); int mapping = SinglePointLookup.getInstance().getCharCodeFromSymbol(checkPoint); Console.WriteLine(mapping.ToString()); UnitFontLookupInfo ufli = UnitFontLookup.getInstance().getLookupInfo(spaceStation); Console.WriteLine(ufli.getMapping1(spaceStation).ToString()); SinglePointRenderer spr = SinglePointRenderer.getInstance(); //Bitmap tempBMP = spr.DrawTest(); //tempBMP.Save("C:\\test.bmp", System.Drawing.Imaging.ImageFormat.Bmp); //MilStdBMP msb = spr.RenderSymbol(spaceStation, null, null); //msb.getBitmap().Save("C:\\test.png", System.Drawing.Imaging.ImageFormat.Png); //Graphics g = Graphics.FromHwnd(this.Handle); //Graphics g = this.CreateGraphics(); float x = this.Width / 2.0f; float y = this.Height / 2.0f; //g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bilinear; //g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; //g.DrawImageUnscaled(tempBMP, (int)x, (int)y); //g.Flush(); //g.Dispose(); // g.DrawImage(spr.DrawTest(), x, y); } catch (Exception exc) { Console.WriteLine(exc.Message); Console.WriteLine(exc.StackTrace); } }
public static void RenameSymbol(SymbolDef symbol, string newName) { symbol.Name = newName; foreach (var orig in symbol.Orig) { orig.Name = newName; } foreach (var reference in symbol.References) { reference.Name = newName; } }
private void btnDrawTG_Click(object sender, EventArgs e) { symbolID = getCodeFromTGList(); SymbolDef sd = SymbolDefTable.getInstance().getSymbolDef(SymbolUtilities.getBasicSymbolID(symbolID), 1); if (sd != null && sd.getMinPoints() == 1 && sd.getMaxPoints() == 1 && sd.HasWidth() == false) { //code is good } else //symbol is a multipoint and renderer isn't ready for that yet. { //symbolID = null; } }
void MarkExport(SymbolDef def, int level) { if (_inDestructuring != null) { var i = 0; do { level++; } while (Parent(i++) != _inDestructuring); } var node = Parent(level); def.Export = node is AstExport; }
public void setSymbolDef(string platform, string definition) { if (string.Equals(platform, "MAPINFO", StringComparison.OrdinalIgnoreCase)) { SymbolDef = new SymbolDef(platform, definition); } if (string.Equals(platform, "ARCGIS", StringComparison.OrdinalIgnoreCase)) { SymbolDefArcMap = new SymbolDef(platform, definition); } if (string.Equals(platform, "AUTOCAD", StringComparison.OrdinalIgnoreCase)) { SymbolDefAutoCad = new SymbolDef(platform, definition); } }
public SymbolDef DefGlobal(AstSymbol symbol) { var name = symbol.Name; if (Globals.ContainsKey(name)) { return(Globals[name]); } var global = new SymbolDef(this, symbol, null); global.Undeclared = true; global.Global = true; Globals.Add(name, global); return(global); }
public override string NextMangled(ScopeOptions options, SymbolDef symbolDef) { // in Safari strict mode, something like (function x(x){...}) is a syntax error; // a function expression's argument cannot shadow the function expression's name var trickyDef = symbolDef.Orig[0] is AstSymbolFunarg && Name != null ? Name.Thedef : null; // the function's MangledName is null when KeepFucntionNames is true var trickyName = trickyDef != null ? (trickyDef.MangledName ?? trickyDef.Name) : null; while (true) { var name = base.NextMangled(options, symbolDef); if (trickyName != name) { return(name); } } }
public override void OnAwake() { CreateBackground(); //4 ways to create Sprites: //1: Create empty Sprites with Sprite.NewEmpty() or Library.New<Sprite>() var container = CinchSprite.NewEmpty("Container"); this.AddChild(container); container.AddEventListener <MouseEvent>(MouseEvent.MOUSE_DOWN, DestroyWhateverWasClicked); //2: Create from Texture via Sprite.NewFromImage() var cherries = CinchSprite.NewFromImage("Cinch2D/Cherries", 256); container.AddChild(cherries); cherries.X = ViewportWidth / -4; //3: Library.New<Any CinchSprite Subclass>(). //Watermelon is defined in a separate file, and actually contains another way to instantiate a sprite var watermelon = Library.New <Watermelon>("Watermelon"); container.AddChild(watermelon); //4: Library.New("SymbolId") //first, add a definition. You can define all your symbols in one place using this method. var strawberryDef = new SymbolDef { SymbolId = "Strawberry", TexturePath = "Cinch2D/Strawberry", PixelsPerMeter = 256, RegistrationPoint = RegistrationPoint.Center }; Library.AddDefinition(strawberryDef); //then instantiate the definition. var strawberry = Library.New("Strawberry"); container.AddChild(strawberry); strawberry.X = ViewportWidth / 4; }
public SymbolDef DefVariable(AstSymbol symbol, AstNode init) { SymbolDef def; if (Variables.ContainsKey(symbol.Name)) { def = Variables[symbol.Name]; def.Orig.Add(symbol); if (def.Init != null && (!ReferenceEquals(def.Scope, symbol.Scope) || def.Init is AstFunction)) { def.Init = init; } } else { def = new SymbolDef(this, symbol, init); Variables.Add(symbol.Name, def); def.Global = ParentScope == null; } return(symbol.Thedef = def); }
public ImageInfo RenderSymbol(String symbolID, Dictionary <int, String> modifiers, Dictionary <int, String> attributes) { ImageInfo returnVal = null; int symStd = 0; if (SymbolUtilities.isTacticalGraphic(symbolID)) { SymbolDef sd = SymbolDefTable.getInstance().getSymbolDef(SymbolUtilities.getBasicSymbolID(symbolID), symStd); if (sd.getMaxPoints() == 1 && sd.HasWidth() == false) { returnVal = RenderSPTG(symbolID, modifiers, attributes); } else { returnVal = RenderMPTG(symbolID, modifiers, attributes); } } else { returnVal = RenderUnit(symbolID, modifiers, attributes); } return(returnVal); }
public ImageInfo RenderSymbol(String symbolID, Dictionary <int, String> modifiers, Dictionary <int, String> attributes) { ImageInfo returnVal = null; int symStd = 1; if (SymbolUtilities.isTacticalGraphic(symbolID)) { 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()); } SymbolDef sd = SymbolDefTable.getInstance().getSymbolDef(SymbolUtilities.getBasicSymbolIDStrict(symbolID), symStd); if (sd.getMaxPoints() == 1 && sd.HasWidth() == false) { returnVal = RenderSPTG(symbolID, modifiers, attributes); } else { returnVal = RenderMPTG(symbolID, modifiers, attributes); } } else { returnVal = RenderUnit(symbolID, modifiers, attributes, null); } return(returnVal); }
public override void OnAwake() { CreateBackground(); //4 ways to create Sprites: //1: Create empty Sprites with CinchSprite.NewEmpty() or Library.New<CinchSprite>() var container = CinchSprite.NewEmpty("Container"); this.AddChild(container); container.AddEventListener<MouseEvent>(MouseEvent.MOUSE_DOWN, DestroyWhateverWasClicked); //2: Create from Texture via CinchSprite.NewFromImage() var cherries = CinchSprite.NewFromImage("Cinch2D/Cherries", 256); container.AddChild(cherries); cherries.X = ViewportWidth/-4; //3: Library.New<Any CinchSprite Subclass>(). //Watermelon is defined in a separate file, and actually contains another way to instantiate a sprite var watermelon = Library.New<Watermelon>("Watermelon"); container.AddChild(watermelon); //4: Library.New("SymbolId") //first, add a definition. You can define all your symbols in one place using this method. var strawberryDef = new SymbolDef{ SymbolId = "Strawberry", TexturePath = "Cinch2D/Strawberry", PixelsPerMeter = 256, RegistrationPoint = RegistrationPoint.Center }; Library.AddDefinition(strawberryDef); //then instantiate the definition. var strawberry = Library.New("Strawberry"); container.AddChild(strawberry); strawberry.X = ViewportWidth/4; }
public SimpleRendererDef(SymbolDef symbolDef) { SymbolDef = symbolDef; }
public ClassBreakInfoDef(double max, double min, SymbolDef symbolDef) { Maximum = max; Minimum = min; SymbolDef = symbolDef; }
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)); } }
public CountReferencesWalker(SymbolDef def) { _def = def; }
public ISymbol newSymbol(SymbolDef symbolDef) { if (symbolDef == null) return null; Type symbolType = symbolDef.GetType(); if (symbolType == typeof(SimpleLineSymbolDef)) { SimpleLineSymbolDef sDef = (SimpleLineSymbolDef)symbolDef; IS3SimpleLineSymbol symbol = new IS3SimpleLineSymbol(); symbol.Color = sDef.Color; symbol.Style = sDef.Style; symbol.Width = sDef.Width; return symbol; } else if (symbolType == typeof(SimpleFillSymbolDef)) { SimpleFillSymbolDef sDef = (SimpleFillSymbolDef)symbolDef; IS3SimpleFillSymbol symbol = new IS3SimpleFillSymbol(); symbol.Color = sDef.Color; symbol.Style = sDef.Style; symbol.Outline = (ISimpleLineSymbol) newSymbol(sDef.OutlineDef); return symbol; } else if (symbolType == typeof(SimpleMarkerSymbolDef)) { SimpleMarkerSymbolDef sDef = (SimpleMarkerSymbolDef)symbolDef; IS3SimpleMarkerSymbol symbol = new IS3SimpleMarkerSymbol(); symbol.Angle = sDef.Angle; symbol.AngleAlignment = sDef.AngleAlignment; symbol.Color = sDef.Color; symbol.Outline = (ISimpleLineSymbol)newSymbol(sDef.OutlineDef); symbol.Size = sDef.Size; symbol.Style = sDef.Style; symbol.XOffset = sDef.XOffset; symbol.YOffset = sDef.YOffset; return symbol; } else if (symbolType == typeof(TextSymbolDef)) { TextSymbolDef sDef = (TextSymbolDef)symbolDef; IS3TextSymbol symbol = new IS3TextSymbol(); symbol.Angle = sDef.Angle; symbol.AngleAlignment = sDef.AngleAlignment; symbol.BackgroundColor = sDef.BackgroundColor; symbol.BorderLineColor = sDef.BorderLineColor; symbol.BorderLineSize = sDef.BorderLineSize; symbol.Color = sDef.Color; symbol.Text = sDef.Text; symbol.HorizontalTextAlignment = sDef.HorizontalTextAlignment; symbol.VerticalTextAlignment = sDef.VerticalTextAlignment; symbol.Font = newSymbolFont(sDef.FontDef); symbol.XOffset = sDef.XOffset; symbol.YOffset = sDef.YOffset; return symbol; } return null; }
public UniqueValueInfoDef(SymbolDef symbolDef, ObservableCollection<object> values) { SymbolDef = symbolDef; Values = values; }
public ISymbol newSymbol(SymbolDef symbolDef) { if (symbolDef == null) { return(null); } Type symbolType = symbolDef.GetType(); if (symbolType == typeof(SimpleLineSymbolDef)) { SimpleLineSymbolDef sDef = (SimpleLineSymbolDef)symbolDef; IS3SimpleLineSymbol symbol = new IS3SimpleLineSymbol(); symbol.Color = sDef.Color; symbol.Style = sDef.Style; symbol.Width = sDef.Width; return(symbol); } else if (symbolType == typeof(SimpleFillSymbolDef)) { SimpleFillSymbolDef sDef = (SimpleFillSymbolDef)symbolDef; IS3SimpleFillSymbol symbol = new IS3SimpleFillSymbol(); symbol.Color = sDef.Color; symbol.Style = sDef.Style; symbol.Outline = (ISimpleLineSymbol)newSymbol(sDef.OutlineDef); return(symbol); } else if (symbolType == typeof(SimpleMarkerSymbolDef)) { SimpleMarkerSymbolDef sDef = (SimpleMarkerSymbolDef)symbolDef; IS3SimpleMarkerSymbol symbol = new IS3SimpleMarkerSymbol(); symbol.Angle = sDef.Angle; symbol.AngleAlignment = sDef.AngleAlignment; symbol.Color = sDef.Color; symbol.Outline = (ISimpleLineSymbol)newSymbol(sDef.OutlineDef); symbol.Size = sDef.Size; symbol.Style = sDef.Style; symbol.XOffset = sDef.XOffset; symbol.YOffset = sDef.YOffset; return(symbol); } else if (symbolType == typeof(TextSymbolDef)) { TextSymbolDef sDef = (TextSymbolDef)symbolDef; IS3TextSymbol symbol = new IS3TextSymbol(); symbol.Angle = sDef.Angle; symbol.AngleAlignment = sDef.AngleAlignment; symbol.BackgroundColor = sDef.BackgroundColor; symbol.BorderLineColor = sDef.BorderLineColor; symbol.BorderLineSize = sDef.BorderLineSize; symbol.Color = sDef.Color; symbol.Text = sDef.Text; symbol.HorizontalTextAlignment = sDef.HorizontalTextAlignment; symbol.VerticalTextAlignment = sDef.VerticalTextAlignment; symbol.Font = newSymbolFont(sDef.FontDef); symbol.XOffset = sDef.XOffset; symbol.YOffset = sDef.YOffset; return(symbol); } return(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); } }
public ClassBreakInfoDef(double max, double min, SymbolDef symbolDef) { Maximum = max; Minimum = min; SymbolDef = symbolDef; }
public AstSymbolRef(AstNode from, SymbolDef def, SymbolUsage usage) : base(from, def.Name) { Thedef = def; def.References.Add(this); Usage = usage; }
public SimpleRendererDef(SymbolDef symbolDef) { SymbolDef = symbolDef; }
public UniqueValueInfoDef(SymbolDef symbolDef, ObservableCollection <object> values) { SymbolDef = symbolDef; Values = values; }
public ClassBreaksRendererDef(SymbolDef defaultSymbolDef, string field, ObservableCollection<ClassBreakInfoDef> infosDef) { DefaultSymbolDef = defaultSymbolDef; Field = field; InfosDef = infosDef; }