public void AddRule(ShapeRule rule, IList <Argument> args) { this.log.Trace("RULE: {0}", rule); var node = this.NewNode(this.currentNode); node.Value.Rule = rule; node.Value.Args = args; this.AddNode(node); }
internal ShapeRule CreatePolygonRule() { ShapeRule shapeRule = (ShapeRule)(m_coreRule = new ShapeRule()); shapeRule.BorderColor = Color.Empty; shapeRule.Text = ""; shapeRule.Category = m_mapVectorLayer.Name; shapeRule.Field = ""; m_coreMap.ShapeRules.Add(shapeRule); SetRuleFieldName(); return(shapeRule); }
private void EnterPredecessor(ParseTreeNode node) { var idNode = node.FirstChild; var ruleSymbol = idNode.Token.Text; var argNames = node.ChildNodes.Count > 1 ? this.GetArgs(node.ChildNodes [1]).Select(x => x.Value).ToList() : new List <string> (); this.currentRule = new ShapeRule(); this.currentRule.Symbol = ruleSymbol; this.currentRule.ArgNames = argNames; this.system.Rules [this.currentRule.Symbol] = this.currentRule; }
internal void RenderPolygonRule(PolygonTemplateMapper shapeTemplateMapper) { ShapeRule shapeRule = (ShapeRule)m_coreRule; SetRuleLegendProperties(shapeRule); SetRuleDistribution(shapeRule); shapeRule.ShowInColorSwatch = GetShowInColorScale(); if (m_mapRule is MapColorRangeRule) { RenderPolygonColorRangeRule(shapeRule); } else if (m_mapRule is MapColorPaletteRule) { RenderPolygonColorPaletteRule(shapeRule); } else { RenderPolygonCustomColorRule(shapeRule); } InitializeCustomColors(shapeRule.CustomColors, shapeTemplateMapper); }
public void RenderPolygonRule(PolygonTemplateMapper shapeTemplateMapper) { ShapeRule shapeRule = (ShapeRule)base.m_coreRule; base.SetRuleLegendProperties(shapeRule); base.SetRuleDistribution(shapeRule); shapeRule.ShowInColorSwatch = this.GetShowInColorScale(); if (base.m_mapRule is MapColorRangeRule) { this.RenderPolygonColorRangeRule(shapeRule); } else if (base.m_mapRule is MapColorPaletteRule) { this.RenderPolygonColorPaletteRule(shapeRule); } else { this.RenderPolygonCustomColorRule(shapeRule); } this.InitializeCustomColors(shapeRule.CustomColors, shapeTemplateMapper); }
private void RenderShapeCustomColors(ShapeRule shapeRule, ColoringMode coloringMode, MapColorPalette palette, Color fromColor, Color middleColor, Color toColor) { shapeRule.UseCustomColors = true; SetRuleColors(shapeRule.GetColors(coloringMode, palette, fromColor, middleColor, toColor, GetBucketCount()), shapeRule.CustomColors); }
private void RenderPolygonCustomColorRule(ShapeRule shapeRule) { shapeRule.UseCustomColors = true; SetRuleColors(GetCustomColors(((MapCustomColorRule)m_mapRule).MapCustomColors), shapeRule.CustomColors); }
private void RenderPolygonColorPaletteRule(ShapeRule shapeRule) { RenderShapeCustomColors(shapeRule, ColoringMode.DistinctColors, GetColorPalette(), Color.Empty, Color.Empty, Color.Empty); }
private void RenderPolygonColorRangeRule(ShapeRule shapeRule) { MapColorRangeRule colorRangeRule = (MapColorRangeRule)m_mapRule; RenderShapeCustomColors(shapeRule, ColoringMode.ColorRange, MapColorPalette.Dundas, GetFromColor(colorRangeRule), GetMiddleColor(colorRangeRule), GetToColor(colorRangeRule)); }