Changeset 15973 for branches/2522_RefactorPluginInfrastructure/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs
- Timestamp:
- 06/28/18 11:13:37 (6 years ago)
- Location:
- branches/2522_RefactorPluginInfrastructure
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2522_RefactorPluginInfrastructure
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2522_RefactorPluginInfrastructure/HeuristicLab.DataPreprocessing.Views
- Property svn:mergeinfo changed
-
branches/2522_RefactorPluginInfrastructure/HeuristicLab.DataPreprocessing.Views/3.4
- Property svn:ignore
-
old new 1 1 ComparisonFilterView.resx 2 2 FilterView.resx 3 *.user
-
- Property svn:ignore
-
branches/2522_RefactorPluginInfrastructure/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs
r12012 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System.Collections.Generic; 23 using System.ComponentModel; 22 using System; 24 23 using System.Linq; 25 using System.Windows.Forms; 26 using HeuristicLab.Data; 24 using HeuristicLab.Data.Views; 27 25 using HeuristicLab.MainForm; 28 26 using HeuristicLab.MainForm.WindowsForms; 29 using HeuristicLab.PluginInfrastructure;30 using System;31 using HeuristicLab.DataPreprocessing;32 using HeuristicLab.Problems.DataAnalysis.Views;33 27 34 namespace HeuristicLab. Problems.DataAnalysis.Views {28 namespace HeuristicLab.DataPreprocessing.Views { 35 29 [View("Preprocessing Feature Correlation View")] 36 [Content(typeof(CorrelationMatrixContent), false)]30 [Content(typeof(CorrelationMatrixContent), true)] 37 31 public partial class PreprocessingFeatureCorrelationView : AsynchronousContentView { 38 39 public new CorrelationMatrixContent Content 40 { 41 get { return (CorrelationMatrixContent) base.Content; } 32 public new CorrelationMatrixContent Content { 33 get { return (CorrelationMatrixContent)base.Content; } 42 34 set { base.Content = value; } 43 35 } 44 36 45 FeatureCorrelationView correlationView;46 47 37 public PreprocessingFeatureCorrelationView() { 48 38 InitializeComponent(); 49 correlationView = new FeatureCorrelationView();50 correlationView.Dock = DockStyle.Fill;51 this.Controls.Add(correlationView);52 39 } 53 54 40 55 41 protected override void RegisterContentEvents() { 56 42 base.RegisterContentEvents(); 57 Content.Changed += Data_Changed; 43 Content.Changed += Data_Changed; 58 44 } 59 45 60 46 protected override void DeregisterContentEvents() { 61 Content.Changed -= Data_Changed; 47 Content.Changed -= Data_Changed; 62 48 base.DeregisterContentEvents(); 63 49 } … … 69 55 protected override void OnContentChanged() { 70 56 base.OnContentChanged(); 71 if (Content == null) { 72 correlationView.Content = null; 57 correlationView.Content = Content != null ? Content.ProblemData : null; 58 } 59 60 #region Check Variables 61 private void checkAllButton_Click(object sender, System.EventArgs e) { 62 SetVisibility(x => true); 63 } 64 private void checkInputsTargetButton_Click(object sender, System.EventArgs e) { 65 var ppd = Content.PreprocessingData; 66 SetVisibility(x => ppd.InputVariables.Contains(x) || ppd.TargetVariable == x); 67 } 68 private void uncheckAllButton_Click(object sender, System.EventArgs e) { 69 SetVisibility(x => false); 70 } 71 private void SetVisibility(Func<string, bool> check) { 72 var dataView = (EnhancedStringConvertibleMatrixView)correlationView.Controls.Find("DataView", searchAllChildren: true).Single(); 73 var ppd = Content.PreprocessingData; 74 var visibilities = ppd.VariableNames.Where((v, i) => ppd.VariableHasType<double>(i)).Select(check).ToList(); 75 if (dataView.Content.Rows != dataView.Content.Columns || dataView.Content.Rows != visibilities.Count) 73 76 return; 74 }75 77 76 correlationView.Content = Content.ProblemData; 78 dataView.ColumnVisibility = visibilities; 79 dataView.RowVisibility = visibilities; 80 dataView.UpdateColumnHeaders(); 81 dataView.UpdateRowHeaders(); 77 82 } 83 #endregion 78 84 } 79 85 }
Note: See TracChangeset
for help on using the changeset viewer.