Пример #1
0
 private void AdjustGraphSize(Plot2DGraph p2dGraph, PlotGraphSize size)
 {
     if (size == PlotGraphSize.Medium)
     {
         p2dGraph.Width  = (int)((p2dGraph.Width * 2) / 3);
         p2dGraph.Height = (int)((p2dGraph.Height * 2) / 3);
     }
     else if (size == PlotGraphSize.Small)
     {
         p2dGraph.Width  = (int)(p2dGraph.Width / 2);
         p2dGraph.Height = (int)(p2dGraph.Height / 2);
     }
 }
Пример #2
0
        public ViewPlot2DForm(ArrayList list, PlotGraphSize size)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            int d = 4;
            int x = d;
            int y = 4;
            int i = 0;

            this.hashtableGraphPlot = new Hashtable();
            IEnumerator en = list.GetEnumerator();

            while (en.MoveNext())
            {
                i++;
                Plot2D      p2d      = (Plot2D)en.Current;
                Plot2DGraph p2dGraph = new Plot2DGraph();
                this.AdjustGraphSize(p2dGraph, size);

                AxisVariable avX = UI.ConvertToAxisVariable(p2d.PlotVariableX);
                AxisVariable avY = UI.ConvertToAxisVariable(p2d.PlotVariableY);
                PlotData     pd  = this.ConvertToPlotData(p2d);
                p2dGraph.UpdatePlot(pd, avX, avY);

                x = i * d + (i - 1) * p2dGraph.Width;
                p2dGraph.Location = new Point(x, y);

                this.panelPlots.Controls.Add(p2dGraph);
                this.hashtableGraphPlot.Add(p2dGraph, p2d);

                p2dGraph.PlotSelected += new PlotSelectedEventHandler(p2dGraph_PlotSelected);
                p2d.Plot2DChanged     += new Plot2DChangedEventHandler(p2d_Plot2DChanged);
            }

            if (size == PlotGraphSize.Medium)
            {
                this.panelPlots.Height -= 135;
                this.Height            -= 150;
            }
            else if (size == PlotGraphSize.Small)
            {
                this.panelPlots.Height -= 208;
                this.Height            -= 222;
            }

            this.UnselectAllPlots();
            this.plot2DControl.CheckBoxDetails.CheckedChanged += new EventHandler(CheckBoxDetails_CheckedChanged);
        }
Пример #3
0
        private void buttonViewPlots_Click(object sender, System.EventArgs e)
        {
            PlotGraphSize plotSize = PlotGraphSize.Medium;

            if (this.radioButtonLarge.Checked)
            {
                plotSize = PlotGraphSize.Large;
            }
            else if (this.radioButtonMedium.Checked)
            {
                plotSize = PlotGraphSize.Medium;
            }
            else if (this.radioButtonSmall.Checked)
            {
                plotSize = PlotGraphSize.Small;
            }

            ViewPlot2DForm form = new ViewPlot2DForm(this.plotsControl.GetValidSelectedPlots(), plotSize);

            form.ShowDialog();
        }