Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14470


Ignore:
Timestamp:
12/09/16 15:19:30 (8 years ago)
Author:
pfleck
Message:

#2709

  • Fixed bugs with double-click on view shortcut.
  • Reuse visual properties for single scatterplot.
Location:
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs

    r14185 r14470  
    2727namespace HeuristicLab.Problems.DataAnalysis.Views {
    2828  [View("Preprocessing Feature Correlation View")]
    29   [Content(typeof(CorrelationMatrixContent), false)]
     29  [Content(typeof(CorrelationMatrixContent), true)]
    3030  public partial class PreprocessingFeatureCorrelationView : AsynchronousContentView {
    3131
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs

    r14467 r14470  
    118118      this.comboBoxGroup.Size = new System.Drawing.Size(121, 21);
    119119      this.comboBoxGroup.TabIndex = 1;
    120       this.comboBoxGroup.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
     120      this.comboBoxGroup.SelectedIndexChanged += new System.EventHandler(this.comboBoxGroup_SelectedIndexChanged);
    121121      //
    122122      // comboBoxYVariable
     
    129129      this.comboBoxYVariable.Size = new System.Drawing.Size(121, 21);
    130130      this.comboBoxYVariable.TabIndex = 1;
    131       this.comboBoxYVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
     131      this.comboBoxYVariable.SelectedIndexChanged += new System.EventHandler(this.comboBoxYVariable_SelectedIndexChanged);
    132132      //
    133133      // comboBoxXVariable
     
    140140      this.comboBoxXVariable.Size = new System.Drawing.Size(121, 21);
    141141      this.comboBoxXVariable.TabIndex = 0;
    142       this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
     142      this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBoxXVariable_SelectedIndexChanged);
    143143      //
    144144      // ScatterPlotSingleView
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs

    r14467 r14470  
    8282    }
    8383
    84     private void comboBox_SelectedIndexChanged(object sender, EventArgs e) {
    85       UpdateScatterPlot();
    86     }
    87 
    8884    private void UpdateScatterPlot() {
    8985      if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null && comboBoxGroup.SelectedItem != null) {
     
    105101      }
    106102    }
     103
     104    private void comboBoxXVariable_SelectedIndexChanged(object sender, EventArgs e) {
     105      var oldPlot = scatterPlotControl.Content;
     106      UpdateScatterPlot();
     107      var newPlot = scatterPlotControl.Content;
     108
     109
     110      if (oldPlot == null || newPlot == null) return;
     111      newPlot.VisualProperties.YAxisMinimumAuto = oldPlot.VisualProperties.YAxisMinimumAuto;
     112      newPlot.VisualProperties.YAxisMaximumAuto = oldPlot.VisualProperties.YAxisMaximumAuto;
     113      newPlot.VisualProperties.YAxisMinimumFixedValue = oldPlot.VisualProperties.YAxisMinimumFixedValue;
     114      newPlot.VisualProperties.YAxisMaximumFixedValue = oldPlot.VisualProperties.YAxisMaximumFixedValue;
     115
     116      foreach (var x in newPlot.Rows.Zip(oldPlot.Rows, (nr, or) => new { nr, or })) {
     117        x.nr.VisualProperties.PointSize = x.or.VisualProperties.PointSize;
     118        x.nr.VisualProperties.PointStyle = x.or.VisualProperties.PointStyle;
     119        x.nr.VisualProperties.Color = x.or.VisualProperties.Color;
     120      }
     121    }
     122
     123    private void comboBoxYVariable_SelectedIndexChanged(object sender, EventArgs e) {
     124      var oldPlot = scatterPlotControl.Content;
     125      UpdateScatterPlot();
     126      var newPlot = scatterPlotControl.Content;
     127
     128      if (oldPlot == null || newPlot == null) return;
     129      newPlot.VisualProperties.XAxisMinimumAuto = oldPlot.VisualProperties.XAxisMinimumAuto;
     130      newPlot.VisualProperties.XAxisMaximumAuto = oldPlot.VisualProperties.XAxisMaximumAuto;
     131      newPlot.VisualProperties.XAxisMinimumFixedValue = oldPlot.VisualProperties.XAxisMinimumFixedValue;
     132      newPlot.VisualProperties.XAxisMaximumFixedValue = oldPlot.VisualProperties.XAxisMaximumFixedValue;
     133
     134      foreach (var x in newPlot.Rows.Zip(oldPlot.Rows, (nr, or) => new { nr, or })) {
     135        x.nr.VisualProperties.PointSize = x.or.VisualProperties.PointSize;
     136        x.nr.VisualProperties.PointStyle = x.or.VisualProperties.PointStyle;
     137        x.nr.VisualProperties.Color = x.or.VisualProperties.Color;
     138      }
     139    }
     140
     141    private void comboBoxGroup_SelectedIndexChanged(object sender, EventArgs e) {
     142      UpdateScatterPlot();
     143    }
    107144  }
    108145}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.cs

    r14467 r14470  
    4646        IViewShortcut item = itemsListView.SelectedItems[0].Tag as IViewShortcut;
    4747        if (item != null) {
    48           item = (IViewShortcut)item.Clone();
    49 
    50           var view = MainFormManager.MainForm.ShowContent(item);
    51           if (view != null) {
    52             view.ReadOnly = ReadOnly;
    53             view.Locked = Locked;
     48          try {
     49            item = (IViewShortcut)item.Clone();
     50            var view = MainFormManager.MainForm.ShowContent(item);
     51            if (view != null) {
     52              view.ReadOnly = ReadOnly;
     53              view.Locked = Locked;
     54            }
     55          } catch (NullReferenceException) {
     56            // cloning for preprocessing not done properly yet
    5457          }
    5558        }
Note: See TracChangeset for help on using the changeset viewer.