Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13502


Ignore:
Timestamp:
01/12/16 17:05:37 (8 years ago)
Author:
pfleck
Message:

#2559

  • Adapted import and export for preprocessing.
  • Added MenuItem to be able to open Preprocessing without creating a DataAnalysisProblem before.
  • Added coloring in ScatterPlot.
  • Removed IPreprocessingContext interface.
  • Reformatted code:
    • Added missing copyright headers.
    • Corrected namespaces.
    • Deleted unnecessary usings.
    • Applied correct formatting.
Location:
trunk/sources
Files:
1 added
1 deleted
49 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/CheckedFilterCollectionView.Designer.cs

    r10785 r13502  
    1 using HeuristicLab.Core.Views;
    2 using HeuristicLab.DataPreprocessing.Filter;
    3 namespace HeuristicLab.DataPreprocessing.Views
    4 {
    5   partial class CheckedFilterCollectionView
    6   {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.DataPreprocessing.Views {
     23  partial class CheckedFilterCollectionView {
    724    /// <summary>
    825    /// Required designer variable.
     
    1431    /// </summary>
    1532    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    16     protected override void Dispose(bool disposing)
    17     {
    18       if (disposing && (components != null))
    19       {
     33    protected override void Dispose(bool disposing) {
     34      if (disposing && (components != null)) {
    2035        components.Dispose();
    2136      }
     
    2944    /// the contents of this method with the code editor.
    3045    /// </summary>
    31     private void InitializeComponent()
    32     {
     46    private void InitializeComponent() {
    3347      components = new System.ComponentModel.Container();
    3448      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/CheckedFilterCollectionView.cs

    r11114 r13502  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Drawing;
    5 using System.Linq;
    6 using System.Text;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    723using System.Windows.Forms;
     24using HeuristicLab.Core;
    825using HeuristicLab.Core.Views;
    9 using HeuristicLab.Collections;
     26using HeuristicLab.DataPreprocessing.Filter;
    1027using HeuristicLab.MainForm;
    11 using HeuristicLab.Core;
    12 using HeuristicLab.DataPreprocessing.Filter;
    1328
    14 namespace HeuristicLab.DataPreprocessing.Views
    15 {
     29namespace HeuristicLab.DataPreprocessing.Views {
    1630  [View("CheckedFilterCollection View")]
    1731  [Content(typeof(ICheckedItemCollection<>), false)]
    1832  [Content(typeof(CheckedItemCollection<>), false)]
    19   public partial class CheckedFilterCollectionView : CheckedItemCollectionView<IFilter>
    20   {
    21     public CheckedFilterCollectionView()
    22     {
     33  public partial class CheckedFilterCollectionView : CheckedItemCollectionView<IFilter> {
     34    public CheckedFilterCollectionView() {
    2335      InitializeComponent();
    2436    }
    2537
    26     protected override void addButton_Click(object sender, EventArgs e)
    27     {
     38    protected override void addButton_Click(object sender, EventArgs e) {
    2839      IFilter filter = new ComparisonFilter();
    2940      Content.Add(filter);
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataCompletenessView.Designer.cs

    r10979 r13502  
    1 namespace HeuristicLab.DataPreprocessing.Views {
    2   partial class DataCompletenessView
    3   {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.DataPreprocessing.Views {
     23  partial class DataCompletenessView {
    424    /// <summary>
    525    /// Required designer variable.
     
    3454      // chart
    3555      //
    36       this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    37             | System.Windows.Forms.AnchorStyles.Left) 
     56      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     57            | System.Windows.Forms.AnchorStyles.Left)
    3858            | System.Windows.Forms.AnchorStyles.Right)));
    3959      chartArea1.Name = "ChartArea1";
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataCompletenessView.cs

    r11002 r13502  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
     23using System.Collections.Generic;
     24using System.Drawing;
    225using System.Windows.Forms;
    3 using HeuristicLab.Analysis;
     26using System.Windows.Forms.DataVisualization.Charting;
     27using HeuristicLab.Core.Views;
    428using HeuristicLab.MainForm;
    5 using HeuristicLab.Core.Views;
    6 using System.Collections.Generic;
    7 using HeuristicLab.DataPreprocessing.Implementations;
    8 using System.Drawing;
    9 using System.Windows.Forms.DataVisualization.Charting;
    1029
    1130namespace HeuristicLab.DataPreprocessing.Views {
     
    1332  [View("Histogram View")]
    1433  [Content(typeof(DataCompletenessChartContent), true)]
    15   public partial class DataCompletenessView : ItemView
    16   {
     34  public partial class DataCompletenessView : ItemView {
    1735
    1836    //list of columns, bool indicates wether the cell is a missing value or not
     
    2240    private static Color colorMissingVal = Color.Orange;
    2341
    24     public new DataCompletenessChartContent Content
    25     {
     42    public new DataCompletenessChartContent Content {
    2643      get { return (DataCompletenessChartContent)base.Content; }
    2744      set { base.Content = value; }
     
    2946
    3047
    31     public DataCompletenessView()
    32     {
     48    public DataCompletenessView() {
    3349      InitializeComponent();
    3450    }
    3551
    36     protected override void OnContentChanged()
    37     {
     52    protected override void OnContentChanged() {
    3853      base.OnContentChanged();
    39       if (Content != null)
    40       {
     54      if (Content != null) {
    4155        InitData();
    4256      }
    4357    }
    4458
    45     private void InitData()
    46     {
     59    private void InitData() {
    4760      IDictionary<int, IList<int>> missingValueIndices = Content.SearchLogic.GetMissingValueIndices();
    48       for (int i = 0; i < Content.SearchLogic.Columns; i++)
    49       {
     61      for (int i = 0; i < Content.SearchLogic.Columns; i++) {
    5062        //append column
    5163        List<bool> column = new List<bool>();
     
    6072    }
    6173
    62     private void PrepareChart()
    63     {
     74    private void PrepareChart() {
    6475      chart.Titles.Add("DataCompletenessChart");
    6576      chart.EnableDoubleClickResetsZoom = true;
     
    7485      //custom x axis label
    7586      double from = 0.5;
    76       foreach (String columnName in Content.SearchLogic.VariableNames)
    77       {
     87      foreach (String columnName in Content.SearchLogic.VariableNames) {
    7888        double to = from + 1;
    7989        chart.ChartAreas[0].AxisX.CustomLabels.Add(from, to, columnName);
     
    8494    }
    8595
    86     private void CreateSeries(List<List<int>> yValuesPerColumn)
    87     {
     96    private void CreateSeries(List<List<int>> yValuesPerColumn) {
    8897      //prepare series
    8998      int seriesCount = DetermineSeriesCount(yValuesPerColumn);
    90       for (int i = 0; i < seriesCount; i++)
    91       {
     99      for (int i = 0; i < seriesCount; i++) {
    92100        chart.Series.Add(CreateSeriesName(i));
    93101        Series series = chart.Series[CreateSeriesName(i)];
     
    95103        series.IsVisibleInLegend = false;
    96104        series["PointWidth"] = "1.0";
    97         if (i % 2 == 0)
    98         {
     105        if (i % 2 == 0) {
    99106          if (i == 0) //show legend for non missing values only once
    100107            series.IsVisibleInLegend = true;
    101108          series.Color = colorNonMissingVal;
    102         }
    103         else
    104         {
     109        } else {
    105110          if (i == 1) //show legend for missing values only once
    106111            series.IsVisibleInLegend = true;
     
    109114      }
    110115      //fill series
    111       for (int i = 0; i < yValuesPerColumn.Count; i++)
    112       {
     116      for (int i = 0; i < yValuesPerColumn.Count; i++) {
    113117        List<int> column = yValuesPerColumn[i];
    114118        for (int j = 0; j < seriesCount; j++) {
     
    122126    }
    123127
    124     private String CreateSeriesName(int index)
    125     {
     128    private String CreateSeriesName(int index) {
    126129      if (index == 0)
    127130        return "non-missing value";
     
    132135
    133136    #region data_preparation_for_chartseries
    134     private int DetermineSeriesCount(List<List<int>> yValuesPerColumn)
    135     {
     137    private int DetermineSeriesCount(List<List<int>> yValuesPerColumn) {
    136138      int highest = 0;
    137139      foreach (List<int> values in yValuesPerColumn) {
     
    141143    }
    142144
    143     private List<List<int>> ProcessMatrixForCharting(List<List<bool>> matrix, IDictionary<int, IList<int>> missingValueIndices)
    144     {
     145    private List<List<int>> ProcessMatrixForCharting(List<List<bool>> matrix, IDictionary<int, IList<int>> missingValueIndices) {
    145146      List<List<int>> columnsYValues = new List<List<int>>();
    146       for (int i=0; i < matrix.Count; i++) //column
     147      for (int i = 0; i < matrix.Count; i++) //column
    147148      {
    148149        List<int> yValues = new List<int>();
     
    150151        bool missingState = false;
    151152        int valueCount = 0;
    152         for (int j = 0; j < column.Count; j++ ) {
    153           if (missingState == missingValueIndices[i].Contains(j))
    154           {
     153        for (int j = 0; j < column.Count; j++) {
     154          if (missingState == missingValueIndices[i].Contains(j)) {
    155155            valueCount++;
    156           }
    157           else
    158           {
     156          } else {
    159157            yValues.Add(valueCount);
    160158            valueCount = 1;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs

    r12676 r13502  
    3030  [View("DataPreprocessing View")]
    3131  [Content(typeof(PreprocessingContext), true)]
    32   [Content(typeof(IPreprocessingContext), false)]
    3332  public partial class DataPreprocessingView : ItemView {
    3433
     
    3736    }
    3837
    39     public new IPreprocessingContext Content {
    40       get { return (IPreprocessingContext)base.Content; }
     38    public new PreprocessingContext Content {
     39      get { return (PreprocessingContext)base.Content; }
    4140      set { base.Content = value; }
    4241    }
     
    6059          new CorrelationMatrixContent(Content),
    6160          new DataCompletenessChartContent(searchLogic),
    62          
     61
    6362          new FilterContent(filterLogic),
    6463          new ManipulationContent(manipulationLogic, searchLogic, filterLogic),
     
    9493      viewShortcutListView.Enabled = Content != null;
    9594      applyInNewTabButton.Enabled = Content != null;
    96       exportProblemButton.Enabled = Content != null && Content.Problem != null;
     95      exportProblemButton.Enabled = Content != null && Content.CanExport;
    9796      undoButton.Enabled = Content != null;
    9897    }
    9998
    10099    private void exportProblemButton_Click(object sender, EventArgs e) {
    101       var problem = Content.ExportProblem();
     100      // ToDo: select one export probability
     101      var problem = Content.Export();
    102102
    103103      var saveFileDialog = new SaveFileDialog {
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessorStarter.cs

    r12676 r13502  
    2121
    2222using System.Windows.Forms;
     23using HeuristicLab.Core;
    2324using HeuristicLab.MainForm;
    2425using HeuristicLab.Optimization;
     
    3334      IDataAnalysisProblem problem;
    3435      GetMostOuterContent(currentView as Control, out algorithm, out problem);
    35       var context = new PreprocessingContext(problemData, algorithm, problem);
     36      var context = new PreprocessingContext(algorithm ?? problem ?? problemData as IItem);
    3637      MainFormManager.MainForm.ShowContent(context);
    3738    }
     
    4243
    4344      while (control != null) {
    44         IContentView contentView = control as IContentView;
     45        var contentView = control as IContentView;
    4546        if (contentView != null) {
    4647          var newAlgorithm = contentView.Content as IAlgorithm;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/FilterView.Designer.cs

    r11044 r13502  
    1 namespace HeuristicLab.DataPreprocessing.Views
    2 {
    3   partial class FilterView
    4   {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.DataPreprocessing.Views {
     23  partial class FilterView {
    524    /// <summary>
    625    /// Required designer variable.
     
    1231    /// </summary>
    1332    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    14     protected override void Dispose(bool disposing)
    15     {
    16       if (disposing && (components != null))
    17       {
     33    protected override void Dispose(bool disposing) {
     34      if (disposing && (components != null)) {
    1835        components.Dispose();
    1936      }
     
    2744    /// the contents of this method with the code editor.
    2845    /// </summary>
    29     private void InitializeComponent()
    30     {
     46    private void InitializeComponent() {
    3147      this.groupBoxFilter = new System.Windows.Forms.GroupBox();
    3248      this.checkedFilterView = new HeuristicLab.DataPreprocessing.Views.CheckedFilterCollectionView();
     
    5369      // groupBoxFilter
    5470      //
    55       this.groupBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     71      this.groupBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    5672            | System.Windows.Forms.AnchorStyles.Right)));
    5773      this.groupBoxFilter.Controls.Add(this.checkedFilterView);
     
    7793      // groupBoxFilterInfo
    7894      //
    79       this.groupBoxFilterInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     95      this.groupBoxFilterInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    8096            | System.Windows.Forms.AnchorStyles.Right)));
    8197      this.groupBoxFilterInfo.Controls.Add(this.lblPercentage);
     
    103119      // tbPercentage
    104120      //
    105       this.tbPercentage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     121      this.tbPercentage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    106122            | System.Windows.Forms.AnchorStyles.Right)));
    107123      this.tbPercentage.Enabled = false;
     
    113129      // tbFiltered
    114130      //
    115       this.tbRemaining.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     131      this.tbRemaining.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    116132            | System.Windows.Forms.AnchorStyles.Right)));
    117133      this.tbRemaining.Enabled = false;
     
    132148      // tbTotal
    133149      //
    134       this.tbTotal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     150      this.tbTotal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    135151            | System.Windows.Forms.AnchorStyles.Right)));
    136152      this.tbTotal.Enabled = false;
     
    193209      // groupBox1
    194210      //
    195       this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     211      this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    196212            | System.Windows.Forms.AnchorStyles.Right)));
    197213      this.groupBox1.Controls.Add(this.label4);
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/FilterView.cs

    r11044 r13502  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.Linq;
    4 using System.Windows.Forms;
    525using HeuristicLab.Collections;
    6 using HeuristicLab.Core;
    726using HeuristicLab.Core.Views;
    8 using HeuristicLab.Data;
    927using HeuristicLab.DataPreprocessing.Filter;
    1028using HeuristicLab.MainForm;
     
    2240    }
    2341
    24     private void InitData()
    25     {
    26         checkedFilterView.Content = Content.Filters;
    27         checkedFilterView.Content.ItemsAdded += Content_ItemsAdded;
    28         checkedFilterView.Content.ItemsRemoved += Content_ItemsRemoved;
    29         checkedFilterView.Content.CheckedItemsChanged += Content_CheckedItemsChanged;
     42    private void InitData() {
     43      checkedFilterView.Content = Content.Filters;
     44      checkedFilterView.Content.ItemsAdded += Content_ItemsAdded;
     45      checkedFilterView.Content.ItemsRemoved += Content_ItemsRemoved;
     46      checkedFilterView.Content.CheckedItemsChanged += Content_CheckedItemsChanged;
    3047    }
    3148
     
    3552    }
    3653
    37     protected override void OnContentChanged()
    38     {
     54    protected override void OnContentChanged() {
    3955      base.OnContentChanged();
    40       if (Content != null)
    41       {
     56      if (Content != null) {
    4257        InitData();
    4358        UpdateFilterInfo();
     
    4661
    4762    private void Content_CheckedItemsChanged(object sender, Collections.CollectionItemsChangedEventArgs<IFilter> e) {
    48       if (Content != null)
    49       {
    50         foreach (IFilter filter in e.Items)
    51         {
     63      if (Content != null) {
     64        foreach (IFilter filter in e.Items) {
    5265          filter.Active = checkedFilterView.Content.ItemChecked(filter);
    5366        }
     
    5770
    5871    private void UpdateFilterInfo() {
    59         List<IFilter> filters = Content.Filters.ToList();
    60         int activeFilters = filters.Count(c => c.Active);
    61         applyFilterButton.Enabled = (activeFilters > 0);
    62         rBtnAnd.Enabled = (activeFilters > 0);
    63         rBtnOr.Enabled = (activeFilters > 0);
    64         Content.FilterLogic.Reset();
    65         bool[] result = Content.FilterLogic.Preview(filters, rBtnAnd.Checked);
     72      List<IFilter> filters = Content.Filters.ToList();
     73      int activeFilters = filters.Count(c => c.Active);
     74      applyFilterButton.Enabled = (activeFilters > 0);
     75      rBtnAnd.Enabled = (activeFilters > 0);
     76      rBtnOr.Enabled = (activeFilters > 0);
     77      Content.FilterLogic.Reset();
     78      bool[] result = Content.FilterLogic.Preview(filters, rBtnAnd.Checked);
    6679
    67         int filteredCnt = result.Count(c => !c);
     80      int filteredCnt = result.Count(c => !c);
    6881
    69         tbRemaining.Text = filteredCnt.ToString();
    70         double percentage = result.Length == 0 ? 0.0 : filteredCnt * 100 / (double)result.Length;
    71         tbPercentage.Text = String.Format("{0:0.0000}%", percentage);
    72         tbTotal.Text = result.Length.ToString();
     82      tbRemaining.Text = filteredCnt.ToString();
     83      double percentage = result.Length == 0 ? 0.0 : filteredCnt * 100 / (double)result.Length;
     84      tbPercentage.Text = String.Format("{0:0.0000}%", percentage);
     85      tbTotal.Text = result.Length.ToString();
    7386    }
    7487
    7588    private void applyFilterButton_Click(object sender, EventArgs e) {
    76       if (Content != null)
    77       {
     89      if (Content != null) {
    7890        List<IFilter> filters = Content.Filters.ToList();
    7991        //apply filters
     
    8193        //deactivate checked filters
    8294        filters = checkedFilterView.Content.CheckedItems.ToList();
    83         foreach (IFilter filter in filters)
    84         {
     95        foreach (IFilter filter in filters) {
    8596          checkedFilterView.Content.SetItemCheckedState(filter, false);
    8697          filter.Active = false;
     
    92103    //whenever a new filter is added the preprocessing data is set to the filter
    93104    private void Content_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IFilter> e) {
    94       if (Content != null)
    95       {
    96         foreach (IFilter filter in e.Items)
    97         {
     105      if (Content != null) {
     106        foreach (IFilter filter in e.Items) {
    98107          filter.ConstrainedValue = Content.FilterLogic.PreprocessingData;
    99108        }
     
    102111
    103112    private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IFilter> e) {
    104       if (Content != null)
    105       {
     113      if (Content != null) {
    106114        UpdateFilterInfo();
    107115      }
    108116    }
    109117
    110     private void rBtnAnd_CheckedChanged(object sender, EventArgs e)
    111     {
    112       if (Content != null)
    113       {
     118    private void rBtnAnd_CheckedChanged(object sender, EventArgs e) {
     119      if (Content != null) {
    114120        UpdateFilterInfo();
    115121        Content.IsAndCombination = rBtnAnd.Checked;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj

    r13252 r13502  
    9797  </ItemGroup>
    9898  <ItemGroup>
     99    <Compile Include="DataPreprocessingMenuItem.cs" />
    99100    <Compile Include="PreprocessingFeatureCorrelationView.cs">
    100101      <SubType>UserControl</SubType>
     
    304305      <Name>HeuristicLab.Optimization-3.3</Name>
    305306      <Private>False</Private>
     307    </ProjectReference>
     308    <ProjectReference Include="..\..\HeuristicLab.Optimizer\3.3\HeuristicLab.Optimizer-3.3.csproj">
     309      <Project>{C664305E-497C-4533-A140-967DEDB05C19}</Project>
     310      <Name>HeuristicLab.Optimizer-3.3</Name>
    306311    </ProjectReference>
    307312    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.Designer.cs

    r12676 r13502  
    1 namespace HeuristicLab.DataPreprocessing.Views {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.DataPreprocessing.Views {
    223  partial class HistogramView {
    324    /// <summary>
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs

    r12676 r13502  
    1919 */
    2020#endregion
     21
    2122using System;
    22 using System.Windows.Forms;
    2323using HeuristicLab.Analysis;
    2424using HeuristicLab.MainForm;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.Designer.cs

    r10736 r13502  
    1 namespace HeuristicLab.DataPreprocessing.Views {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.DataPreprocessing.Views {
    223  partial class LineChartView {
    324    /// <summary>
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.cs

    r12012 r13502  
    2121
    2222using System;
    23 using System.Windows.Forms;
    2423using HeuristicLab.Analysis;
    2524using HeuristicLab.MainForm;
     
    4645    private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) {
    4746      Content.AllInOneMode = allInOneCheckBox.Checked;
    48  
     47
    4948      GenerateChart();
    5049    }
    5150
    52     protected override void OnContentChanged()
    53     {
     51    protected override void OnContentChanged() {
    5452      base.OnContentChanged();
    55       if (Content != null)
    56       {
     53      if (Content != null) {
    5754        allInOneCheckBox.Checked = Content.AllInOneMode;
    5855      }
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/ManipulationView.Designer.cs

    r12676 r13502  
    1 namespace HeuristicLab.DataPreprocessing.Views {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.DataPreprocessing.Views {
    223  partial class ManipulationView {
    324    /// <summary>
     
    91112      // lstMethods
    92113      //
    93       this.lstMethods.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     114      this.lstMethods.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    94115            | System.Windows.Forms.AnchorStyles.Right)));
    95116      this.lstMethods.FormattingEnabled = true;
     
    124145      // grpBoxData
    125146      //
    126       this.grpBoxData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     147      this.grpBoxData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    127148            | System.Windows.Forms.AnchorStyles.Right)));
    128149      this.grpBoxData.Controls.Add(this.tabsData);
     
    138159      // tabsData
    139160      //
    140       this.tabsData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     161      this.tabsData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    141162            | System.Windows.Forms.AnchorStyles.Right)));
    142163      this.tabsData.Controls.Add(this.tabPage1);
     
    416437      // grpBoxPreview
    417438      //
    418       this.grpBoxPreview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    419             | System.Windows.Forms.AnchorStyles.Left) 
     439      this.grpBoxPreview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     440            | System.Windows.Forms.AnchorStyles.Left)
    420441            | System.Windows.Forms.AnchorStyles.Right)));
    421442      this.grpBoxPreview.Controls.Add(this.tabsPreview);
     
    431452      // tabsPreview
    432453      //
    433       this.tabsPreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     454      this.tabsPreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    434455            | System.Windows.Forms.AnchorStyles.Right)));
    435456      this.tabsPreview.Controls.Add(this.tabPreviewInactive);
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.Designer.cs

    r12012 r13502  
    2020#endregion
    2121
    22 using HeuristicLab.Data;
    2322namespace HeuristicLab.DataPreprocessing.Views {
    2423  partial class PreprocessingChartView {
     
    6564      // tableLayoutPanel
    6665      //
    67       this.tableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    68             | System.Windows.Forms.AnchorStyles.Left) 
     66      this.tableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     67            | System.Windows.Forms.AnchorStyles.Left)
    6968            | System.Windows.Forms.AnchorStyles.Right)));
    7069      this.tableLayoutPanel.AutoScroll = true;
     
    8281      // checkedItemList
    8382      //
    84       this.checkedItemList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     83      this.checkedItemList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    8584            | System.Windows.Forms.AnchorStyles.Left)));
    8685      this.checkedItemList.Caption = "View";
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs

    r12676 r13502  
    2828using HeuristicLab.Core.Views;
    2929using HeuristicLab.Data;
    30 using HeuristicLab.DataPreprocessing.Implementations;
    3130using HeuristicLab.MainForm;
    3231
    3332namespace HeuristicLab.DataPreprocessing.Views {
    34 
    3533  [View("Preprocessing Chart View")]
    3634  [Content(typeof(PreprocessingChartContent), false)]
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedItemListView.cs

    r12012 r13502  
    2222#endregion
    2323
    24 using System.Windows.Forms;
    2524using HeuristicLab.Core;
    2625using HeuristicLab.Core.Views;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.Designer.cs

    r12012 r13502  
    2020#endregion
    2121
    22 namespace HeuristicLab.DataPreprocessing.Views
    23 {
     22namespace HeuristicLab.DataPreprocessing.Views {
    2423  partial class PreprocessingDataTableView {
    2524    /// <summary>
     
    5756      // chart
    5857      //
    59       this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    60             | System.Windows.Forms.AnchorStyles.Left) 
     58      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     59            | System.Windows.Forms.AnchorStyles.Left)
    6160            | System.Windows.Forms.AnchorStyles.Right)));
    6261      this.chart.BorderlineColor = System.Drawing.Color.Black;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.cs

    r12676 r13502  
    2626using System.Windows.Forms;
    2727using System.Windows.Forms.DataVisualization.Charting;
     28using HeuristicLab.Analysis;
     29using HeuristicLab.Analysis.Views;
    2830using HeuristicLab.Collections;
    2931using HeuristicLab.Core.Views;
    30 using HeuristicLab.DataPreprocessing.Implementations;
    3132using HeuristicLab.MainForm;
    32 using HeuristicLab.Analysis;
    33 using HeuristicLab.Analysis.Views;
    3433
    3534namespace HeuristicLab.DataPreprocessing.Views {
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.Designer.cs

    r12012 r13502  
    4747    /// </summary>
    4848    private void InitializeComponent() {
    49       this.components = new System.ComponentModel.Container();     
     49      this.components = new System.ComponentModel.Container();
    5050      this.ResumeLayout(false);
    5151    }
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs

    r12012 r13502  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    23 using System.ComponentModel;
    24 using System.Linq;
    2522using System.Windows.Forms;
    26 using HeuristicLab.Data;
     23using HeuristicLab.DataPreprocessing;
    2724using HeuristicLab.MainForm;
    2825using HeuristicLab.MainForm.WindowsForms;
    29 using HeuristicLab.PluginInfrastructure;
    30 using System;
    31 using HeuristicLab.DataPreprocessing;
    32 using HeuristicLab.Problems.DataAnalysis.Views;
    3326
    3427namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    3730  public partial class PreprocessingFeatureCorrelationView : AsynchronousContentView {
    3831
    39     public new CorrelationMatrixContent Content
    40     {
    41       get { return (CorrelationMatrixContent) base.Content; }
     32    public new CorrelationMatrixContent Content {
     33      get { return (CorrelationMatrixContent)base.Content; }
    4234      set { base.Content = value; }
    4335    }
     
    5547    protected override void RegisterContentEvents() {
    5648      base.RegisterContentEvents();
    57       Content.Changed += Data_Changed;     
     49      Content.Changed += Data_Changed;
    5850    }
    5951
    6052    protected override void DeregisterContentEvents() {
    61       Content.Changed -= Data_Changed;     
     53      Content.Changed -= Data_Changed;
    6254      base.DeregisterContentEvents();
    6355    }
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingScatterPlotView.Designer.cs

    r12012 r13502  
    5656      // chart
    5757      //
    58       this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    59             | System.Windows.Forms.AnchorStyles.Left) 
     58      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     59            | System.Windows.Forms.AnchorStyles.Left)
    6060            | System.Windows.Forms.AnchorStyles.Right)));
    6161      this.chart.BorderlineColor = System.Drawing.Color.Black;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingScatterPlotView.cs

    r12012 r13502  
    462462      if (chartDoubleClick != null)
    463463        chartDoubleClick(this, e);
    464     } 
     464    }
    465465  }
    466466}
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/RenameColumnsDialog.Designer.cs

    r13271 r13502  
    7878      this.dataGridView.AllowUserToAddRows = false;
    7979      this.dataGridView.AllowUserToDeleteRows = false;
    80       this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    81             | System.Windows.Forms.AnchorStyles.Left) 
     80      this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     81            | System.Windows.Forms.AnchorStyles.Left)
    8282            | System.Windows.Forms.AnchorStyles.Right)));
    8383      this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.Designer.cs

    r10987 r13502  
    1 namespace HeuristicLab.DataPreprocessing.Views {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.DataPreprocessing.Views {
    223  partial class ScatterPlotMultiView {
    324    /// <summary>
     
    2950      // tableLayoutPanel
    3051      //
    31       this.tableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    32             | System.Windows.Forms.AnchorStyles.Left) 
     52      this.tableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     53            | System.Windows.Forms.AnchorStyles.Left)
    3354            | System.Windows.Forms.AnchorStyles.Right)));
    3455      this.tableLayoutPanel.AutoScroll = true;
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs

    r10992 r13502  
    77using HeuristicLab.Common;
    88using HeuristicLab.Core.Views;
    9 using HeuristicLab.DataPreprocessing.Implementations;
    109using HeuristicLab.MainForm;
    1110
    1211namespace HeuristicLab.DataPreprocessing.Views {
    13 
    1412  [View("Scatter Plot Multi View")]
    1513  [Content(typeof(ScatterPlotContent), false)]
     
    8179          tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, (tableLayoutPanel.Height - HEADER_HEIGHT) / variables.Count));
    8280        }
    83           // fixed size
     81        // fixed size
    8482        else {
    8583          tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, FIXED_CHART_WIDTH));
     
    111109            tableLayoutPanel.Controls.Add(pcv, y, x);
    112110          }
    113             //scatter plot
     111          //scatter plot
    114112          else {
    115113            ScatterPlot scatterPlot = Content.CreateScatterPlot(variables[x - 1], variables[y - 1]);
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs

    r11043 r13502  
    1 namespace HeuristicLab.DataPreprocessing.Views {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.DataPreprocessing.Views {
    223  partial class ScatterPlotSingleView {
    324    /// <summary>
     
    3051      this.comboBoxYVariable = new System.Windows.Forms.ComboBox();
    3152      this.comboBoxXVariable = new System.Windows.Forms.ComboBox();
     53      this.label3 = new System.Windows.Forms.Label();
     54      this.comboBoxColor = new System.Windows.Forms.ComboBox();
    3255      this.groupBox1.SuspendLayout();
    3356      this.SuspendLayout();
     
    3558      // scatterPlotView
    3659      //
    37       this.scatterPlotView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    38             | System.Windows.Forms.AnchorStyles.Left) 
     60      this.scatterPlotView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     61            | System.Windows.Forms.AnchorStyles.Left)
    3962            | System.Windows.Forms.AnchorStyles.Right)));
    4063      this.scatterPlotView.Caption = "ScatterPlot View";
     
    4871      // groupBox1
    4972      //
     73      this.groupBox1.Controls.Add(this.label3);
    5074      this.groupBox1.Controls.Add(this.label2);
    5175      this.groupBox1.Controls.Add(this.label1);
     76      this.groupBox1.Controls.Add(this.comboBoxColor);
    5277      this.groupBox1.Controls.Add(this.comboBoxYVariable);
    5378      this.groupBox1.Controls.Add(this.comboBoxXVariable);
    5479      this.groupBox1.Location = new System.Drawing.Point(3, 3);
    5580      this.groupBox1.Name = "groupBox1";
    56       this.groupBox1.Size = new System.Drawing.Size(160, 140);
     81      this.groupBox1.Size = new System.Drawing.Size(160, 215);
    5782      this.groupBox1.TabIndex = 1;
    5883      this.groupBox1.TabStop = false;
     
    99124      this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
    100125      //
     126      // label3
     127      //
     128      this.label3.AutoSize = true;
     129      this.label3.Location = new System.Drawing.Point(17, 141);
     130      this.label3.Name = "label3";
     131      this.label3.Size = new System.Drawing.Size(31, 13);
     132      this.label3.TabIndex = 3;
     133      this.label3.Text = "Color";
     134      //
     135      // comboBoxColor
     136      //
     137      this.comboBoxColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     138      this.comboBoxColor.FormattingEnabled = true;
     139      this.comboBoxColor.Location = new System.Drawing.Point(20, 164);
     140      this.comboBoxColor.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3);
     141      this.comboBoxColor.Name = "comboBoxColor";
     142      this.comboBoxColor.Size = new System.Drawing.Size(121, 21);
     143      this.comboBoxColor.TabIndex = 1;
     144      this.comboBoxColor.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
     145      //
    101146      // ScatterPlotSingleView
    102147      //
     
    121166    private System.Windows.Forms.ComboBox comboBoxYVariable;
    122167    private System.Windows.Forms.ComboBox comboBoxXVariable;
     168    private System.Windows.Forms.ComboBox comboBoxColor;
     169    private System.Windows.Forms.Label label3;
    123170  }
    124171}
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs

    r10998 r13502  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.Linq;
    4 using System.Windows.Forms;
    525using HeuristicLab.Analysis;
    626using HeuristicLab.Core.Views;
     
    1838    }
    1939
    20     public ScatterPlotSingleView()
    21     {
     40    public ScatterPlotSingleView() {
    2241      InitializeComponent();
    2342    }
    2443
    2544    public void InitData() {
    26 
    2745      IEnumerable<string> variables = Content.PreprocessingData.GetDoubleVariableNames();
    2846
     
    3048      comboBoxXVariable.Items.Clear();
    3149      comboBoxYVariable.Items.Clear();
     50      comboBoxColor.Items.Clear();
    3251      comboBoxXVariable.Items.AddRange(variables.ToArray());
    3352      comboBoxYVariable.Items.AddRange(variables.ToArray());
     53      comboBoxColor.Items.Add("-");
     54      for (int i = 0; i < Content.PreprocessingData.Columns; ++i) {
     55        if (Content.PreprocessingData.VariableHasType<double>(i)) {
     56          double distinctValueCount = Content.PreprocessingData.GetValues<double>(i).GroupBy(x => x).Count();
     57          if (distinctValueCount <= 20)
     58            comboBoxColor.Items.Add(Content.PreprocessingData.GetVariableName(i));
     59        }
     60      }
    3461
    3562      // use x and y variable from content
    36       if (Content.SelectedXVariable != null && Content.SelectedYVariable != null) {
     63      if (Content.SelectedXVariable != null && Content.SelectedYVariable != null && Content.SelectedColorVariable != null) {
    3764        comboBoxXVariable.SelectedItem = Content.SelectedXVariable;
    3865        comboBoxYVariable.SelectedItem = Content.SelectedYVariable;
     66        comboBoxColor.SelectedItem = Content.SelectedColorVariable;
    3967      } else {
    4068        if (variables.Count() >= 2) {
    4169          comboBoxXVariable.SelectedIndex = 0;
    4270          comboBoxYVariable.SelectedIndex = 1;
     71          comboBoxColor.SelectedIndex = 0;
    4372          UpdateScatterPlot();
    44 
    4573        }
    4674      }
     
    5987
    6088    private void UpdateScatterPlot() {
    61       if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null) {
     89      if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null && comboBoxColor.SelectedItem != null) {
    6290        //get scatter plot with selected x and y variable
    63         ScatterPlot scatterPlot = Content.CreateScatterPlot((string)comboBoxXVariable.SelectedItem, (string)comboBoxYVariable.SelectedItem);
     91        ScatterPlot scatterPlot = Content.CreateScatterPlot(
     92          (string)comboBoxXVariable.SelectedItem,
     93          (string)comboBoxYVariable.SelectedItem,
     94          (string)comboBoxColor.SelectedItem);
    6495        scatterPlotView.Content = scatterPlot;
    6596
     
    6798        this.Content.SelectedXVariable = (string)comboBoxXVariable.SelectedItem;
    6899        this.Content.SelectedYVariable = (string)comboBoxYVariable.SelectedItem;
     100        this.Content.SelectedColorVariable = (string)comboBoxColor.SelectedItem;
    69101      }
    70102    }
    71 
    72103  }
    73 
    74 
    75104}
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/SearchAndReplaceDialog.Designer.cs

    r10930 r13502  
    1 namespace HeuristicLab.DataPreprocessing.Views {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.DataPreprocessing.Views {
    223  partial class SearchAndReplaceDialog {
    324    /// <summary>
     
    4465      // tabSearchReplace
    4566      //
    46       this.tabSearchReplace.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    47             | System.Windows.Forms.AnchorStyles.Left) 
     67      this.tabSearchReplace.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     68            | System.Windows.Forms.AnchorStyles.Left)
    4869            | System.Windows.Forms.AnchorStyles.Right)));
    4970      this.tabSearchReplace.Controls.Add(this.tabSearch);
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/SearchAndReplaceDialog.cs

    r10930 r13502  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Windows.Forms;
    324
     
    2041    NotEqual
    2142  }
    22 
    23 
    2443
    2544  public partial class SearchAndReplaceDialog : Form {
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.Designer.cs

    r12012 r13502  
    1919 */
    2020#endregion
    21 
    2221
    2322namespace HeuristicLab.DataPreprocessing.Views {
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/HeuristicLab.DataPreprocessing-3.4.csproj

    r12682 r13502  
    108108    <None Include="Plugin.cs.frame" />
    109109    <Compile Include="Implementations\DataGridContent.cs" />
    110     <Compile Include="Implementations\PreprocessingContext.cs" />
     110    <Compile Include="PreprocessingContext.cs" />
    111111    <Compile Include="Implementations\TransactionalPreprocessingData.cs" />
    112112    <Compile Include="Implementations\SearchLogic.cs" />
    113113    <Compile Include="Implementations\StatisticsLogic.cs" />
    114114    <Compile Include="Interfaces\IDataGridContent.cs" />
    115     <Compile Include="Interfaces\IPreprocessingContext.cs" />
    116115    <Compile Include="Interfaces\ISearchLogic.cs" />
    117116    <Compile Include="Interfaces\IStatisticsLogic.cs" />
     
    160159      <Private>False</Private>
    161160    </ProjectReference>
     161    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
     162      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
     163      <Name>HeuristicLab.Persistence-3.3</Name>
     164    </ProjectReference>
    162165    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    163166      <Project>{94186a6a-5176-4402-ae83-886557b53cca}</Project>
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/CorrelationMatrixContent.cs

    r12012 r13502  
    2121
    2222using System.Drawing;
     23using System.Linq;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    3233    }
    3334
    34     private IPreprocessingContext Context { get; set; }
     35    private PreprocessingContext Context { get; set; }
    3536    private ITransactionalPreprocessingData PreprocessingData {
    3637      get { return Context.Data; }
     
    3940    public DataAnalysisProblemData ProblemData {
    4041      get {
    41         var creator = new ProblemDataCreator(Context);
    42         return (DataAnalysisProblemData)creator.CreateProblemData();
     42        // ToDo: avoid iterating
     43        return Context.ExportPossibilities.Select(p => p.Value()).OfType<DataAnalysisProblemData>().Single();
     44        //var creator = new ProblemDataCreator(Context);
     45        //return (DataAnalysisProblemData)creator.CreateProblemData();
    4346      }
    4447    }
    4548
    46     public CorrelationMatrixContent(IPreprocessingContext context) {
     49    public CorrelationMatrixContent(PreprocessingContext context) {
    4750      Context = context;
    4851    }
     
    5053    public CorrelationMatrixContent(CorrelationMatrixContent original, Cloner cloner)
    5154      : base(original, cloner) {
    52         Context = original.Context;
     55      Context = original.Context;
    5356    }
    5457
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/Filter/IFilter.cs

    r10667 r13502  
    1 using HeuristicLab.Core;
    2 using System;
    3 using System.Collections.Generic;
    4 using System.Linq;
    5 using System.Text;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
    621
    7 namespace HeuristicLab.DataPreprocessing.Filter
    8 {
    9   public interface IFilter : IConstraint
    10   {
     22using HeuristicLab.Core;
     23
     24namespace HeuristicLab.DataPreprocessing.Filter {
     25  public interface IFilter : IConstraint {
    1126    new bool[] Check();
    1227    new bool[] Check(out string errorMessage);
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/FilterLogic.cs

    r12012 r13502  
    2424using System.Linq;
    2525using HeuristicLab.DataPreprocessing.Filter;
    26 using HeuristicLab.DataPreprocessing.Interfaces;
     26
    2727namespace HeuristicLab.DataPreprocessing {
    2828  public class FilterLogic : IFilterLogic {
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/FilteredPreprocessingData.cs

    r13252 r13502  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using HeuristicLab.Common;
    425using HeuristicLab.Core;
    526using HeuristicLab.Data;
    6 using HeuristicLab.DataPreprocessing.Interfaces;
    727using HeuristicLab.Problems.DataAnalysis;
    828
    9 namespace HeuristicLab.DataPreprocessing.Implementations {
     29namespace HeuristicLab.DataPreprocessing {
    1030  public class FilteredPreprocessingData : NamedItem, IFilteredPreprocessingData {
    1131    private readonly ITransactionalPreprocessingData originalData;
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/HistogramContent.cs

    r12676 r13502  
    2525using HeuristicLab.Common;
    2626using HeuristicLab.Core;
    27 using HeuristicLab.DataPreprocessing.Interfaces;
    2827
    2928namespace HeuristicLab.DataPreprocessing {
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/LineChartContent.cs

    r12012 r13502  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    25 using HeuristicLab.DataPreprocessing.Interfaces;
    2625
    2726namespace HeuristicLab.DataPreprocessing {
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingChartContent.cs

    r12676 r13502  
    2828using HeuristicLab.Core;
    2929using HeuristicLab.Data;
    30 using HeuristicLab.DataPreprocessing.Interfaces;
    3130
    3231namespace HeuristicLab.DataPreprocessing {
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingData.cs

    r13427 r13502  
    9494      selection = new Dictionary<int, IList<int>>();
    9595
     96      Import(problemData);
     97
     98      RegisterEventHandler();
     99    }
     100
     101    public void Import(IDataAnalysisProblemData problemData) {
    96102      Dataset dataset = (Dataset)problemData.Dataset;
    97103      variableNames = new List<string>(problemData.Dataset.VariableNames);
     
    114120      TrainingPartition = new IntRange(problemData.TrainingPartition.Start, problemData.TrainingPartition.End);
    115121      TestPartition = new IntRange(problemData.TestPartition.Start, problemData.TestPartition.End);
    116 
    117       RegisterEventHandler();
    118122    }
    119123
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingDataTable.cs

    r11114 r13502  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using HeuristicLab.Analysis;
    324using HeuristicLab.Common;
    425using HeuristicLab.Core;
    526
    6 namespace HeuristicLab.DataPreprocessing.Implementations {
     27namespace HeuristicLab.DataPreprocessing {
    728  [Item("PreprossingDataTable", "A table of data values.")]
    829  public class PreprocessingDataTable : DataTable {
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/ScatterPlotContent.cs

    r12012 r13502  
    2222using System.Collections.Generic;
    2323using System.Drawing;
     24using System.Linq;
    2425using HeuristicLab.Analysis;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
    27 using HeuristicLab.DataPreprocessing.Interfaces;
    2828
    2929namespace HeuristicLab.DataPreprocessing {
     
    3434    public string SelectedXVariable { get; set; }
    3535    public string SelectedYVariable { get; set; }
     36    public string SelectedColorVariable { get; set; }
    3637
    3738    public ScatterPlotContent(IFilteredPreprocessingData preprocessingData)
     
    4344      this.SelectedXVariable = content.SelectedXVariable;
    4445      this.SelectedYVariable = content.SelectedYVariable;
     46      this.SelectedColorVariable = content.SelectedColorVariable;
    4547    }
    4648
    47     public static new Image StaticItemImage
    48     {
     49    public static new Image StaticItemImage {
    4950      get { return HeuristicLab.Common.Resources.VSImageLibrary.Performance; }
    5051    }
     
    5455    }
    5556
    56     public ScatterPlot CreateScatterPlot(string variableNameX, string variableNameY) {
     57    public ScatterPlot CreateScatterPlot(string variableNameX, string variableNameY, string variableNameColor = "-") {
    5758      ScatterPlot scatterPlot = new ScatterPlot();
    5859
    5960      IList<double> xValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameX));
    6061      IList<double> yValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameY));
     62      if (variableNameColor == null || variableNameColor == "-") {
     63        List<Point2D<double>> points = new List<Point2D<double>>();
    6164
    62       List<Point2D<double>> points = new List<Point2D<double>>();
     65        for (int i = 0; i < xValues.Count; i++) {
     66          Point2D<double> point = new Point2D<double>(xValues[i], yValues[i]);
     67          points.Add(point);
     68        }
    6369
    64       for (int i = 0; i < xValues.Count; i++) {
    65         Point2D<double> point = new Point2D<double>(xValues[i], yValues[i]);
    66         points.Add(point);
     70        ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY, "", points);
     71        scatterPlot.Rows.Add(scdr);
     72
     73      } else {
     74        var colorValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameColor));
     75        var data = xValues.Zip(yValues, (x, y) => new { x, y }).Zip(colorValues, (v, c) => new { v.x, v.y, c }).ToList();
     76        var gradients = ColorGradient.Colors;
     77        int curGradient = 0;
     78        int numColors = colorValues.Distinct().Count();
     79        foreach (var colorValue in colorValues.Distinct()) {
     80          var values = data.Where(x => x.c == colorValue);
     81          var row = new ScatterPlotDataRow(
     82            variableNameX + " - " + variableNameY + " (" + colorValue + ")",
     83            "",
     84            values.Select(v => new Point2D<double>(v.x, v.y)),
     85            new ScatterPlotDataRowVisualProperties() { Color = gradients[curGradient] });
     86          curGradient += gradients.Count / numColors;
     87          scatterPlot.Rows.Add(row);
     88        }
    6789      }
    68 
    69       ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY, "", points);
    70       scatterPlot.Rows.Add(scdr);
    7190      return scatterPlot;
    7291    }
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/StatisticsContent.cs

    r12012 r13502  
    1919 */
    2020#endregion
     21
    2122using System.Drawing;
    2223using HeuristicLab.Common;
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/StatisticsLogic.cs

    r13051 r13502  
    2626
    2727namespace HeuristicLab.DataPreprocessing {
    28 
    2928  public class StatisticsLogic : IStatisticsLogic {
    3029
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Interfaces/IFilterLogic.cs

    r12012 r13502  
    2323using System.Collections.Generic;
    2424using HeuristicLab.DataPreprocessing.Filter;
    25 using HeuristicLab.DataPreprocessing.Interfaces;
     25
    2626namespace HeuristicLab.DataPreprocessing {
    2727  public interface IFilterLogic {
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Interfaces/IFilteredPreprocessingData.cs

    r10900 r13502  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
    521
    6 namespace HeuristicLab.DataPreprocessing.Interfaces
    7 {
    8   public interface IFilteredPreprocessingData : ITransactionalPreprocessingData
    9   {
     22using System;
     23
     24namespace HeuristicLab.DataPreprocessing {
     25  public interface IFilteredPreprocessingData : ITransactionalPreprocessingData {
    1026    void SetFilter(bool[] rowFilters);
    1127    void PersistFilter();
     
    1430
    1531    event EventHandler FilterChanged;
    16    }
     32  }
    1733}
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Interfaces/ITransactionalPreprocessingData.cs

    r12012 r13502  
    2020#endregion
    2121
     22using System;
    2223
    23 using System;
    2424namespace HeuristicLab.DataPreprocessing {
    25 
    2625  public interface ITransactionalPreprocessingData : IPreprocessingData {
    2726
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Interfaces/IViewChartShortcut.cs

    r12012 r13502  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322
    2423namespace HeuristicLab.DataPreprocessing {
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/PreprocessingContext.cs

    r13496 r13502  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
    2224using HeuristicLab.Common;
    2325using HeuristicLab.Core;
    24 using HeuristicLab.DataPreprocessing.Implementations;
    25 using HeuristicLab.DataPreprocessing.Interfaces;
    2626using HeuristicLab.Optimization;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2728using HeuristicLab.Problems.DataAnalysis;
    2829
    2930namespace HeuristicLab.DataPreprocessing {
    3031  [Item("PreprocessingContext", "PreprocessingContext")]
    31   public class PreprocessingContext
    32     : Item, IPreprocessingContext {
     32  public class PreprocessingContext : NamedItem, IStorableContent {
     33
     34    public string Filename { get; set; }
     35
     36    public IEnumerable<KeyValuePair<string, Func<IItem>>> ExportPossibilities {
     37      get {
     38        var algorithm = Source as IAlgorithm;
     39        if (algorithm != null)
     40          yield return new KeyValuePair<string, Func<IItem>>(algorithm.Name, () => ExportAlgorithm(algorithm));
     41
     42        var problem = algorithm != null ? algorithm.Problem as IDataAnalysisProblem : Source as IDataAnalysisProblem;
     43        if (problem != null)
     44          yield return new KeyValuePair<string, Func<IItem>>(problem.Name, () => ExportProblem(problem));
     45
     46        var problemData = problem != null ? problem.ProblemData : Source as IDataAnalysisProblemData;
     47        if (problemData != null)
     48          yield return new KeyValuePair<string, Func<IItem>>(problemData.Name, () => ExportProblemData(problemData));
     49
     50        // ToDo: Export CSV
     51      }
     52    }
     53    public bool CanExport {
     54      get { return Source is IAlgorithm || Source is IDataAnalysisProblem || Source is IDataAnalysisProblemData; }
     55    }
     56
     57    [Storable]
     58    public IFilteredPreprocessingData Data { get; private set; }
     59
     60    [Storable]
     61    private IItem Source { get; set; }
    3362
    3463
    35     public IFilteredPreprocessingData Data { get; private set; }
     64    public PreprocessingContext() : this(new RegressionProblemData()) { }
     65    public PreprocessingContext(IItem source) {
     66      Import(source);
    3667
    37     public IAlgorithm Algorithm { get; private set; }
    38     public IDataAnalysisProblem Problem { get; private set; }
    39     public IDataAnalysisProblemData ProblemData { get; private set; }
    40 
    41     private readonly ProblemDataCreator creator;
    42 
    43     public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IAlgorithm algorithm, IDataAnalysisProblem problem) {
    44       var transactionalPreprocessingData = new TransactionalPreprocessingData(dataAnalysisProblemData);
    45       Data = new FilteredPreprocessingData(transactionalPreprocessingData);
    46 
    47       ProblemData = dataAnalysisProblemData;
    48       Algorithm = algorithm;
    49       Problem = problem;
    50 
    51       creator = new ProblemDataCreator(this);
    5268    }
    5369
     70    [StorableConstructor]
     71    private PreprocessingContext(bool deserializing)
     72      : base(deserializing) { }
    5473    protected PreprocessingContext(PreprocessingContext original, Cloner cloner)
    5574      : base(original, cloner) {
     75      Source = cloner.Clone(original.Source);
    5676      Data = cloner.Clone(original.Data);
    57       Algorithm = original.Algorithm;
    58       Problem = original.Problem;
    5977    }
    6078
     
    6381    }
    6482
     83    #region Import
     84    public void Import(IItem source) {
     85      Source = source;
     86
     87      var dataSource = ExtractProblemData(source);
     88      Data = new FilteredPreprocessingData(new TransactionalPreprocessingData(dataSource));
     89    }
     90
     91    private IDataAnalysisProblemData ExtractProblemData(IItem source) {
     92      var algorithm = source as Algorithm;
     93      var problem = algorithm != null ? algorithm.Problem as IDataAnalysisProblem : source as IDataAnalysisProblem;
     94      var problemData = problem != null ? problem.ProblemData : source as IDataAnalysisProblemData;
     95      return problemData;
     96    }
     97    #endregion
     98
     99    #region Export
    65100    public IItem Export() {
    66       if (Algorithm != null)
    67         return ExportAlgorithm();
    68       else if (Problem != null)
    69         return ExportProblem();
    70       return ExportProblemData();
     101      var creator = new ProblemDataCreator(this);
     102      if (Source is IAlgorithm)
     103        return ExportAlgorithm((IAlgorithm)Source);
     104      if (Source is IDataAnalysisProblem)
     105        return ExportProblem((IDataAnalysisProblem)Source);
     106      if (Source is IDataAnalysisProblemData)
     107        return ExportProblemData((IDataAnalysisProblemData)Source);
     108      return null;
    71109    }
    72     public IAlgorithm ExportAlgorithm() {
    73       var preprocessedAlgorithm = (IAlgorithm)Algorithm.Clone(new Cloner());
     110    private IAlgorithm ExportAlgorithm(IAlgorithm source) {
     111      var preprocessedAlgorithm = (IAlgorithm)source.Clone();
    74112      preprocessedAlgorithm.Name = preprocessedAlgorithm.Name + "(Preprocessed)";
    75       Algorithm.Runs.Clear();
     113      preprocessedAlgorithm.Runs.Clear();
    76114      var problem = (IDataAnalysisProblem)preprocessedAlgorithm.Problem;
    77115      SetNewProblemData(problem);
    78116      return preprocessedAlgorithm;
    79117    }
    80     public IDataAnalysisProblem ExportProblem() {
    81       var preprocessedProblem = (IDataAnalysisProblem)Problem.Clone(new Cloner());
     118    private IDataAnalysisProblem ExportProblem(IDataAnalysisProblem source) {
     119      var preprocessedProblem = (IDataAnalysisProblem)source.Clone();
    82120      SetNewProblemData(preprocessedProblem);
    83121      return preprocessedProblem;
    84122    }
    85 
    86     public IDataAnalysisProblemData ExportProblemData() {
    87       return creator.CreateProblemData();
     123    private IDataAnalysisProblemData ExportProblemData(IDataAnalysisProblemData source) {
     124      var creator = new ProblemDataCreator(this);
     125      return creator.CreateProblemData(source);
    88126    }
    89 
    90127    private void SetNewProblemData(IDataAnalysisProblem problem) {
    91       var data = creator.CreateProblemData();
     128      var data = ExtractProblemData(problem.ProblemData);
    92129      problem.ProblemDataParameter.ActualValue = data;
    93130      problem.Name = "Preprocessed " + problem.Name;
    94131    }
     132    #endregion
    95133  }
    96134}
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs

    r13252 r13502  
    2929  public class ProblemDataCreator {
    3030
    31     private readonly IPreprocessingContext context;
     31    private readonly PreprocessingContext context;
    3232
    3333    private Dataset ExportedDataset {
     
    3939    private IList<ITransformation> Transformations { get { return context.Data.Transformations; } }
    4040
    41     public ProblemDataCreator(IPreprocessingContext context) {
     41    public ProblemDataCreator(PreprocessingContext context) {
    4242      this.context = context;
    4343    }
    4444
    45     public IDataAnalysisProblemData CreateProblemData() {
     45    public IDataAnalysisProblemData CreateProblemData(IDataAnalysisProblemData oldProblemData) {
    4646      if (context.Data.Rows == 0 || context.Data.Columns == 0) return null;
    4747
    48       var oldProblemData = context.ProblemData;
    4948      IDataAnalysisProblemData problemData;
    5049
Note: See TracChangeset for help on using the changeset viewer.