Exemple #1
0
        public void InitializePlotControl(IPlot iPlot)
        {
            this.iPlot = iPlot;
            ArrayList oxVars = iPlot.GetOxVariables();
            ArrayList oyVars = iPlot.GetOyVariables();

            this.comboBoxOxVariables.Items.Clear();
            this.comboBoxOyVariables.Items.Clear();

            // populate the ox variables
            IEnumerator e1 = oxVars.GetEnumerator();

            while (e1.MoveNext())
            {
                this.comboBoxOxVariables.Items.Add(e1.Current);
            }
            if (oxVars != null && oxVars.Count > 0)
            {
                this.comboBoxOxVariables.SelectedIndex = 0;
            }

            // populate the oy variables
            IEnumerator e2 = oyVars.GetEnumerator();

            while (e2.MoveNext())
            {
                this.comboBoxOyVariables.Items.Add(e2.Current);
            }
            if (oyVars != null && oyVars.Count > 0)
            {
                this.comboBoxOyVariables.SelectedIndex = 0;
            }

            PlotData plotData = iPlot.GetPlotData(this.OxVariable, this.OyVariable);

            // update the ranges
            this.UpdateRangesOnUI(this.OxVariable, this.OyVariable);

            // update the plot
            this.plotGraph.UpdatePlot(plotData, this.OxVariable, this.OyVariable);

            //
            this.UpdateFamiliesList(plotData);

            if (this.iPlot != null)
            {
                this.iPlot.PlotChanged += new PlotChangedEventHandler(iPlot_PlotChanged);
            }
        }