示例#1
0
        public void PopulatePort(Port port, string prefix)
        {
            bool gotColors = colors != null && colors.Count > 0;
            CircularIndex i = null;
            if (gotColors) i = new CircularIndex(colors.Count);

            int k = (names == null) ? 0 : names.Count;
            int l = (list == null) ? 0 : list.Count;
            int m = Math.Min(k, l);

            int j = 0;
            while (j < m) // named ones
            {
                list[j].PopulatePort(port, prefix + names[j]);
                if (gotColors)
                {
                    port[prefix + names[j]].Settings.Color = colors[i.Current];
                    i.Next();
                }
                j++;
            }

            string elsename = prefix + "All else";
            while (j < l) // and all others
            {
                list[j].PopulatePort(port, elsename);
                if (gotColors) port[elsename].Settings.Color = colors[i.Current];
                j++;
            }

            if (transformer != null)
            {
                port.Settings.Transformer = transformer;
            }
        }
示例#2
0
        public void PopulatePort(Port port, string prefix)
        {
            // Form a list of DrawableElement's
            List<DrawableElement> list = new List<DrawableElement>();
            foreach (var s in sgts)
            {
                list.Add(DrawableElement.Segment(s.Begin.X, s.Begin.Y, s.End.X, s.End.Y));
            }

            // To a port's chart named "prefix+..." add a list of DrawableElement's
            port[prefix + "Segments"].Populate( list );
        }
示例#3
0
        public void PopulatePort(Port port, string prefix)
        {
            // Form a list of DrawableElement's
            List<DrawableElement> list = new List<DrawableElement>();
            List<string> strings = new List<string>();

            foreach (var s in polts)
            {
                List<double> newConPol = new List<double>();
                foreach (var d in s.Points)
                {
                    newConPol.Add(d.X);
                    newConPol.Add(d.Y);
                }
                list.Add(DrawableElement.Polygon(newConPol));
                //strings.Add("x:" + s.X + " y:" + s.Y);
            }
            port[prefix + "ConPol"].Populate(list);
            //port[prefix + "Text"].Populate(DrawableElement.Text(40, 40, strings.ToArray()));
            port[prefix + "ConPol"].Settings.Color = "Black";
            port.Settings.Transformer = new ChainTransformer(new ScaleTransformer(0.3, -0.3),
                                                             new TranslateTransformer(50, 200));
        }
示例#4
0
 public void PopulatePort(Port port, string prefix)
 {
     List<string> str = new List<String>();
     foreach (var item in data)
     {
         str.Add(item.Name + " = \t" + item.Value);
     }
     var it = DrawableElement.Text(5, 5, str.ToArray());
     port[prefix + ".Variables"].Populate(it);
 }
示例#5
0
 public void PopulatePort(Port port, string prefix)
 {
     port[prefix].Populate(this);
 }