Index: trunk/sources/HeuristicLab.Data.Views/3.3/HeuristicLab.Data.Views-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Data.Views/3.3/HeuristicLab.Data.Views-3.3.csproj	(revision 8832)
+++ trunk/sources/HeuristicLab.Data.Views/3.3/HeuristicLab.Data.Views-3.3.csproj	(revision 8833)
@@ -128,4 +128,16 @@
     </Compile>
     <Compile Include="Plugin.cs" />
+    <Compile Include="StringConvertibleMatrixColumnVisibilityDialog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="StringConvertibleMatrixColumnVisibilityDialog.Designer.cs">
+      <DependentUpon>StringConvertibleMatrixColumnVisibilityDialog.cs</DependentUpon>
+    </Compile>
+    <Compile Include="StringConvertibleMatrixRowVisibilityDialog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="StringConvertibleMatrixRowVisibilityDialog.Designer.cs">
+      <DependentUpon>StringConvertibleMatrixRowVisibilityDialog.cs</DependentUpon>
+    </Compile>
     <Compile Include="StringConvertibleValueTupleView.cs">
       <SubType>UserControl</SubType>
@@ -141,9 +153,9 @@
       <DependentUpon>BoolValueView.cs</DependentUpon>
     </Compile>
-    <Compile Include="ColumnsVisibilityDialog.cs">
+    <Compile Include="StringConvertibleMatrixVisibilityDialog.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="ColumnsVisibilityDialog.Designer.cs">
-      <DependentUpon>ColumnsVisibilityDialog.cs</DependentUpon>
+    <Compile Include="StringConvertibleMatrixVisibilityDialog.Designer.cs">
+      <DependentUpon>StringConvertibleMatrixVisibilityDialog.cs</DependentUpon>
     </Compile>
     <Compile Include="ComparisonView.cs">
@@ -240,5 +252,5 @@
   -->
   <PropertyGroup>
-   <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
 set ProjectDir=$(ProjectDir)
 set SolutionDir=$(SolutionDir)
@@ -247,5 +259,5 @@
 call PreBuildEvent.cmd
 </PreBuildEvent>
-<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
 export ProjectDir=$(ProjectDir)
 export SolutionDir=$(SolutionDir)
Index: trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixColumnVisibilityDialog.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixColumnVisibilityDialog.Designer.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixColumnVisibilityDialog.Designer.cs	(revision 8833)
@@ -0,0 +1,32 @@
+﻿namespace HeuristicLab.Data.Views {
+  partial class StringConvertibleMatrixColumnVisibilityDialog {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+    }
+
+    #endregion
+  }
+}
Index: trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixColumnVisibilityDialog.cs
===================================================================
--- trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixColumnVisibilityDialog.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixColumnVisibilityDialog.cs	(revision 8833)
@@ -0,0 +1,42 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace HeuristicLab.Data.Views {
+  public partial class StringConvertibleMatrixColumnVisibilityDialog : StringConvertibleMatrixVisibilityDialog<DataGridViewColumn> {
+    public StringConvertibleMatrixColumnVisibilityDialog() {
+      InitializeComponent();
+    }
+
+    public StringConvertibleMatrixColumnVisibilityDialog(IEnumerable<DataGridViewColumn> columns)
+      : base(columns) {
+    }
+
+    protected override void UpdateCheckBoxes() {
+      this.checkedListBox.Items.Clear();
+      foreach (DataGridViewColumn column in bands) {
+        checkedListBox.Items.Add(column.HeaderText, column.Visible);
+      }
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixRowVisibilityDialog.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixRowVisibilityDialog.Designer.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixRowVisibilityDialog.Designer.cs	(revision 8833)
@@ -0,0 +1,33 @@
+﻿namespace HeuristicLab.Data.Views {
+  partial class StringConvertibleMatrixRowVisibilityDialog {
+    /// <summary>
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary>
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form Designer generated code
+
+    /// <summary>
+    /// Required method for Designer support - do not modify
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Text = "StringConvertibleMatrixRowVisibilityDialog";
+    }
+
+    #endregion
+  }
+}
Index: trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixRowVisibilityDialog.cs
===================================================================
--- trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixRowVisibilityDialog.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixRowVisibilityDialog.cs	(revision 8833)
@@ -0,0 +1,42 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace HeuristicLab.Data.Views {
+  public partial class StringConvertibleMatrixRowVisibilityDialog : StringConvertibleMatrixVisibilityDialog<DataGridViewRow> {
+    public StringConvertibleMatrixRowVisibilityDialog() {
+      InitializeComponent();
+    }
+
+    public StringConvertibleMatrixRowVisibilityDialog(IEnumerable<DataGridViewRow> rows)
+      : base(rows) {
+    }
+
+    protected override void UpdateCheckBoxes() {
+      this.checkedListBox.Items.Clear();
+      foreach (DataGridViewRow row in bands) {
+        checkedListBox.Items.Add(row.HeaderCell.Value, row.Visible);
+      }
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
===================================================================
--- trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs	(revision 8833)
@@ -35,5 +35,5 @@
   [Content(typeof(IStringConvertibleMatrix), true)]
   public partial class StringConvertibleMatrixView : AsynchronousContentView {
-    private int[] virtualRowIndices;
+    protected int[] virtualRowIndices;
     private List<KeyValuePair<int, SortOrder>> sortedColumnIndices;
     private RowComparer rowComparer;
@@ -171,5 +171,5 @@
       }
     }
-    protected void UpdateRowHeaders() {
+    protected virtual void UpdateRowHeaders() {
       int index = dataGridView.FirstDisplayedScrollingRowIndex;
       if (index == -1) index = 0;
@@ -509,6 +509,6 @@
         contextMenu.Show(MousePosition);
     }
-    private void ShowHideColumns_Click(object sender, EventArgs e) {
-      new ColumnsVisibilityDialog(this.dataGridView.Columns.Cast<DataGridViewColumn>()).ShowDialog();
+    protected virtual void ShowHideColumns_Click(object sender, EventArgs e) {
+      new StringConvertibleMatrixColumnVisibilityDialog(this.dataGridView.Columns.Cast<DataGridViewColumn>()).ShowDialog();
     }
 
Index: trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixVisibilityDialog.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixVisibilityDialog.Designer.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixVisibilityDialog.Designer.cs	(revision 8833)
@@ -0,0 +1,112 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Data.Views {
+  partial class StringConvertibleMatrixVisibilityDialog<T> {
+    /// <summary>
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary>
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form Designer generated code
+
+    /// <summary>
+    /// Required method for Designer support - do not modify
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.checkedListBox = new System.Windows.Forms.CheckedListBox();
+      this.btnShowAll = new System.Windows.Forms.Button();
+      this.btnHideAll = new System.Windows.Forms.Button();
+      this.SuspendLayout();
+      // 
+      // checkedListBox
+      // 
+      this.checkedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.checkedListBox.CheckOnClick = true;
+      this.checkedListBox.FormattingEnabled = true;
+      this.checkedListBox.Location = new System.Drawing.Point(12, 12);
+      this.checkedListBox.Name = "checkedListBox";
+      this.checkedListBox.Size = new System.Drawing.Size(309, 289);
+      this.checkedListBox.TabIndex = 0;
+      this.checkedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBox_ItemCheck);
+      // 
+      // btnShowAll
+      // 
+      this.btnShowAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+      this.btnShowAll.Location = new System.Drawing.Point(12, 315);
+      this.btnShowAll.Name = "btnShowAll";
+      this.btnShowAll.Size = new System.Drawing.Size(75, 23);
+      this.btnShowAll.TabIndex = 1;
+      this.btnShowAll.Text = "Show all";
+      this.btnShowAll.UseVisualStyleBackColor = true;
+      this.btnShowAll.Click += new System.EventHandler(this.btnShowAll_Click);
+      // 
+      // btnHideAll
+      // 
+      this.btnHideAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+      this.btnHideAll.Location = new System.Drawing.Point(101, 315);
+      this.btnHideAll.Name = "btnHideAll";
+      this.btnHideAll.Size = new System.Drawing.Size(75, 23);
+      this.btnHideAll.TabIndex = 2;
+      this.btnHideAll.Text = "Hide all";
+      this.btnHideAll.UseVisualStyleBackColor = true;
+      this.btnHideAll.Click += new System.EventHandler(this.btnHideAll_Click);
+      // 
+      // ColumnsVisibilityDialog
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.ClientSize = new System.Drawing.Size(332, 350);
+      this.Controls.Add(this.btnHideAll);
+      this.Controls.Add(this.btnShowAll);
+      this.Controls.Add(this.checkedListBox);
+      this.MaximizeBox = false;
+      this.MinimizeBox = false;
+      this.Name = "ColumnsVisibilityDialog";
+      this.ShowIcon = false;
+      this.ShowInTaskbar = false;
+      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+      this.Text = "Show/Hide Columns";
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.CheckedListBox checkedListBox;
+    protected System.Windows.Forms.Button btnShowAll;
+    protected System.Windows.Forms.Button btnHideAll;
+  }
+}
Index: trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixVisibilityDialog.cs
===================================================================
--- trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixVisibilityDialog.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixVisibilityDialog.cs	(revision 8833)
@@ -0,0 +1,66 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace HeuristicLab.Data.Views {
+  public abstract partial class StringConvertibleMatrixVisibilityDialog<T> : Form where T : DataGridViewBand {
+    public StringConvertibleMatrixVisibilityDialog() {
+      InitializeComponent();
+    }
+
+    public StringConvertibleMatrixVisibilityDialog(IEnumerable<T> bands)
+      : this() {
+      this.Bands = bands;
+      this.visibility = bands.Select(b => b.Visible).ToList();
+      UpdateCheckBoxes();
+    }
+
+    protected List<T> bands;
+    private IEnumerable<T> Bands {
+      get { return this.bands; }
+      set { this.bands = new List<T>(value); }
+    }
+
+    private List<bool> visibility;
+    public IList<bool> Visibility {
+      get { return this.visibility; }
+    }
+
+    protected abstract void UpdateCheckBoxes();
+
+    protected void checkedListBox_ItemCheck(object sender, ItemCheckEventArgs e) {
+      this.bands[e.Index].Visible = e.NewValue == CheckState.Checked;
+      this.visibility[e.Index] = e.NewValue == CheckState.Checked;
+    }
+
+    protected void btnShowAll_Click(object sender, System.EventArgs e) {
+      for (int i = 0; i < checkedListBox.Items.Count; i++)
+        checkedListBox.SetItemChecked(i, true);
+    }
+    protected void btnHideAll_Click(object sender, System.EventArgs e) {
+      for (int i = 0; i < checkedListBox.Items.Count; i++)
+        checkedListBox.SetItemChecked(i, false);
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationFeatureCorrelationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationFeatureCorrelationView.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationFeatureCorrelationView.cs	(revision 8833)
@@ -37,7 +37,7 @@
     }
 
-    protected override bool[] SetInitialVisibilityOfColumns() {
+    protected override bool[] SetInitialVariableVisibility() {
       int i = Content.Dataset.DoubleVariables.ToList().FindIndex(x => x == Content.TargetVariable);
-      var initialVisibility = base.SetInitialVisibilityOfColumns();
+      var initialVisibility = base.SetInitialVariableVisibility();
       initialVisibility[i] = true;
       return initialVisibility;
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationTimeframeFeatureCorrelationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationTimeframeFeatureCorrelationView.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationTimeframeFeatureCorrelationView.cs	(revision 8833)
@@ -37,7 +37,7 @@
     }
 
-    protected override bool[] SetInitialVisibilityOfColumns() {
+    protected override bool[] SetInitialVariableVisibility() {
       int i = Content.Dataset.DoubleVariables.ToList().FindIndex(x => x == Content.TargetVariable);
-      var initialVisibility = base.SetInitialVisibilityOfColumns();
+      var initialVisibility = base.SetInitialVariableVisibility();
       initialVisibility[i] = true;
       return initialVisibility;
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.Designer.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.Designer.cs	(revision 8833)
@@ -21,4 +21,5 @@
 
 #endregion
+
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   partial class AbstractFeatureCorrelationView {
@@ -48,5 +49,4 @@
       this.components = new System.ComponentModel.Container();
       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AbstractFeatureCorrelationView));
-      this.DataGridView = new System.Windows.Forms.DataGridView();
       this.HeatMapProgressBar = new System.Windows.Forms.ProgressBar();
       this.PartitionComboBox = new System.Windows.Forms.ComboBox();
@@ -60,7 +60,5 @@
       this.CalculatingPanel = new System.Windows.Forms.Panel();
       this.CalculatingLabel = new System.Windows.Forms.Label();
-      this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
-      this.ShowHideColumns = new System.Windows.Forms.ToolStripMenuItem();
-      ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit();
+      this.dataView = new HeuristicLab.Problems.DataAnalysis.Views.EnhancedStringConvertibleMatrixView();
       ((System.ComponentModel.ISupportInitialize)(this.PictureBox)).BeginInit();
       ((System.ComponentModel.ISupportInitialize)(this.SplitContainer)).BeginInit();
@@ -69,24 +67,5 @@
       this.SplitContainer.SuspendLayout();
       this.CalculatingPanel.SuspendLayout();
-      this.contextMenu.SuspendLayout();
       this.SuspendLayout();
-      // 
-      // DataGridView
-      // 
-      this.DataGridView.AllowUserToAddRows = false;
-      this.DataGridView.AllowUserToDeleteRows = false;
-      this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-      this.DataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.DataGridView.Location = new System.Drawing.Point(0, 0);
-      this.DataGridView.Name = "DataGridView";
-      this.DataGridView.ReadOnly = true;
-      this.DataGridView.Size = new System.Drawing.Size(475, 301);
-      this.DataGridView.TabIndex = 0;
-      this.DataGridView.VirtualMode = true;
-      this.DataGridView.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.DataGridView_CellPainting);
-      this.DataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.DataGridView_CellValueNeeded);
-      this.DataGridView.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.DataGridView_ColumnHeaderMouseClick);
-      this.DataGridView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DataGridView_KeyDown);
-      this.DataGridView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.DataGridView_MouseClick);
       // 
       // HeatMapProgressBar
@@ -162,5 +141,5 @@
       // 
       this.PictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.PictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
       this.PictureBox.Image = ((System.Drawing.Image)(resources.GetObject("PictureBox.Image")));
@@ -175,6 +154,6 @@
       // 
       this.SplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.SplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
       this.SplitContainer.IsSplitterFixed = true;
@@ -193,5 +172,5 @@
       // 
       this.SplitContainer.Panel2.Controls.Add(this.CalculatingPanel);
-      this.SplitContainer.Panel2.Controls.Add(this.DataGridView);
+      this.SplitContainer.Panel2.Controls.Add(this.dataView);
       this.SplitContainer.Size = new System.Drawing.Size(475, 330);
       this.SplitContainer.SplitterDistance = 25;
@@ -217,17 +196,12 @@
       this.CalculatingLabel.Text = "Calculating correlation...";
       // 
-      // contextMenu
-      // 
-      this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.ShowHideColumns});
-      this.contextMenu.Name = "contextMenu";
-      this.contextMenu.Size = new System.Drawing.Size(191, 26);
-      // 
-      // ShowHideColumns
-      // 
-      this.ShowHideColumns.Name = "ShowHideColumns";
-      this.ShowHideColumns.Size = new System.Drawing.Size(190, 22);
-      this.ShowHideColumns.Text = "Show / Hide Columns";
-      this.ShowHideColumns.Click += new System.EventHandler(this.ShowHideColumns_Click);
+      // DataGridView
+      // 
+      this.dataView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.dataView.Location = new System.Drawing.Point(0, 0);
+      this.dataView.Name = "DataView";
+      this.dataView.ReadOnly = true;
+      this.dataView.Size = new System.Drawing.Size(475, 301);
+      this.dataView.TabIndex = 0;
       // 
       // AbstractFeatureCorrelationView
@@ -241,5 +215,4 @@
       this.Name = "AbstractFeatureCorrelationView";
       this.Size = new System.Drawing.Size(569, 336);
-      ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit();
       ((System.ComponentModel.ISupportInitialize)(this.PictureBox)).EndInit();
       this.SplitContainer.Panel1.ResumeLayout(false);
@@ -250,5 +223,4 @@
       this.CalculatingPanel.ResumeLayout(false);
       this.CalculatingPanel.PerformLayout();
-      this.contextMenu.ResumeLayout(false);
       this.ResumeLayout(false);
 
@@ -257,5 +229,4 @@
     #endregion
 
-    protected System.Windows.Forms.DataGridView DataGridView;
     protected System.Windows.Forms.ProgressBar HeatMapProgressBar;
     protected System.Windows.Forms.ComboBox PartitionComboBox;
@@ -269,6 +240,5 @@
     protected System.Windows.Forms.Panel CalculatingPanel;
     protected System.Windows.Forms.Label CalculatingLabel;
-    protected System.Windows.Forms.ContextMenuStrip contextMenu;
-    protected System.Windows.Forms.ToolStripMenuItem ShowHideColumns;
+    protected HeuristicLab.Problems.DataAnalysis.Views.EnhancedStringConvertibleMatrixView dataView;
 
   }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/AbstractFeatureCorrelationView.cs	(revision 8833)
@@ -20,17 +20,11 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
 using System.ComponentModel;
-using System.Drawing;
 using System.Linq;
-using System.Text;
 using System.Windows.Forms;
 using HeuristicLab.Analysis;
-using HeuristicLab.Common;
-using HeuristicLab.Data.Views;
-using HeuristicLab.DataAnalysis.Views;
 using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
@@ -38,10 +32,4 @@
   [Content(typeof(DataAnalysisProblemData), false)]
   public abstract partial class AbstractFeatureCorrelationView : AsynchronousContentView {
-
-    private int[] virtualRowIndices;
-    private VariableVisibilityDialog variableVisibility;
-    private List<KeyValuePair<int, SortOrder>> sortedColumnIndices;
-    private StringConvertibleMatrixView.RowComparer rowComparer;
-
     protected FeatureCorrelationCalculator fcc;
     protected HeatMap currentCorrelation;
@@ -54,15 +42,13 @@
     protected AbstractFeatureCorrelationView() {
       InitializeComponent();
-      sortedColumnIndices = new List<KeyValuePair<int, SortOrder>>();
-      rowComparer = new StringConvertibleMatrixView.RowComparer();
       fcc = new FeatureCorrelationCalculator();
-      var calculatorList = FeatureCorrelationEnums.EnumToList<FeatureCorrelationEnums.CorrelationCalculators>().Select(x => new KeyValuePair<FeatureCorrelationEnums.CorrelationCalculators, string>(x, FeatureCorrelationEnums.GetEnumDescription(x))).ToList();
-      CorrelationCalcComboBox.ValueMember = "Key";
-      CorrelationCalcComboBox.DisplayMember = "Value";
-      CorrelationCalcComboBox.DataSource = new BindingList<KeyValuePair<FeatureCorrelationEnums.CorrelationCalculators, string>>(calculatorList);
-      var partitionList = FeatureCorrelationEnums.EnumToList<FeatureCorrelationEnums.Partitions>().Select(x => new KeyValuePair<FeatureCorrelationEnums.Partitions, string>(x, FeatureCorrelationEnums.GetEnumDescription(x))).ToList();
-      PartitionComboBox.ValueMember = "Key";
-      PartitionComboBox.DisplayMember = "Value";
-      PartitionComboBox.DataSource = new BindingList<KeyValuePair<FeatureCorrelationEnums.Partitions, string>>(partitionList);
+      var calculators = ApplicationManager.Manager.GetInstances<IDependencyCalculator>();
+      var calcList = calculators.OrderBy(c => c.Name).Select(c => new { Name = c.Name, Calculator = c }).ToList();
+      CorrelationCalcComboBox.ValueMember = "Calculator";
+      CorrelationCalcComboBox.DisplayMember = "Name";
+      CorrelationCalcComboBox.DataSource = calcList;
+      CorrelationCalcComboBox.SelectedItem = calcList.First(c => c.Calculator.GetType().Equals(typeof(PearsonsRDependenceCalculator)));
+      PartitionComboBox.DataSource = FeatureCorrelationPartitions.Partitions;
+      PartitionComboBox.SelectedItem = FeatureCorrelationPartitions.TRAININGSAMPLES;
     }
 
@@ -81,18 +67,15 @@
     protected override void OnContentChanged() {
       base.OnContentChanged();
+      fcc.TryCancelCalculation();
       if (Content != null) {
         fcc.ProblemData = Content;
-        bool[] initialVisibility = SetInitialVisibilityOfColumns();
-
-        variableVisibility = new VariableVisibilityDialog(Content.Dataset.DoubleVariables, initialVisibility);
-        variableVisibility.VariableVisibilityChanged += new ItemCheckEventHandler(variableVisibility_VariableVisibilityChanged);
         CalculateCorrelation();
       } else {
-        DataGridView.Columns.Clear();
-        DataGridView.Rows.Clear();
+        dataView.Content = null;
+        dataView.ResetVisibility();
       }
     }
 
-    protected virtual bool[] SetInitialVisibilityOfColumns() {
+    protected virtual bool[] SetInitialVariableVisibility() {
       bool[] initialVisibility = new bool[Content.Dataset.DoubleVariables.Count()];
       int i = 0;
@@ -103,6 +86,4 @@
       return initialVisibility;
     }
-
-    protected abstract void variableVisibility_VariableVisibilityChanged(object sender, ItemCheckEventArgs e);
 
     protected void CorrelationMeasureComboBox_SelectedChangeCommitted(object sender, System.EventArgs e) {
@@ -116,41 +97,11 @@
     protected abstract void Content_CorrelationCalculationFinished(object sender, FeatureCorrelationCalculator.CorrelationCalculationFinishedArgs e);
 
-    protected void UpdateDataGrid() {
-      virtualRowIndices = Enumerable.Range(0, currentCorrelation.Rows).ToArray();
-      DataGridViewColumn[] columns = new DataGridViewColumn[currentCorrelation.Columns];
-      for (int i = 0; i < columns.Length; ++i) {
-        var column = new DataGridViewTextBoxColumn();
-        column.FillWeight = 1;
-        columns[i] = column;
-      }
-
-      DataGridView.Columns.Clear();
-      DataGridView.Columns.AddRange(columns);
-
-      DataGridView.RowCount = currentCorrelation.Rows;
-
-      ClearSorting();
-      UpdateColumnHeaders();
-      UpdateRowHeaders();
-
+    protected void UpdateDataView() {
       maximumLabel.Text = currentCorrelation.Maximum.ToString();
       minimumLabel.Text = currentCorrelation.Minimum.ToString();
 
-      DataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.ColumnHeader);
-      DataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders);
-      DataGridView.Enabled = true;
-    }
-
-    protected virtual void UpdateColumnHeaders() {
-      for (int i = 0; i < DataGridView.ColumnCount; i++) {
-        DataGridView.Columns[i].HeaderText = currentCorrelation.ColumnNames.ElementAt(i);
-        DataGridView.Columns[i].Visible = variableVisibility.Visibility[i];
-      }
-    }
-    protected virtual void UpdateRowHeaders() {
-      for (int i = 0; i < DataGridView.RowCount; i++) {
-        DataGridView.Rows[i].HeaderCell.Value = currentCorrelation.RowNames.ElementAt(virtualRowIndices[i]);
-        DataGridView.Rows[i].Visible = variableVisibility.Visibility[virtualRowIndices[i]];
-      }
+      currentCorrelation.SortableView = true;
+      dataView.Content = currentCorrelation;
+      dataView.Enabled = true;
     }
 
@@ -163,186 +114,4 @@
       HeatMapProgressBar.Value = e.ProgressPercentage;
     }
-
-    protected void DataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
-      if (Content == null) return;
-      int rowIndex = virtualRowIndices[e.RowIndex];
-      e.Value = currentCorrelation[rowIndex, e.ColumnIndex];
-    }
-
-    protected void DataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) {
-      if (Content == null) return;
-      if (e.RowIndex < 0) return;
-      if (e.ColumnIndex < 0) return;
-      if (e.State.HasFlag(DataGridViewElementStates.Selected)) return;
-      if (!e.PaintParts.HasFlag(DataGridViewPaintParts.Background)) return;
-
-      int rowIndex = virtualRowIndices[e.RowIndex];
-      Color backColor = GetDataPointColor(currentCorrelation[rowIndex, e.ColumnIndex], currentCorrelation.Minimum, currentCorrelation.Maximum);
-      using (Brush backColorBrush = new SolidBrush(backColor)) {
-        e.Graphics.FillRectangle(backColorBrush, e.CellBounds);
-      }
-      e.PaintContent(e.CellBounds);
-      e.Handled = true;
-    }
-
-    protected virtual Color GetDataPointColor(double value, double min, double max) {
-      if (double.IsNaN(value)) {
-        return Color.DarkGray;
-      }
-      IList<Color> colors = ColorGradient.Colors;
-      int index = (int)((colors.Count - 1) * (value - min) / (max - min));
-      if (index >= colors.Count) index = colors.Count - 1;
-      if (index < 0) index = 0;
-      return colors[index];
-    }
-
-    #region sort
-    protected void DataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) {
-      if (Content != null) {
-        if (e.Button == MouseButtons.Left) {
-          bool addToSortedIndices = (Control.ModifierKeys & Keys.Control) == Keys.Control;
-          SortOrder newSortOrder = SortOrder.Ascending;
-          if (sortedColumnIndices.Any(x => x.Key == e.ColumnIndex)) {
-            SortOrder oldSortOrder = sortedColumnIndices.Where(x => x.Key == e.ColumnIndex).First().Value;
-            int enumLength = Enum.GetValues(typeof(SortOrder)).Length;
-            newSortOrder = oldSortOrder = (SortOrder)Enum.Parse(typeof(SortOrder), ((((int)oldSortOrder) + 1) % enumLength).ToString());
-          }
-
-          if (!addToSortedIndices)
-            sortedColumnIndices.Clear();
-
-          if (sortedColumnIndices.Any(x => x.Key == e.ColumnIndex)) {
-            int sortedIndex = sortedColumnIndices.FindIndex(x => x.Key == e.ColumnIndex);
-            if (newSortOrder != SortOrder.None)
-              sortedColumnIndices[sortedIndex] = new KeyValuePair<int, SortOrder>(e.ColumnIndex, newSortOrder);
-            else
-              sortedColumnIndices.RemoveAt(sortedIndex);
-          } else
-            if (newSortOrder != SortOrder.None)
-              sortedColumnIndices.Add(new KeyValuePair<int, SortOrder>(e.ColumnIndex, newSortOrder));
-          Sort();
-        }
-      }
-    }
-
-    protected virtual void ClearSorting() {
-      virtualRowIndices = Enumerable.Range(0, currentCorrelation.Rows).ToArray();
-      sortedColumnIndices.Clear();
-      UpdateSortGlyph();
-    }
-
-    private void Sort() {
-      virtualRowIndices = Sort(sortedColumnIndices);
-      UpdateSortGlyph();
-      UpdateRowHeaders();
-      DataGridView.Invalidate();
-    }
-
-    protected virtual int[] Sort(IEnumerable<KeyValuePair<int, SortOrder>> sortedColumns) {
-      int[] newSortedIndex = Enumerable.Range(0, currentCorrelation.Rows).ToArray();
-      if (sortedColumns.Count() != 0) {
-        rowComparer.SortedIndices = sortedColumns;
-        rowComparer.Matrix = currentCorrelation;
-        Array.Sort(newSortedIndex, rowComparer);
-      }
-      return newSortedIndex;
-    }
-    private void UpdateSortGlyph() {
-      foreach (DataGridViewColumn col in this.DataGridView.Columns)
-        col.HeaderCell.SortGlyphDirection = SortOrder.None;
-      foreach (KeyValuePair<int, SortOrder> p in sortedColumnIndices)
-        this.DataGridView.Columns[p.Key].HeaderCell.SortGlyphDirection = p.Value;
-    }
-    #endregion
-
-    #region copy
-    protected void DataGridView_KeyDown(object sender, KeyEventArgs e) {
-      if (e.Control && e.KeyCode == Keys.C)
-        CopyValuesFromDataGridView();
-    }
-
-    private void CopyValuesFromDataGridView() {
-      if (DataGridView.SelectedCells.Count == 0) return;
-      StringBuilder s = new StringBuilder();
-      int minRowIndex = DataGridView.SelectedCells[0].RowIndex;
-      int maxRowIndex = DataGridView.SelectedCells[DataGridView.SelectedCells.Count - 1].RowIndex;
-      int minColIndex = DataGridView.SelectedCells[0].ColumnIndex;
-      int maxColIndex = DataGridView.SelectedCells[DataGridView.SelectedCells.Count - 1].ColumnIndex;
-
-      if (minRowIndex > maxRowIndex) {
-        int temp = minRowIndex;
-        minRowIndex = maxRowIndex;
-        maxRowIndex = temp;
-      }
-      if (minColIndex > maxColIndex) {
-        int temp = minColIndex;
-        minColIndex = maxColIndex;
-        maxColIndex = temp;
-      }
-
-      bool addRowNames = DataGridView.AreAllCellsSelected(false) && currentCorrelation.RowNames.Count() > 0;
-      bool addColumnNames = DataGridView.AreAllCellsSelected(false) && currentCorrelation.ColumnNames.Count() > 0;
-
-      //add colum names
-      if (addColumnNames) {
-        if (addRowNames)
-          s.Append('\t');
-
-        DataGridViewColumn column = DataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible);
-        while (column != null) {
-          s.Append(column.HeaderText);
-          s.Append('\t');
-          column = DataGridView.Columns.GetNextColumn(column, DataGridViewElementStates.Visible, DataGridViewElementStates.None);
-        }
-        s.Remove(s.Length - 1, 1); //remove last tab
-        s.Append(Environment.NewLine);
-      }
-
-      for (int i = minRowIndex; i <= maxRowIndex; i++) {
-        int rowIndex = this.virtualRowIndices[i];
-        if (addRowNames) {
-          s.Append(currentCorrelation.RowNames.ElementAt(rowIndex));
-          s.Append('\t');
-        }
-
-        DataGridViewColumn column = DataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible);
-        while (column != null) {
-          DataGridViewCell cell = DataGridView[column.Index, i];
-          if (cell.Selected) {
-            s.Append(currentCorrelation[rowIndex, column.Index]);
-            s.Append('\t');
-          }
-
-          column = DataGridView.Columns.GetNextColumn(column, DataGridViewElementStates.Visible, DataGridViewElementStates.None);
-        }
-        s.Remove(s.Length - 1, 1); //remove last tab
-        s.Append(Environment.NewLine);
-      }
-      Clipboard.SetText(s.ToString());
-    }
-    #endregion
-
-    protected void ShowHideColumns_Click(object sender, EventArgs e) {
-      variableVisibility.ShowDialog();
-    }
-
-    protected void DataGridView_MouseClick(object sender, MouseEventArgs e) {
-      if (Content == null) return;
-      if (e.Button == MouseButtons.Right && DataGridView.Columns.Count != 0)
-        contextMenu.Show(MousePosition);
-    }
-
-    protected int GetRowIndexOfVirtualindex(int virtualIndex) {
-      if (virtualIndex < 0 || virtualIndex >= virtualRowIndices.Length) {
-        throw new ArgumentException("Virtual index is out of bounds");
-      }
-
-      for (int i = 0; i < virtualRowIndices.Length; i++) {
-        if (virtualRowIndices[i] == virtualIndex) {
-          return i;
-        }
-      }
-      throw new ArgumentException("Virtual index was not found!");
-    }
   }
 }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.Designer.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.Designer.cs	(revision 8833)
@@ -0,0 +1,72 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class EnhancedStringConvertibleMatrixView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.ShowHideRows = new System.Windows.Forms.ToolStripMenuItem();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // rowsTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.rowsTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.rowsTextBox, 2);
+      //
+      // dataGridView
+      //
+      this.dataGridView.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(dataGridView_CellPainting);
+      // 
+      // contextMenu
+      // 
+      this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.ShowHideRows});
+      // 
+      // ShowHideRows
+      // 
+      this.ShowHideRows.Name = "ShowHideRows";
+      this.ShowHideRows.Size = new System.Drawing.Size(190, 22);
+      this.ShowHideRows.Text = "Show / Hide Rows";
+      this.ShowHideRows.Click += new System.EventHandler(this.ShowHideRows_Click);
+      // 
+      // ColoredStringConvertibleMatrixView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Name = "ColoredStringConvertibleMatrixView";
+      this.ShowRowsAndColumnsTextBox = false;
+      this.ShowStatisticalInformation = false;
+      this.Controls.SetChildIndex(this.statisticsTextBox, 0);
+      this.Controls.SetChildIndex(this.rowsLabel, 0);
+      this.Controls.SetChildIndex(this.columnsLabel, 0);
+      this.Controls.SetChildIndex(this.rowsTextBox, 0);
+      this.Controls.SetChildIndex(this.columnsTextBox, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+    #endregion
+
+    protected System.Windows.Forms.ToolStripMenuItem ShowHideRows;
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/EnhancedStringConvertibleMatrixView.cs	(revision 8833)
@@ -0,0 +1,115 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Data.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  public partial class EnhancedStringConvertibleMatrixView : StringConvertibleMatrixView {
+
+    protected IEnumerable<bool> columnVisibility, rowVisibility;
+
+    // sets the visibility of its columns for the next time it is updated
+    public IEnumerable<bool> ColumnVisibility { set { columnVisibility = value; } }
+    // sets the visibility of its rows for the next time it is updated
+    public IEnumerable<bool> RowVisibility { set { rowVisibility = value; } }
+
+    public new HeatMap Content {
+      get { return (HeatMap)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public EnhancedStringConvertibleMatrixView() {
+      InitializeComponent();
+    }
+
+    public void ResetVisibility() {
+      columnVisibility = null;
+      rowVisibility = null;
+    }
+
+    protected override void UpdateColumnHeaders() {
+      base.UpdateColumnHeaders();
+      if (columnVisibility != null && Content != null && columnVisibility.Count() == dataGridView.ColumnCount) {
+        int i = 0;
+        foreach (var visibility in columnVisibility) {
+          dataGridView.Columns[i].Visible = visibility;
+          i++;
+        }
+      }
+    }
+    protected override void UpdateRowHeaders() {
+      base.UpdateRowHeaders();
+      if (rowVisibility != null && Content != null && rowVisibility.Count() == dataGridView.RowCount) {
+        int i = 0;
+        foreach (var visibility in rowVisibility) {
+          dataGridView.Rows[i].Visible = visibility;
+          i++;
+        }
+      }
+    }
+
+    protected virtual void ShowHideRows_Click(object sender, EventArgs e) {
+      var dialog = new StringConvertibleMatrixRowVisibilityDialog(this.dataGridView.Rows.Cast<DataGridViewRow>());
+      dialog.ShowDialog();
+      rowVisibility = dialog.Visibility;
+    }
+
+    protected override void ShowHideColumns_Click(object sender, EventArgs e) {
+      var dialog = new StringConvertibleMatrixColumnVisibilityDialog(this.dataGridView.Columns.Cast<DataGridViewColumn>());
+      dialog.ShowDialog();
+      columnVisibility = dialog.Visibility;
+    }
+
+    protected void dataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) {
+      if (Content == null) return;
+      if (e.RowIndex < 0) return;
+      if (e.ColumnIndex < 0) return;
+      if (e.State.HasFlag(DataGridViewElementStates.Selected)) return;
+      if (!e.PaintParts.HasFlag(DataGridViewPaintParts.Background)) return;
+
+      int rowIndex = virtualRowIndices[e.RowIndex];
+      Color backColor = GetDataPointColor(Content[rowIndex, e.ColumnIndex], Content.Minimum, Content.Maximum);
+      using (Brush backColorBrush = new SolidBrush(backColor)) {
+        e.Graphics.FillRectangle(backColorBrush, e.CellBounds);
+      }
+      e.PaintContent(e.CellBounds);
+      e.Handled = true;
+    }
+
+    protected virtual Color GetDataPointColor(double value, double min, double max) {
+      if (double.IsNaN(value)) {
+        return Color.DarkGray;
+      }
+      IList<Color> colors = ColorGradient.Colors;
+      int index = (int)((colors.Count - 1) * (value - min) / (max - min));
+      if (index >= colors.Count) index = colors.Count - 1;
+      if (index < 0) index = 0;
+      return colors[index];
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationCalculator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationCalculator.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationCalculator.cs	(revision 8833)
@@ -51,10 +51,10 @@
     }
 
-    public void CalculateElements(FeatureCorrelationEnums.CorrelationCalculators calc, FeatureCorrelationEnums.Partitions partition) {
+    public void CalculateElements(IDependencyCalculator calc, string partition) {
       CalculateElements(problemData.Dataset, calc, partition);
     }
 
-    // returns if any calculation takes place
-    public bool CalculateTimeframeElements(FeatureCorrelationEnums.CorrelationCalculators calc, FeatureCorrelationEnums.Partitions partition, string variable, int frames, double[,] correlation = null) {
+    // returns true if any calculation takes place
+    public bool CalculateTimeframeElements(IDependencyCalculator calc, string partition, string variable, int frames, double[,] correlation = null) {
       if (correlation == null || correlation.GetLength(1) <= frames) {
         CalculateElements(problemData.Dataset, calc, partition, variable, frames, correlation);
@@ -65,4 +65,11 @@
     }
 
+    public void TryCancelCalculation() {
+      if (bw != null && bw.IsBusy) {
+        bwInfo = null;
+        bw.CancelAsync();
+      }
+    }
+
     private double[,] GetElementsOfCorrelation(double[,] corr, int frames) {
       double[,] elements = new double[corr.GetLength(0), frames + 1];
@@ -75,5 +82,5 @@
     }
 
-    private void CalculateElements(Dataset dataset, FeatureCorrelationEnums.CorrelationCalculators calc, FeatureCorrelationEnums.Partitions partition, string variable = null, int frames = 0, double[,] alreadyCalculated = null) {
+    private void CalculateElements(Dataset dataset, IDependencyCalculator calc, string partition, string variable = null, int frames = 0, double[,] alreadyCalculated = null) {
       bwInfo = new BackgroundWorkerInfo { Dataset = dataset, Calculator = calc, Partition = partition, Variable = variable, Frames = frames, AlreadyCalculated = alreadyCalculated };
       if (bw == null) {
@@ -107,6 +114,6 @@
       BackgroundWorkerInfo bwInfo = (BackgroundWorkerInfo)e.Argument;
       Dataset dataset = bwInfo.Dataset;
-      FeatureCorrelationEnums.Partitions partition = bwInfo.Partition;
-      FeatureCorrelationEnums.CorrelationCalculators calc = bwInfo.Calculator;
+      string partition = bwInfo.Partition;
+      IDependencyCalculator calc = bwInfo.Calculator;
 
       IList<string> doubleVariableNames = dataset.DoubleVariables.ToList();
@@ -121,4 +128,5 @@
         for (int j = 0; j < i + 1; j++) {
           if (worker.CancellationPending) {
+            worker.ReportProgress(100);
             e.Cancel = true;
             return;
@@ -127,5 +135,5 @@
           IEnumerable<double> var2 = GetRelevantValues(problemData, partition, doubleVariableNames[j]);
 
-          elements[i, j] = CalculateElementWithCalculator(calc, var1, var2, out error);
+          elements[i, j] = calc.Calculate(var1, var2, out error);
 
           if (!error.Equals(OnlineCalculatorError.None)) {
@@ -137,4 +145,5 @@
       }
       e.Result = elements;
+      worker.ReportProgress(100);
     }
 
@@ -144,6 +153,6 @@
       BackgroundWorkerInfo bwInfo = (BackgroundWorkerInfo)e.Argument;
       Dataset dataset = bwInfo.Dataset;
-      FeatureCorrelationEnums.Partitions partition = bwInfo.Partition;
-      FeatureCorrelationEnums.CorrelationCalculators calc = bwInfo.Calculator;
+      string partition = bwInfo.Partition;
+      IDependencyCalculator calc = bwInfo.Calculator;
       string variable = bwInfo.Variable;
       int frames = bwInfo.Frames;
@@ -169,4 +178,5 @@
         for (int j = start; j <= frames; j++) {
           if (worker.CancellationPending) {
+            worker.ReportProgress(100);
             e.Cancel = true;
             return;
@@ -181,5 +191,5 @@
           var1 = help;
 
-          elements[i, j] = CalculateElementWithCalculator(calc, var1, var2, out error);
+          elements[i, j] = calc.Calculate(var1, var2, out error);
 
           if (!error.Equals(OnlineCalculatorError.None)) {
@@ -190,26 +200,15 @@
       }
       e.Result = elements;
-    }
-
-    private IEnumerable<double> GetRelevantValues(IDataAnalysisProblemData problemData, FeatureCorrelationEnums.Partitions partition, string variable) {
+      worker.ReportProgress(100);
+    }
+
+    private IEnumerable<double> GetRelevantValues(IDataAnalysisProblemData problemData, string partition, string variable) {
       IEnumerable<double> var = problemData.Dataset.GetDoubleValues(variable);
-      if (partition.Equals(FeatureCorrelationEnums.Partitions.TrainingSamples)) {
+      if (partition.Equals(FeatureCorrelationPartitions.TRAININGSAMPLES)) {
         var = var.Skip(problemData.TrainingPartition.Start).Take(problemData.TrainingPartition.End - problemData.TrainingPartition.Start);
-      } else if (partition.Equals(FeatureCorrelationEnums.Partitions.TestSamples)) {
+      } else if (partition.Equals(FeatureCorrelationPartitions.TESTSAMPLES)) {
         var = var.Skip(problemData.TestPartition.Start).Take(problemData.TestPartition.End - problemData.TestPartition.Start);
       }
       return var;
-    }
-
-    private double CalculateElementWithCalculator(FeatureCorrelationEnums.CorrelationCalculators calc, IEnumerable<double> var1, IEnumerable<double> var2, out OnlineCalculatorError error) {
-      if (calc.Equals(FeatureCorrelationEnums.CorrelationCalculators.HoeffdingsDependence)) {
-        return HoeffdingsDependenceCalculator.Calculate(var1, var2, out error);
-      } else if (calc.Equals(FeatureCorrelationEnums.CorrelationCalculators.SpearmansRank)) {
-        return SpearmansRankCorrelationCoefficientCalculator.Calculate(var1, var2, out error);
-      } else if (calc.Equals(FeatureCorrelationEnums.CorrelationCalculators.PearsonsRSquared)) {
-        return OnlinePearsonsRSquaredCalculator.Calculate(var1, var2, out error);
-      } else {
-        return Math.Sqrt(OnlinePearsonsRSquaredCalculator.Calculate(var1, var2, out error));
-      }
     }
 
@@ -222,5 +221,5 @@
           OnCorrelationCalculationFinished((double[,])e.Result, bwInfo.Calculator, bwInfo.Partition, bwInfo.Variable);
         }
-      } else {
+      } else if (bwInfo != null) {
         bw.RunWorkerAsync(bwInfo);
       }
@@ -231,9 +230,9 @@
     public class CorrelationCalculationFinishedArgs : EventArgs {
       public double[,] Correlation { get; private set; }
-      public FeatureCorrelationEnums.CorrelationCalculators Calculcator { get; private set; }
-      public FeatureCorrelationEnums.Partitions Partition { get; private set; }
+      public IDependencyCalculator Calculcator { get; private set; }
+      public string Partition { get; private set; }
       public string Variable { get; private set; }
 
-      public CorrelationCalculationFinishedArgs(double[,] correlation, FeatureCorrelationEnums.CorrelationCalculators calculator, FeatureCorrelationEnums.Partitions partition, string variable = null) {
+      public CorrelationCalculationFinishedArgs(double[,] correlation, IDependencyCalculator calculator, string partition, string variable = null) {
         this.Correlation = correlation;
         this.Calculcator = calculator;
@@ -245,5 +244,5 @@
     public delegate void CorrelationCalculationFinishedHandler(object sender, CorrelationCalculationFinishedArgs e);
     public event CorrelationCalculationFinishedHandler CorrelationCalculationFinished;
-    protected virtual void OnCorrelationCalculationFinished(double[,] correlation, FeatureCorrelationEnums.CorrelationCalculators calculator, FeatureCorrelationEnums.Partitions partition, string variable = null) {
+    protected virtual void OnCorrelationCalculationFinished(double[,] correlation, IDependencyCalculator calculator, string partition, string variable = null) {
       var handler = CorrelationCalculationFinished;
       if (handler != null)
@@ -255,5 +254,5 @@
     protected void BwProgressChanged(object sender, ProgressChangedEventArgs e) {
       BackgroundWorker worker = sender as BackgroundWorker;
-      if (!worker.CancellationPending && ProgressCalculation != null) {
+      if (ProgressCalculation != null) {
         ProgressCalculation(sender, e);
       }
@@ -263,6 +262,6 @@
     private class BackgroundWorkerInfo {
       public Dataset Dataset { get; set; }
-      public FeatureCorrelationEnums.CorrelationCalculators Calculator { get; set; }
-      public FeatureCorrelationEnums.Partitions Partition { get; set; }
+      public IDependencyCalculator Calculator { get; set; }
+      public string Partition { get; set; }
       public string Variable { get; set; }
       public int Frames { get; set; }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationHelpers.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationHelpers.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationHelpers.cs	(revision 8833)
@@ -0,0 +1,34 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [NonDiscoverableType]
+  public class FeatureCorrelationPartitions {
+    public const string ALLSAMPLES = "All Samples";
+    public const string TRAININGSAMPLES = "Training Samples";
+    public const string TESTSAMPLES = "Test Samples";
+
+    public static readonly IList<string> Partitions = new List<string>() { ALLSAMPLES, TRAININGSAMPLES, TESTSAMPLES };
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationView.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationView.cs	(revision 8833)
@@ -20,4 +20,6 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
 using System.Windows.Forms;
 using HeuristicLab.Analysis;
@@ -25,4 +27,5 @@
 using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
@@ -40,4 +43,8 @@
 
     protected override void OnContentChanged() {
+      if (Content != null) {
+        dataView.RowVisibility = SetInitialVariableVisibility();
+        dataView.ColumnVisibility = SetInitialVariableVisibility();
+      }
       correlationCache.Reset();
       base.OnContentChanged();
@@ -46,20 +53,20 @@
     protected override void CalculateCorrelation() {
       if (CorrelationCalcComboBox.SelectedItem != null && PartitionComboBox.SelectedItem != null) {
-        FeatureCorrelationEnums.CorrelationCalculators calc = (FeatureCorrelationEnums.CorrelationCalculators)CorrelationCalcComboBox.SelectedValue;
-        FeatureCorrelationEnums.Partitions partition = (FeatureCorrelationEnums.Partitions)PartitionComboBox.SelectedValue;
-        DataGridView.Columns.Clear();
-        DataGridView.Enabled = false;
+        IDependencyCalculator calc = (IDependencyCalculator)CorrelationCalcComboBox.SelectedValue;
+        string partition = (string)PartitionComboBox.SelectedValue;
+        dataView.Enabled = false;
         double[,] corr = correlationCache.GetCorrelation(calc, partition);
         if (corr == null) {
           fcc.CalculateElements(calc, partition);
         } else {
+          fcc.TryCancelCalculation();
           SetNewCorrelation(corr, calc);
-          UpdateDataGrid();
+          UpdateDataView();
         }
       }
     }
 
-    private void SetNewCorrelation(double[,] elements, FeatureCorrelationEnums.CorrelationCalculators calc) {
-      DoubleRange range = FeatureCorrelationEnums.calculatorInterval[calc];
+    private void SetNewCorrelation(double[,] elements, IDependencyCalculator calc) {
+      DoubleRange range = calc.Interval;
       HeatMap hm = new HeatMap(elements, "", range.End, range.Start);
       hm.RowNames = Content.Dataset.DoubleVariables;
@@ -74,11 +81,36 @@
         correlationCache.SetCorrelation(e.Calculcator, e.Partition, e.Correlation);
         SetNewCorrelation(e.Correlation, e.Calculcator);
-        UpdateDataGrid();
+        UpdateDataView();
       }
     }
 
-    protected override void variableVisibility_VariableVisibilityChanged(object sender, ItemCheckEventArgs e) {
-      DataGridView.Columns[e.Index].Visible = e.NewValue == CheckState.Checked;
-      DataGridView.Rows[GetRowIndexOfVirtualindex(e.Index)].Visible = e.NewValue == CheckState.Checked;
+    [NonDiscoverableType]
+    private class FeatureCorrelationCache : Object {
+      private Dictionary<Tuple<IDependencyCalculator, string>, double[,]> correlationsCache;
+
+      public FeatureCorrelationCache()
+        : base() {
+        InitializeCaches();
+      }
+
+      private void InitializeCaches() {
+        correlationsCache = new Dictionary<Tuple<IDependencyCalculator, string>, double[,]>();
+      }
+
+      public void Reset() {
+        InitializeCaches();
+      }
+
+      public double[,] GetCorrelation(IDependencyCalculator calc, string partition) {
+        double[,] corr;
+        var key = new Tuple<IDependencyCalculator, string>(calc, partition);
+        correlationsCache.TryGetValue(key, out corr);
+        return corr;
+      }
+
+      public void SetCorrelation(IDependencyCalculator calc, string partition, double[,] correlation) {
+        var key = new Tuple<IDependencyCalculator, string>(calc, partition);
+        correlationsCache[key] = correlation;
+      }
     }
   }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.Designer.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.Designer.cs	(revision 8833)
@@ -49,5 +49,5 @@
       this.VariableSelectionComboBox = new System.Windows.Forms.ComboBox();
       this.TimeFrameLabel = new System.Windows.Forms.Label();
-      this.TimeframeComboBox = new System.Windows.Forms.ComboBox();
+      this.TimeframeTextbox = new System.Windows.Forms.TextBox();
       ((System.ComponentModel.ISupportInitialize)(this.PictureBox)).BeginInit();
       ((System.ComponentModel.ISupportInitialize)(this.SplitContainer)).BeginInit();
@@ -78,5 +78,5 @@
       // 
       this.SplitContainer.Panel1.Controls.Add(this.VariableSelectionComboBox);
-      this.SplitContainer.Panel1.Controls.Add(this.TimeframeComboBox);
+      this.SplitContainer.Panel1.Controls.Add(this.TimeframeTextbox);
       this.SplitContainer.Panel1.Controls.Add(this.TimeFrameLabel);
       this.SplitContainer.Panel1.Controls.Add(this.VariableSelectionLabel);
@@ -117,11 +117,10 @@
       // TimeframeComboBox
       // 
-      this.TimeframeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-      this.TimeframeComboBox.FormattingEnabled = true;
-      this.TimeframeComboBox.Location = new System.Drawing.Point(344, 30);
-      this.TimeframeComboBox.Name = "TimeframeComboBox";
-      this.TimeframeComboBox.Size = new System.Drawing.Size(131, 21);
-      this.TimeframeComboBox.TabIndex = 19;
-      this.TimeframeComboBox.SelectionChangeCommitted += new System.EventHandler(this.TimeframeComboBox_SelectedChangeCommitted);
+      this.TimeframeTextbox.Location = new System.Drawing.Point(344, 30);
+      this.TimeframeTextbox.Name = "TimeframeTextbox";
+      this.TimeframeTextbox.Size = new System.Drawing.Size(131, 21);
+      this.TimeframeTextbox.TabIndex = 19;
+      this.TimeframeTextbox.Text = "5";
+      this.TimeframeTextbox.KeyDown += new System.Windows.Forms.KeyEventHandler(TimeframeTextbox_KeyDown);
       // 
       // TimeframeFeatureCorrelationView
@@ -146,5 +145,5 @@
     protected System.Windows.Forms.ComboBox VariableSelectionComboBox;
     protected System.Windows.Forms.Label TimeFrameLabel;
-    protected System.Windows.Forms.ComboBox TimeframeComboBox;
+    protected System.Windows.Forms.TextBox TimeframeTextbox;
   }
 }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/TimeframeFeatureCorrelationView.cs	(revision 8833)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Linq;
 using System.Windows.Forms;
@@ -26,4 +27,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
@@ -36,5 +38,4 @@
     public TimeframeFeatureCorrelationView() {
       InitializeComponent();
-      TimeframeComboBox.DataSource = Enumerable.Range(0, 16).ToList<int>();
       correlationTimeframCache = new FeatureCorrelationTimeframeCache();
     }
@@ -43,4 +44,5 @@
       correlationTimeframCache.Reset();
       if (Content != null) {
+        dataView.RowVisibility = SetInitialVariableVisibility();
         VariableSelectionComboBox.DataSource = Content.Dataset.DoubleVariables.ToList();
       }
@@ -51,16 +53,19 @@
       CalculateCorrelation();
     }
-    protected void TimeframeComboBox_SelectedChangeCommitted(object sender, EventArgs e) {
-      CalculateCorrelation();
+    protected void TimeframeTextbox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) {
+      if (e.KeyCode == Keys.Enter) {
+        CalculateCorrelation();
+      }
     }
 
     protected override void CalculateCorrelation() {
-      string variable = (string)VariableSelectionComboBox.SelectedItem;
-      if (CorrelationCalcComboBox.SelectedItem != null && PartitionComboBox.SelectedItem != null && variable != null) {
-        FeatureCorrelationEnums.CorrelationCalculators calc = (FeatureCorrelationEnums.CorrelationCalculators)CorrelationCalcComboBox.SelectedValue;
-        FeatureCorrelationEnums.Partitions partition = (FeatureCorrelationEnums.Partitions)PartitionComboBox.SelectedValue;
-        DataGridView.Columns.Clear();
-        DataGridView.Enabled = false;
-        int frames = (int)TimeframeComboBox.SelectedItem;
+      if (CorrelationCalcComboBox.SelectedItem != null && PartitionComboBox.SelectedItem != null
+        && VariableSelectionComboBox.SelectedItem != null && ValidateTimeframeTextbox()) {
+        string variable = (string)VariableSelectionComboBox.SelectedItem;
+        IDependencyCalculator calc = (IDependencyCalculator)CorrelationCalcComboBox.SelectedValue;
+        string partition = (string)PartitionComboBox.SelectedValue;
+        int frames;
+        int.TryParse(TimeframeTextbox.Text, out frames);
+        dataView.Enabled = false;
         double[,] corr = correlationTimeframCache.GetTimeframeCorrelation(calc, partition, variable);
         if (corr == null) {
@@ -69,11 +74,27 @@
           fcc.CalculateTimeframeElements(calc, partition, variable, frames, corr);
         } else {
+          fcc.TryCancelCalculation();
           SetNewCorrelation(corr, calc, frames);
-          UpdateDataGrid();
+          UpdateDataView();
         }
       }
     }
 
-    private void SetNewCorrelation(double[,] elements, FeatureCorrelationEnums.CorrelationCalculators calc, int frames) {
+    protected bool ValidateTimeframeTextbox() {
+      int help;
+      if (!int.TryParse(TimeframeTextbox.Text, out help)) {
+        MessageBox.Show("Timeframe couldn't be parsed. Enter a valid integer value.", "Parse Error", MessageBoxButtons.OK);
+        return false;
+      } else {
+        if (help > 50) {
+          DialogResult dr = MessageBox.Show("The entered value is bigger than 50. Are you sure you want to calculate? " +
+                                            "The calculation could take some time.", "Huge Value Warning", MessageBoxButtons.YesNo);
+          return dr.Equals(DialogResult.Yes);
+        }
+      }
+      return true;
+    }
+
+    private void SetNewCorrelation(double[,] elements, IDependencyCalculator calc, int frames) {
       double[,] neededValues = new double[elements.GetLength(0), frames + 1];
       for (int i = 0; i < elements.GetLength(0); i++) {
@@ -83,6 +104,6 @@
     }
 
-    private void SetNewCorrelation(double[,] elements, FeatureCorrelationEnums.CorrelationCalculators calc) {
-      DoubleRange range = FeatureCorrelationEnums.calculatorInterval[calc];
+    private void SetNewCorrelation(double[,] elements, IDependencyCalculator calc) {
+      DoubleRange range = calc.Interval;
       HeatMap hm = new HeatMap(elements, "", range.End, range.Start);
       hm.RowNames = Content.Dataset.DoubleVariables;
@@ -97,16 +118,36 @@
         correlationTimeframCache.SetTimeframeCorrelation(e.Calculcator, e.Partition, e.Variable, e.Correlation);
         SetNewCorrelation(e.Correlation, e.Calculcator);
-        UpdateDataGrid();
+        UpdateDataView();
       }
     }
 
-    protected override void UpdateColumnHeaders() {
-      for (int i = 0; i < DataGridView.ColumnCount; i++) {
-        DataGridView.Columns[i].HeaderText = i.ToString();
+    [NonDiscoverableType]
+    private class FeatureCorrelationTimeframeCache : Object {
+      private Dictionary<Tuple<IDependencyCalculator, string, string>, double[,]> timeFrameCorrelationsCache;
+
+      public FeatureCorrelationTimeframeCache()
+        : base() {
+        InitializeCaches();
       }
-    }
 
-    protected override void variableVisibility_VariableVisibilityChanged(object sender, ItemCheckEventArgs e) {
-      DataGridView.Rows[GetRowIndexOfVirtualindex(e.Index)].Visible = e.NewValue == CheckState.Checked;
+      private void InitializeCaches() {
+        timeFrameCorrelationsCache = new Dictionary<Tuple<IDependencyCalculator, string, string>, double[,]>();
+      }
+
+      public void Reset() {
+        InitializeCaches();
+      }
+
+      public double[,] GetTimeframeCorrelation(IDependencyCalculator calc, string partition, string variable) {
+        double[,] corr;
+        var key = new Tuple<IDependencyCalculator, string, string>(calc, partition, variable);
+        timeFrameCorrelationsCache.TryGetValue(key, out corr);
+        return corr;
+      }
+
+      public void SetTimeframeCorrelation(IDependencyCalculator calc, string partition, string variable, double[,] correlation) {
+        var key = new Tuple<IDependencyCalculator, string, string>(calc, partition, variable);
+        timeFrameCorrelationsCache[key] = correlation;
+      }
     }
   }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/VariableVisibilityDialog.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/VariableVisibilityDialog.Designer.cs	(revision 8832)
+++ 	(revision )
@@ -1,112 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-namespace HeuristicLab.DataAnalysis.Views {
-  partial class VariableVisibilityDialog {
-    /// <summary>
-    /// Required designer variable.
-    /// </summary>
-    private System.ComponentModel.IContainer components = null;
-
-    /// <summary>
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing && (components != null)) {
-        components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
-
-    #region Windows Form Designer generated code
-
-    /// <summary>
-    /// Required method for Designer support - do not modify
-    /// the contents of this method with the code editor.
-    /// </summary>
-    private void InitializeComponent() {
-      this.checkedListBox = new System.Windows.Forms.CheckedListBox();
-      this.btnShowAll = new System.Windows.Forms.Button();
-      this.btnHideAll = new System.Windows.Forms.Button();
-      this.SuspendLayout();
-      // 
-      // checkedListBox
-      // 
-      this.checkedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.checkedListBox.CheckOnClick = true;
-      this.checkedListBox.FormattingEnabled = true;
-      this.checkedListBox.Location = new System.Drawing.Point(12, 12);
-      this.checkedListBox.Name = "checkedListBox";
-      this.checkedListBox.Size = new System.Drawing.Size(309, 289);
-      this.checkedListBox.TabIndex = 0;
-      this.checkedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBox_ItemCheck);
-      // 
-      // btnShowAll
-      // 
-      this.btnShowAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-      this.btnShowAll.Location = new System.Drawing.Point(12, 315);
-      this.btnShowAll.Name = "btnShowAll";
-      this.btnShowAll.Size = new System.Drawing.Size(75, 23);
-      this.btnShowAll.TabIndex = 1;
-      this.btnShowAll.Text = "Show all";
-      this.btnShowAll.UseVisualStyleBackColor = true;
-      this.btnShowAll.Click += new System.EventHandler(this.btnShowAll_Click);
-      // 
-      // btnHideAll
-      // 
-      this.btnHideAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-      this.btnHideAll.Location = new System.Drawing.Point(101, 315);
-      this.btnHideAll.Name = "btnHideAll";
-      this.btnHideAll.Size = new System.Drawing.Size(75, 23);
-      this.btnHideAll.TabIndex = 2;
-      this.btnHideAll.Text = "Hide all";
-      this.btnHideAll.UseVisualStyleBackColor = true;
-      this.btnHideAll.Click += new System.EventHandler(this.btnHideAll_Click);
-      // 
-      // ColumnsVisibilityDialog
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
-      this.ClientSize = new System.Drawing.Size(332, 350);
-      this.Controls.Add(this.btnHideAll);
-      this.Controls.Add(this.btnShowAll);
-      this.Controls.Add(this.checkedListBox);
-      this.MaximizeBox = false;
-      this.MinimizeBox = false;
-      this.Name = "ColumnsVisibilityDialog";
-      this.ShowIcon = false;
-      this.ShowInTaskbar = false;
-      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
-      this.Text = "Show/Hide Columns";
-      this.ResumeLayout(false);
-
-    }
-
-    #endregion
-
-    private System.Windows.Forms.CheckedListBox checkedListBox;
-    private System.Windows.Forms.Button btnShowAll;
-    private System.Windows.Forms.Button btnHideAll;
-  }
-}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/VariableVisibilityDialog.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/VariableVisibilityDialog.cs	(revision 8832)
+++ 	(revision )
@@ -1,76 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Windows.Forms;
-
-namespace HeuristicLab.DataAnalysis.Views {
-  public partial class VariableVisibilityDialog : Form {
-    public VariableVisibilityDialog() {
-      InitializeComponent();
-    }
-
-    public VariableVisibilityDialog(IEnumerable<string> columns, IEnumerable<bool> visibility)
-      : this() {
-      if (columns.Count() != visibility.Count()) {
-        throw new ArgumentException("There have to be as many variables as values for visibility!");
-      }
-      this.columns = columns.ToList();
-      this.visibility = visibility.ToList();
-      UpdateCheckBoxes();
-    }
-
-    private List<string> columns;
-    public IList<string> Columns {
-      get { return this.columns; }
-    }
-    private List<bool> visibility;
-    public IList<bool> Visibility {
-      get { return this.visibility; }
-    }
-
-    private void UpdateCheckBoxes() {
-      for (int i = 0; i < columns.Count; i++) {
-        checkedListBox.Items.Add(columns[i], visibility[i]);
-      }
-    }
-
-    public event ItemCheckEventHandler VariableVisibilityChanged;
-
-    private void checkedListBox_ItemCheck(object sender, ItemCheckEventArgs e) {
-      this.visibility[e.Index] = e.NewValue == CheckState.Checked;
-      if (VariableVisibilityChanged != null) {
-        VariableVisibilityChanged(this, e);
-      }
-    }
-
-    private void btnShowAll_Click(object sender, System.EventArgs e) {
-      for (int i = 0; i < checkedListBox.Items.Count; i++)
-        checkedListBox.SetItemChecked(i, true);
-    }
-    private void btnHideAll_Click(object sender, System.EventArgs e) {
-      for (int i = 0; i < checkedListBox.Items.Count; i++)
-        checkedListBox.SetItemChecked(i, false);
-    }
-  }
-}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 8833)
@@ -162,12 +162,12 @@
       <DependentUpon>DataAnalysisSolutionEvaluationView.cs</DependentUpon>
     </Compile>
+    <Compile Include="FeatureCorrelation\EnhancedStringConvertibleMatrixView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="FeatureCorrelation\EnhancedStringConvertibleMatrixView.Designer.cs">
+      <DependentUpon>EnhancedStringConvertibleMatrixView.cs</DependentUpon>
+    </Compile>
     <Compile Include="FeatureCorrelation\FeatureCorrelationCalculator.cs" />
-    <Compile Include="FeatureCorrelation\FeatureCorrelationEnums.cs" />
-    <Compile Include="FeatureCorrelation\VariableVisibilityDialog.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FeatureCorrelation\VariableVisibilityDialog.Designer.cs">
-      <DependentUpon>VariableVisibilityDialog.cs</DependentUpon>
-    </Compile>
+    <Compile Include="FeatureCorrelation\FeatureCorrelationHelpers.cs" />
     <Compile Include="FeatureCorrelation\FeatureCorrelationView.cs">
       <SubType>UserControl</SubType>
@@ -176,6 +176,4 @@
       <DependentUpon>FeatureCorrelationView.cs</DependentUpon>
     </Compile>
-    <Compile Include="FeatureCorrelation\FeatureCorrelationCache.cs" />
-    <Compile Include="FeatureCorrelation\FeatureCorrelationTimeframeCache.cs" />
     <Compile Include="Plugin.cs" />
     <Compile Include="ProblemDataView.cs">
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataView.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataView.cs	(revision 8833)
@@ -45,5 +45,5 @@
 
     protected void FeatureCorrelationButton_Click(object sender, System.EventArgs e) {
-      Type viewType = MainFormManager.GetViewTypes(this.Content.GetType(), true).FirstOrDefault(t => typeof(AbstractFeatureCorrelationView).IsAssignableFrom(t));
+      Type viewType = MainFormManager.GetViewTypes(this.Content.GetType(), true).FirstOrDefault(t => typeof(FeatureCorrelationView).IsAssignableFrom(t));
       MainFormManager.MainForm.ShowContent(Content, viewType);
     }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionFeatureCorrelationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionFeatureCorrelationView.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionFeatureCorrelationView.cs	(revision 8833)
@@ -37,7 +37,7 @@
     }
 
-    protected override bool[] SetInitialVisibilityOfColumns() {
+    protected override bool[] SetInitialVariableVisibility() {
       int i = Content.Dataset.DoubleVariables.ToList().FindIndex(x => x == Content.TargetVariable);
-      var initialVisibility = base.SetInitialVisibilityOfColumns();
+      var initialVisibility = base.SetInitialVariableVisibility();
       initialVisibility[i] = true;
       return initialVisibility;
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionTimeframeFeatureCorrelationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionTimeframeFeatureCorrelationView.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionTimeframeFeatureCorrelationView.cs	(revision 8833)
@@ -37,7 +37,7 @@
     }
 
-    protected override bool[] SetInitialVisibilityOfColumns() {
+    protected override bool[] SetInitialVariableVisibility() {
       int i = Content.Dataset.DoubleVariables.ToList().FindIndex(x => x == Content.TargetVariable);
-      var initialVisibility = base.SetInitialVisibilityOfColumns();
+      var initialVisibility = base.SetInitialVariableVisibility();
       initialVisibility[i] = true;
       return initialVisibility;
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 8833)
@@ -152,4 +152,5 @@
     </Compile>
     <Compile Include="Interfaces\Classification\IDiscriminantFunctionThresholdCalculator.cs" />
+    <Compile Include="Interfaces\IDependencyCalculator.cs" />
     <Compile Include="Interfaces\Regression\IRegressionEnsembleModel.cs">
       <SubType>Code</SubType>
@@ -206,4 +207,6 @@
     <Compile Include="OnlineCalculators\OnlineTheilsUStatisticCalculator.cs" />
     <Compile Include="OnlineCalculators\OnlineWeightedDirectionalSymmetryCalculator.cs" />
+    <Compile Include="OnlineCalculators\PearsonsRDependenceCalculator.cs" />
+    <Compile Include="OnlineCalculators\PearsonsRSquaredDependenceCalculator.cs" />
     <Compile Include="OnlineCalculators\SpearmansRankCorrelationCoefficientCalculator.cs" />
     <Compile Include="Plugin.cs" />
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDependencyCalculator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDependencyCalculator.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDependencyCalculator.cs	(revision 8833)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IDependencyCalculator {
+    DoubleRange Interval { get; }
+    string Name { get; }
+
+    double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState);
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/HoeffdingsDependenceCalculator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/HoeffdingsDependenceCalculator.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/HoeffdingsDependenceCalculator.cs	(revision 8833)
@@ -23,9 +23,18 @@
 using System.Collections.Generic;
 using System.Linq;
+using HeuristicLab.Data;
 
 namespace HeuristicLab.Problems.DataAnalysis {
-  public class HoeffdingsDependenceCalculator {
+  public class HoeffdingsDependenceCalculator : IDependencyCalculator {
 
-    public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
+    public DoubleRange Interval { get { return new DoubleRange(1.0, -0.5); } }
+
+    public string Name { get { return "Hoeffdings Dependence"; } }
+
+    public double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
+      return HoeffdingsDependenceCalculator.CalculateHoeffdings(originalValues, estimatedValues, out errorState);
+    }
+
+    public static double CalculateHoeffdings(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
       double d = HoeffD(originalValues, estimatedValues, out errorState);
       if (errorState != OnlineCalculatorError.None) return double.NaN;
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/PearsonsRDependenceCalculator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/PearsonsRDependenceCalculator.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/PearsonsRDependenceCalculator.cs	(revision 8833)
@@ -0,0 +1,37 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public class PearsonsRDependenceCalculator : IDependencyCalculator {
+
+    public DoubleRange Interval { get { return new DoubleRange(1.0, -1.0); } }
+
+    public string Name { get { return "Pearsons R"; } }
+
+    public double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
+      return Math.Sqrt(OnlinePearsonsRSquaredCalculator.Calculate(originalValues, estimatedValues, out errorState));
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/PearsonsRSquaredDependenceCalculator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/PearsonsRSquaredDependenceCalculator.cs	(revision 8833)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/PearsonsRSquaredDependenceCalculator.cs	(revision 8833)
@@ -0,0 +1,36 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public class PearsonsRSquaredDependenceCalculator : IDependencyCalculator {
+
+    public DoubleRange Interval { get { return new DoubleRange(1.0, 0.0); } }
+
+    public string Name { get { return "Pearsons R Squared"; } }
+
+    public double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
+      return OnlinePearsonsRSquaredCalculator.Calculate(originalValues, estimatedValues, out errorState);
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/SpearmansRankCorrelationCoefficientCalculator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/SpearmansRankCorrelationCoefficientCalculator.cs	(revision 8832)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/SpearmansRankCorrelationCoefficientCalculator.cs	(revision 8833)
@@ -22,9 +22,18 @@
 using System.Collections.Generic;
 using System.Linq;
+using HeuristicLab.Data;
 
 namespace HeuristicLab.Problems.DataAnalysis {
-  public class SpearmansRankCorrelationCoefficientCalculator {
+  public class SpearmansRankCorrelationCoefficientCalculator : IDependencyCalculator {
 
-    public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
+    public DoubleRange Interval { get { return new DoubleRange(1.0, -1.0); } }
+
+    public string Name { get { return "Spearmans Rank"; } }
+
+    public double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
+      return SpearmansRankCorrelationCoefficientCalculator.CalculateSpearmansRank(originalValues, estimatedValues, out errorState);
+    }
+
+    public static double CalculateSpearmansRank(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
       double rs = double.NaN;
       try {
