Ejemplo n.º 1
0
        public virtual ISeriesPainter GetPainter(ChartPerformer performer)
        {
            ISeriesPainter p = new FiguresSeriesPainter();

            p.Performer = performer;
            return(p);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="label">Label of component</param>
        public FormPointCollection(IObjectLabel label)
        {
            InitializeComponent();
            this.label = label;
            draw       = label.Object as DrawSeries;
            Text       = label.Name;
            string[] names = PointCollectionChooserFactory.Factory.Names;
            comboBoxType.FillCombo(names);
            PanelChart panel = new PanelChart(new int[, ] {
                { 80, 20 }, { 30, 40 }
            });

            panel.Width  = panelChart.Width - 100;
            panel.Height = panelChart.Height - 100;
            panel.Top    = 50;
            panel.Left   = 50;
            panel.Dock   = DockStyle.Fill;
            performer    = panel.Performer;
            performer.Resize();
            panelChart.Controls.Add(panel);
            SimpleCoordinator coordinator = new SimpleCoordinator(5, 5, performer);

            performer.Coordinator = coordinator;
            setChooser();
            string fn = draw.FactoryName;

            if (fn != null)
            {
                comboBoxType.SelectCombo(fn);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="series">Series for saving</param>
        /// <param name="comments">Comments for saving</param>
        public FormGraphSave(DataPerformer.Series series, ArrayList comments)
        {
            InitializeComponent();
            this.LoadResources();
            this.series.CopyFrom(series);
            //this.series.CopyFrom(series);
            PanelChart panel = new PanelChart(new int[, ] {
                { 80, 30 }, { 10, 40 }
            });

            panel.Width  = panelGraph.Width - 100;
            panel.Height = panelGraph.Height - 100;
            panel.Left   = 50;
            panel.Top    = 50;
            performer    = panel.Performer;
            panelGraph.Controls.Add(panel);
            panel.LoadResources();
            SimpleCoordinator coordinator = new SimpleCoordinator(5, 5, performer);

            performer.Coordinator = coordinator;
            EditorReceiver.AddEditorDrag(panelGraph);
            PictureReceiver.AddImageDrag(panelGraph);
            ControlPanel.LoadControls(panelGraph, comments);
            ISeries s = new SeriesGraph(series);

            performer.AddSeries(s, Color.Magenta);
            performer.RefreshAll();
        }
Ejemplo n.º 4
0
 public SimpleCoordinator(int nx, int ny, ChartPerformer performer)
 {
     this.performer = performer;
     n[0]           = nx;
     n[1]           = ny;
     sc[0]          = scd;
     sc[1]          = scd;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Preparation
 /// </summary>
 /// <param name="insets">Insets</param>
 /// <param name="hasStandardHandlers">The has standard handlers sign</param>
 public void Prepare(int[,] insets, bool hasStandardHandlers)
 {
     if (performer != null)
     {
         throw new Exception("Double initialization");
     }
     performer = new ChartPerformer(this, insets, hasStandardHandlers);
     Paint    += new PaintEventHandler(OnPaint);
     Resize   += new EventHandler(OnResize);
     BackColor = Color.White;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Preparation
 /// </summary>
 /// <param name="insets">Insets</param>
 /// <param name="hasStandardHandlers">The has standard handlers sign</param>
 public void Prepare(int[,] insets, bool hasStandardHandlers)
 {
     if (performer != null)
     {
         throw new Exception("Double initialization");
     }
     performer = new ChartPerformer(userControlControlInternalChart, insets, hasStandardHandlers);
     userControlControlInternalChart.Performer = performer;
     userControlControlInternalChart.Parent    = this;
     if (DataTextChooser.Localize != null)
     {
         DataTextChooser.Localize(this);
     }
 }
Ejemplo n.º 7
0
        void init()
        {
            Chart.UserControls.UserControlExternalChart chart = userControlExternalChart;

            chart.Prepare(new int[, ] {
                { 80, 30 }, { 10, 40 }
            }, true);
            chart.Cursor = Cursors.Cross;

            /*panel.Width = panelGraph.Width - 100;
             * panel.Height = panelGraph.Height - 100;
             * panel.Left = 50;
             * panel.Top = 50;
             */
            performer = chart.Performer;

            /*
             * performer.InternalInsets[0, 0] = 20;
             * performer.InternalInsets[1, 0] = 20;
             * performer.InternalInsets[0, 1] = 20;
             * performer.InternalInsets[1, 1] = 20;
             */
            //panelGraph.Controls.Add(chart);
            chart.Dock = DockStyle.Fill;
            performer.Resize();
            coordinator           = new LogarithmCoordinator(performer);
            performer.Coordinator = coordinator;
            //EditorReceiver.AddEditorDrag(panelGraph);
            //PictureReceiver.AddImageDrag(panelGraph);

            /*ArrayList graphControls = consumer.GraphControls;
             * ControlPanel.LoadControls(panelGraph, graphControls);
             * textBoxStart.Text = consumer.Start + "";
             * textBoxStep.Text = consumer.Step + "";
             * textBoxStepCount.Text = consumer.Steps + "";*/
            /*pic.Text = ResourceService.Resources.GetControlResource("Color");
             * pic.Width = 50;*/
            /*DataPerformer.UI.Performers.SeriesPerformer.FillTypeCombo(toolStripButtonType);
             * if (argument.Equals("Time"))
             * {
             *  checkBoxTime.Checked = true;
             * }*/
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Post operation
        /// </summary>
        public void Post()
        {
            userControlChart.Prepare(new int[, ] {
                { 80, 30 }, { 10, 40 }
            }, true);
            performer = userControlChart.Performer;
            string[] names = PointCollectionChooserFactory.Factory.Names;
            comboBoxType.FillCombo(names);
            SimpleCoordinator coordinator = new SimpleCoordinator(5, 5, performer);

            performer.Coordinator = coordinator;
            setChooser();
            string fn = series.FactoryName;

            if (fn != null)
            {
                comboBoxType.SelectCombo(fn);
            }
        }
        /// <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);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Pre initialization
        /// </summary>
        protected virtual void PreInit()
        {
            pic.Text = ResourceService.Resources.GetControlResource("Color", DataPerformer.UI.Utils.ControlUtilites.Resources);
            PanelChart panel = new PanelChart(new int[, ] {
                { 80, 30 }, { 10, 40 }
            });

            panel.SetObject(this);
            panelGraph.DragEnter += fileDragEnter;
            panelGraph.DragDrop  += fileDragDrop;
            performer             = panel.Performer;
            panelGraph.Controls.Add(panel);
            panel.LoadResources();
            panel.Dock = DockStyle.Fill;
            performer.Resize();
            SimpleCoordinator coordinator = new SimpleCoordinator(5, 5, performer);

            performer.Coordinator = coordinator;
            EditorReceiver.AddEditorDrag(panelGraph);
            PictureReceiver.AddImageDrag(panelGraph);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="insets">Insets</param>
 public PanelChart(int[,] insets)
 {
     InitializeComponent();
     performer = new ChartPerformer(this, insets, true);
     Paint    += new PaintEventHandler(onPaint);
     Resize   += new EventHandler(onResize);
     BackColor = Color.White;
     copyToolStripMenuItem.Click       += copyToolStripMenuItem_Click;
     copySeriesToolStripMenuItem.Click += copySeriesToolStripMenuItem_Click;
     pasteToolStripMenuItem.Click      += pasteToolStripMenuItem_Click;
     formatToolStripMenuItem.Click     += formatToolStripMenuItem_Click;
     contextMenuStripChart.Popup       += (object sender, EventArgs e) =>
     {
         bool visible = (!performer.IsMoved & (performer.LastPressed == MouseButtons.Right));
         foreach (MenuItem it in contextMenuStripChart.MenuItems)
         {
             if (it.Visible != visible)
             {
                 it.Visible = visible;
             }
         }
     };
 }
Ejemplo n.º 12
0
 public LogarithmCoordinator(ChartPerformer performer)
     : base(5, 5, performer)
 {
 }
 /// <summary>
 /// Selects painter
 /// </summary>
 /// <param name="box">Combomox</param>
 /// <param name="color">Color</param>
 /// <param name="performer">Performer</param>
 /// <returns>Painter</returns>
 static public ISeriesPainter SelectPainter(this ComboBox box, Color color, ChartPerformer performer)
 {
     return(SelectPainter(box.SelectedItem + "", new Color[] { color }, performer));
 }