コード例 #1
0
        void setChooser()
        {
            if (chooser != null)
            {
                Control c = chooser as Control;
                Control p = c.Parent;
                p.Controls.Remove(c);
            }
            IPointFactory f = draw.Factory;

            if (f == null)
            {
                return;
            }
            chooser              = PointCollectionChooserFactory.Factory[f];
            chooser.Consumer     = draw;
            chooser.Measurements = draw.Measurements;
            Control control = chooser as Control;

            splitContainerMain.Panel2.Controls.Add(control);
            control.LoadResources();
            if (performer.Count > 0)
            {
                performer.Remove(draw);
            }
            ISeriesPainter painter = f.GetPainter(performer);

            performer.AddSeries(draw, painter);
            performer.Resize();
            performer.RefreshAll();
        }
コード例 #2
0
ファイル: DrawSeriesLabel.cs プロジェクト: Erroman/universal
        void setChooser()
        {
            if (chooser != null)
            {
                Control c = chooser as Control;
                Control p = c.Parent;
                p.Controls.Remove(c);
            }
            IPointFactory f = series.Factory;

            if (f == null)
            {
                return;
            }
            chooser              = PointCollectionChooserFactory.Factory[f];
            chooser.Consumer     = series;
            chooser.Measurements = series.Measurements;
            Control control = chooser as Control;

            this.LoadResources();
            panelParameters.Controls.Add(control);
            if (performer.Count > 0)
            {
                performer.Remove(series);
            }
            ISeriesPainter painter = f.GetPainter(performer);

            performer.AddSeries(series, painter);
            performer.Resize();
            performer.RefreshAll();
        }
コード例 #3
0
        void ShowChart()
        {
            Chart.ChartPerformer performer = userControlChart.Performer;
            performer.RemoveAll();
            ISeriesPainter sp = painterInreface.Painter;

            if (sp != null)
            {
                DataPerformer.Series series = nc as DataPerformer.Series;
                SeriesGraph          ser    = new SeriesGraph(series);
                performer.AddSeries(ser, sp);
            }
            performer.RefreshAll();
        }
コード例 #4
0
 internal void ShowInternal()
 {
     performer.RemoveAll();
     if (painterInreface != null)
     {
         ISeriesPainter sp = painterInreface.Painter;
         if (sp != null)
         {
             SeriesGraph ser = new SeriesGraph(series);
             performer.AddSeries(ser, sp);
         }
         performer.RefreshAll();
     }
 }
コード例 #5
0
ファイル: ChartPerformer.cs プロジェクト: Erroman/universal
 public void AddSeries(ISeries s, ISeriesPainter painter)
 {
     if (parent != null)
     {
         parent.AddSeries(s, painter);
         return;
     }
     series.Add(s);
     painter.Performer = this;
     painters[s]       = painter;
     foreach (ChartPerformer ch in children)
     {
         ISeriesPainter p = painter.Clone() as ISeriesPainter;
         ch.AddSeries(s, p);
     }
 }
コード例 #6
0
ファイル: ChartPerformer.cs プロジェクト: Erroman/universal
        /// <summary>
        /// Paints itself
        /// </summary>
        public void Paint()
        {
            if (isBlocked)
            {
                return;
            }
            if (image == null)
            {
                return;
            }
            Brush    brush = new SolidBrush(Bkgnd);
            Graphics gi    = Graphics.FromImage(image);

            gi.FillRectangle(brush, 0, 0, image.Width, image.Height);
            if (IsNaN(false))
            {
                return;
            }
            if (coordPainter != null)
            {
                coordPainter.DrawCoord(gi, dSize, size);
            }
            for (int i = 0; i < Count; i++)
            {
                ISeries        s = this[i];
                ISeriesPainter p = null;
                if (painters.ContainsKey(s))
                {
                    p = painters[s];
                }
                else
                {
                    p           = new SimpleSeriesPainter(new Color[] { Color.Black });
                    p.Performer = this;
                    painters[s] = p;
                }
                if (p != null)
                {
                    p.Draw(s, gi);
                }
            }
            //drawHistograms(gi);
            gi.Dispose();
            gi = Graphics.FromImage(iTemp);
            gi.DrawImage(image, 0, 0);
            gi.Dispose();
        }
コード例 #7
0
        /// <summary>
        /// Selects painter
        /// </summary>
        /// <param name="mode">Mode</param>
        /// <param name="color">Color</param>
        /// <param name="performer">Performer</param>
        /// <returns>Painter</returns>
        static public ISeriesPainter SelectPainter(this string mode, Color[] color, ChartPerformer performer)
        {
            ISeriesPainter painter = null;

            if (mode.Equals(ResourceService.Resources.GetControlResource("Lines",
                                                                         DataPerformer.UI.Utils.ControlUtilites.Resources)))
            {
                painter = new SimpleSeriesPainter(color);
            }
            if (mode.Equals(ResourceService.Resources.GetControlResource("Crosses",
                                                                         DataPerformer.UI.Utils.ControlUtilites.Resources)))
            {
                painter = new CrossSeriesPainter(color);
            }
            if (painter != null)
            {
                painter.Performer = performer;
            }
            return(painter);
        }
コード例 #8
0
 /// <summary>
 /// Adds series
 /// </summary>
 /// <param name="series">Series to add</param>
 /// <param name="painter">Painter</param>
 public void AddSeries(ISeries series, ISeriesPainter painter)
 {
     performer.AddSeries(series, painter);
     RefreshAll();
 }