Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/23/17 16:11:02 (7 years ago)
Author:
abeham
Message:

#2457: updated branch to trunk

Location:
branches/PerformanceComparison/HeuristicLab.Analysis.Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis.Views

  • branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotDataRowVisualPropertiesControl.cs

    r13722 r14600  
    2020#endregion
    2121
    22 using HeuristicLab.MainForm;
    2322using System;
    2423using System.Drawing;
    2524using System.Windows.Forms;
     25using HeuristicLab.MainForm;
     26using HeuristicLab.MainForm.WindowsForms;
    2627
    2728namespace HeuristicLab.Analysis.Views {
     
    4344      InitializeComponent();
    4445      pointStyleComboBox.DataSource = Enum.GetValues(typeof(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle));
     46      regressionTypeComboBox.DataSource = Enum.GetValues(typeof(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType));
    4547      SetEnabledStateOfControls();
    4648    }
     
    5658          pointSizeNumericUpDown.Value = 1;
    5759          displayNameTextBox.Text = String.Empty;
    58           regressionLineCheckBox.Checked = false;
     60          regressionTypeComboBox.SelectedIndex = -1;
     61          polynomialRegressionOrderNumericUpDown.Value = 2;
     62          isRegressionVisibleInLegendCheckBox.Checked = false;
     63          regressionLegendTextBox.Text = string.Empty;
    5964        } else {
    6065          displayNameTextBox.Text = Content.DisplayName;
     
    6974          pointSizeNumericUpDown.Value = Content.PointSize;
    7075          isVisibleInLegendCheckBox.Checked = Content.IsVisibleInLegend;
    71           regressionLineCheckBox.Checked = Content.ShowRegressionLine;
     76          regressionTypeComboBox.SelectedItem = Content.RegressionType;
     77          polynomialRegressionOrderNumericUpDown.Value = Content.PolynomialRegressionOrder;
     78          isRegressionVisibleInLegendCheckBox.Checked = Content.IsRegressionVisibleInLegend;
     79          regressionLegendTextBox.Text = content.RegressionDisplayName;
    7280        }
    7381      }
     
    8391      pointSizeNumericUpDown.Enabled = Content != null;
    8492      displayNameTextBox.Enabled = Content != null;
    85       regressionLineCheckBox.Enabled = Content != null;
     93      regressionTypeComboBox.Enabled = Content != null;
     94      polynomialRegressionOrderNumericUpDown.Enabled = Content != null && Content.RegressionType == ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType.Polynomial;
     95      orderLabel.Enabled = polynomialRegressionOrderNumericUpDown.Enabled;
     96      isRegressionVisibleInLegendCheckBox.Enabled = Content != null && Content.RegressionType != ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType.None;
     97      regressionLegendTextBox.Enabled = Content != null && Content.RegressionType != ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType.None;
    8698    }
    8799
     
    89101    private void pointStyleComboBox_SelectedValueChanged(object sender, EventArgs e) {
    90102      if (!SuppressEvents && Content != null) {
    91         ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle selected = (ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle)pointStyleComboBox.SelectedValue;
     103        var selected = (ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle)pointStyleComboBox.SelectedValue;
    92104        Content.PointStyle = selected;
    93105      }
     
    124136    }
    125137
    126     private void regressionLineCheckBox_CheckedChanged(object sender, EventArgs e) {
     138    private void regressionTypeComboBox_SelectedValueChanged(object sender, EventArgs e) {
    127139      if (!SuppressEvents && Content != null) {
    128         Content.ShowRegressionLine = regressionLineCheckBox.Checked;
     140        var selected = (ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType)regressionTypeComboBox.SelectedValue;
     141        Content.RegressionType = selected;
     142        SetEnabledStateOfControls();
     143      }
     144    }
     145
     146    private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) {
     147      if (!SuppressEvents && Content != null) {
     148        Content.PolynomialRegressionOrder = (int)polynomialRegressionOrderNumericUpDown.Value;
     149      }
     150    }
     151
     152    private void isRegressionVisibleInLegendCheckBox_CheckedChanged(object sender, EventArgs e) {
     153      if (!SuppressEvents && Content != null) {
     154        Content.IsRegressionVisibleInLegend = isRegressionVisibleInLegendCheckBox.Checked;
     155      }
     156    }
     157
     158    private void regressionLegendTextBox_Validated(object sender, EventArgs e) {
     159      if (!SuppressEvents && Content != null) {
     160        Content.RegressionDisplayName = regressionLegendTextBox.Text;
    129161      }
    130162    }
Note: See TracChangeset for help on using the changeset viewer.