Changeset 15242 for stable/HeuristicLab.DataPreprocessing.Views
- Timestamp:
- 07/14/17 10:29:51 (7 years ago)
- Location:
- stable
- Files:
-
- 6 deleted
- 36 edited
- 5 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 15110,15119,15210
- Property svn:mergeinfo changed
-
stable/HeuristicLab.DataPreprocessing.Views
- Property svn:mergeinfo changed
-
stable/HeuristicLab.DataPreprocessing.Views/3.4/CheckedTransformationListView.cs
r14186 r15242 32 32 namespace HeuristicLab.DataPreprocessing.Views { 33 33 [View("CheckedTransformationList View")] 34 //[Content(typeof(RunCollectionConstraintCollection), true)]35 34 [Content(typeof(ICheckedItemList<ITransformation>), false)] 36 35 public partial class CheckedTransformationListView : CheckedItemListView<ITransformation> { 37 38 36 public CheckedTransformationListView() { 39 37 InitializeComponent(); … … 56 54 57 55 return (ITransformation)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(new[] { columnNames }); 58 } 59 catch (Exception ex) { 56 } catch (Exception ex) { 60 57 ErrorHandling.ShowErrorDialog(this, ex); 61 58 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ComparisonFilterView.cs
r14186 r15242 32 32 [Content(typeof(ComparisonFilter), false)] 33 33 public partial class ComparisonFilterView : ItemView { 34 public ComparisonFilterView() {35 InitializeComponent();36 }37 38 34 public new ComparisonFilter Content { 39 35 get { return (ComparisonFilter)base.Content; } … … 41 37 } 42 38 39 public ComparisonFilterView() { 40 InitializeComponent(); 41 } 43 42 44 43 protected override void OnContentChanged() { 45 44 base.OnContentChanged(); 46 cbAttr.Items.Clear(); //cmbConstraintColumn.Items.Clear();47 cbFilterOperation.Items.Clear(); //cmbConstraintOperation.Items.Clear();45 cbAttr.Items.Clear(); 46 cbFilterOperation.Items.Clear(); 48 47 tbFilterData.Text = string.Empty; 49 48 if (Content != null) { … … 121 120 } 122 121 123 124 122 protected virtual void Content_ComparisonOperationChanged(object sender, EventArgs e) { 125 123 if (Content.ConstraintOperation != (ConstraintOperation)this.cbFilterOperation.SelectedItem) … … 178 176 errorProvider.Clear(); 179 177 } 180 181 178 } 182 179 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/DataCompletenessView.Designer.cs
r14186 r15242 54 54 // chart 55 55 // 56 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 57 | System.Windows.Forms.AnchorStyles.Left) 56 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 57 | System.Windows.Forms.AnchorStyles.Left) 58 58 | System.Windows.Forms.AnchorStyles.Right))); 59 59 chartArea1.Name = "ChartArea1"; 60 60 this.chart.ChartAreas.Add(chartArea1); 61 legend1.Alignment = System.Drawing.StringAlignment.Center; 62 legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top; 61 63 legend1.Name = "Legend1"; 62 64 this.chart.Legends.Add(legend1); -
stable/HeuristicLab.DataPreprocessing.Views/3.4/DataCompletenessView.cs
r14186 r15242 24 24 using System.Drawing; 25 25 using System.Linq; 26 using System.Windows.Forms;27 26 using System.Windows.Forms.DataVisualization.Charting; 28 27 using HeuristicLab.Core.Views; … … 30 29 31 30 namespace HeuristicLab.DataPreprocessing.Views { 32 33 31 [View("Histogram View")] 34 32 [Content(typeof(DataCompletenessChartContent), true)] … … 69 67 70 68 private void PrepareChart() { 71 chart.Titles.Add("DataCompletenessChart");72 69 chart.EnableDoubleClickResetsZoom = true; 73 70 chart.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0; -
stable/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.Designer.cs
r14186 r15242 63 63 this.btnReplace = new System.Windows.Forms.Button(); 64 64 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 65 this.checkInputsTargetButton = new System.Windows.Forms.Button(); 66 this.uncheckAllButton = new System.Windows.Forms.Button(); 67 this.checkAllButton = new System.Windows.Forms.Button(); 65 68 this.addRowButton = new System.Windows.Forms.Button(); 66 69 this.addColumnButton = new System.Windows.Forms.Button(); 67 70 this.renameColumnsButton = new System.Windows.Forms.Button(); 71 this.showVariablesGroupBox = new System.Windows.Forms.GroupBox(); 68 72 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 69 73 this.contextMenuCell.SuspendLayout(); 74 this.showVariablesGroupBox.SuspendLayout(); 70 75 this.SuspendLayout(); 76 // 77 // rowsLabel 78 // 79 this.rowsLabel.Size = new System.Drawing.Size(55, 13); 80 this.rowsLabel.Text = "Datarows:"; 71 81 // 72 82 // rowsTextBox … … 82 92 this.columnsTextBox.Size = new System.Drawing.Size(71, 20); 83 93 // 94 // columnsLabel 95 // 96 this.columnsLabel.Size = new System.Drawing.Size(53, 13); 97 this.columnsLabel.Text = "Variables:"; 98 // 84 99 // statisticsTextBox 85 100 // 86 this.statisticsTextBox.Location = new System.Drawing.Point(3, 387);87 101 this.statisticsTextBox.Size = new System.Drawing.Size(421, 13); 88 102 // 89 103 // btnApplySort 90 104 // 91 this.btnApplySort.Location = new System.Drawing.Point(2 34, 0);105 this.btnApplySort.Location = new System.Drawing.Point(228, 0); 92 106 this.btnApplySort.Name = "btnApplySort"; 93 107 this.btnApplySort.Size = new System.Drawing.Size(104, 23); … … 104 118 this.replaceValueOverSelectionToolStripMenuItem}); 105 119 this.contextMenuCell.Name = "contextMenuCell"; 106 this.contextMenuCell.Size = new System.Drawing.Size(22 5, 48);120 this.contextMenuCell.Size = new System.Drawing.Size(224, 48); 107 121 // 108 122 // replaceValueOverColumnToolStripMenuItem … … 116 130 this.smoothingToolStripMenuItem_Column}); 117 131 this.replaceValueOverColumnToolStripMenuItem.Name = "replaceValueOverColumnToolStripMenuItem"; 118 this.replaceValueOverColumnToolStripMenuItem.Size = new System.Drawing.Size(22 4, 22);119 this.replaceValueOverColumnToolStripMenuItem.Text = "Replace Value over Column";132 this.replaceValueOverColumnToolStripMenuItem.Size = new System.Drawing.Size(223, 22); 133 this.replaceValueOverColumnToolStripMenuItem.Text = "Replace Value over Variable"; 120 134 // 121 135 // averageToolStripMenuItem_Column … … 169 183 this.mostCommonToolStripMenuItem_Selection}); 170 184 this.replaceValueOverSelectionToolStripMenuItem.Name = "replaceValueOverSelectionToolStripMenuItem"; 171 this.replaceValueOverSelectionToolStripMenuItem.Size = new System.Drawing.Size(22 4, 22);185 this.replaceValueOverSelectionToolStripMenuItem.Size = new System.Drawing.Size(223, 22); 172 186 this.replaceValueOverSelectionToolStripMenuItem.Text = "Replace Value over Selection"; 173 187 // … … 202 216 // btnSearch 203 217 // 204 this.btnSearch.Location = new System.Drawing.Point(1 73, 0);218 this.btnSearch.Location = new System.Drawing.Point(167, 0); 205 219 this.btnSearch.Name = "btnSearch"; 206 220 this.btnSearch.Size = new System.Drawing.Size(55, 23); … … 213 227 // btnReplace 214 228 // 215 this.btnReplace.Location = new System.Drawing.Point(1 73, 26);229 this.btnReplace.Location = new System.Drawing.Point(167, 26); 216 230 this.btnReplace.Name = "btnReplace"; 217 231 this.btnReplace.Size = new System.Drawing.Size(55, 23); … … 222 236 this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click); 223 237 // 238 // checkInputsTargetButton 239 // 240 this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs; 241 this.checkInputsTargetButton.Location = new System.Drawing.Point(36, 19); 242 this.checkInputsTargetButton.Name = "checkInputsTargetButton"; 243 this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24); 244 this.checkInputsTargetButton.TabIndex = 14; 245 this.toolTip.SetToolTip(this.checkInputsTargetButton, "Select Inputs & Target"); 246 this.checkInputsTargetButton.UseVisualStyleBackColor = true; 247 this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click); 248 // 249 // uncheckAllButton 250 // 251 this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None; 252 this.uncheckAllButton.Location = new System.Drawing.Point(66, 19); 253 this.uncheckAllButton.Name = "uncheckAllButton"; 254 this.uncheckAllButton.Size = new System.Drawing.Size(24, 24); 255 this.uncheckAllButton.TabIndex = 12; 256 this.toolTip.SetToolTip(this.uncheckAllButton, "Select None"); 257 this.uncheckAllButton.UseVisualStyleBackColor = true; 258 this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click); 259 // 260 // checkAllButton 261 // 262 this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All; 263 this.checkAllButton.Location = new System.Drawing.Point(6, 19); 264 this.checkAllButton.Name = "checkAllButton"; 265 this.checkAllButton.Size = new System.Drawing.Size(24, 24); 266 this.checkAllButton.TabIndex = 13; 267 this.toolTip.SetToolTip(this.checkAllButton, "Select All"); 268 this.checkAllButton.UseVisualStyleBackColor = true; 269 this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click); 270 // 224 271 // addRowButton 225 272 // 226 this.addRowButton.Location = new System.Drawing.Point(3 44, 26);273 this.addRowButton.Location = new System.Drawing.Point(338, 26); 227 274 this.addRowButton.Name = "addRowButton"; 228 this.addRowButton.Size = new System.Drawing.Size( 76, 23);275 this.addRowButton.Size = new System.Drawing.Size(83, 23); 229 276 this.addRowButton.TabIndex = 10; 230 this.addRowButton.Text = "Add Row";277 this.addRowButton.Text = "Add Datarow"; 231 278 this.addRowButton.UseVisualStyleBackColor = true; 232 279 this.addRowButton.Click += new System.EventHandler(this.addRowButton_Click); … … 234 281 // addColumnButton 235 282 // 236 this.addColumnButton.Location = new System.Drawing.Point(3 44, 0);283 this.addColumnButton.Location = new System.Drawing.Point(338, 0); 237 284 this.addColumnButton.Name = "addColumnButton"; 238 this.addColumnButton.Size = new System.Drawing.Size( 76, 23);285 this.addColumnButton.Size = new System.Drawing.Size(83, 23); 239 286 this.addColumnButton.TabIndex = 10; 240 this.addColumnButton.Text = "Add Column";287 this.addColumnButton.Text = "Add Variable"; 241 288 this.addColumnButton.UseVisualStyleBackColor = true; 242 289 this.addColumnButton.Click += new System.EventHandler(this.addColumnButton_Click); … … 244 291 // renameColumnsButton 245 292 // 246 this.renameColumnsButton.Location = new System.Drawing.Point(2 34, 26);293 this.renameColumnsButton.Location = new System.Drawing.Point(228, 26); 247 294 this.renameColumnsButton.Name = "renameColumnsButton"; 248 295 this.renameColumnsButton.Size = new System.Drawing.Size(104, 23); 249 296 this.renameColumnsButton.TabIndex = 11; 250 this.renameColumnsButton.Text = "Rename Columns";297 this.renameColumnsButton.Text = "Rename Variables"; 251 298 this.renameColumnsButton.UseVisualStyleBackColor = true; 252 299 this.renameColumnsButton.Click += new System.EventHandler(this.renameColumnsButton_Click); 253 300 // 301 // showVariablesGroupBox 302 // 303 this.showVariablesGroupBox.Controls.Add(this.checkInputsTargetButton); 304 this.showVariablesGroupBox.Controls.Add(this.uncheckAllButton); 305 this.showVariablesGroupBox.Controls.Add(this.checkAllButton); 306 this.showVariablesGroupBox.Location = new System.Drawing.Point(448, 0); 307 this.showVariablesGroupBox.Name = "showVariablesGroupBox"; 308 this.showVariablesGroupBox.Size = new System.Drawing.Size(97, 49); 309 this.showVariablesGroupBox.TabIndex = 17; 310 this.showVariablesGroupBox.TabStop = false; 311 this.showVariablesGroupBox.Text = "Show Variables"; 312 // 254 313 // DataGridContentView 255 314 // 256 315 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 257 316 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 317 this.Controls.Add(this.showVariablesGroupBox); 258 318 this.Controls.Add(this.renameColumnsButton); 259 319 this.Controls.Add(this.addColumnButton); … … 263 323 this.Controls.Add(this.btnApplySort); 264 324 this.Name = "DataGridContentView"; 265 this.Size = new System.Drawing.Size(430, 403);266 325 this.Controls.SetChildIndex(this.btnApplySort, 0); 267 326 this.Controls.SetChildIndex(this.btnSearch, 0); … … 275 334 this.Controls.SetChildIndex(this.rowsTextBox, 0); 276 335 this.Controls.SetChildIndex(this.columnsTextBox, 0); 336 this.Controls.SetChildIndex(this.showVariablesGroupBox, 0); 277 337 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 278 338 this.contextMenuCell.ResumeLayout(false); 339 this.showVariablesGroupBox.ResumeLayout(false); 279 340 this.ResumeLayout(false); 280 341 this.PerformLayout(); … … 304 365 private System.Windows.Forms.Button addColumnButton; 305 366 private System.Windows.Forms.Button renameColumnsButton; 367 private System.Windows.Forms.GroupBox showVariablesGroupBox; 368 private System.Windows.Forms.Button checkInputsTargetButton; 369 private System.Windows.Forms.Button uncheckAllButton; 370 private System.Windows.Forms.Button checkAllButton; 306 371 } 307 372 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs
r14797 r15242 33 33 [Content(typeof(DataGridContent), true)] 34 34 public partial class DataGridContentView : StringConvertibleMatrixView { 35 36 35 private bool isSearching = false; 37 36 private bool updateOnMouseUp = false; … … 81 80 base.Sort(); 82 81 } 83 84 82 } 85 83 … … 141 139 } 142 140 } 143 144 141 145 142 protected override void PasteValuesToDataGridView() { … … 692 689 } 693 690 } 691 692 private void checkInputsTargetButton_Click(object sender, EventArgs e) { 693 foreach (DataGridViewColumn column in DataGridView.Columns) { 694 var variable = column.HeaderText; 695 bool isInputTarget = Content.PreProcessingData.InputVariables.Contains(variable) 696 || Content.PreProcessingData.TargetVariable == variable; 697 column.Visible = isInputTarget; 698 } 699 } 700 701 private void checkAllButton_Click(object sender, EventArgs e) { 702 foreach (DataGridViewColumn column in DataGridView.Columns) { 703 column.Visible = true; 704 } 705 } 706 707 private void uncheckAllButton_Click(object sender, EventArgs e) { 708 foreach (DataGridViewColumn column in DataGridView.Columns) { 709 column.Visible = false; 710 } 711 } 694 712 } 695 713 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
r15197 r15242 36 36 [Content(typeof(PreprocessingContext), true)] 37 37 public partial class DataPreprocessingView : NamedItemView { 38 39 public DataPreprocessingView() {40 InitializeComponent();41 }42 43 38 public new PreprocessingContext Content { 44 39 get { return (PreprocessingContext)base.Content; } 45 40 set { base.Content = value; } 41 } 42 43 public DataPreprocessingView() { 44 InitializeComponent(); 46 45 } 47 46 … … 57 56 var viewShortcuts = new ItemList<IViewShortcut> { 58 57 new DataGridContent(data, manipulationLogic, filterLogic), 59 new StatisticsContent( statisticsLogic),58 new StatisticsContent(data, statisticsLogic), 60 59 61 60 new LineChartContent(data), 62 61 new HistogramContent(data), 63 new ScatterPlotContent(data), 62 new SingleScatterPlotContent(data), 63 new MultiScatterPlotContent(data), 64 64 new CorrelationMatrixContent(Content), 65 65 new DataCompletenessChartContent(searchLogic), … … 125 125 } 126 126 private void newRegressionToolStripMenuItem_Click(object sender, EventArgs e) { 127 Content.Import(new RegressionProblemData()); 127 if (CheckNew("Regression")) 128 Content.Import(new RegressionProblemData()); 128 129 } 129 130 private void newClassificationToolStripMenuItem_Click(object sender, EventArgs e) { 130 Content.Import(new ClassificationProblemData()); 131 if (CheckNew("Classification")) 132 Content.Import(new ClassificationProblemData()); 131 133 } 132 134 private void newTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) { 133 Content.Import(new TimeSeriesPrognosisProblemData()); 135 if (CheckNew("Time Series Prognosis")) 136 Content.Import(new TimeSeriesPrognosisProblemData()); 137 } 138 139 private bool CheckNew(string type) { 140 return DialogResult.OK == MessageBox.Show( 141 this, 142 string.Format("When creating a new {0}, all previous information will be lost.", type), 143 "Continue?", 144 MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); 134 145 } 135 146 #endregion -
stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessorStarter.cs
r14186 r15242 29 29 namespace HeuristicLab.DataPreprocessing.Views { 30 30 public class DataPreprocessorStarter : IDataPreprocessorStarter { 31 32 31 public void Start(IDataAnalysisProblemData problemData, IContentView currentView) { 33 32 IAlgorithm algorithm; -
stable/HeuristicLab.DataPreprocessing.Views/3.4/FilterView.Designer.cs
r14186 r15242 62 62 this.label2 = new System.Windows.Forms.Label(); 63 63 this.label3 = new System.Windows.Forms.Label(); 64 this.bottomPanel = new System.Windows.Forms.Panel(); 64 65 this.groupBoxFilter.SuspendLayout(); 65 66 this.groupBoxFilterInfo.SuspendLayout(); 66 67 this.groupBox1.SuspendLayout(); 68 this.bottomPanel.SuspendLayout(); 67 69 this.SuspendLayout(); 68 70 // 69 71 // groupBoxFilter 70 72 // 71 this.groupBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 73 this.groupBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 72 74 | System.Windows.Forms.AnchorStyles.Right))); 73 75 this.groupBoxFilter.Controls.Add(this.checkedFilterView); … … 93 95 // groupBoxFilterInfo 94 96 // 95 this.groupBoxFilterInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 97 this.groupBoxFilterInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 96 98 | System.Windows.Forms.AnchorStyles.Right))); 97 99 this.groupBoxFilterInfo.Controls.Add(this.lblPercentage); … … 103 105 this.groupBoxFilterInfo.Location = new System.Drawing.Point(4, 337); 104 106 this.groupBoxFilterInfo.Name = "groupBoxFilterInfo"; 105 this.groupBoxFilterInfo.Size = new System.Drawing.Size(65 9, 102);107 this.groupBoxFilterInfo.Size = new System.Drawing.Size(658, 102); 106 108 this.groupBoxFilterInfo.TabIndex = 1; 107 109 this.groupBoxFilterInfo.TabStop = false; … … 119 121 // tbPercentage 120 122 // 121 this.tbPercentage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 123 this.tbPercentage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 122 124 | System.Windows.Forms.AnchorStyles.Right))); 123 125 this.tbPercentage.Enabled = false; 124 126 this.tbPercentage.Location = new System.Drawing.Point(104, 71); 125 127 this.tbPercentage.Name = "tbPercentage"; 126 this.tbPercentage.Size = new System.Drawing.Size(54 9, 20);128 this.tbPercentage.Size = new System.Drawing.Size(548, 20); 127 129 this.tbPercentage.TabIndex = 10; 128 130 // 129 // tb Filtered130 // 131 this.tbRemaining.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 131 // tbRemaining 132 // 133 this.tbRemaining.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 132 134 | System.Windows.Forms.AnchorStyles.Right))); 133 135 this.tbRemaining.Enabled = false; 134 136 this.tbRemaining.Location = new System.Drawing.Point(104, 45); 135 137 this.tbRemaining.Name = "tbRemaining"; 136 this.tbRemaining.Size = new System.Drawing.Size(54 9, 20);138 this.tbRemaining.Size = new System.Drawing.Size(548, 20); 137 139 this.tbRemaining.TabIndex = 9; 138 140 // 139 // lbl Filtered141 // lblRemaining 140 142 // 141 143 this.lblRemaining.AutoSize = true; … … 148 150 // tbTotal 149 151 // 150 this.tbTotal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 152 this.tbTotal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 151 153 | System.Windows.Forms.AnchorStyles.Right))); 152 154 this.tbTotal.Enabled = false; 153 155 this.tbTotal.Location = new System.Drawing.Point(104, 19); 154 156 this.tbTotal.Name = "tbTotal"; 155 this.tbTotal.Size = new System.Drawing.Size(54 9, 20);157 this.tbTotal.Size = new System.Drawing.Size(548, 20); 156 158 this.tbTotal.TabIndex = 7; 157 159 // … … 167 169 // applyFilterButton 168 170 // 169 this.applyFilterButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));171 this.applyFilterButton.Anchor = System.Windows.Forms.AnchorStyles.Right; 170 172 this.applyFilterButton.Cursor = System.Windows.Forms.Cursors.Default; 171 173 this.applyFilterButton.Enabled = false; 172 this.applyFilterButton.Location = new System.Drawing.Point(55 4, 628);174 this.applyFilterButton.Location = new System.Drawing.Point(559, 3); 173 175 this.applyFilterButton.Name = "applyFilterButton"; 174 176 this.applyFilterButton.Size = new System.Drawing.Size(107, 23); … … 180 182 // rBtnOr 181 183 // 182 this.rBtnOr.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));184 this.rBtnOr.Anchor = System.Windows.Forms.AnchorStyles.Left; 183 185 this.rBtnOr.AutoSize = true; 184 186 this.rBtnOr.Cursor = System.Windows.Forms.Cursors.Default; 185 187 this.rBtnOr.Enabled = false; 186 this.rBtnOr.Location = new System.Drawing.Point( 60, 634);188 this.rBtnOr.Location = new System.Drawing.Point(53, 6); 187 189 this.rBtnOr.Name = "rBtnOr"; 188 190 this.rBtnOr.Size = new System.Drawing.Size(36, 17); … … 193 195 // rBtnAnd 194 196 // 195 this.rBtnAnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));197 this.rBtnAnd.Anchor = System.Windows.Forms.AnchorStyles.Left; 196 198 this.rBtnAnd.AutoSize = true; 197 199 this.rBtnAnd.Checked = true; 198 200 this.rBtnAnd.Cursor = System.Windows.Forms.Cursors.Default; 199 201 this.rBtnAnd.Enabled = false; 200 this.rBtnAnd.Location = new System.Drawing.Point( 10, 634);202 this.rBtnAnd.Location = new System.Drawing.Point(3, 6); 201 203 this.rBtnAnd.Name = "rBtnAnd"; 202 204 this.rBtnAnd.Size = new System.Drawing.Size(44, 17); … … 209 211 // groupBox1 210 212 // 211 this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 213 this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 212 214 | System.Windows.Forms.AnchorStyles.Right))); 213 215 this.groupBox1.Controls.Add(this.label4); … … 215 217 this.groupBox1.Controls.Add(this.label2); 216 218 this.groupBox1.Controls.Add(this.label3); 217 this.groupBox1.Location = new System.Drawing.Point( 7, 445);219 this.groupBox1.Location = new System.Drawing.Point(4, 445); 218 220 this.groupBox1.Name = "groupBox1"; 219 this.groupBox1.Size = new System.Drawing.Size(65 9, 130);221 this.groupBox1.Size = new System.Drawing.Size(658, 130); 220 222 this.groupBox1.TabIndex = 12; 221 223 this.groupBox1.TabStop = false; … … 261 263 this.label3.Text = "A filter specifies the data rows which should remain."; 262 264 // 265 // bottomPanel 266 // 267 this.bottomPanel.Controls.Add(this.applyFilterButton); 268 this.bottomPanel.Controls.Add(this.rBtnAnd); 269 this.bottomPanel.Controls.Add(this.rBtnOr); 270 this.bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom; 271 this.bottomPanel.Location = new System.Drawing.Point(0, 580); 272 this.bottomPanel.Name = "bottomPanel"; 273 this.bottomPanel.Size = new System.Drawing.Size(670, 30); 274 this.bottomPanel.TabIndex = 13; 275 // 263 276 // FilterView 264 277 // 265 278 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 266 279 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 280 this.Controls.Add(this.bottomPanel); 267 281 this.Controls.Add(this.groupBox1); 268 this.Controls.Add(this.rBtnAnd);269 this.Controls.Add(this.rBtnOr);270 this.Controls.Add(this.applyFilterButton);271 282 this.Controls.Add(this.groupBoxFilterInfo); 272 283 this.Controls.Add(this.groupBoxFilter); 273 284 this.Name = "FilterView"; 274 this.Size = new System.Drawing.Size(670, 6 60);285 this.Size = new System.Drawing.Size(670, 610); 275 286 this.groupBoxFilter.ResumeLayout(false); 276 287 this.groupBoxFilterInfo.ResumeLayout(false); … … 278 289 this.groupBox1.ResumeLayout(false); 279 290 this.groupBox1.PerformLayout(); 291 this.bottomPanel.ResumeLayout(false); 292 this.bottomPanel.PerformLayout(); 280 293 this.ResumeLayout(false); 281 this.PerformLayout();282 294 283 295 } … … 302 314 private System.Windows.Forms.Label label2; 303 315 private System.Windows.Forms.Label label3; 304 305 316 private System.Windows.Forms.Panel bottomPanel; 306 317 } 307 318 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/FilterView.cs
r14186 r15242 32 32 [Content(typeof(FilterContent), true)] 33 33 public partial class FilterView : ItemView { 34 public new FilterContent Content { 35 get { return (FilterContent)base.Content; } 36 set { base.Content = value; } 37 } 34 38 35 39 public FilterView() { … … 45 49 checkedFilterView.Content.ItemsRemoved += Content_ItemsRemoved; 46 50 checkedFilterView.Content.CheckedItemsChanged += Content_CheckedItemsChanged; 47 }48 49 public new FilterContent Content {50 get { return (FilterContent)base.Content; }51 set { base.Content = value; }52 51 } 53 52 … … 122 121 } 123 122 } 124 125 123 } 126 124 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj
r15131 r15242 89 89 <ItemGroup> 90 90 <Reference Include="System" /> 91 <Reference Include="System.Core" />92 <Reference Include="System.Data" />93 91 <Reference Include="System.Drawing" /> 94 92 <Reference Include="System.Windows.Forms" /> 95 93 <Reference Include="System.Windows.Forms.DataVisualization" /> 96 <Reference Include="System.Xml" />97 94 </ItemGroup> 98 95 <ItemGroup> … … 128 125 <DependentUpon>ComparisonFilterView.cs</DependentUpon> 129 126 </Compile> 127 <Compile Include="PreprocessingIcons.Designer.cs"> 128 <AutoGen>True</AutoGen> 129 <DesignTime>True</DesignTime> 130 <DependentUpon>PreprocessingIcons.resx</DependentUpon> 131 </Compile> 130 132 <Compile Include="RenameColumnsDialog.cs"> 131 133 <SubType>Form</SubType> … … 159 161 </Compile> 160 162 <Compile Include="DataPreprocessorStarter.cs" /> 161 <Compile Include="PreprocessingDataTableView.cs">162 <SubType>UserControl</SubType>163 </Compile>164 <Compile Include="PreprocessingDataTableView.Designer.cs">165 <DependentUpon>PreprocessingDataTableView.cs</DependentUpon>166 </Compile>167 163 <Compile Include="FilterView.cs"> 168 164 <SubType>UserControl</SubType> … … 177 173 <DependentUpon>ScatterPlotMultiView.cs</DependentUpon> 178 174 </Compile> 179 <Compile Include="PreprocessingScatterPlotView.cs">180 <SubType>UserControl</SubType>181 </Compile>182 <Compile Include="PreprocessingScatterPlotView.Designer.cs">183 <DependentUpon>PreprocessingScatterPlotView.cs</DependentUpon>184 </Compile>185 175 <Compile Include="SearchAndReplaceDialog.cs"> 186 176 <SubType>Form</SubType> … … 214 204 <DependentUpon>PreprocessingChartView.cs</DependentUpon> 215 205 </Compile> 216 <Compile Include="PreprocessingCheckedItemListView.cs">217 <SubType>UserControl</SubType>218 </Compile>219 <Compile Include="PreprocessingCheckedItemListView.Designer.cs">220 <DependentUpon>PreprocessingCheckedItemListView.cs</DependentUpon>221 </Compile>222 206 <Compile Include="Properties\AssemblyInfo.cs" /> 223 207 <Compile Include="StatisticsView.cs"> … … 235 219 <Compile Include="Utils\FindPreprocessingItemsIterator.cs" /> 236 220 <Compile Include="Utils\IFindPreprocessingItemsIterator.cs" /> 221 <Compile Include="Utils\VerticalLabel.cs"> 222 <SubType>Component</SubType> 223 </Compile> 237 224 <Compile Include="ViewShortcutListView.cs"> 238 225 <SubType>UserControl</SubType> … … 249 236 <ItemGroup> 250 237 <ProjectReference Include="..\..\HeuristicLab.Analysis.Views\3.3\HeuristicLab.Analysis.Views-3.3.csproj"> 251 <Project>{76945 d76-ca61-4147-9dc2-0acdcddf87f9}</Project>238 <Project>{76945D76-CA61-4147-9DC2-0ACDCDDF87F9}</Project> 252 239 <Name>HeuristicLab.Analysis.Views-3.3</Name> 253 240 <Private>False</Private> 254 241 </ProjectReference> 255 242 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 256 <Project>{887425 b4-4348-49ed-a457-b7d2c26ddbf9}</Project>243 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 257 244 <Name>HeuristicLab.Analysis-3.3</Name> 258 245 <Private>False</Private> 259 246 </ProjectReference> 260 247 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 261 <Project>{958 b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project>248 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> 262 249 <Name>HeuristicLab.Collections-3.3</Name> 263 250 <Private>False</Private> … … 269 256 </ProjectReference> 270 257 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 271 <Project>{ a9ad58b9-3ef9-4cc1-97e5-8d909039ff5c}</Project>258 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> 272 259 <Name>HeuristicLab.Common-3.3</Name> 273 260 <Private>False</Private> 274 261 </ProjectReference> 275 262 <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj"> 276 <Project>{ e226881d-315f-423d-b419-a766fe0d8685}</Project>263 <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project> 277 264 <Name>HeuristicLab.Core.Views-3.3</Name> 278 265 <Private>False</Private> 279 266 </ProjectReference> 280 267 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 281 <Project>{ c36bd924-a541-4a00-afa8-41701378ddc5}</Project>268 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project> 282 269 <Name>HeuristicLab.Core-3.3</Name> 283 270 <Private>False</Private> … … 289 276 </ProjectReference> 290 277 <ProjectReference Include="..\..\HeuristicLab.DataPreprocessing\3.4\HeuristicLab.DataPreprocessing-3.4.csproj"> 291 <Project>{3 b90f866-70f8-43ef-a541-51819d255b7b}</Project>278 <Project>{3B90F866-70F8-43EF-A541-51819D255B7B}</Project> 292 279 <Name>HeuristicLab.DataPreprocessing-3.4</Name> 293 280 <Private>False</Private> 294 281 </ProjectReference> 295 282 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj"> 296 <Project>{ bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project>283 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project> 297 284 <Name>HeuristicLab.Data-3.3</Name> 298 285 <Private>False</Private> … … 304 291 </ProjectReference> 305 292 <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj"> 306 <Project>{3 bd61258-31da-4b09-89c0-4f71fef5f05a}</Project>293 <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project> 307 294 <Name>HeuristicLab.MainForm-3.3</Name> 308 295 <Private>False</Private> 309 296 </ProjectReference> 310 297 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 311 <Project>{14 ab8d24-25bc-400c-a846-4627aa945192}</Project>298 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 312 299 <Name>HeuristicLab.Optimization-3.3</Name> 313 300 <Private>False</Private> … … 319 306 </ProjectReference> 320 307 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 321 <Project>{94186 a6a-5176-4402-ae83-886557b53cca}</Project>308 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 322 309 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 323 310 <Private>False</Private> 324 311 </ProjectReference> 325 312 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Views\3.4\HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj"> 326 <Project>{3 e9e8944-44ff-40bb-a622-3a4a7dd0f198}</Project>313 <Project>{3E9E8944-44FF-40BB-A622-3A4A7DD0F198}</Project> 327 314 <Name>HeuristicLab.Problems.DataAnalysis.Views-3.4</Name> 328 315 <Private>False</Private> 329 316 </ProjectReference> 330 317 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj"> 331 <Project>{ df87c13e-a889-46ff-8153-66dcaa8c5674}</Project>318 <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project> 332 319 <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name> 333 320 <Private>False</Private> … … 353 340 <Private>False</Private> 354 341 </ProjectReference> 342 </ItemGroup> 343 <ItemGroup> 344 <EmbeddedResource Include="PreprocessingIcons.resx"> 345 <Generator>ResXFileCodeGenerator</Generator> 346 <LastGenOutput>PreprocessingIcons.Designer.cs</LastGenOutput> 347 </EmbeddedResource> 348 <EmbeddedResource Include="ScatterPlotSingleView.resx"> 349 <DependentUpon>ScatterPlotSingleView.cs</DependentUpon> 350 </EmbeddedResource> 351 </ItemGroup> 352 <ItemGroup> 353 <Content Include="Icons\All.png" /> 354 <Content Include="Icons\Inputs.png" /> 355 <Content Include="Icons\None.png" /> 355 356 </ItemGroup> 356 357 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
stable/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.Designer.cs
r14796 r15242 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.optionsBox = new System.Windows.Forms.GroupBox(); 48 this.displayDetailsCheckBox = new System.Windows.Forms.CheckBox(); 49 this.label1 = new System.Windows.Forms.Label(); 50 this.classifierComboBox = new System.Windows.Forms.ComboBox(); 49 this.groupingTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 50 this.variableLabel = new System.Windows.Forms.Label(); 51 this.orderLabel = new System.Windows.Forms.Label(); 52 this.aggregationLabel = new System.Windows.Forms.Label(); 53 this.orderComboBox = new System.Windows.Forms.ComboBox(); 54 this.groupingComboBox = new System.Windows.Forms.ComboBox(); 55 this.aggregationComboBox = new System.Windows.Forms.ComboBox(); 56 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 51 57 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 52 58 this.splitContainer.Panel1.SuspendLayout(); 53 59 this.splitContainer.SuspendLayout(); 54 60 this.optionsBox.SuspendLayout(); 61 this.groupingTableLayoutPanel.SuspendLayout(); 55 62 this.SuspendLayout(); 56 63 // 64 // sizeGroupBox 65 // 66 this.sizeGroupBox.Location = new System.Drawing.Point(0, 258); 67 // 57 68 // splitContainer 58 69 // … … 64 75 // optionsBox 65 76 // 66 this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 67 | System.Windows.Forms.AnchorStyles.Right))); 68 this.optionsBox.Controls.Add(this.displayDetailsCheckBox); 69 this.optionsBox.Controls.Add(this.label1); 70 this.optionsBox.Controls.Add(this.classifierComboBox); 71 this.optionsBox.Location = new System.Drawing.Point(4, 262); 77 this.optionsBox.Controls.Add(this.groupingTableLayoutPanel); 78 this.optionsBox.Dock = System.Windows.Forms.DockStyle.Bottom; 79 this.optionsBox.Location = new System.Drawing.Point(0, 302); 72 80 this.optionsBox.Name = "optionsBox"; 73 this.optionsBox.Size = new System.Drawing.Size( 84, 138);81 this.optionsBox.Size = new System.Drawing.Size(180, 101); 74 82 this.optionsBox.TabIndex = 7; 75 83 this.optionsBox.TabStop = false; 76 this.optionsBox.Text = "Options"; 77 // 78 // displayDetailsCheckBox 79 // 80 this.displayDetailsCheckBox.AutoSize = true; 81 this.displayDetailsCheckBox.Location = new System.Drawing.Point(5, 58); 82 this.displayDetailsCheckBox.Margin = new System.Windows.Forms.Padding(2); 83 this.displayDetailsCheckBox.Name = "displayDetailsCheckBox"; 84 this.displayDetailsCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; 85 this.displayDetailsCheckBox.Size = new System.Drawing.Size(119, 17); 86 this.displayDetailsCheckBox.TabIndex = 3; 87 this.displayDetailsCheckBox.Text = "Display value count"; 88 this.displayDetailsCheckBox.UseVisualStyleBackColor = true; 89 this.displayDetailsCheckBox.CheckedChanged += new System.EventHandler(this.displayDetailsCheckBox_CheckedChanged); 90 // 91 // label1 92 // 93 this.label1.AutoSize = true; 94 this.label1.Location = new System.Drawing.Point(3, 15); 95 this.label1.Name = "label1"; 96 this.label1.Size = new System.Drawing.Size(81, 13); 97 this.label1.TabIndex = 2; 98 this.label1.Text = "Target variable:"; 99 // 100 // classifierComboBox 101 // 102 this.classifierComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 103 | System.Windows.Forms.AnchorStyles.Right))); 104 this.classifierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 105 this.classifierComboBox.FormattingEnabled = true; 106 this.classifierComboBox.Location = new System.Drawing.Point(5, 32); 107 this.classifierComboBox.Name = "classifierComboBox"; 108 this.classifierComboBox.Size = new System.Drawing.Size(73, 21); 109 this.classifierComboBox.TabIndex = 1; 110 this.classifierComboBox.SelectedIndexChanged += new System.EventHandler(this.classifierComboBox_SelectedIndexChanged); 84 this.optionsBox.Text = "Grouping Options"; 85 // 86 // groupingTableLayoutPanel 87 // 88 this.groupingTableLayoutPanel.ColumnCount = 2; 89 this.groupingTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); 90 this.groupingTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 91 this.groupingTableLayoutPanel.Controls.Add(this.variableLabel, 0, 0); 92 this.groupingTableLayoutPanel.Controls.Add(this.orderLabel, 0, 2); 93 this.groupingTableLayoutPanel.Controls.Add(this.aggregationLabel, 0, 1); 94 this.groupingTableLayoutPanel.Controls.Add(this.orderComboBox, 1, 2); 95 this.groupingTableLayoutPanel.Controls.Add(this.groupingComboBox, 1, 0); 96 this.groupingTableLayoutPanel.Controls.Add(this.aggregationComboBox, 1, 1); 97 this.groupingTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; 98 this.groupingTableLayoutPanel.Location = new System.Drawing.Point(3, 16); 99 this.groupingTableLayoutPanel.Name = "groupingTableLayoutPanel"; 100 this.groupingTableLayoutPanel.RowCount = 3; 101 this.groupingTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); 102 this.groupingTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); 103 this.groupingTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); 104 this.groupingTableLayoutPanel.Size = new System.Drawing.Size(174, 82); 105 this.groupingTableLayoutPanel.TabIndex = 3; 106 // 107 // variableLabel 108 // 109 this.variableLabel.AutoSize = true; 110 this.variableLabel.Dock = System.Windows.Forms.DockStyle.Fill; 111 this.variableLabel.Location = new System.Drawing.Point(3, 0); 112 this.variableLabel.Name = "variableLabel"; 113 this.variableLabel.Size = new System.Drawing.Size(48, 27); 114 this.variableLabel.TabIndex = 2; 115 this.variableLabel.Text = "Variable:"; 116 this.variableLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 117 // 118 // orderLabel 119 // 120 this.orderLabel.AutoSize = true; 121 this.orderLabel.Dock = System.Windows.Forms.DockStyle.Fill; 122 this.orderLabel.Location = new System.Drawing.Point(3, 54); 123 this.orderLabel.Name = "orderLabel"; 124 this.orderLabel.Size = new System.Drawing.Size(48, 28); 125 this.orderLabel.TabIndex = 2; 126 this.orderLabel.Text = "Order:"; 127 this.orderLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 128 this.toolTip.SetToolTip(this.orderLabel, "Order of Legend Entries"); 129 // 130 // aggregationLabel 131 // 132 this.aggregationLabel.AutoSize = true; 133 this.aggregationLabel.Dock = System.Windows.Forms.DockStyle.Fill; 134 this.aggregationLabel.Location = new System.Drawing.Point(3, 27); 135 this.aggregationLabel.Name = "aggregationLabel"; 136 this.aggregationLabel.Size = new System.Drawing.Size(48, 27); 137 this.aggregationLabel.TabIndex = 2; 138 this.aggregationLabel.Text = "Aggr.:"; 139 this.aggregationLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 140 this.toolTip.SetToolTip(this.aggregationLabel, "Aggregation"); 141 // 142 // orderComboBox 143 // 144 this.orderComboBox.Dock = System.Windows.Forms.DockStyle.Fill; 145 this.orderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 146 this.orderComboBox.FormattingEnabled = true; 147 this.orderComboBox.Location = new System.Drawing.Point(57, 57); 148 this.orderComboBox.Name = "orderComboBox"; 149 this.orderComboBox.Size = new System.Drawing.Size(114, 21); 150 this.orderComboBox.TabIndex = 1; 151 this.orderComboBox.SelectedIndexChanged += new System.EventHandler(this.orderComboBox_SelectedIndexChanged); 152 // 153 // groupingComboBox 154 // 155 this.groupingComboBox.Dock = System.Windows.Forms.DockStyle.Fill; 156 this.groupingComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 157 this.groupingComboBox.FormattingEnabled = true; 158 this.groupingComboBox.Location = new System.Drawing.Point(57, 3); 159 this.groupingComboBox.Name = "groupingComboBox"; 160 this.groupingComboBox.Size = new System.Drawing.Size(114, 21); 161 this.groupingComboBox.TabIndex = 1; 162 this.groupingComboBox.SelectedIndexChanged += new System.EventHandler(this.classifierComboBox_SelectedIndexChanged); 163 // 164 // aggregationComboBox 165 // 166 this.aggregationComboBox.Dock = System.Windows.Forms.DockStyle.Fill; 167 this.aggregationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 168 this.aggregationComboBox.FormattingEnabled = true; 169 this.aggregationComboBox.Location = new System.Drawing.Point(57, 30); 170 this.aggregationComboBox.Name = "aggregationComboBox"; 171 this.aggregationComboBox.Size = new System.Drawing.Size(114, 21); 172 this.aggregationComboBox.TabIndex = 1; 173 this.aggregationComboBox.SelectedIndexChanged += new System.EventHandler(this.aggregationComboBox_SelectedIndexChanged); 111 174 // 112 175 // HistogramView … … 120 183 this.splitContainer.ResumeLayout(false); 121 184 this.optionsBox.ResumeLayout(false); 122 this.optionsBox.PerformLayout(); 185 this.groupingTableLayoutPanel.ResumeLayout(false); 186 this.groupingTableLayoutPanel.PerformLayout(); 123 187 this.ResumeLayout(false); 124 188 … … 128 192 129 193 private System.Windows.Forms.GroupBox optionsBox; 130 private System.Windows.Forms.ComboBox classifierComboBox; 131 private System.Windows.Forms.Label label1; 132 private System.Windows.Forms.CheckBox displayDetailsCheckBox; 133 194 private System.Windows.Forms.ComboBox groupingComboBox; 195 private System.Windows.Forms.Label variableLabel; 196 private System.Windows.Forms.Label aggregationLabel; 197 private System.Windows.Forms.ComboBox aggregationComboBox; 198 private System.Windows.Forms.TableLayoutPanel groupingTableLayoutPanel; 199 private System.Windows.Forms.Label orderLabel; 200 private System.Windows.Forms.ComboBox orderComboBox; 201 private System.Windows.Forms.ToolTip toolTip; 134 202 } 135 203 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs
r14186 r15242 21 21 22 22 using System; 23 using System.Drawing; 23 24 using HeuristicLab.Analysis; 24 25 using HeuristicLab.MainForm; 25 26 26 27 namespace HeuristicLab.DataPreprocessing.Views { 27 28 28 [View("Histogram View")] 29 29 [Content(typeof(HistogramContent), true)] 30 30 public partial class HistogramView : PreprocessingChartView { 31 private const string HISTOGRAM_CHART_TITLE = "Histogram";32 33 public HistogramView() {34 InitializeComponent();35 chartType = DataRowVisualProperties.DataRowChartType.Histogram;36 chartTitle = HISTOGRAM_CHART_TITLE;37 }38 39 protected override void OnContentChanged() {40 base.OnContentChanged();41 if (Content != null) {42 classifierComboBox.Items.Clear();43 classifierComboBox.Items.Add("None");44 45 foreach (string var in Content.GetVariableNamesForHistogramClassification()) {46 classifierComboBox.Items.Add(var);47 }48 49 if (classifierComboBox.SelectedItem == null && Content.ClassifierVariableIndex < classifierComboBox.Items.Count) {50 classifierComboBox.SelectedIndex = Content.ClassifierVariableIndex;51 }52 }53 }54 55 31 public new HistogramContent Content { 56 32 get { return (HistogramContent)base.Content; } … … 58 34 } 59 35 60 private void classifierComboBox_SelectedIndexChanged(object sender, EventArgs e) { 61 if (classifierComboBox.SelectedItem == null) 62 return; 36 public HistogramView() { 37 InitializeComponent(); 38 aggregationComboBox.DataSource = Enum.GetValues(typeof(DataTableVisualProperties.DataTableHistogramAggregation)); 39 aggregationComboBox.SelectedItem = DataTableVisualProperties.DataTableHistogramAggregation.Overlapping; 40 orderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder)); 41 orderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Alphabetically; 42 } 63 43 64 if (classifierComboBox.SelectedIndex != 0) { 65 int columndIndex = Content.PreprocessingData.GetColumnIndex(classifierComboBox.SelectedItem.ToString()); 66 Classification = Content.PreprocessingData.GetValues<double>(columndIndex); 67 } else { 68 Classification = null; 69 } 44 protected override void OnContentChanged() { 45 base.OnContentChanged(); 46 groupingComboBox.Items.Clear(); 47 groupingComboBox.Items.Add(string.Empty); 70 48 71 Content.ClassifierVariableIndex = classifierComboBox.SelectedIndex; 72 if (Content.IsDetailedChartViewEnabled != IsDetailedChartViewEnabled) { 73 displayDetailsCheckBox.Checked = Content.IsDetailedChartViewEnabled; 74 } else { 75 GenerateChart(); 49 if (Content != null) { 50 foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData)) { 51 groupingComboBox.Items.Add(var); 52 } 53 54 groupingComboBox.SelectedItem = Content.GroupingVariableName ?? string.Empty; 76 55 } 77 56 } 78 private void displayDetailsCheckBox_CheckedChanged(object sender, EventArgs e) { 79 bool isChecked = displayDetailsCheckBox.Checked; 80 if (IsDetailedChartViewEnabled != isChecked) { 81 IsDetailedChartViewEnabled = isChecked; 82 Content.IsDetailedChartViewEnabled = isChecked; 83 GenerateChart(); 57 58 protected override DataTable CreateDataTable(string variableName) { 59 var aggregation = (DataTableVisualProperties.DataTableHistogramAggregation)aggregationComboBox.SelectedItem; 60 var hist = HistogramContent.CreateHistogram(Content.PreprocessingData, variableName, Content.GroupingVariableName, aggregation, Content.Order); 61 hist.VisualProperties.TitleFont = new Font(DefaultFont.FontFamily, 10, FontStyle.Bold); 62 return hist; 63 } 64 65 private void classifierComboBox_SelectedIndexChanged(object sender, EventArgs e) { 66 Content.GroupingVariableName = groupingComboBox.SelectedItem.ToString(); 67 68 // rebuild datatables 69 InitData(); 70 GenerateLayout(); 71 } 72 73 private void aggregationComboBox_SelectedIndexChanged(object sender, EventArgs e) { 74 foreach (var dt in dataTables.Values) { 75 dt.VisualProperties.HistogramAggregation = (DataTableVisualProperties.DataTableHistogramAggregation)aggregationComboBox.SelectedItem; 84 76 } 77 } 78 79 private void orderComboBox_SelectedIndexChanged(object sender, EventArgs e) { 80 if (Content == null) return; 81 82 Content.Order = (PreprocessingChartContent.LegendOrder)orderComboBox.SelectedItem; 83 84 // rebuild datatables 85 InitData(); 86 GenerateLayout(); 85 87 } 86 88 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.Designer.cs
r14796 r15242 62 62 // optionsBox 63 63 // 64 this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)65 | System.Windows.Forms.AnchorStyles.Right)));66 64 this.optionsBox.Controls.Add(this.allInOneCheckBox); 67 this.optionsBox.Location = new System.Drawing.Point(4, 262); 65 this.optionsBox.Dock = System.Windows.Forms.DockStyle.Bottom; 66 this.optionsBox.Location = new System.Drawing.Point(0, 357); 68 67 this.optionsBox.Name = "optionsBox"; 69 this.optionsBox.Size = new System.Drawing.Size( 84, 138);68 this.optionsBox.Size = new System.Drawing.Size(180, 46); 70 69 this.optionsBox.TabIndex = 7; 71 70 this.optionsBox.TabStop = false; -
stable/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.cs
r14186 r15242 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 23 25 using HeuristicLab.Analysis; 26 using HeuristicLab.Analysis.Views; 27 using HeuristicLab.Collections; 28 using HeuristicLab.Data; 24 29 using HeuristicLab.MainForm; 30 using HeuristicLab.Visualization.ChartControlsExtensions; 25 31 26 32 namespace HeuristicLab.DataPreprocessing.Views { 27 28 33 [View("Line Chart View")] 29 34 [Content(typeof(LineChartContent), true)] 30 35 public partial class LineChartView : PreprocessingChartView { 31 32 private const string LINE_CHART_TITLE = "Line Chart"; 33 34 public LineChartView() { 35 InitializeComponent(); 36 chartType = DataRowVisualProperties.DataRowChartType.Line; 37 chartTitle = LINE_CHART_TITLE; 38 } 36 protected Dictionary<string, DataRow> allInOneDataRows; 37 protected DataTable allInOneDataTable; 38 protected DataTableView allInOneDataTableView; 39 39 40 40 public new LineChartContent Content { … … 43 43 } 44 44 45 public LineChartView() { 46 InitializeComponent(); 47 sizeGroupBox.Visible = false; 48 49 allInOneDataRows = new Dictionary<string, DataRow>(); 50 allInOneDataTable = new DataTable(); 51 } 52 53 protected override void InitData() { 54 base.InitData(); 55 56 allInOneDataRows.Clear(); 57 foreach (var x in Content.VariableItemList.Select((v, i) => new { variable = v.Value, i })) { 58 var row = Content.CreateDataRow(x.variable, DataRowVisualProperties.DataRowChartType.Line); 59 row.VisualProperties.Color = Colors[x.i % Colors.Length]; 60 allInOneDataRows.Add(x.variable, row); 61 } 62 63 allInOneDataTable.Rows.Clear(); 64 var rows = Content.VariableItemList.CheckedItems.Select(v => allInOneDataRows[v.Value.Value]); 65 allInOneDataTable.Rows.AddRange(rows); 66 } 67 68 protected override int GetNumberOfVisibleDataTables() { 69 return Content.AllInOneMode ? 1 : base.GetNumberOfVisibleDataTables(); 70 } 71 protected override IEnumerable<DataTableView> GetVisibleDataTables() { 72 if (Content.AllInOneMode) { 73 if (allInOneDataTableView == null) 74 allInOneDataTableView = new DataTableView() { Content = allInOneDataTable, ShowChartOnly = true }; 75 return new[] { allInOneDataTableView }; 76 } 77 return base.GetVisibleDataTables(); 78 } 79 protected override DataTable CreateDataTable(string variableName) { 80 var dt = new DataTable(); 81 var row = Content.CreateDataRow(variableName, DataRowVisualProperties.DataRowChartType.Line); 82 dt.Rows.Add(row); 83 84 var validValues = row.Values.Where(x => !double.IsNaN(x) && !double.IsInfinity(x)).ToList(); 85 if (validValues.Any()) { 86 try { 87 double axisMin, axisMax, axisInterval; 88 ChartUtil.CalculateOptimalAxisInterval(validValues.Min(), validValues.Max(), out axisMin, out axisMax, out axisInterval); 89 dt.VisualProperties.YAxisMinimumAuto = false; 90 dt.VisualProperties.YAxisMaximumAuto = false; 91 dt.VisualProperties.YAxisMinimumFixedValue = axisMin; 92 dt.VisualProperties.YAxisMaximumFixedValue = axisMax; 93 } catch (ArgumentOutOfRangeException) { } 94 } 95 return dt; 96 } 97 45 98 private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) { 46 99 Content.AllInOneMode = allInOneCheckBox.Checked; 47 100 48 GenerateChart(); 101 sizeGroupBox.Visible = !allInOneCheckBox.Checked; 102 103 GenerateLayout(); 49 104 } 50 105 … … 55 110 } 56 111 } 112 113 protected override void CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> checkedItems) { 114 base.CheckedItemsChanged(sender, checkedItems); 115 116 foreach (IndexedItem<StringValue> item in checkedItems.Items) { 117 string variableName = item.Value.Value; 118 119 if (IsVariableChecked(variableName)) { 120 // ToDo: avoid clearing all rows, but how? 121 allInOneDataTable.Rows.Clear(); 122 var rows = Content.VariableItemList.CheckedItems.Select(r => allInOneDataRows[r.Value.Value]); 123 allInOneDataTable.Rows.AddRange(rows); 124 } else { 125 allInOneDataTable.Rows.Remove(variableName); 126 } 127 } 128 } 129 130 #region Add/Remove/Update Variable, Reset 131 protected override void AddVariable(string name) { 132 base.AddVariable(name); 133 var row = Content.CreateDataRow(name, DataRowVisualProperties.DataRowChartType.Line); 134 allInOneDataTable.Rows.Add(row); 135 } 136 137 // remove variable from data table and item list 138 protected override void RemoveVariable(string name) { 139 base.RemoveVariable(name); 140 allInOneDataTable.Rows.Remove(name); 141 } 142 143 protected override void UpdateVariable(string name) { 144 base.UpdateVariable(name); 145 allInOneDataTable.Rows.Remove(name); 146 var newRow = Content.CreateDataRow(name, DataRowVisualProperties.DataRowChartType.Line); 147 allInOneDataTable.Rows.Add(newRow); 148 } 149 #endregion 57 150 } 58 151 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ManipulationView.cs
r14186 r15242 31 31 32 32 namespace HeuristicLab.DataPreprocessing.Views { 33 34 33 [View("Manipulation Chart View")] 35 34 [Content(typeof(ManipulationContent), true)] 36 35 public partial class ManipulationView : ItemView { 37 38 36 private Action[] validators; 39 37 private Action[] manipulations; 38 39 public new ManipulationContent Content { 40 get { return (ManipulationContent)base.Content; } 41 set { base.Content = value; } 42 } 40 43 41 44 public ManipulationView() { … … 49 52 tabsPreview.SizeMode = TabSizeMode.Fixed; 50 53 51 validators = new Action[] { 52 () =>validateDeleteColumnsInfo(),53 () =>validateDeleteColumnsVariance(),54 () =>validateDeleteRowsInfo(),55 () =>validateReplaceWith(),56 () =>validateShuffle()54 validators = new Action[] { 55 () => ValidateDeleteColumnsInfo(), 56 () => ValidateDeleteColumnsVariance(), 57 () => ValidateDeleteRowsInfo(), 58 () => ValidateReplaceWith(), 59 () => ValidateShuffle() 57 60 }; 58 61 59 manipulations = new Action[] { 60 () =>Content.ManipulationLogic.DeleteColumnsWithMissingValuesGreater(getDeleteColumnsInfo()),61 () =>Content.ManipulationLogic.DeleteColumnsWithVarianceSmaller(getDeleteColumnsVariance()),62 () =>Content.ManipulationLogic.DeleteRowsWithMissingValuesGreater(getRowsColumnsInfo()),63 () =>replaceMissingValues(),64 () =>Content.ManipulationLogic.Shuffle(shuffleSeparatelyCheckbox.Checked)62 manipulations = new Action[] { 63 () => Content.ManipulationLogic.DeleteColumnsWithMissingValuesGreater(GetDeleteColumnsInfo()), 64 () => Content.ManipulationLogic.DeleteColumnsWithVarianceSmaller(GetDeleteColumnsVariance()), 65 () => Content.ManipulationLogic.DeleteRowsWithMissingValuesGreater(GetRowsColumnsInfo()), 66 () => ReplaceMissingValues(), 67 () => Content.ManipulationLogic.Shuffle(shuffleSeparatelyCheckbox.Checked) 65 68 }; 66 69 } … … 111 114 } 112 115 113 private double getDeleteColumnsInfo() {116 private double GetDeleteColumnsInfo() { 114 117 return double.Parse(txtDeleteColumnsInfo.Text); 115 118 } 116 119 117 private double getDeleteColumnsVariance() {120 private double GetDeleteColumnsVariance() { 118 121 return double.Parse(txtDeleteColumnsVariance.Text); 119 122 } 120 123 121 private double getRowsColumnsInfo() {124 private double GetRowsColumnsInfo() { 122 125 return double.Parse(txtDeleteRowsInfo.Text); 123 126 } 124 127 125 private void replaceMissingValues() {128 private void ReplaceMissingValues() { 126 129 var allIndices = Content.SearchLogic.GetMissingValueIndices(); 127 130 var columnIndex = cmbVariableNames.SelectedIndex; … … 149 152 } 150 153 151 private void validateDeleteColumnsInfo() {152 validateDoubleTextBox(txtDeleteColumnsInfo.Text);154 private void ValidateDeleteColumnsInfo() { 155 ValidateDoubleTextBox(txtDeleteColumnsInfo.Text); 153 156 if (btnApply.Enabled) { 154 var filteredColumns = Content.ManipulationLogic.ColumnsWithMissingValuesGreater( getDeleteColumnsInfo());157 var filteredColumns = Content.ManipulationLogic.ColumnsWithMissingValuesGreater(GetDeleteColumnsInfo()); 155 158 int count = filteredColumns.Count; 156 159 int columnCount = Content.FilterLogic.PreprocessingData.Columns; … … 180 183 } 181 184 182 private void validateDeleteColumnsVariance() {183 validateDoubleTextBox(txtDeleteColumnsVariance.Text);185 private void ValidateDeleteColumnsVariance() { 186 ValidateDoubleTextBox(txtDeleteColumnsVariance.Text); 184 187 if (btnApply.Enabled) { 185 var filteredColumns = Content.ManipulationLogic.ColumnsWithVarianceSmaller( getDeleteColumnsVariance());188 var filteredColumns = Content.ManipulationLogic.ColumnsWithVarianceSmaller(GetDeleteColumnsVariance()); 186 189 int count = filteredColumns.Count; 187 190 int columnCount = Content.FilterLogic.PreprocessingData.Columns; … … 211 214 } 212 215 213 private void validateDeleteRowsInfo() {214 validateDoubleTextBox(txtDeleteRowsInfo.Text);216 private void ValidateDeleteRowsInfo() { 217 ValidateDoubleTextBox(txtDeleteRowsInfo.Text); 215 218 if (btnApply.Enabled) { 216 int count = Content.ManipulationLogic.RowsWithMissingValuesGreater( getRowsColumnsInfo()).Count;219 int count = Content.ManipulationLogic.RowsWithMissingValuesGreater(GetRowsColumnsInfo()).Count; 217 220 int rowCount = Content.FilterLogic.PreprocessingData.Rows; 218 221 lblPreviewRowsInfo.Text = count + " row" + (count > 1 || count == 0 ? "s" : "") + " of " + rowCount + " (" + string.Format("{0:F2}%", 100d / rowCount * count) + ") were detected with more than " + txtDeleteRowsInfo.Text + "% missing values."; … … 227 230 } 228 231 229 private void validateReplaceWith() {232 private void ValidateReplaceWith() { 230 233 btnApply.Enabled = false; 231 234 string replaceWith = (string)cmbReplaceWith.SelectedItem; … … 260 263 } 261 264 262 private void validateShuffle() {265 private void ValidateShuffle() { 263 266 btnApply.Enabled = true; 264 267 lblShuffleProperties.Enabled = false; … … 268 271 } 269 272 270 public new ManipulationContent Content {271 get { return (ManipulationContent)base.Content; }272 set { base.Content = value; }273 }274 275 273 private void lstMethods_SelectedIndexChanged(object sender, System.EventArgs e) { 276 274 int index = lstMethods.SelectedIndex; … … 308 306 } 309 307 310 private void validateDoubleTextBox(String text) {308 private void ValidateDoubleTextBox(String text) { 311 309 btnApply.Enabled = false; 312 310 if (!string.IsNullOrEmpty(text)) { … … 319 317 320 318 private void txtDeleteColumnsInfo_TextChanged(object sender, EventArgs e) { 321 validateDeleteColumnsInfo();319 ValidateDeleteColumnsInfo(); 322 320 } 323 321 324 322 private void txtDeleteColumnsVariance_TextChanged(object sender, EventArgs e) { 325 validateDeleteColumnsVariance();323 ValidateDeleteColumnsVariance(); 326 324 } 327 325 328 326 private void txtDeleteRowsInfo_TextChanged(object sender, EventArgs e) { 329 validateDeleteRowsInfo();327 ValidateDeleteRowsInfo(); 330 328 } 331 329 … … 334 332 lblValueColon.Visible = isReplaceWithValueSelected; 335 333 txtReplaceValue.Visible = isReplaceWithValueSelected; 336 validateReplaceWith();334 ValidateReplaceWith(); 337 335 } 338 336 339 337 private void txtReplaceValue_TextChanged(object sender, EventArgs e) { 340 validateReplaceWith();338 ValidateReplaceWith(); 341 339 } 342 340 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.Designer.cs
r14963 r15242 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.dataTableView = new HeuristicLab.DataPreprocessing.Views.PreprocessingDataTableView();48 47 this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 48 this.sizeGroupBox = new System.Windows.Forms.GroupBox(); 49 this.columnsNumericUpDown = new System.Windows.Forms.NumericUpDown(); 50 this.columnsLabel = new System.Windows.Forms.Label(); 51 this.scrollPanel = new System.Windows.Forms.Panel(); 49 52 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 50 53 this.splitContainer.Panel1.SuspendLayout(); 51 54 this.splitContainer.Panel2.SuspendLayout(); 52 55 this.splitContainer.SuspendLayout(); 53 this.tableLayoutPanel.SuspendLayout(); 56 this.sizeGroupBox.SuspendLayout(); 57 ((System.ComponentModel.ISupportInitialize)(this.columnsNumericUpDown)).BeginInit(); 58 this.scrollPanel.SuspendLayout(); 54 59 this.SuspendLayout(); 55 60 // … … 57 62 // 58 63 // 64 // splitContainer.Panel1 65 // 66 this.splitContainer.Panel1.Controls.Add(this.sizeGroupBox); 67 // 59 68 // splitContainer.Panel2 60 69 // 61 this.splitContainer.Panel2.Controls.Add(this.tableLayoutPanel); 62 // 63 // dataTableView 64 // 65 this.dataTableView.AutoScroll = true; 66 this.dataTableView.Caption = "DataTable View"; 67 this.dataTableView.Classification = null; 68 this.dataTableView.Content = null; 69 this.dataTableView.Dock = System.Windows.Forms.DockStyle.Fill; 70 this.dataTableView.IsDetailedChartViewEnabled = false; 71 this.dataTableView.Location = new System.Drawing.Point(3, 3); 72 this.dataTableView.Name = "dataTableView"; 73 this.dataTableView.ReadOnly = false; 74 this.dataTableView.ShowLegend = true; 75 this.dataTableView.Size = new System.Drawing.Size(553, 397); 76 this.dataTableView.TabIndex = 0; 77 this.dataTableView.XAxisFormat = ""; 78 this.dataTableView.YAxisFormat = ""; 70 this.splitContainer.Panel2.Controls.Add(this.scrollPanel); 71 this.splitContainer.Panel2.Resize += new System.EventHandler(this.splitContainer_Panel2_Resize); 79 72 // 80 73 // tableLayoutPanel 81 74 // 75 this.tableLayoutPanel.AutoSize = true; 76 this.tableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 82 77 this.tableLayoutPanel.ColumnCount = 1; 83 78 this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); 84 79 this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); 85 this.tableLayoutPanel.Controls.Add(this.dataTableView, 0, 0);86 this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;87 80 this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0); 88 81 this.tableLayoutPanel.Name = "tableLayoutPanel"; … … 90 83 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 91 84 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 92 this.tableLayoutPanel.Size = new System.Drawing.Size( 559, 403);85 this.tableLayoutPanel.Size = new System.Drawing.Size(0, 0); 93 86 this.tableLayoutPanel.TabIndex = 0; 94 87 this.tableLayoutPanel.Layout += new System.Windows.Forms.LayoutEventHandler(this.tableLayoutPanel_Layout); 88 // 89 // sizeGroupBox 90 // 91 this.sizeGroupBox.Controls.Add(this.columnsNumericUpDown); 92 this.sizeGroupBox.Controls.Add(this.columnsLabel); 93 this.sizeGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom; 94 this.sizeGroupBox.Location = new System.Drawing.Point(0, 359); 95 this.sizeGroupBox.Name = "sizeGroupBox"; 96 this.sizeGroupBox.Size = new System.Drawing.Size(180, 44); 97 this.sizeGroupBox.TabIndex = 8; 98 this.sizeGroupBox.TabStop = false; 99 this.sizeGroupBox.Text = "Chart Size"; 100 // 101 // columnsNumericUpDown 102 // 103 this.columnsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 104 | System.Windows.Forms.AnchorStyles.Right))); 105 this.columnsNumericUpDown.Location = new System.Drawing.Point(88, 14); 106 this.columnsNumericUpDown.Minimum = new decimal(new int[] { 107 1, 108 0, 109 0, 110 0}); 111 this.columnsNumericUpDown.Name = "columnsNumericUpDown"; 112 this.columnsNumericUpDown.Size = new System.Drawing.Size(86, 20); 113 this.columnsNumericUpDown.TabIndex = 3; 114 this.columnsNumericUpDown.Value = new decimal(new int[] { 115 3, 116 0, 117 0, 118 0}); 119 this.columnsNumericUpDown.ValueChanged += new System.EventHandler(this.columnsNumericUpDown_ValueChanged); 120 // 121 // columnsLabel 122 // 123 this.columnsLabel.AutoSize = true; 124 this.columnsLabel.Location = new System.Drawing.Point(6, 16); 125 this.columnsLabel.Name = "columnsLabel"; 126 this.columnsLabel.Size = new System.Drawing.Size(76, 13); 127 this.columnsLabel.TabIndex = 1; 128 this.columnsLabel.Text = "Max. Columns:"; 129 // 130 // scrollPanel 131 // 132 this.scrollPanel.AutoScroll = true; 133 this.scrollPanel.Controls.Add(this.tableLayoutPanel); 134 this.scrollPanel.Dock = System.Windows.Forms.DockStyle.Fill; 135 this.scrollPanel.Location = new System.Drawing.Point(0, 0); 136 this.scrollPanel.Name = "scrollPanel"; 137 this.scrollPanel.Size = new System.Drawing.Size(470, 403); 138 this.scrollPanel.TabIndex = 1; 95 139 // 96 140 // PreprocessingChartView … … 103 147 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 104 148 this.splitContainer.ResumeLayout(false); 105 this.tableLayoutPanel.ResumeLayout(false); 149 this.sizeGroupBox.ResumeLayout(false); 150 this.sizeGroupBox.PerformLayout(); 151 ((System.ComponentModel.ISupportInitialize)(this.columnsNumericUpDown)).EndInit(); 152 this.scrollPanel.ResumeLayout(false); 153 this.scrollPanel.PerformLayout(); 106 154 this.ResumeLayout(false); 107 155 … … 110 158 #endregion 111 159 112 private DataPreprocessing.Views.PreprocessingDataTableView dataTableView; 113 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; 160 protected System.Windows.Forms.TableLayoutPanel tableLayoutPanel; 161 private System.Windows.Forms.NumericUpDown columnsNumericUpDown; 162 private System.Windows.Forms.Label columnsLabel; 163 private System.Windows.Forms.Panel scrollPanel; 164 protected System.Windows.Forms.GroupBox sizeGroupBox; 114 165 } 115 166 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
r14963 r15242 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing; 24 25 using System.Linq; 25 26 using System.Windows.Forms; 26 27 using HeuristicLab.Analysis; 28 using HeuristicLab.Analysis.Views; 27 29 using HeuristicLab.Collections; 28 30 using HeuristicLab.Data; 29 31 using HeuristicLab.MainForm; 32 using HeuristicLab.MainForm.WindowsForms; 30 33 31 34 namespace HeuristicLab.DataPreprocessing.Views { … … 33 36 [Content(typeof(PreprocessingChartContent), false)] 34 37 public partial class PreprocessingChartView : PreprocessingCheckedVariablesView { 35 36 protected PreprocessingDataTable dataTable; 37 protected List<PreprocessingDataTable> dataTablePerVariable; 38 protected List<DataRow> dataRows; 39 protected List<DataRow> selectedDataRows; 40 41 protected DataRowVisualProperties.DataRowChartType chartType; 42 protected string chartTitle; 43 44 private const string DEFAULT_CHART_TITLE = "Chart"; 45 private const int FIXED_CHART_SIZE = 300; 46 private const int MAX_TABLE_AUTO_SIZE_ROWS = 3; 47 48 49 public IEnumerable<double> Classification { get; set; } 50 public bool IsDetailedChartViewEnabled { get; set; } 38 protected Dictionary<string, DataTable> dataTables; 39 protected Dictionary<string, DataTableView> dataTableViews; 40 41 public static readonly Color[] Colors = { 42 Color.FromArgb(59, 136, 239), Color.FromArgb(252, 177, 59), Color.FromArgb(226, 64, 10), 43 Color.FromArgb(5, 100, 146), Color.FromArgb(191, 191, 191), Color.FromArgb(26, 59, 105), 44 Color.FromArgb(255, 226, 126), Color.FromArgb(18, 156, 221), Color.FromArgb(202, 107, 75), 45 Color.FromArgb(0, 92, 219), Color.FromArgb(243, 210, 136), Color.FromArgb(80, 99, 129), 46 Color.FromArgb(241, 185, 168), Color.FromArgb(224, 131, 10), Color.FromArgb(120, 147, 190) 47 }; 51 48 52 49 public PreprocessingChartView() { 53 50 InitializeComponent(); 54 chartType = DataRowVisualProperties.DataRowChartType.Line; 55 chartTitle = DEFAULT_CHART_TITLE; 51 dataTables = new Dictionary<string, DataTable>(); 52 dataTableViews = new Dictionary<string, DataTableView>(); 53 scrollPanel.HorizontalScroll.Visible = false; 56 54 } 57 55 … … 60 58 if (Content != null) { 61 59 InitData(); 62 GenerateChart(); 63 64 foreach (var row in dataRows) { 65 string variableName = row.Name; 66 if (!IsVariableChecked(variableName)) { 67 dataTableView.SetRowEnabled(variableName, false); 68 dataTable.SelectedRows.Remove(variableName); 69 dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName))); 70 } 71 } 72 } 73 } 74 75 private void InitData() { 76 //Create data tables and data rows 77 dataRows = Content.CreateAllDataRows(chartType); 78 dataTable = new PreprocessingDataTable(chartTitle); 79 dataTablePerVariable = new List<PreprocessingDataTable>(); 80 81 //add data rows to data tables according to checked item list 82 foreach (var row in dataRows) { 83 string variableName = row.Name; 84 85 //add row to data table 86 dataTable.Rows.Add(row); 87 88 //add row to data table per variable 89 PreprocessingDataTable d = new PreprocessingDataTable(variableName); 90 d.Rows.Add(row); 91 dataTablePerVariable.Add(d); 92 } 93 94 UpdateSelection(); 60 GenerateLayout(); 61 } 62 } 63 64 protected virtual int GetNumberOfVisibleDataTables() { 65 return Content.VariableItemList.CheckedItems.Count(); 66 } 67 68 protected virtual IEnumerable<DataTableView> GetVisibleDataTables() { 69 foreach (var name in Content.VariableItemList.CheckedItems) { 70 if (!dataTableViews.ContainsKey(name.Value.Value)) 71 dataTableViews.Add(name.Value.Value, new DataTableView() { Content = dataTables[name.Value.Value], ShowChartOnly = true }); 72 yield return dataTableViews[name.Value.Value]; 73 } 74 } 75 76 protected virtual DataTable CreateDataTable(string variableName) { 77 return null; 78 } 79 80 protected virtual void InitData() { 81 dataTables.Clear(); 82 dataTableViews.Clear(); 83 foreach (var variable in Content.VariableItemList.Select(v => v.Value)) { 84 dataTables.Add(variable, CreateDataTable(variable)); 85 } 95 86 } 96 87 … … 98 89 base.CheckedItemsChanged(sender, checkedItems); 99 90 100 foreach (IndexedItem<StringValue> item in checkedItems.Items) { 101 string variableName = item.Value.Value; 102 103 104 if (!IsVariableChecked(variableName)) { 105 // not checked -> remove 106 dataTableView.SetRowEnabled(variableName, false); 107 dataTable.SelectedRows.Remove(variableName); 108 dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName))); 109 } else { 110 // checked -> add 111 DataRow row = GetDataRow(variableName); 112 DataRow selectedRow = GetSelectedDataRow(variableName); 113 dataTableView.SetRowEnabled(variableName, true); 114 115 PreprocessingDataTable pdt = new PreprocessingDataTable(variableName); 116 pdt.Rows.Add(row); 117 // dataTablePerVariable does not contain unchecked variables => reduce insert position by number of uncheckt variables to correct the index 118 int uncheckedUntilVariable = checkedItemList.Content.TakeWhile(x => x.Value != variableName).Count(x => !checkedItemList.Content.ItemChecked(x)); 119 dataTablePerVariable.Insert(item.Index - uncheckedUntilVariable, pdt); 120 121 //update selection 122 if (selectedRow != null) { 123 dataTable.SelectedRows.Add(selectedRow); 124 pdt.SelectedRows.Add(selectedRow); 125 } 126 } 127 } 128 129 // update chart if not in all in one mode 130 if (Content != null && !Content.AllInOneMode) 131 GenerateChart(); 132 } 133 134 private DataRow GetSelectedDataRow(string variableName) { 135 foreach (DataRow row in selectedDataRows) { 136 if (row.Name == variableName) 137 return row; 138 } 139 return null; 140 } 141 private DataRow GetDataRow(string variableName) { 142 foreach (DataRow row in dataRows) { 143 if (row.Name == variableName) 144 return row; 145 } 146 return null; 147 } 91 GenerateLayout(); 92 } 93 148 94 149 95 #region Add/Remove/Update Variable, Reset 150 96 protected override void AddVariable(string name) { 151 97 base.AddVariable(name); 152 DataRow row = Content.CreateDataRow(name, chartType); 153 dataTable.Rows.Add(row); 154 PreprocessingDataTable d = new PreprocessingDataTable(name); 155 d.Rows.Add(row); 156 dataTablePerVariable.Add(d); 157 158 if (!Content.AllInOneMode) 159 GenerateChart(); 98 dataTables.Add(name, CreateDataTable(name)); 99 100 GenerateLayout(); 160 101 } 161 102 … … 163 104 protected override void RemoveVariable(string name) { 164 105 base.RemoveVariable(name); 165 dataTable.Rows.Remove(name); 166 dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == name))); 167 168 if (!Content.AllInOneMode) 169 GenerateChart(); 106 dataTables.Remove(name); 107 dataTableViews.Remove(name); 108 109 GenerateLayout(); 170 110 } 171 111 172 112 protected override void UpdateVariable(string name) { 173 113 base.UpdateVariable(name); 174 DataRow newRow = Content.CreateDataRow(name, chartType); 175 dataTable.Rows.Remove(name); 176 dataTable.Rows.Add(newRow); 177 DataTable dt = dataTablePerVariable.Find(x => x.Rows.Find(y => y.Name == name) != null); 178 if (dt != null) { 179 dt.Rows.Remove(name); 180 dt.Rows.Add(newRow); 181 } 114 dataTables.Remove(name); 115 var newDataTable = CreateDataTable(name); 116 dataTables.Add(name, newDataTable); 117 dataTableViews[name].Content = newDataTable; 118 GenerateLayout(); 182 119 } 183 120 protected override void ResetAllVariables() { … … 186 123 #endregion 187 124 188 #region Generate Charts 189 protected void GenerateChart() { 125 protected override void CheckedChangedUpdate() { 126 GenerateLayout(); 127 } 128 129 #region Generate Layout 130 protected void GenerateLayout() { 131 if (SuppressCheckedChangedUpdate) 132 return; 133 134 scrollPanel.SuspendRepaint(); 135 190 136 ClearTableLayout(); 191 if (Content.AllInOneMode) { 192 GenerateSingleChartLayout(); 193 } else 194 GenerateMultiChartLayout(); 195 } 196 197 private void GenerateSingleChartLayout() { 198 tableLayoutPanel.ColumnCount = 1; 199 tableLayoutPanel.RowCount = 1; 200 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); 201 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); 202 tableLayoutPanel.Controls.Add(dataTableView, 0, 0); 203 dataTableView.Content = dataTable; 204 } 205 206 private void GenerateMultiChartLayout() { 207 int checkedItemsCnt = 0; 208 foreach (var item in Content.VariableItemList.CheckedItems) 209 checkedItemsCnt++; 210 211 // set columns and rows based on number of items 212 int columns = GetNrOfMultiChartColumns(checkedItemsCnt); 213 int rows = GetNrOfMultiChartRows(checkedItemsCnt, columns); 214 215 tableLayoutPanel.ColumnCount = columns; 216 tableLayoutPanel.RowCount = rows; 217 218 List<PreprocessingDataTable>.Enumerator enumerator = dataTablePerVariable.GetEnumerator(); 219 for (int x = 0; x < columns; x++) { 220 221 if (rows <= MAX_TABLE_AUTO_SIZE_ROWS) 222 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100 / columns)); 223 else 224 //scrollbar is shown if there are more than 3 rows -> remove scroll bar width from total width 225 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, (tableLayoutPanel.Width - System.Windows.Forms.SystemInformation.VerticalScrollBarWidth) / columns)); 226 for (int y = 0; y < rows; y++) { 227 //Add a row only when creating the first column 228 if (x == 0) { 229 // fixed chart size when there are more than 3 tables 230 if (rows > MAX_TABLE_AUTO_SIZE_ROWS) 231 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, FIXED_CHART_SIZE)); 232 else 233 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100 / rows)); 137 138 int nrCharts = GetNumberOfVisibleDataTables(); 139 140 // Set columns and rows based on number of items 141 int columns = Math.Min(nrCharts, (int)columnsNumericUpDown.Value); 142 int rows = (int)Math.Ceiling((float)nrCharts / columns); 143 144 tableLayoutPanel.ColumnCount = Math.Max(columns, 0); 145 tableLayoutPanel.RowCount = Math.Max(rows, 0); 146 147 if (columns > 0 && rows > 0) { 148 var width = (splitContainer.Panel2.Width - SystemInformation.VerticalScrollBarWidth) / columns; 149 var height = width * 0.75f; 150 151 using (var enumerator = GetVisibleDataTables().GetEnumerator()) { 152 for (int row = 0; row < rows; row++) { 153 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, height)); 154 for (int col = 0; col < columns; col++) { 155 if (row == 0) { 156 // Add a column-style only when creating the first row 157 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, width)); 158 } 159 160 if (enumerator.MoveNext()) 161 AddDataTableToTableLayout(enumerator.Current, row, col); 162 163 } 234 164 } 235 236 enumerator.MoveNext();237 PreprocessingDataTable d = enumerator.Current;238 AddDataTableToTableLayout(d, x, y);239 240 165 } 241 } 242 } 243 private int GetNrOfMultiChartColumns(int itemCount) { 244 int columns = 0; 245 if (itemCount <= 2) 246 columns = 1; 247 else if (itemCount <= 6) 248 columns = 2; 249 else 250 columns = 3; 251 return columns; 252 } 253 private int GetNrOfMultiChartRows(int itemCount, int columns) { 254 int rows = 0; 255 if (columns == 3) 256 rows = (itemCount + 2) / columns; 257 else if (columns == 2) 258 rows = (itemCount + 1) / columns; 259 else 260 rows = itemCount / columns; 261 return rows; 262 } 263 264 private void AddDataTableToTableLayout(PreprocessingDataTable dataTable, int x, int y) { 265 PreprocessingDataTableView dataView = new PreprocessingDataTableView(); 266 dataView.Classification = Classification; 267 dataView.IsDetailedChartViewEnabled = IsDetailedChartViewEnabled; 268 166 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 0)); 167 } 168 169 scrollPanel.ResumeRepaint(true); 170 } 171 172 private void AddDataTableToTableLayout(DataTableView dataTable, int row, int col) { 269 173 if (dataTable == null) { 270 174 // dummy panel for empty field 271 Panel p = new Panel(); 272 p.Dock = DockStyle.Fill; 273 tableLayoutPanel.Controls.Add(p, y, x); 175 Panel p = new Panel { Dock = DockStyle.Fill }; 176 tableLayoutPanel.Controls.Add(p, col, row); 274 177 } else { 275 dataView.Content = dataTable; 276 dataView.Dock = DockStyle.Fill; 277 tableLayoutPanel.Controls.Add(dataView, y, x); 178 dataTable.Dock = DockStyle.Fill; 179 tableLayoutPanel.Controls.Add(dataTable, col, row); 278 180 } 279 181 } … … 286 188 tableLayoutPanel.ColumnStyles.Clear(); 287 189 tableLayoutPanel.RowStyles.Clear(); 288 tableLayoutPanel.AutoScroll = false;289 tableLayoutPanel.AutoScroll = true;290 190 } 291 191 //Remove horizontal scroll bar if visible … … 293 193 if (tableLayoutPanel.HorizontalScroll.Visible) { 294 194 // Add padding on the right in order to accomodate the vertical scrollbar 295 int vWidth = SystemInformation.VerticalScrollBarWidth; 296 tableLayoutPanel.Padding = new Padding(0, 0, vWidth, 0); 195 tableLayoutPanel.Padding = new Padding(0, 0, SystemInformation.VerticalScrollBarWidth, 0); 297 196 } else { 298 197 // Reset padding … … 302 201 #endregion 303 202 304 #region Update Selection305 protected override void PreprocessingData_SelctionChanged(object sender, EventArgs e) {306 base.PreprocessingData_SelctionChanged(sender, e);307 UpdateSelection(); 308 }309 310 private void UpdateSelection() {311 //update data table selection 312 s electedDataRows = Content.CreateAllSelectedDataRows(chartType);313 dataTable.SelectedRows.Clear(); 314 foreach (var selectedRow in selectedDataRows) {315 if (IsVariableChecked(selectedRow.Name))316 dataTable.SelectedRows.Add(selectedRow);317 } 318 319 //update data table per variable selection320 foreach (PreprocessingDataTable d in dataTablePerVariable) {321 d.SelectedRows.Clear();322 DataRow row = selectedDataRows.Find(x => x.Name == d.Name);323 if (row != null)324 d.SelectedRows.Add(row);325 } 326 }327 #endregion203 private void columnsNumericUpDown_ValueChanged(object sender, System.EventArgs e) { 204 GenerateLayout(); 205 } 206 207 private void splitContainer_Panel2_Resize(object sender, EventArgs e) { 208 if (SuppressCheckedChangedUpdate) 209 return; 210 211 scrollPanel.SuspendRepaint(); 212 213 if (tableLayoutPanel.ColumnCount > 0 && tableLayoutPanel.RowCount > 0) { 214 var width = (splitContainer.Panel2.Width - SystemInformation.VerticalScrollBarWidth) / tableLayoutPanel.ColumnCount; 215 var height = width * 0.75f; 216 217 for (int i = 0; i < tableLayoutPanel.RowStyles.Count - 1; i++) { 218 tableLayoutPanel.RowStyles[i].Height = height; 219 } 220 for (int i = 0; i < tableLayoutPanel.ColumnStyles.Count; i++) { 221 tableLayoutPanel.ColumnStyles[i].Width = width; 222 } 223 } 224 225 scrollPanel.ResumeRepaint(true); 226 } 328 227 } 329 228 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.Designer.cs
r14963 r15242 47 47 this.components = new System.ComponentModel.Container(); 48 48 this.splitContainer = new System.Windows.Forms.SplitContainer(); 49 this.checkedItemList = new HeuristicLab.DataPreprocessing.Views.PreprocessingCheckedItemListView(); 50 this.variablesListcontextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); 51 this.checkInputsTargetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 52 this.checkOnlyInputsTargetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 53 this.checkAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 54 this.uncheckAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 49 this.variablesGroupBox = new System.Windows.Forms.GroupBox(); 50 this.variablesListView = new System.Windows.Forms.ListView(); 51 this.columnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 52 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 53 this.uncheckAllButton = new System.Windows.Forms.Button(); 54 this.checkAllButton = new System.Windows.Forms.Button(); 55 this.checkInputsTargetButton = new System.Windows.Forms.Button(); 55 56 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 56 57 this.splitContainer.Panel1.SuspendLayout(); 57 58 this.splitContainer.SuspendLayout(); 58 this.variables ListcontextMenuStrip.SuspendLayout();59 this.variablesGroupBox.SuspendLayout(); 59 60 this.SuspendLayout(); 60 61 // … … 62 63 // 63 64 this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; 65 this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; 64 66 this.splitContainer.Location = new System.Drawing.Point(0, 0); 65 67 this.splitContainer.Name = "splitContainer"; … … 67 69 // splitContainer.Panel1 68 70 // 69 this.splitContainer.Panel1.Controls.Add(this. checkedItemList);70 this.splitContainer.Size = new System.Drawing.Size( 654, 403);71 this.splitContainer.SplitterDistance = 91;71 this.splitContainer.Panel1.Controls.Add(this.variablesGroupBox); 72 this.splitContainer.Size = new System.Drawing.Size(940, 698); 73 this.splitContainer.SplitterDistance = 180; 72 74 this.splitContainer.TabIndex = 7; 73 75 // 74 // checkedItemList76 // variablesGroupBox 75 77 // 76 this.checkedItemList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 77 | System.Windows.Forms.AnchorStyles.Left) 78 this.variablesGroupBox.Controls.Add(this.uncheckAllButton); 79 this.variablesGroupBox.Controls.Add(this.checkAllButton); 80 this.variablesGroupBox.Controls.Add(this.checkInputsTargetButton); 81 this.variablesGroupBox.Controls.Add(this.variablesListView); 82 this.variablesGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 83 this.variablesGroupBox.Location = new System.Drawing.Point(0, 0); 84 this.variablesGroupBox.Name = "variablesGroupBox"; 85 this.variablesGroupBox.Size = new System.Drawing.Size(180, 698); 86 this.variablesGroupBox.TabIndex = 7; 87 this.variablesGroupBox.TabStop = false; 88 this.variablesGroupBox.Text = "Variables"; 89 // 90 // variablesListView 91 // 92 this.variablesListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 93 | System.Windows.Forms.AnchorStyles.Left) 78 94 | System.Windows.Forms.AnchorStyles.Right))); 79 this.checkedItemList.Caption = "View"; 80 this.checkedItemList.Content = null; 81 this.checkedItemList.ContextMenuStrip = this.variablesListcontextMenuStrip; 82 this.checkedItemList.Location = new System.Drawing.Point(4, 4); 83 this.checkedItemList.Name = "checkedItemList"; 84 this.checkedItemList.ReadOnly = false; 85 this.checkedItemList.Size = new System.Drawing.Size(84, 252); 86 this.checkedItemList.TabIndex = 4; 95 this.variablesListView.CheckBoxes = true; 96 this.variablesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 97 this.columnHeader}); 98 this.variablesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; 99 this.variablesListView.HideSelection = false; 100 this.variablesListView.Location = new System.Drawing.Point(6, 49); 101 this.variablesListView.Name = "variablesListView"; 102 this.variablesListView.Size = new System.Drawing.Size(168, 643); 103 this.variablesListView.TabIndex = 12; 104 this.variablesListView.UseCompatibleStateImageBehavior = false; 105 this.variablesListView.View = System.Windows.Forms.View.Details; 87 106 // 88 // variablesListcontextMenuStrip107 // columnHeader 89 108 // 90 this.variablesListcontextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 91 this.checkInputsTargetToolStripMenuItem, 92 this.checkOnlyInputsTargetToolStripMenuItem, 93 this.checkAllToolStripMenuItem, 94 this.uncheckAllToolStripMenuItem}); 95 this.variablesListcontextMenuStrip.Name = "variablesListcontextMenuStrip"; 96 this.variablesListcontextMenuStrip.Size = new System.Drawing.Size(211, 92); 97 this.variablesListcontextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.variablesListcontextMenuStrip_Opening); 109 this.columnHeader.Text = ""; 110 this.columnHeader.Width = 164; 98 111 // 99 // checkInputsTargetToolStripMenuItem112 // uncheckAllButton 100 113 // 101 this.checkInputsTargetToolStripMenuItem.Name = "checkInputsTargetToolStripMenuItem"; 102 this.checkInputsTargetToolStripMenuItem.Size = new System.Drawing.Size(210, 22); 103 this.checkInputsTargetToolStripMenuItem.Text = "Check Inputs+Target"; 104 this.checkInputsTargetToolStripMenuItem.Click += new System.EventHandler(this.checkInputsTargetToolStripMenuItem_Click); 114 this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None; 115 this.uncheckAllButton.Location = new System.Drawing.Point(66, 19); 116 this.uncheckAllButton.Name = "uncheckAllButton"; 117 this.uncheckAllButton.Size = new System.Drawing.Size(24, 24); 118 this.uncheckAllButton.TabIndex = 9; 119 this.toolTip.SetToolTip(this.uncheckAllButton, "Show None"); 120 this.uncheckAllButton.UseVisualStyleBackColor = true; 121 this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click); 105 122 // 106 // check OnlyInputsTargetToolStripMenuItem123 // checkAllButton 107 124 // 108 this.checkOnlyInputsTargetToolStripMenuItem.Name = "checkOnlyInputsTargetToolStripMenuItem"; 109 this.checkOnlyInputsTargetToolStripMenuItem.Size = new System.Drawing.Size(210, 22); 110 this.checkOnlyInputsTargetToolStripMenuItem.Text = "Check only Inputs+Target"; 111 this.checkOnlyInputsTargetToolStripMenuItem.Click += new System.EventHandler(this.checkOnlyInputsTargetToolStripMenuItem_Click); 125 this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All; 126 this.checkAllButton.Location = new System.Drawing.Point(6, 19); 127 this.checkAllButton.Name = "checkAllButton"; 128 this.checkAllButton.Size = new System.Drawing.Size(24, 24); 129 this.checkAllButton.TabIndex = 7; 130 this.toolTip.SetToolTip(this.checkAllButton, "Show All"); 131 this.checkAllButton.UseVisualStyleBackColor = true; 132 this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click); 112 133 // 113 // check AllToolStripMenuItem134 // checkInputsTargetButton 114 135 // 115 this.checkAllToolStripMenuItem.Name = "checkAllToolStripMenuItem"; 116 this.checkAllToolStripMenuItem.Size = new System.Drawing.Size(210, 22); 117 this.checkAllToolStripMenuItem.Text = "Check All"; 118 this.checkAllToolStripMenuItem.Click += new System.EventHandler(this.checkAllToolStripMenuItem_Click); 119 // 120 // uncheckAllToolStripMenuItem 121 // 122 this.uncheckAllToolStripMenuItem.Name = "uncheckAllToolStripMenuItem"; 123 this.uncheckAllToolStripMenuItem.Size = new System.Drawing.Size(210, 22); 124 this.uncheckAllToolStripMenuItem.Text = "Uncheck All"; 125 this.uncheckAllToolStripMenuItem.Click += new System.EventHandler(this.uncheckAllToolStripMenuItem_Click); 136 this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs; 137 this.checkInputsTargetButton.Location = new System.Drawing.Point(36, 19); 138 this.checkInputsTargetButton.Name = "checkInputsTargetButton"; 139 this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24); 140 this.checkInputsTargetButton.TabIndex = 8; 141 this.toolTip.SetToolTip(this.checkInputsTargetButton, "Show Inputs & Target"); 142 this.checkInputsTargetButton.UseVisualStyleBackColor = true; 143 this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click); 126 144 // 127 145 // PreprocessingCheckedVariablesView … … 131 149 this.Controls.Add(this.splitContainer); 132 150 this.Name = "PreprocessingCheckedVariablesView"; 133 this.Size = new System.Drawing.Size( 654, 403);151 this.Size = new System.Drawing.Size(940, 698); 134 152 this.splitContainer.Panel1.ResumeLayout(false); 135 153 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 136 154 this.splitContainer.ResumeLayout(false); 137 this.variables ListcontextMenuStrip.ResumeLayout(false);155 this.variablesGroupBox.ResumeLayout(false); 138 156 this.ResumeLayout(false); 139 157 … … 141 159 142 160 #endregion 143 144 protected PreprocessingCheckedItemListView checkedItemList;145 161 protected System.Windows.Forms.SplitContainer splitContainer; 146 private System.Windows.Forms.ContextMenuStrip variablesListcontextMenuStrip; 147 private System.Windows.Forms.ToolStripMenuItem checkInputsTargetToolStripMenuItem; 148 private System.Windows.Forms.ToolStripMenuItem checkAllToolStripMenuItem; 149 private System.Windows.Forms.ToolStripMenuItem uncheckAllToolStripMenuItem; 150 private System.Windows.Forms.ToolStripMenuItem checkOnlyInputsTargetToolStripMenuItem; 162 private System.Windows.Forms.ToolTip toolTip; 163 private System.Windows.Forms.ColumnHeader columnHeader; 164 private System.Windows.Forms.ListView variablesListView; 165 private System.Windows.Forms.GroupBox variablesGroupBox; 166 private System.Windows.Forms.Button checkInputsTargetButton; 167 private System.Windows.Forms.Button uncheckAllButton; 168 private System.Windows.Forms.Button checkAllButton; 151 169 } 152 170 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.cs
r14963 r15242 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 23 using System.Drawing; … … 34 33 [Content(typeof(PreprocessingChartContent), false)] 35 34 public abstract partial class PreprocessingCheckedVariablesView : ItemView { 35 protected bool SuppressCheckedChangedUpdate = false; 36 36 37 37 public new PreprocessingChartContent Content { … … 48 48 } 49 49 protected IList<string> GetCheckedVariables() { 50 return checkedItemList.Content.CheckedItems.Select(i => i.Value.Value).ToList();50 return Content.VariableItemList.CheckedItems.Select(i => i.Value.Value).ToList(); 51 51 } 52 52 … … 55 55 if (Content == null) return; 56 56 57 if (Content.VariableItemList == null) { 58 IList<string> inputs = Content.PreprocessingData.InputVariables; 59 if (Content.PreprocessingData.TargetVariable != null) 60 inputs = inputs.Union(new[] { Content.PreprocessingData.TargetVariable }).ToList(); 61 Content.VariableItemList = Content.CreateVariableItemList(inputs); 62 } else { 63 var checkedNames = Content.VariableItemList.CheckedItems.Select(x => x.Value.Value); 64 Content.VariableItemList = Content.CreateVariableItemList(checkedNames.ToList()); 57 variablesListView.ItemChecked -= variablesListView_ItemChecked; 58 variablesListView.Items.Clear(); 59 foreach (var variable in Content.VariableItemList) { 60 bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable.Value) 61 || Content.PreprocessingData.TargetVariable == variable.Value; 62 variablesListView.Items.Add(new ListViewItem(variable.Value) { 63 Tag = variable, 64 Checked = IsVariableChecked(variable.Value), 65 ForeColor = isInputTarget ? Color.Black : Color.Gray 66 }); 65 67 } 66 Content.VariableItemList.CheckedItemsChanged += CheckedItemsChanged; 67 68 checkedItemList.Content = Content.VariableItemList; 69 var target = Content.PreprocessingData.TargetVariable; 70 var inputAndTarget = Content.PreprocessingData.InputVariables.Union(target != null ? new[] { target } : new string[] { }); 71 foreach (var col in Content.PreprocessingData.GetDoubleVariableNames().Except(inputAndTarget)) { 72 var listViewItem = checkedItemList.ItemsListView.FindItemWithText(col, false, 0, false); 73 listViewItem.ForeColor = Color.LightGray; 74 } 68 variablesListView.ItemChecked += variablesListView_ItemChecked; 75 69 } 76 70 protected override void RegisterContentEvents() { 77 71 base.RegisterContentEvents(); 78 72 Content.PreprocessingData.Changed += PreprocessingData_Changed; 79 Content. PreprocessingData.SelectionChanged += PreprocessingData_SelctionChanged;73 Content.VariableItemList.CheckedItemsChanged += CheckedItemsChanged; 80 74 } 75 81 76 protected override void DeregisterContentEvents() { 82 77 Content.PreprocessingData.Changed -= PreprocessingData_Changed; 83 Content. PreprocessingData.SelectionChanged -= PreprocessingData_SelctionChanged;78 Content.VariableItemList.CheckedItemsChanged -= CheckedItemsChanged; 84 79 base.DeregisterContentEvents(); 85 80 } 86 81 87 82 protected virtual void CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> checkedItems) { 83 // sync listview 84 foreach (var item in checkedItems.Items) 85 variablesListView.Items[item.Index].Checked = Content.VariableItemList.ItemChecked(item.Value); 86 } 87 private void variablesListView_ItemChecked(object sender, ItemCheckedEventArgs e) { 88 // sync checked item list 89 var variable = (StringValue)e.Item.Tag; 90 Content.VariableItemList.SetItemCheckedState(variable, e.Item.Checked); 88 91 } 89 92 … … 109 112 Content.VariableItemList.Add(new StringValue(name)); 110 113 if (!Content.PreprocessingData.InputVariables.Contains(name) && Content.PreprocessingData.TargetVariable != name) { 111 var listViewItem = checkedItemList.ItemsListView.FindItemWithText(name, false, 0, false);114 var listViewItem = variablesListView.FindItemWithText(name, false, 0, false); 112 115 listViewItem.ForeColor = Color.LightGray; 113 116 } … … 118 121 Content.VariableItemList.Remove(stringValue); 119 122 } 120 protected virtual void UpdateVariable(string name) { 121 } 122 protected virtual void ResetAllVariables() { 123 protected virtual void UpdateVariable(string name) { } 124 protected virtual void ResetAllVariables() { } 125 protected virtual void CheckedChangedUpdate() { } 126 127 private void checkInputsTargetButton_Click(object sender, System.EventArgs e) { 128 SuppressCheckedChangedUpdate = true; 129 foreach (var name in Content.VariableItemList) { 130 var isInputTarget = Content.PreprocessingData.InputVariables.Contains(name.Value) || Content.PreprocessingData.TargetVariable == name.Value; 131 Content.VariableItemList.SetItemCheckedState(name, isInputTarget); 132 } 133 SuppressCheckedChangedUpdate = false; 134 CheckedChangedUpdate(); 123 135 } 124 136 125 protected virtual void PreprocessingData_SelctionChanged(object sender, EventArgs e) { 137 private void checkAllButton_Click(object sender, System.EventArgs e) { 138 SuppressCheckedChangedUpdate = true; 139 foreach (var name in Content.VariableItemList) { 140 Content.VariableItemList.SetItemCheckedState(name, true); 141 } 142 SuppressCheckedChangedUpdate = false; 143 CheckedChangedUpdate(); 126 144 } 127 145 128 #region ContextMenu Events 129 private void variablesListcontextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) { 130 var data = Content.PreprocessingData; 131 checkInputsTargetToolStripMenuItem.Text = "Check Inputs" + (data.TargetVariable != null ? "+Target" : ""); 132 checkOnlyInputsTargetToolStripMenuItem.Text = "Check only Inputs" + (data.TargetVariable != null ? "+Target" : ""); 146 private void uncheckAllButton_Click(object sender, System.EventArgs e) { 147 SuppressCheckedChangedUpdate = true; 148 foreach (var name in Content.VariableItemList) { 149 Content.VariableItemList.SetItemCheckedState(name, false); 150 } 151 SuppressCheckedChangedUpdate = false; 152 CheckedChangedUpdate(); 133 153 } 134 private void checkInputsTargetToolStripMenuItem_Click(object sender, EventArgs e) {135 foreach (var name in checkedItemList.Content) {136 var isInputTarget = Content.PreprocessingData.InputVariables.Contains(name.Value) || Content.PreprocessingData.TargetVariable == name.Value;137 if (isInputTarget) {138 checkedItemList.Content.SetItemCheckedState(name, true);139 }140 }141 }142 private void checkOnlyInputsTargetToolStripMenuItem_Click(object sender, EventArgs e) {143 foreach (var name in checkedItemList.Content) {144 var isInputTarget = Content.PreprocessingData.InputVariables.Contains(name.Value) || Content.PreprocessingData.TargetVariable == name.Value;145 checkedItemList.Content.SetItemCheckedState(name, isInputTarget);146 }147 }148 private void checkAllToolStripMenuItem_Click(object sender, EventArgs e) {149 foreach (var name in checkedItemList.Content) {150 checkedItemList.Content.SetItemCheckedState(name, true);151 }152 }153 private void uncheckAllToolStripMenuItem_Click(object sender, EventArgs e) {154 foreach (var name in checkedItemList.Content) {155 checkedItemList.Content.SetItemCheckedState(name, false);156 }157 }158 #endregion159 154 } 160 155 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.Designer.cs
r14186 r15242 22 22 #endregion 23 23 24 namespace HeuristicLab. Problems.DataAnalysis.Views {24 namespace HeuristicLab.DataPreprocessing.Views { 25 25 partial class PreprocessingFeatureCorrelationView { 26 26 /// <summary> … … 48 48 private void InitializeComponent() { 49 49 this.components = new System.ComponentModel.Container(); 50 this.checkInputsTargetButton = new System.Windows.Forms.Button(); 51 this.uncheckAllButton = new System.Windows.Forms.Button(); 52 this.checkAllButton = new System.Windows.Forms.Button(); 53 this.correlationView = new HeuristicLab.Problems.DataAnalysis.Views.FeatureCorrelationView(); 54 this.variablesLabel = new System.Windows.Forms.Label(); 55 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 56 this.SuspendLayout(); 57 // 58 // checkInputsTargetButton 59 // 60 this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs; 61 this.checkInputsTargetButton.Location = new System.Drawing.Point(736, 5); 62 this.checkInputsTargetButton.Name = "checkInputsTargetButton"; 63 this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24); 64 this.checkInputsTargetButton.TabIndex = 14; 65 this.toolTip.SetToolTip(this.checkInputsTargetButton, "Inputs & Target Variables"); 66 this.checkInputsTargetButton.UseVisualStyleBackColor = true; 67 this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click); 68 // 69 // uncheckAllButton 70 // 71 this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None; 72 this.uncheckAllButton.Location = new System.Drawing.Point(766, 5); 73 this.uncheckAllButton.Name = "uncheckAllButton"; 74 this.uncheckAllButton.Size = new System.Drawing.Size(24, 24); 75 this.uncheckAllButton.TabIndex = 12; 76 this.toolTip.SetToolTip(this.uncheckAllButton, "None"); 77 this.uncheckAllButton.UseVisualStyleBackColor = true; 78 this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click); 79 // 80 // checkAllButton 81 // 82 this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All; 83 this.checkAllButton.Location = new System.Drawing.Point(706, 5); 84 this.checkAllButton.Name = "checkAllButton"; 85 this.checkAllButton.Size = new System.Drawing.Size(24, 24); 86 this.checkAllButton.TabIndex = 13; 87 this.toolTip.SetToolTip(this.checkAllButton, "All"); 88 this.checkAllButton.UseVisualStyleBackColor = true; 89 this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click); 90 // 91 // correlationView 92 // 93 this.correlationView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 94 | System.Windows.Forms.AnchorStyles.Left) 95 | System.Windows.Forms.AnchorStyles.Right))); 96 this.correlationView.Caption = "Feature Correlation View"; 97 this.correlationView.Content = null; 98 this.correlationView.Location = new System.Drawing.Point(0, 0); 99 this.correlationView.Name = "correlationView"; 100 this.correlationView.ReadOnly = false; 101 this.correlationView.Size = new System.Drawing.Size(1013, 640); 102 this.correlationView.TabIndex = 18; 103 // 104 // variablesLabel 105 // 106 this.variablesLabel.AutoSize = true; 107 this.variablesLabel.Location = new System.Drawing.Point(650, 11); 108 this.variablesLabel.Name = "variablesLabel"; 109 this.variablesLabel.Size = new System.Drawing.Size(50, 13); 110 this.variablesLabel.TabIndex = 15; 111 this.variablesLabel.Text = "Variables"; 112 // 113 // PreprocessingFeatureCorrelationView 114 // 115 this.Controls.Add(this.variablesLabel); 116 this.Controls.Add(this.checkInputsTargetButton); 117 this.Controls.Add(this.uncheckAllButton); 118 this.Controls.Add(this.checkAllButton); 119 this.Controls.Add(this.correlationView); 120 this.Name = "PreprocessingFeatureCorrelationView"; 121 this.Size = new System.Drawing.Size(1013, 640); 50 122 this.ResumeLayout(false); 123 this.PerformLayout(); 124 51 125 } 52 126 53 127 #endregion 128 private System.Windows.Forms.Button checkInputsTargetButton; 129 private System.Windows.Forms.Button uncheckAllButton; 130 private System.Windows.Forms.Button checkAllButton; 131 private HeuristicLab.Problems.DataAnalysis.Views.FeatureCorrelationView correlationView; 132 private System.Windows.Forms.ToolTip toolTip; 133 private System.Windows.Forms.Label variablesLabel; 54 134 } 55 135 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs
r14186 r15242 20 20 #endregion 21 21 22 using System.Windows.Forms; 23 using HeuristicLab.DataPreprocessing; 22 using System; 23 using System.Linq; 24 using HeuristicLab.Data.Views; 24 25 using HeuristicLab.MainForm; 25 26 using HeuristicLab.MainForm.WindowsForms; 26 27 27 namespace HeuristicLab. Problems.DataAnalysis.Views {28 namespace HeuristicLab.DataPreprocessing.Views { 28 29 [View("Preprocessing Feature Correlation View")] 29 [Content(typeof(CorrelationMatrixContent), false)]30 [Content(typeof(CorrelationMatrixContent), true)] 30 31 public partial class PreprocessingFeatureCorrelationView : AsynchronousContentView { 31 32 32 public new CorrelationMatrixContent Content { 33 33 get { return (CorrelationMatrixContent)base.Content; } … … 35 35 } 36 36 37 FeatureCorrelationView correlationView;38 39 37 public PreprocessingFeatureCorrelationView() { 40 38 InitializeComponent(); 41 correlationView = new FeatureCorrelationView();42 correlationView.Dock = DockStyle.Fill;43 this.Controls.Add(correlationView);44 39 } 45 46 40 47 41 protected override void RegisterContentEvents() { … … 61 55 protected override void OnContentChanged() { 62 56 base.OnContentChanged(); 63 if (Content == null) { 64 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) 65 76 return; 66 }67 77 68 correlationView.Content = Content.ProblemData; 78 dataView.ColumnVisibility = visibilities; 79 dataView.RowVisibility = visibilities; 80 dataView.UpdateColumnHeaders(); 81 dataView.UpdateRowHeaders(); 69 82 } 83 #endregion 70 84 } 71 85 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingIcons.resx
r15110 r15242 120 120 <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 121 121 <data name="All" type="System.Resources.ResXFileRef, System.Windows.Forms"> 122 <value> icons\all.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>122 <value>Icons\All.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 123 123 </data> 124 124 <data name="Inputs" type="System.Resources.ResXFileRef, System.Windows.Forms"> 125 <value> icons\inputs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>125 <value>Icons\Inputs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 126 126 </data> 127 127 <data name="None" type="System.Resources.ResXFileRef, System.Windows.Forms"> 128 <value> icons\none.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>128 <value>Icons\None.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 129 129 </data> 130 130 </root> -
stable/HeuristicLab.DataPreprocessing.Views/3.4/RenameColumnsDialog.cs
r14186 r15242 26 26 namespace HeuristicLab.DataPreprocessing.Views { 27 27 public partial class RenameColumnsDialog : Form { 28 29 28 public IList<string> ColumnNames { 30 29 get { -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.Designer.cs
r14963 r15242 53 53 this.bodyTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 54 54 this.sizeGroupBox = new System.Windows.Forms.GroupBox(); 55 this.heightNumericUpDown = new System.Windows.Forms.NumericUpDown(); 56 this.widthNumericUpDown = new System.Windows.Forms.NumericUpDown(); 55 57 this.heightLabel = new System.Windows.Forms.Label(); 56 58 this.widthLabel = new System.Windows.Forms.Label(); 57 this.heightTrackBar = new System.Windows.Forms.TrackBar(); 58 this.widthTrackBar = new System.Windows.Forms.TrackBar(); 59 this.lockAspectCheckBox = new System.Windows.Forms.CheckBox(); 60 this.pointSizeNumericUpDown = new System.Windows.Forms.NumericUpDown(); 61 this.pointSizeLabel = new System.Windows.Forms.Label(); 62 this.regressionGroupBox = new System.Windows.Forms.GroupBox(); 63 this.regressionTypeComboBox = new System.Windows.Forms.ComboBox(); 64 this.polynomialRegressionOrderNumericUpDown = new System.Windows.Forms.NumericUpDown(); 65 this.orderLabel = new System.Windows.Forms.Label(); 66 this.regressionTyleLabel = new System.Windows.Forms.Label(); 67 this.groupingOptionsBox = new System.Windows.Forms.GroupBox(); 68 this.legendGroupBox = new System.Windows.Forms.GroupBox(); 69 this.legendCheckbox = new System.Windows.Forms.CheckBox(); 70 this.legendOrderComboBox = new System.Windows.Forms.ComboBox(); 71 this.legendOrderLabel = new System.Windows.Forms.Label(); 72 this.aggregationLabel = new System.Windows.Forms.Label(); 73 this.aggregationComboBox = new System.Windows.Forms.ComboBox(); 74 this.groupingComboBox = new System.Windows.Forms.ComboBox(); 75 this.opacityLabel = new System.Windows.Forms.Label(); 76 this.pointOpacityNumericUpDown = new System.Windows.Forms.NumericUpDown(); 77 this.pointsGroupBox = new System.Windows.Forms.GroupBox(); 59 78 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 60 79 this.splitContainer.Panel1.SuspendLayout(); … … 66 85 this.bodyScrollPanel.SuspendLayout(); 67 86 this.sizeGroupBox.SuspendLayout(); 68 ((System.ComponentModel.ISupportInitialize)(this.heightTrackBar)).BeginInit(); 69 ((System.ComponentModel.ISupportInitialize)(this.widthTrackBar)).BeginInit(); 87 ((System.ComponentModel.ISupportInitialize)(this.heightNumericUpDown)).BeginInit(); 88 ((System.ComponentModel.ISupportInitialize)(this.widthNumericUpDown)).BeginInit(); 89 ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).BeginInit(); 90 this.regressionGroupBox.SuspendLayout(); 91 ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).BeginInit(); 92 this.groupingOptionsBox.SuspendLayout(); 93 this.legendGroupBox.SuspendLayout(); 94 ((System.ComponentModel.ISupportInitialize)(this.pointOpacityNumericUpDown)).BeginInit(); 95 this.pointsGroupBox.SuspendLayout(); 70 96 this.SuspendLayout(); 71 97 // 72 // checkedItemList73 //74 this.checkedItemList.Size = new System.Drawing.Size(113, 369);75 //76 98 // splitContainer 77 99 // … … 80 102 // 81 103 this.splitContainer.Panel1.Controls.Add(this.sizeGroupBox); 104 this.splitContainer.Panel1.Controls.Add(this.pointsGroupBox); 105 this.splitContainer.Panel1.Controls.Add(this.groupingOptionsBox); 106 this.splitContainer.Panel1.Controls.Add(this.regressionGroupBox); 82 107 // 83 108 // splitContainer.Panel2 84 109 // 85 110 this.splitContainer.Panel2.Controls.Add(this.frameTableLayoutPanel); 86 this.splitContainer.Size = new System.Drawing.Size(863, 520); 87 this.splitContainer.SplitterDistance = 120; 111 this.splitContainer.Size = new System.Drawing.Size(589, 451); 88 112 // 89 113 // frameTableLayoutPanel … … 101 125 this.frameTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); 102 126 this.frameTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); 103 this.frameTableLayoutPanel.Size = new System.Drawing.Size( 739, 520);127 this.frameTableLayoutPanel.Size = new System.Drawing.Size(405, 451); 104 128 this.frameTableLayoutPanel.TabIndex = 0; 105 129 // … … 111 135 this.columnHeaderScrollPanel.Margin = new System.Windows.Forms.Padding(0); 112 136 this.columnHeaderScrollPanel.Name = "columnHeaderScrollPanel"; 113 this.columnHeaderScrollPanel.Size = new System.Drawing.Size( 699, 40);137 this.columnHeaderScrollPanel.Size = new System.Drawing.Size(365, 40); 114 138 this.columnHeaderScrollPanel.TabIndex = 3; 115 139 // … … 138 162 this.rowHeaderScrollPanel.Margin = new System.Windows.Forms.Padding(0); 139 163 this.rowHeaderScrollPanel.Name = "rowHeaderScrollPanel"; 140 this.rowHeaderScrollPanel.Size = new System.Drawing.Size(40, 4 80);164 this.rowHeaderScrollPanel.Size = new System.Drawing.Size(40, 411); 141 165 this.rowHeaderScrollPanel.TabIndex = 4; 142 166 // … … 166 190 this.bodyScrollPanel.Margin = new System.Windows.Forms.Padding(0); 167 191 this.bodyScrollPanel.Name = "bodyScrollPanel"; 168 this.bodyScrollPanel.Size = new System.Drawing.Size( 699, 480);192 this.bodyScrollPanel.Size = new System.Drawing.Size(365, 411); 169 193 this.bodyScrollPanel.TabIndex = 5; 170 194 this.bodyScrollPanel.Scroll += new System.Windows.Forms.ScrollEventHandler(this.bodyScrollPanel_Scroll); … … 188 212 // sizeGroupBox 189 213 // 190 this.sizeGroupBox. Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)191 | System.Windows.Forms.AnchorStyles.Right)));214 this.sizeGroupBox.Controls.Add(this.heightNumericUpDown); 215 this.sizeGroupBox.Controls.Add(this.widthNumericUpDown); 192 216 this.sizeGroupBox.Controls.Add(this.heightLabel); 193 217 this.sizeGroupBox.Controls.Add(this.widthLabel); 194 this.sizeGroupBox.Controls.Add(this. heightTrackBar);195 this.sizeGroupBox. Controls.Add(this.widthTrackBar);196 this.sizeGroupBox.Location = new System.Drawing.Point( 4, 379);218 this.sizeGroupBox.Controls.Add(this.lockAspectCheckBox); 219 this.sizeGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom; 220 this.sizeGroupBox.Location = new System.Drawing.Point(0, 78); 197 221 this.sizeGroupBox.Name = "sizeGroupBox"; 198 this.sizeGroupBox.Size = new System.Drawing.Size(1 13, 124);222 this.sizeGroupBox.Size = new System.Drawing.Size(180, 98); 199 223 this.sizeGroupBox.TabIndex = 5; 200 224 this.sizeGroupBox.TabStop = false; 201 225 this.sizeGroupBox.Text = "Chart Size"; 202 226 // 227 // heightNumericUpDown 228 // 229 this.heightNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 230 | System.Windows.Forms.AnchorStyles.Right))); 231 this.heightNumericUpDown.Increment = new decimal(new int[] { 232 50, 233 0, 234 0, 235 0}); 236 this.heightNumericUpDown.Location = new System.Drawing.Point(50, 46); 237 this.heightNumericUpDown.Maximum = new decimal(new int[] { 238 100000, 239 0, 240 0, 241 0}); 242 this.heightNumericUpDown.Name = "heightNumericUpDown"; 243 this.heightNumericUpDown.Size = new System.Drawing.Size(124, 20); 244 this.heightNumericUpDown.TabIndex = 4; 245 this.heightNumericUpDown.Value = new decimal(new int[] { 246 225, 247 0, 248 0, 249 0}); 250 this.heightNumericUpDown.ValueChanged += new System.EventHandler(this.heightNumericUpDown_ValueChanged); 251 // 252 // widthNumericUpDown 253 // 254 this.widthNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 255 | System.Windows.Forms.AnchorStyles.Right))); 256 this.widthNumericUpDown.Increment = new decimal(new int[] { 257 50, 258 0, 259 0, 260 0}); 261 this.widthNumericUpDown.Location = new System.Drawing.Point(50, 20); 262 this.widthNumericUpDown.Maximum = new decimal(new int[] { 263 10000, 264 0, 265 0, 266 0}); 267 this.widthNumericUpDown.Name = "widthNumericUpDown"; 268 this.widthNumericUpDown.Size = new System.Drawing.Size(124, 20); 269 this.widthNumericUpDown.TabIndex = 3; 270 this.widthNumericUpDown.Value = new decimal(new int[] { 271 300, 272 0, 273 0, 274 0}); 275 this.widthNumericUpDown.ValueChanged += new System.EventHandler(this.widthNumericUpDown_ValueChanged); 276 // 203 277 // heightLabel 204 278 // 205 279 this.heightLabel.AutoSize = true; 206 this.heightLabel.Location = new System.Drawing.Point(6, 64);280 this.heightLabel.Location = new System.Drawing.Point(6, 48); 207 281 this.heightLabel.Name = "heightLabel"; 208 282 this.heightLabel.Size = new System.Drawing.Size(41, 13); … … 213 287 // 214 288 this.widthLabel.AutoSize = true; 215 this.widthLabel.Location = new System.Drawing.Point(6, 16);289 this.widthLabel.Location = new System.Drawing.Point(6, 22); 216 290 this.widthLabel.Name = "widthLabel"; 217 291 this.widthLabel.Size = new System.Drawing.Size(38, 13); … … 219 293 this.widthLabel.Text = "Width:"; 220 294 // 221 // heightTrackBar 222 // 223 this.heightTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 224 | System.Windows.Forms.AnchorStyles.Right))); 225 this.heightTrackBar.LargeChange = 50; 226 this.heightTrackBar.Location = new System.Drawing.Point(6, 83); 227 this.heightTrackBar.Maximum = 100; 228 this.heightTrackBar.Name = "heightTrackBar"; 229 this.heightTrackBar.Size = new System.Drawing.Size(101, 45); 230 this.heightTrackBar.SmallChange = 10; 231 this.heightTrackBar.TabIndex = 0; 232 this.heightTrackBar.TickFrequency = 10; 233 this.heightTrackBar.Value = 20; 234 this.heightTrackBar.ValueChanged += new System.EventHandler(this.heightTrackBar_ValueChanged); 235 // 236 // widthTrackBar 237 // 238 this.widthTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 239 | System.Windows.Forms.AnchorStyles.Right))); 240 this.widthTrackBar.LargeChange = 50; 241 this.widthTrackBar.Location = new System.Drawing.Point(6, 32); 242 this.widthTrackBar.Maximum = 100; 243 this.widthTrackBar.Name = "widthTrackBar"; 244 this.widthTrackBar.Size = new System.Drawing.Size(101, 45); 245 this.widthTrackBar.SmallChange = 10; 246 this.widthTrackBar.TabIndex = 0; 247 this.widthTrackBar.TickFrequency = 10; 248 this.widthTrackBar.Value = 20; 249 this.widthTrackBar.ValueChanged += new System.EventHandler(this.widthTrackBar_ValueChanged); 295 // lockAspectCheckBox 296 // 297 this.lockAspectCheckBox.AutoSize = true; 298 this.lockAspectCheckBox.Checked = true; 299 this.lockAspectCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 300 this.lockAspectCheckBox.Location = new System.Drawing.Point(50, 73); 301 this.lockAspectCheckBox.Name = "lockAspectCheckBox"; 302 this.lockAspectCheckBox.Size = new System.Drawing.Size(114, 17); 303 this.lockAspectCheckBox.TabIndex = 6; 304 this.lockAspectCheckBox.Text = "Lock Aspect Ratio"; 305 this.lockAspectCheckBox.UseVisualStyleBackColor = true; 306 // 307 // pointSizeNumericUpDown 308 // 309 this.pointSizeNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 310 | System.Windows.Forms.AnchorStyles.Right))); 311 this.pointSizeNumericUpDown.Location = new System.Drawing.Point(58, 15); 312 this.pointSizeNumericUpDown.Maximum = new decimal(new int[] { 313 50, 314 0, 315 0, 316 0}); 317 this.pointSizeNumericUpDown.Minimum = new decimal(new int[] { 318 1, 319 0, 320 0, 321 0}); 322 this.pointSizeNumericUpDown.Name = "pointSizeNumericUpDown"; 323 this.pointSizeNumericUpDown.Size = new System.Drawing.Size(116, 20); 324 this.pointSizeNumericUpDown.TabIndex = 8; 325 this.pointSizeNumericUpDown.Value = new decimal(new int[] { 326 3, 327 0, 328 0, 329 0}); 330 this.pointSizeNumericUpDown.ValueChanged += new System.EventHandler(this.pointSizeNumericUpDown_ValueChanged); 331 // 332 // pointSizeLabel 333 // 334 this.pointSizeLabel.AutoSize = true; 335 this.pointSizeLabel.Location = new System.Drawing.Point(6, 17); 336 this.pointSizeLabel.Name = "pointSizeLabel"; 337 this.pointSizeLabel.Size = new System.Drawing.Size(30, 13); 338 this.pointSizeLabel.TabIndex = 7; 339 this.pointSizeLabel.Text = "Size:"; 340 // 341 // regressionGroupBox 342 // 343 this.regressionGroupBox.Controls.Add(this.regressionTypeComboBox); 344 this.regressionGroupBox.Controls.Add(this.polynomialRegressionOrderNumericUpDown); 345 this.regressionGroupBox.Controls.Add(this.orderLabel); 346 this.regressionGroupBox.Controls.Add(this.regressionTyleLabel); 347 this.regressionGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom; 348 this.regressionGroupBox.Location = new System.Drawing.Point(0, 376); 349 this.regressionGroupBox.Name = "regressionGroupBox"; 350 this.regressionGroupBox.Size = new System.Drawing.Size(180, 75); 351 this.regressionGroupBox.TabIndex = 3; 352 this.regressionGroupBox.TabStop = false; 353 this.regressionGroupBox.Text = "Regression"; 354 // 355 // regressionTypeComboBox 356 // 357 this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 358 | System.Windows.Forms.AnchorStyles.Right))); 359 this.regressionTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 360 this.regressionTypeComboBox.FormattingEnabled = true; 361 this.regressionTypeComboBox.Location = new System.Drawing.Point(67, 19); 362 this.regressionTypeComboBox.Name = "regressionTypeComboBox"; 363 this.regressionTypeComboBox.Size = new System.Drawing.Size(107, 21); 364 this.regressionTypeComboBox.TabIndex = 14; 365 this.regressionTypeComboBox.SelectedValueChanged += new System.EventHandler(this.regressionTypeComboBox_SelectedValueChanged); 366 // 367 // polynomialRegressionOrderNumericUpDown 368 // 369 this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 370 | System.Windows.Forms.AnchorStyles.Right))); 371 this.polynomialRegressionOrderNumericUpDown.Location = new System.Drawing.Point(67, 45); 372 this.polynomialRegressionOrderNumericUpDown.Margin = new System.Windows.Forms.Padding(9, 3, 3, 3); 373 this.polynomialRegressionOrderNumericUpDown.Maximum = new decimal(new int[] { 374 6, 375 0, 376 0, 377 0}); 378 this.polynomialRegressionOrderNumericUpDown.Minimum = new decimal(new int[] { 379 2, 380 0, 381 0, 382 0}); 383 this.polynomialRegressionOrderNumericUpDown.Name = "polynomialRegressionOrderNumericUpDown"; 384 this.polynomialRegressionOrderNumericUpDown.Size = new System.Drawing.Size(107, 20); 385 this.polynomialRegressionOrderNumericUpDown.TabIndex = 15; 386 this.polynomialRegressionOrderNumericUpDown.Value = new decimal(new int[] { 387 2, 388 0, 389 0, 390 0}); 391 this.polynomialRegressionOrderNumericUpDown.ValueChanged += new System.EventHandler(this.polynomialRegressionOrderNumericUpDown_ValueChanged); 392 // 393 // orderLabel 394 // 395 this.orderLabel.AutoSize = true; 396 this.orderLabel.Location = new System.Drawing.Point(6, 47); 397 this.orderLabel.Name = "orderLabel"; 398 this.orderLabel.Size = new System.Drawing.Size(36, 13); 399 this.orderLabel.TabIndex = 16; 400 this.orderLabel.Text = "Order:"; 401 // 402 // regressionTyleLabel 403 // 404 this.regressionTyleLabel.AutoSize = true; 405 this.regressionTyleLabel.Location = new System.Drawing.Point(6, 22); 406 this.regressionTyleLabel.Name = "regressionTyleLabel"; 407 this.regressionTyleLabel.Size = new System.Drawing.Size(34, 13); 408 this.regressionTyleLabel.TabIndex = 13; 409 this.regressionTyleLabel.Text = "Type:"; 410 // 411 // groupingOptionsBox 412 // 413 this.groupingOptionsBox.Controls.Add(this.legendGroupBox); 414 this.groupingOptionsBox.Controls.Add(this.aggregationLabel); 415 this.groupingOptionsBox.Controls.Add(this.aggregationComboBox); 416 this.groupingOptionsBox.Controls.Add(this.groupingComboBox); 417 this.groupingOptionsBox.Dock = System.Windows.Forms.DockStyle.Bottom; 418 this.groupingOptionsBox.Location = new System.Drawing.Point(0, 245); 419 this.groupingOptionsBox.Name = "groupingOptionsBox"; 420 this.groupingOptionsBox.Size = new System.Drawing.Size(180, 131); 421 this.groupingOptionsBox.TabIndex = 8; 422 this.groupingOptionsBox.TabStop = false; 423 this.groupingOptionsBox.Text = "Grouping"; 424 // 425 // legendGroupBox 426 // 427 this.legendGroupBox.Controls.Add(this.legendCheckbox); 428 this.legendGroupBox.Controls.Add(this.legendOrderComboBox); 429 this.legendGroupBox.Controls.Add(this.legendOrderLabel); 430 this.legendGroupBox.Enabled = false; 431 this.legendGroupBox.Location = new System.Drawing.Point(6, 73); 432 this.legendGroupBox.Name = "legendGroupBox"; 433 this.legendGroupBox.Size = new System.Drawing.Size(167, 50); 434 this.legendGroupBox.TabIndex = 7; 435 this.legendGroupBox.TabStop = false; 436 this.legendGroupBox.Text = "Legend"; 437 // 438 // legendCheckbox 439 // 440 this.legendCheckbox.AutoSize = true; 441 this.legendCheckbox.Checked = true; 442 this.legendCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; 443 this.legendCheckbox.Location = new System.Drawing.Point(56, -1); 444 this.legendCheckbox.Name = "legendCheckbox"; 445 this.legendCheckbox.Size = new System.Drawing.Size(56, 17); 446 this.legendCheckbox.TabIndex = 0; 447 this.legendCheckbox.Text = "Visible"; 448 this.legendCheckbox.UseVisualStyleBackColor = true; 449 this.legendCheckbox.CheckedChanged += new System.EventHandler(this.legendCheckbox_CheckedChanged); 450 // 451 // legendOrderComboBox 452 // 453 this.legendOrderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 454 this.legendOrderComboBox.FormattingEnabled = true; 455 this.legendOrderComboBox.Location = new System.Drawing.Point(49, 19); 456 this.legendOrderComboBox.Name = "legendOrderComboBox"; 457 this.legendOrderComboBox.Size = new System.Drawing.Size(109, 21); 458 this.legendOrderComboBox.TabIndex = 5; 459 this.legendOrderComboBox.SelectedIndexChanged += new System.EventHandler(this.legendOrderComboBox_SelectedIndexChanged); 460 // 461 // legendOrderLabel 462 // 463 this.legendOrderLabel.AutoSize = true; 464 this.legendOrderLabel.Location = new System.Drawing.Point(7, 22); 465 this.legendOrderLabel.Name = "legendOrderLabel"; 466 this.legendOrderLabel.Size = new System.Drawing.Size(36, 13); 467 this.legendOrderLabel.TabIndex = 4; 468 this.legendOrderLabel.Text = "Order:"; 469 this.legendOrderLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 470 // 471 // aggregationLabel 472 // 473 this.aggregationLabel.AutoSize = true; 474 this.aggregationLabel.Enabled = false; 475 this.aggregationLabel.Location = new System.Drawing.Point(5, 49); 476 this.aggregationLabel.Name = "aggregationLabel"; 477 this.aggregationLabel.Size = new System.Drawing.Size(67, 13); 478 this.aggregationLabel.TabIndex = 3; 479 this.aggregationLabel.Text = "Aggregation:"; 480 // 481 // aggregationComboBox 482 // 483 this.aggregationComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 484 | System.Windows.Forms.AnchorStyles.Right))); 485 this.aggregationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 486 this.aggregationComboBox.Enabled = false; 487 this.aggregationComboBox.FormattingEnabled = true; 488 this.aggregationComboBox.Location = new System.Drawing.Point(79, 46); 489 this.aggregationComboBox.Name = "aggregationComboBox"; 490 this.aggregationComboBox.Size = new System.Drawing.Size(96, 21); 491 this.aggregationComboBox.TabIndex = 2; 492 this.aggregationComboBox.SelectedIndexChanged += new System.EventHandler(this.aggregationComboBox_SelectedIndexChanged); 493 // 494 // groupingComboBox 495 // 496 this.groupingComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 497 | System.Windows.Forms.AnchorStyles.Right))); 498 this.groupingComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 499 this.groupingComboBox.FormattingEnabled = true; 500 this.groupingComboBox.Location = new System.Drawing.Point(6, 19); 501 this.groupingComboBox.Name = "groupingComboBox"; 502 this.groupingComboBox.Size = new System.Drawing.Size(169, 21); 503 this.groupingComboBox.TabIndex = 1; 504 this.groupingComboBox.SelectedIndexChanged += new System.EventHandler(this.groupingComboBox_SelectedIndexChanged); 505 // 506 // opacityLabel 507 // 508 this.opacityLabel.AutoSize = true; 509 this.opacityLabel.Location = new System.Drawing.Point(6, 43); 510 this.opacityLabel.Name = "opacityLabel"; 511 this.opacityLabel.Size = new System.Drawing.Size(46, 13); 512 this.opacityLabel.TabIndex = 7; 513 this.opacityLabel.Text = "Opacity:"; 514 // 515 // pointOpacityNumericUpDown 516 // 517 this.pointOpacityNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 518 | System.Windows.Forms.AnchorStyles.Right))); 519 this.pointOpacityNumericUpDown.DecimalPlaces = 2; 520 this.pointOpacityNumericUpDown.Increment = new decimal(new int[] { 521 1, 522 0, 523 0, 524 65536}); 525 this.pointOpacityNumericUpDown.Location = new System.Drawing.Point(58, 41); 526 this.pointOpacityNumericUpDown.Maximum = new decimal(new int[] { 527 1, 528 0, 529 0, 530 0}); 531 this.pointOpacityNumericUpDown.Name = "pointOpacityNumericUpDown"; 532 this.pointOpacityNumericUpDown.Size = new System.Drawing.Size(115, 20); 533 this.pointOpacityNumericUpDown.TabIndex = 8; 534 this.pointOpacityNumericUpDown.Value = new decimal(new int[] { 535 1, 536 0, 537 0, 538 0}); 539 this.pointOpacityNumericUpDown.ValueChanged += new System.EventHandler(this.pointOpacityNumericUpDown_ValueChanged); 540 // 541 // pointsGroupBox 542 // 543 this.pointsGroupBox.Controls.Add(this.pointOpacityNumericUpDown); 544 this.pointsGroupBox.Controls.Add(this.pointSizeLabel); 545 this.pointsGroupBox.Controls.Add(this.pointSizeNumericUpDown); 546 this.pointsGroupBox.Controls.Add(this.opacityLabel); 547 this.pointsGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom; 548 this.pointsGroupBox.Location = new System.Drawing.Point(0, 176); 549 this.pointsGroupBox.Name = "pointsGroupBox"; 550 this.pointsGroupBox.Size = new System.Drawing.Size(180, 69); 551 this.pointsGroupBox.TabIndex = 4; 552 this.pointsGroupBox.TabStop = false; 553 this.pointsGroupBox.Text = "Points"; 250 554 // 251 555 // ScatterPlotMultiView … … 254 558 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 255 559 this.Name = "ScatterPlotMultiView"; 256 this.Size = new System.Drawing.Size( 863, 520);560 this.Size = new System.Drawing.Size(589, 451); 257 561 this.splitContainer.Panel1.ResumeLayout(false); 258 562 this.splitContainer.Panel2.ResumeLayout(false); … … 268 572 this.sizeGroupBox.ResumeLayout(false); 269 573 this.sizeGroupBox.PerformLayout(); 270 ((System.ComponentModel.ISupportInitialize)(this.heightTrackBar)).EndInit(); 271 ((System.ComponentModel.ISupportInitialize)(this.widthTrackBar)).EndInit(); 574 ((System.ComponentModel.ISupportInitialize)(this.heightNumericUpDown)).EndInit(); 575 ((System.ComponentModel.ISupportInitialize)(this.widthNumericUpDown)).EndInit(); 576 ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).EndInit(); 577 this.regressionGroupBox.ResumeLayout(false); 578 this.regressionGroupBox.PerformLayout(); 579 ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).EndInit(); 580 this.groupingOptionsBox.ResumeLayout(false); 581 this.groupingOptionsBox.PerformLayout(); 582 this.legendGroupBox.ResumeLayout(false); 583 this.legendGroupBox.PerformLayout(); 584 ((System.ComponentModel.ISupportInitialize)(this.pointOpacityNumericUpDown)).EndInit(); 585 this.pointsGroupBox.ResumeLayout(false); 586 this.pointsGroupBox.PerformLayout(); 272 587 this.ResumeLayout(false); 273 588 … … 284 599 private System.Windows.Forms.Panel bodyScrollPanel; 285 600 private System.Windows.Forms.GroupBox sizeGroupBox; 286 private System.Windows.Forms.TrackBar widthTrackBar;287 private System.Windows.Forms.TrackBar heightTrackBar;288 601 private System.Windows.Forms.Label heightLabel; 289 602 private System.Windows.Forms.Label widthLabel; 603 private System.Windows.Forms.GroupBox regressionGroupBox; 604 private System.Windows.Forms.ComboBox regressionTypeComboBox; 605 private System.Windows.Forms.NumericUpDown polynomialRegressionOrderNumericUpDown; 606 private System.Windows.Forms.Label orderLabel; 607 private System.Windows.Forms.Label regressionTyleLabel; 608 private System.Windows.Forms.GroupBox groupingOptionsBox; 609 private System.Windows.Forms.ComboBox groupingComboBox; 610 private System.Windows.Forms.NumericUpDown widthNumericUpDown; 611 private System.Windows.Forms.NumericUpDown heightNumericUpDown; 612 private System.Windows.Forms.CheckBox lockAspectCheckBox; 613 private System.Windows.Forms.NumericUpDown pointSizeNumericUpDown; 614 private System.Windows.Forms.Label pointSizeLabel; 615 private System.Windows.Forms.Label aggregationLabel; 616 private System.Windows.Forms.ComboBox aggregationComboBox; 617 private System.Windows.Forms.GroupBox pointsGroupBox; 618 private System.Windows.Forms.NumericUpDown pointOpacityNumericUpDown; 619 private System.Windows.Forms.Label opacityLabel; 620 private System.Windows.Forms.Label legendOrderLabel; 621 private System.Windows.Forms.ComboBox legendOrderComboBox; 622 private System.Windows.Forms.GroupBox legendGroupBox; 623 private System.Windows.Forms.CheckBox legendCheckbox; 290 624 } 291 625 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
r14963 r15242 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Drawing; … … 5 26 using System.Windows.Forms; 6 27 using HeuristicLab.Analysis; 28 using HeuristicLab.Analysis.Views; 7 29 using HeuristicLab.Collections; 8 using HeuristicLab.Common;9 using HeuristicLab.Core.Views;10 30 using HeuristicLab.Data; 11 31 using HeuristicLab.MainForm; 12 32 using HeuristicLab.MainForm.WindowsForms; 33 using AggregationType = HeuristicLab.Analysis.DataTableVisualProperties.DataTableHistogramAggregation; 34 using RegressionType = HeuristicLab.Analysis.ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType; 13 35 14 36 namespace HeuristicLab.DataPreprocessing.Views { 15 37 [View("Scatter Plot Multi View")] 16 [Content(typeof(ScatterPlotContent), false)] 17 public partial class ScatterPlotMultiView : PreprocessingCheckedVariablesView { 18 private readonly IDictionary<string, Label> columnHeaderCache; 19 private readonly IDictionary<string, Label> rowHeaderCache; 20 private readonly IDictionary<Tuple<string/*col*/, string/*row*/>, ItemView> bodyCache; 38 [Content(typeof(MultiScatterPlotContent), true)] 39 public sealed partial class ScatterPlotMultiView : PreprocessingCheckedVariablesView { 40 private readonly IDictionary<string, Label> columnHeaderCache = new Dictionary<string, Label>(); 41 private readonly IDictionary<string, VerticalLabel> rowHeaderCache = new Dictionary<string, VerticalLabel>(); 42 private readonly IDictionary<Tuple<string/*col*/, string/*row*/>, Control> bodyCache = new Dictionary<Tuple<string, string>, Control>(); 43 44 public new MultiScatterPlotContent Content { 45 get { return (MultiScatterPlotContent)base.Content; } 46 set { base.Content = value; } 47 } 21 48 22 49 public ScatterPlotMultiView() { 23 50 InitializeComponent(); 51 52 oldWidth = (int)widthNumericUpDown.Value; 53 oldHeight = (int)heightNumericUpDown.Value; 54 55 regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType)); 56 regressionTypeComboBox.SelectedItem = RegressionType.None; 57 58 aggregationComboBox.DataSource = Enum.GetValues(typeof(AggregationType)); 59 aggregationComboBox.SelectedItem = AggregationType.Overlapping; 60 61 legendOrderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder)); 62 legendOrderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Alphabetically; 24 63 25 64 #region Initialize Scrollbars … … 41 80 #endregion 42 81 43 columnHeaderCache = new Dictionary<string, Label>();44 rowHeaderCache = new Dictionary<string, Label>();45 bodyCache = new Dictionary<Tuple<string, string>, ItemView>();46 47 82 bodyScrollPanel.MouseWheel += bodyScrollPanel_MouseWheel; 48 }49 50 public new ScatterPlotContent Content {51 get { return (ScatterPlotContent)base.Content; }52 set { base.Content = value; }53 83 } 54 84 … … 56 86 base.OnContentChanged(); 57 87 if (Content != null) { 58 GenerateCharts(); 59 } 88 groupingComboBox.Items.Add(string.Empty); 89 foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData)) { 90 groupingComboBox.Items.Add(var); 91 } 92 SuppressCheckedChangedUpdate = true; 93 groupingComboBox.SelectedItem = Content.GroupingVariable ?? string.Empty; 94 SuppressCheckedChangedUpdate = false; 95 96 // uncheck variables that max 20 vars are selected initially 97 var variables = Content.VariableItemList; 98 int numChecked = variables.CheckedItems.Count(); 99 if (numChecked > 20) { 100 string message = string.Format("Display all {0} input variables ({1} charts)?" + Environment.NewLine + 101 "Press No to reduce the number of checked variables to 20." + Environment.NewLine + 102 "Press Cancel to uncheck all.", 103 numChecked, numChecked * numChecked); 104 var dialogResult = MessageBox.Show(this, message, "Display All Input Variables?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); 105 if (dialogResult == DialogResult.No || dialogResult == DialogResult.Cancel) { 106 SuppressCheckedChangedUpdate = true; 107 IEnumerable<StringValue> toUncheck = variables; 108 if (dialogResult == DialogResult.No) // only show the first 20 109 toUncheck = variables.CheckedItems.Reverse().Take(numChecked - 20).Select(x => x.Value); 110 foreach (var var in toUncheck) 111 Content.VariableItemList.SetItemCheckedState(var, false); 112 SuppressCheckedChangedUpdate = false; 113 } 114 } 115 GenerateCharts(true); 116 } 117 } 118 119 protected override void SetEnabledStateOfControls() { 120 base.SetEnabledStateOfControls(); 121 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 122 polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial; 123 sizeGroupBox.Enabled = Content != null; 124 pointsGroupBox.Enabled = Content != null; 125 groupingComboBox.Enabled = Content != null; 126 regressionGroupBox.Enabled = Content != null; 60 127 } 61 128 62 129 protected override void CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> checkedItems) { 63 130 base.CheckedItemsChanged(sender, checkedItems); 64 foreach (var variable in checkedItems.Items.Select(i => i.Value.Value)) { 65 if (IsVariableChecked(variable)) 66 AddChartToTable(variable); 131 if (SuppressCheckedChangedUpdate) return; 132 133 foreach (var variable in checkedItems.Items) { 134 if (Content.VariableItemList.ItemChecked(variable.Value)) 135 ShowChartOnTable(variable.Value.Value, variable.Index); 67 136 else 68 RemoveChartFromTable(variable); 69 } 70 } 71 72 #region Add and remove charts 137 HideChartFromTable(variable.Value.Value, variable.Index); 138 } 139 } 140 141 #region Show and Hide charts 142 private void ShowChartOnTable(string variable, int idx) { 143 frameTableLayoutPanel.SuspendLayout(); 144 145 // show column header 146 var colH = columnHeaderTableLayoutPanel; 147 colH.ColumnStyles[idx].Width = GetColumnWidth(); 148 if (colH.GetControlFromPosition(idx, 0) == null) 149 colH.Controls.Add(GetColumnHeader(variable), idx, 0); 150 else 151 colH.GetControlFromPosition(idx, 0).Visible = true; 152 153 // show row header 154 var rowH = rowHeaderTableLayoutPanel; 155 rowH.RowStyles[idx].Height = GetRowHeight(); 156 if (rowH.GetControlFromPosition(0, idx) == null) 157 rowH.Controls.Add(GetRowHeader(variable), 0, idx); 158 else 159 rowH.GetControlFromPosition(0, idx).Visible = true; 160 161 // show body 162 var body = bodyTableLayoutPanel; 163 ShowColumnHelper(body, idx, r => GetBody(variable, Content.VariableItemList[r].Value)); 164 ShowRowHelper(body, idx, c => GetBody(Content.VariableItemList[c].Value, variable)); 165 166 frameTableLayoutPanel.ResumeLayout(true); 167 } 168 private void ShowColumnHelper(TableLayoutPanel tlp, int idx, Func<int, Control> creatorFunc) { 169 tlp.ColumnStyles[idx].Width = GetColumnWidth(); 170 for (int r = 0; r < tlp.RowCount; r++) { 171 if (Content.VariableItemList.ItemChecked(Content.VariableItemList[r])) { 172 var control = tlp.GetControlFromPosition(idx, r); 173 if (control == null) 174 tlp.Controls.Add(creatorFunc(r), idx, r); 175 else 176 control.Visible = true; 177 } 178 } 179 } 180 private void ShowRowHelper(TableLayoutPanel tlp, int idx, Func<int, Control> creatorFunc) { 181 tlp.RowStyles[idx].Height = GetRowHeight(); 182 for (int c = 0; c < tlp.ColumnCount; c++) { 183 if (Content.VariableItemList.ItemChecked(Content.VariableItemList[c])) { 184 var control = tlp.GetControlFromPosition(c, idx); 185 if (control == null) 186 tlp.Controls.Add(creatorFunc(c), c, idx); 187 else 188 tlp.GetControlFromPosition(c, idx).Visible = true; 189 } 190 } 191 } 192 193 private void HideChartFromTable(string variable, int idx) { 194 frameTableLayoutPanel.SuspendLayout(); 195 196 // hide column header 197 var colH = columnHeaderTableLayoutPanel; 198 HideColumnHelper(colH, idx); 199 200 // hide row header 201 var rowH = rowHeaderTableLayoutPanel; 202 HideRowHelper(rowH, idx); 203 204 // hide from body 205 var body = bodyTableLayoutPanel; 206 HideColumnHelper(body, idx); 207 HideRowHelper(body, idx); 208 209 frameTableLayoutPanel.ResumeLayout(true); 210 } 211 private void HideColumnHelper(TableLayoutPanel tlp, int idx) { 212 tlp.ColumnStyles[idx].Width = 0; 213 // hide controls 214 for (int r = 0; r < tlp.RowCount; r++) { 215 var control = tlp.GetControlFromPosition(idx, r); 216 if (control != null) 217 control.Visible = false; 218 } 219 } 220 private void HideRowHelper(TableLayoutPanel tlp, int idx) { 221 tlp.RowStyles[idx].Height = 0; 222 // hide controls 223 for (int c = 0; c < tlp.ColumnCount; c++) { 224 var control = tlp.GetControlFromPosition(c, idx); 225 if (control != null) 226 control.Visible = false; 227 } 228 } 229 #endregion 230 231 #region Add/Remove/Update Variable 232 protected override void AddVariable(string name) { 233 base.AddVariable(name); 234 if (IsVariableChecked(name)) 235 AddChartToTable(name); 236 } 237 protected override void RemoveVariable(string name) { 238 base.RemoveVariable(name); 239 240 if (IsVariableChecked(name)) { 241 RemoveChartFromTable(name); 242 } 243 244 // clear caches 245 columnHeaderCache[name].Dispose(); 246 columnHeaderCache.Remove(name); 247 rowHeaderCache[name].Dispose(); 248 rowHeaderCache.Remove(name); 249 var keys = bodyCache.Keys.Where(t => t.Item1 == name || t.Item2 == name).ToList(); 250 foreach (var key in keys) { 251 bodyCache[key].Dispose(); 252 bodyCache.Remove(key); 253 } 254 } 255 protected override void UpdateVariable(string name) { 256 base.UpdateVariable(name); 257 RemoveVariable(name); 258 AddVariable(name); 259 } 260 protected override void ResetAllVariables() { 261 GenerateCharts(true); 262 } 263 73 264 private void AddChartToTable(string variable) { 74 265 frameTableLayoutPanel.SuspendLayout(); 75 266 76 267 // find index to insert 77 var variables = checkedItemList.Content.Select(v => v.Value).ToList();268 var variables = Content.VariableItemList.Select(v => v.Value).ToList(); 78 269 int idx = variables // all variables 79 270 .TakeWhile(t => t != variable) // ... until the variable that was checked … … 102 293 tlp.ColumnStyles.Insert(idx, new ColumnStyle(SizeType.Absolute, GetColumnWidth())); 103 294 // shift right 104 for (int c = tlp.ColumnCount; c > 295 for (int c = tlp.ColumnCount; c > idx - 1; c--) { 105 296 for (int r = 0; r < tlp.RowCount; r++) { 106 297 var control = tlp.GetControlFromPosition(c, r); … … 192 383 #endregion 193 384 194 #region Add/Remove/Update Variable 195 protected override void AddVariable(string name) { 196 base.AddVariable(name); 197 if (IsVariableChecked(name)) 198 AddChartToTable(name); 199 } 200 protected override void RemoveVariable(string name) { 201 base.RemoveVariable(name); 202 203 // clear caches 204 columnHeaderCache.Remove(name); 205 rowHeaderCache.Remove(name); 206 var keys = bodyCache.Keys.Where(t => t.Item1 == name || t.Item2 == name).ToList(); 207 foreach (var key in keys) 208 bodyCache.Remove(key); 209 210 if (IsVariableChecked(name)) { 211 RemoveChartFromTable(name); 212 } 213 } 214 protected override void UpdateVariable(string name) { 215 base.UpdateVariable(name); 216 RemoveVariable(name); 217 AddVariable(name); 218 } 219 protected override void ResetAllVariables() { 220 GenerateCharts(); 221 } 222 #endregion 223 224 #region Creating Headers and Body 385 #region Creating Headers and Body 225 386 private Label GetColumnHeader(string variable) { 226 387 if (!columnHeaderCache.ContainsKey(variable)) { … … 238 399 private Label GetRowHeader(string variable) { 239 400 if (!rowHeaderCache.ContainsKey(variable)) { 240 rowHeaderCache.Add(variable, new Label() {401 rowHeaderCache.Add(variable, new VerticalLabel() { 241 402 Text = variable, 242 403 TextAlign = ContentAlignment.MiddleCenter, 243 404 Name = variable, 244 405 Width = rowHeaderTableLayoutPanel.Width, 406 Height = columnHeaderScrollPanel.Width, 245 407 Dock = DockStyle.Fill, 246 408 Margin = new Padding(3) … … 249 411 return rowHeaderCache[variable]; 250 412 } 251 private ItemViewGetBody(string colVariable, string rowVariable) {413 private Control GetBody(string colVariable, string rowVariable) { 252 414 var key = Tuple.Create(colVariable, rowVariable); 253 415 if (!bodyCache.ContainsKey(key)) { 254 416 if (rowVariable == colVariable) { // use historgram if x and y variable are equal 255 PreprocessingDataTable dataTable = new PreprocessingDataTable(); 256 DataRow dataRow = Content.CreateDataRow(rowVariable, DataRowVisualProperties.DataRowChartType.Histogram); 257 dataTable.Rows.Add(dataRow); 258 PreprocessingDataTableView pcv = new PreprocessingDataTableView { 417 var dataTable = HistogramContent.CreateHistogram( 418 Content.PreprocessingData, 419 rowVariable, 420 (string)groupingComboBox.SelectedItem, 421 (AggregationType)aggregationComboBox.SelectedItem, 422 (PreprocessingChartContent.LegendOrder)legendOrderComboBox.SelectedItem); 423 dataTable.VisualProperties.Title = string.Empty; 424 foreach (var dataRow in dataTable.Rows) { 425 dataRow.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0; 426 } 427 var pcv = new DataTableView { 259 428 Name = key.ToString(), 260 429 Content = dataTable, 261 430 Dock = DockStyle.Fill, 262 ShowLegend = false, 263 XAxisFormat = "G3" 431 ShowChartOnly = true 264 432 }; 265 pcv.ChartDoubleClick += HistogramDoubleClick;433 //pcv.ChartDoubleClick += HistogramDoubleClick; // ToDo: not working; double click is already handled by the chart 266 434 bodyCache.Add(key, pcv); 267 435 } else { //scatter plot 268 ScatterPlot scatterPlot = Content.CreateScatterPlot(colVariable, rowVariable); 269 PreprocessingScatterPlotView pspv = new PreprocessingScatterPlotView { 436 var scatterPlot = ScatterPlotContent.CreateScatterPlot(Content.PreprocessingData, 437 colVariable, 438 rowVariable, 439 (string)groupingComboBox.SelectedItem, 440 (PreprocessingChartContent.LegendOrder)legendOrderComboBox.SelectedItem); 441 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 442 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 443 int i = 0; 444 var colors = PreprocessingChartView.Colors; 445 foreach (var row in scatterPlot.Rows) { 446 row.VisualProperties.PointSize = (int)pointSizeNumericUpDown.Value; 447 row.VisualProperties.Color = Color.FromArgb((int)(pointOpacityNumericUpDown.Value * 255), 448 row.VisualProperties.Color.IsEmpty ? colors[i++ % colors.Length] : row.VisualProperties.Color); 449 row.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0; 450 row.VisualProperties.IsRegressionVisibleInLegend = false; 451 row.VisualProperties.RegressionType = regressionType; 452 row.VisualProperties.PolynomialRegressionOrder = order; 453 } 454 scatterPlot.VisualProperties.Title = string.Empty; 455 var scatterPlotView = new ScatterPlotView { 270 456 Name = key.ToString(), 271 457 Content = scatterPlot, 272 458 Dock = DockStyle.Fill, 273 ShowLegend = false, 274 XAxisFormat = "G3" 459 ShowName = false 460 //ShowLegend = false, 461 //XAxisFormat = "G3" 275 462 }; 276 pspv.ChartDoubleClick += ScatterPlotDoubleClick;277 bodyCache.Add(key, pspv);463 //scatterPlotView.DoubleClick += ScatterPlotDoubleClick; // ToDo: not working; double click is already handled by the chart 464 bodyCache.Add(key, scatterPlotView); 278 465 } 279 466 } … … 282 469 #endregion 283 470 471 protected override void CheckedChangedUpdate() { 472 GenerateCharts(false); // only checked-changes -> reuse cached values 473 } 474 284 475 #region Generate Charts 285 private void GenerateCharts( ) {286 var variables = GetCheckedVariables();476 private void GenerateCharts(bool clearCache) { 477 if (Content == null || SuppressCheckedChangedUpdate) return; 287 478 288 479 // Clear old layouts and cache … … 292 483 tableLayoutPanel.RowStyles.Clear(); 293 484 } 294 columnHeaderCache.Clear(); 295 rowHeaderCache.Clear(); 296 bodyCache.Clear(); 485 486 if (clearCache) { 487 foreach (var control in bodyCache.Values.Concat(columnHeaderCache.Values).Concat(rowHeaderCache.Values)) { 488 control.Dispose(); 489 } 490 columnHeaderCache.Clear(); 491 rowHeaderCache.Clear(); 492 bodyCache.Clear(); 493 } 494 495 var variables = Content.VariableItemList.Select(x => x.Value).ToList(); 297 496 298 497 // Set row and column count … … 304 503 // Set column and row layout 305 504 for (int i = 0; i < variables.Count; i++) { 306 columnHeaderTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, GetColumnWidth())); 307 rowHeaderTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, GetRowHeight())); 308 bodyTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, GetColumnWidth())); 309 bodyTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, GetRowHeight())); 505 bool @checked = Content.VariableItemList.ItemChecked(Content.VariableItemList[i]); 506 columnHeaderTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, @checked ? GetColumnWidth() : 0)); 507 rowHeaderTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, @checked ? GetRowHeight() : 0)); 508 bodyTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, @checked ? GetColumnWidth() : 0)); 509 bodyTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, @checked ? GetRowHeight() : 0)); 310 510 } 311 511 … … 318 518 319 519 private void AddHeaderToTableLayoutPanels() { 320 int i = 0; 321 foreach (var variable in GetCheckedVariables()) { 322 columnHeaderTableLayoutPanel.Controls.Add(GetColumnHeader(variable), i, 0); 323 rowHeaderTableLayoutPanel.Controls.Add(GetRowHeader(variable), 0, i); 324 i++; 520 for (int i = 0; i < Content.VariableItemList.Count; i++) { 521 var variable = Content.VariableItemList[i]; 522 if (Content.VariableItemList.ItemChecked(variable)) { 523 columnHeaderTableLayoutPanel.Controls.Add(GetColumnHeader(variable.Value), i, 0); 524 rowHeaderTableLayoutPanel.Controls.Add(GetRowHeader(variable.Value), 0, i); 525 } 325 526 } 326 527 } 327 528 private void AddChartsToTableLayoutPanel() { 328 int c = 0;329 foreach (var colVar in GetCheckedVariables()) {529 for (int c = 0; c < Content.VariableItemList.Count; c++) { 530 var colVar = Content.VariableItemList[c].Value; 330 531 if (!IsVariableChecked(colVar)) continue; 331 int r = 0;332 foreach (var rowVar in GetCheckedVariables()) {532 for (int r = 0; r < Content.VariableItemList.Count; r++) { 533 var rowVar = Content.VariableItemList[r].Value; 333 534 if (!IsVariableChecked(rowVar)) continue; 334 535 bodyTableLayoutPanel.Controls.Add(GetBody(colVar, rowVar), c, r); 335 r++; 336 } 337 c++; 338 } 536 } 537 } 538 UpdateRegressionLine(); 339 539 } 340 540 … … 344 544 //Open scatter plot in new tab with new content when double clicked 345 545 private void ScatterPlotDoubleClick(object sender, EventArgs e) { 346 PreprocessingScatterPlotView pspv = (PreprocessingScatterPlotView)sender;347 ScatterPlotContent scatterContent = new ScatterPlotContent(Content, new Cloner()); // create new content348 ScatterPlot scatterPlot = pspv.Content;546 var scatterPlotView = (ScatterPlotView)sender; 547 var scatterContent = new SingleScatterPlotContent(Content.PreprocessingData); 548 ScatterPlot scatterPlot = scatterPlotView.Content; 349 549 350 550 //Extract variable names from scatter plot and set them in content … … 355 555 } 356 556 357 MainFormManager.MainForm.ShowContent(scatterContent, typeof(ScatterPlotSingleView)); 557 MainFormManager.MainForm.ShowContent(scatterContent, typeof(ScatterPlotSingleView)); // open in new tab 358 558 } 359 559 360 560 //open histogram in new tab with new content when double clicked 361 561 private void HistogramDoubleClick(object sender, EventArgs e) { 362 PreprocessingDataTableView pcv = (PreprocessingDataTableView)sender;562 DataTableView pcv = (DataTableView)sender; 363 563 HistogramContent histoContent = new HistogramContent(Content.PreprocessingData); // create new content 364 histoContent.VariableItemList = Content.CreateVariableItemList();365 PreprocessingDataTabledataTable = pcv.Content;564 //ToDo: histoContent.VariableItemList = Content.CreateVariableItemList(); 565 var dataTable = pcv.Content; 366 566 367 567 //Set variable item list from with variable from data table … … 374 574 } 375 575 } 376 MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView)); 576 MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView)); // open in new tab 377 577 } 378 578 #endregion … … 413 613 414 614 #region Sizing of Charts 415 private int GetColumnWidth() { return (int)(bodyScrollPanel.Width * ((float)widthTrackBar.Value / 100)); } 416 private int GetRowHeight() { return (int)(bodyScrollPanel.Height * ((float)heightTrackBar.Value / 100)); } 417 private void widthTrackBar_ValueChanged(object sender, EventArgs e) { 615 private int oldWidth; 616 private int oldHeight; 617 private float AspectRatio { 618 get { 619 if (oldWidth == 0 || oldHeight == 0) return 1; 620 return (float)oldWidth / oldHeight; 621 } 622 } 623 private bool lockChange = false; 624 625 private int GetColumnWidth() { return (int)widthNumericUpDown.Value; } 626 private int GetRowHeight() { return (int)heightNumericUpDown.Value; } 627 628 private void widthNumericUpDown_ValueChanged(object sender, EventArgs e) { 418 629 frameTableLayoutPanel.SuspendRepaint(); 630 if (lockAspectCheckBox.Checked && !lockChange) { 631 lockChange = true; 632 heightNumericUpDown.Value = (int)((double)widthNumericUpDown.Value / AspectRatio); 633 lockChange = false; 634 } 419 635 for (int i = 0; i < columnHeaderTableLayoutPanel.ColumnCount; i++) { 420 columnHeaderTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth(); 421 bodyTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth(); 422 } 636 if (Content.VariableItemList.ItemChecked(Content.VariableItemList[i])) { 637 columnHeaderTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth(); 638 bodyTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth(); 639 } 640 } 641 oldWidth = GetColumnWidth(); 642 oldHeight = GetRowHeight(); 423 643 frameTableLayoutPanel.ResumeRepaint(true); 424 644 } 425 private void height TrackBar_ValueChanged(object sender, EventArgs e) {645 private void heightNumericUpDown_ValueChanged(object sender, EventArgs e) { 426 646 frameTableLayoutPanel.SuspendRepaint(); 427 647 if (lockAspectCheckBox.Checked && !lockChange) { 648 lockChange = true; 649 widthNumericUpDown.Value = (int)((double)heightNumericUpDown.Value * AspectRatio); 650 lockChange = false; 651 } 428 652 for (int i = 0; i < rowHeaderTableLayoutPanel.RowCount; i++) { 429 rowHeaderTableLayoutPanel.RowStyles[i].Height = GetRowHeight(); 430 bodyTableLayoutPanel.RowStyles[i].Height = GetRowHeight(); 431 } 653 if (Content.VariableItemList.ItemChecked(Content.VariableItemList[i])) { 654 rowHeaderTableLayoutPanel.RowStyles[i].Height = GetRowHeight(); 655 bodyTableLayoutPanel.RowStyles[i].Height = GetRowHeight(); 656 } 657 } 658 oldWidth = GetColumnWidth(); 659 oldHeight = GetRowHeight(); 432 660 frameTableLayoutPanel.ResumeRepaint(true); 661 } 662 private void pointSizeNumericUpDown_ValueChanged(object sender, EventArgs e) { 663 int pointSize = (int)pointSizeNumericUpDown.Value; 664 foreach (var control in bodyCache.ToList()) { 665 var scatterPlotView = control.Value as ScatterPlotView; 666 if (scatterPlotView != null) { 667 foreach (var row in scatterPlotView.Content.Rows) { 668 row.VisualProperties.PointSize = pointSize; 669 } 670 } 671 } 672 } 673 private void pointOpacityNumericUpDown_ValueChanged(object sender, EventArgs e) { 674 float opacity = (float)pointOpacityNumericUpDown.Value; 675 foreach (var control in bodyCache.ToList()) { 676 var scatterPlotView = control.Value as ScatterPlotView; 677 if (scatterPlotView != null) { 678 foreach (var row in scatterPlotView.Content.Rows) { 679 var color = row.VisualProperties.Color; 680 if (color.IsEmpty) 681 color = PreprocessingChartView.Colors.First(); 682 row.VisualProperties.Color = Color.FromArgb((int)(opacity * 255), color); 683 } 684 } 685 } 686 } 687 #endregion 688 689 #region Regression Line 690 private void regressionTypeComboBox_SelectedValueChanged(object sender, EventArgs e) { 691 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 692 polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial; 693 UpdateRegressionLine(); 694 } 695 696 private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) { 697 UpdateRegressionLine(); 698 } 699 700 private void UpdateRegressionLine() { 701 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 702 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 703 704 foreach (var control in bodyCache.ToList()) { 705 // hidden chart => reset cache 706 if (!bodyTableLayoutPanel.Controls.Contains(control.Value)) { 707 bodyCache.Remove(control.Key); 708 } 709 710 var scatterPlotView = control.Value as ScatterPlotView; 711 if (scatterPlotView != null) { 712 foreach (var row in scatterPlotView.Content.Rows) { 713 row.VisualProperties.IsRegressionVisibleInLegend = false; 714 row.VisualProperties.RegressionType = regressionType; 715 row.VisualProperties.PolynomialRegressionOrder = order; 716 } 717 } 718 } 719 } 720 #endregion 721 722 #region Grouping 723 private void groupingComboBox_SelectedIndexChanged(object sender, EventArgs e) { 724 aggregationLabel.Enabled = groupingComboBox.SelectedIndex > 0; 725 aggregationComboBox.Enabled = groupingComboBox.SelectedIndex > 0; 726 legendGroupBox.Enabled = groupingComboBox.SelectedIndex > 0; 727 GenerateCharts(true); // new series within charts -> clear cache 728 } 729 730 private void aggregationComboBox_SelectedIndexChanged(object sender, EventArgs e) { 731 var aggregation = (AggregationType)aggregationComboBox.SelectedValue; 732 foreach (var control in bodyCache.ToList()) { 733 // hidden chart => reset cache 734 if (!bodyTableLayoutPanel.Controls.Contains(control.Value)) { 735 bodyCache.Remove(control.Key); 736 } 737 738 var histogramView = control.Value as DataTableView; 739 if (histogramView != null) { 740 histogramView.Content.VisualProperties.HistogramAggregation = aggregation; 741 } 742 } 743 } 744 745 private void legendCheckbox_CheckedChanged(object sender, EventArgs e) { 746 foreach (var control in bodyCache.ToList()) { 747 var histogramControl = control.Value as DataTableView; 748 if (histogramControl != null) { 749 foreach (var row in histogramControl.Content.Rows) { 750 row.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0; 751 } 752 } 753 var scatterplotControl = control.Value as ScatterPlotView; 754 if (scatterplotControl != null) { 755 foreach (var row in scatterplotControl.Content.Rows) { 756 row.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0; 757 } 758 } 759 } 760 } 761 762 private void legendOrderComboBox_SelectedIndexChanged(object sender, EventArgs e) { 763 GenerateCharts(true); 433 764 } 434 765 #endregion 435 766 } 436 767 } 768 -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs
r14186 r15242 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.scatterPlotView = new HeuristicLab.DataPreprocessing.Views.PreprocessingScatterPlotView(); 48 this.groupBox1 = new System.Windows.Forms.GroupBox(); 49 this.label2 = new System.Windows.Forms.Label(); 50 this.label1 = new System.Windows.Forms.Label(); 47 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ScatterPlotSingleView)); 48 this.scatterPlotView = new HeuristicLab.Analysis.Views.ScatterPlotView(); 49 this.variablesGroupBox = new System.Windows.Forms.GroupBox(); 50 this.orderComboBox = new System.Windows.Forms.ComboBox(); 51 this.legendOrderLabel = new System.Windows.Forms.Label(); 52 this.useGradientCheckBox = new System.Windows.Forms.CheckBox(); 53 this.groupLabel = new System.Windows.Forms.Label(); 54 this.yLabel = new System.Windows.Forms.Label(); 55 this.xLabel = new System.Windows.Forms.Label(); 56 this.comboBoxGroup = new System.Windows.Forms.ComboBox(); 51 57 this.comboBoxYVariable = new System.Windows.Forms.ComboBox(); 52 58 this.comboBoxXVariable = new System.Windows.Forms.ComboBox(); 53 this.label3 = new System.Windows.Forms.Label(); 54 this.comboBoxColor = new System.Windows.Forms.ComboBox(); 55 this.groupBox1.SuspendLayout(); 59 this.regressionGroupBox = new System.Windows.Forms.GroupBox(); 60 this.regressionTypeComboBox = new System.Windows.Forms.ComboBox(); 61 this.polynomialRegressionOrderNumericUpDown = new System.Windows.Forms.NumericUpDown(); 62 this.orderLabel = new System.Windows.Forms.Label(); 63 this.regressionTypeLabel = new System.Windows.Forms.Label(); 64 this.splitContainer = new System.Windows.Forms.SplitContainer(); 65 this.gradientPanel = new System.Windows.Forms.Panel(); 66 this.gradientPictureBox = new System.Windows.Forms.PictureBox(); 67 this.gradientMinimumLabel = new System.Windows.Forms.Label(); 68 this.gradientMaximumLabel = new System.Windows.Forms.Label(); 69 this.variablesGroupBox.SuspendLayout(); 70 this.regressionGroupBox.SuspendLayout(); 71 ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).BeginInit(); 72 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 73 this.splitContainer.Panel1.SuspendLayout(); 74 this.splitContainer.Panel2.SuspendLayout(); 75 this.splitContainer.SuspendLayout(); 76 this.gradientPanel.SuspendLayout(); 77 ((System.ComponentModel.ISupportInitialize)(this.gradientPictureBox)).BeginInit(); 56 78 this.SuspendLayout(); 57 79 // 58 80 // scatterPlotView 59 81 // 60 this.scatterPlotView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 61 | System.Windows.Forms.AnchorStyles.Left) 62 | System.Windows.Forms.AnchorStyles.Right))); 63 this.scatterPlotView.Caption = "ScatterPlot View"; 82 this.scatterPlotView.Caption = "View"; 64 83 this.scatterPlotView.Content = null; 65 this.scatterPlotView.Location = new System.Drawing.Point(169, 3); 84 this.scatterPlotView.Dock = System.Windows.Forms.DockStyle.Fill; 85 this.scatterPlotView.Location = new System.Drawing.Point(0, 0); 66 86 this.scatterPlotView.Name = "scatterPlotView"; 67 87 this.scatterPlotView.ReadOnly = false; 68 this.scatterPlotView.Size = new System.Drawing.Size(689, 509); 88 this.scatterPlotView.ShowName = false; 89 this.scatterPlotView.Size = new System.Drawing.Size(618, 517); 69 90 this.scatterPlotView.TabIndex = 0; 70 91 // 71 // groupBox1 72 // 73 this.groupBox1.Controls.Add(this.label3); 74 this.groupBox1.Controls.Add(this.label2); 75 this.groupBox1.Controls.Add(this.label1); 76 this.groupBox1.Controls.Add(this.comboBoxColor); 77 this.groupBox1.Controls.Add(this.comboBoxYVariable); 78 this.groupBox1.Controls.Add(this.comboBoxXVariable); 79 this.groupBox1.Location = new System.Drawing.Point(3, 3); 80 this.groupBox1.Name = "groupBox1"; 81 this.groupBox1.Size = new System.Drawing.Size(160, 215); 82 this.groupBox1.TabIndex = 1; 83 this.groupBox1.TabStop = false; 84 this.groupBox1.Text = "Options"; 85 // 86 // label2 87 // 88 this.label2.AutoSize = true; 89 this.label2.Location = new System.Drawing.Point(17, 80); 90 this.label2.Name = "label2"; 91 this.label2.Size = new System.Drawing.Size(55, 13); 92 this.label2.TabIndex = 3; 93 this.label2.Text = "Y Variable"; 94 // 95 // label1 96 // 97 this.label1.AutoSize = true; 98 this.label1.Location = new System.Drawing.Point(17, 25); 99 this.label1.Name = "label1"; 100 this.label1.Size = new System.Drawing.Size(55, 13); 101 this.label1.TabIndex = 2; 102 this.label1.Text = "X Variable"; 92 // variablesGroupBox 93 // 94 this.variablesGroupBox.Controls.Add(this.orderComboBox); 95 this.variablesGroupBox.Controls.Add(this.legendOrderLabel); 96 this.variablesGroupBox.Controls.Add(this.useGradientCheckBox); 97 this.variablesGroupBox.Controls.Add(this.groupLabel); 98 this.variablesGroupBox.Controls.Add(this.yLabel); 99 this.variablesGroupBox.Controls.Add(this.xLabel); 100 this.variablesGroupBox.Controls.Add(this.comboBoxGroup); 101 this.variablesGroupBox.Controls.Add(this.comboBoxYVariable); 102 this.variablesGroupBox.Controls.Add(this.comboBoxXVariable); 103 this.variablesGroupBox.Dock = System.Windows.Forms.DockStyle.Top; 104 this.variablesGroupBox.Location = new System.Drawing.Point(0, 0); 105 this.variablesGroupBox.Name = "variablesGroupBox"; 106 this.variablesGroupBox.Size = new System.Drawing.Size(172, 178); 107 this.variablesGroupBox.TabIndex = 1; 108 this.variablesGroupBox.TabStop = false; 109 this.variablesGroupBox.Text = "Variables"; 110 // 111 // orderComboBox 112 // 113 this.orderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 114 this.orderComboBox.FormattingEnabled = true; 115 this.orderComboBox.Location = new System.Drawing.Point(51, 144); 116 this.orderComboBox.Name = "orderComboBox"; 117 this.orderComboBox.Size = new System.Drawing.Size(115, 21); 118 this.orderComboBox.TabIndex = 6; 119 this.orderComboBox.SelectedIndexChanged += new System.EventHandler(this.orderComboBox_SelectedIndexChanged); 120 // 121 // legendOrderLabel 122 // 123 this.legendOrderLabel.AutoSize = true; 124 this.legendOrderLabel.Location = new System.Drawing.Point(6, 149); 125 this.legendOrderLabel.Name = "legendOrderLabel"; 126 this.legendOrderLabel.Size = new System.Drawing.Size(36, 13); 127 this.legendOrderLabel.TabIndex = 5; 128 this.legendOrderLabel.Text = "Order:"; 129 this.legendOrderLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 130 // 131 // useGradientCheckBox 132 // 133 this.useGradientCheckBox.AutoSize = true; 134 this.useGradientCheckBox.Location = new System.Drawing.Point(51, 121); 135 this.useGradientCheckBox.Name = "useGradientCheckBox"; 136 this.useGradientCheckBox.Size = new System.Drawing.Size(115, 17); 137 this.useGradientCheckBox.TabIndex = 4; 138 this.useGradientCheckBox.Text = "Use Color Gradient"; 139 this.useGradientCheckBox.UseVisualStyleBackColor = true; 140 this.useGradientCheckBox.CheckedChanged += new System.EventHandler(this.useGradientCheckBox_CheckedChanged); 141 // 142 // groupLabel 143 // 144 this.groupLabel.AutoSize = true; 145 this.groupLabel.Location = new System.Drawing.Point(6, 97); 146 this.groupLabel.Name = "groupLabel"; 147 this.groupLabel.Size = new System.Drawing.Size(39, 13); 148 this.groupLabel.TabIndex = 3; 149 this.groupLabel.Text = "Group:"; 150 // 151 // yLabel 152 // 153 this.yLabel.AutoSize = true; 154 this.yLabel.Location = new System.Drawing.Point(6, 63); 155 this.yLabel.Name = "yLabel"; 156 this.yLabel.Size = new System.Drawing.Size(17, 13); 157 this.yLabel.TabIndex = 3; 158 this.yLabel.Text = "Y:"; 159 // 160 // xLabel 161 // 162 this.xLabel.AutoSize = true; 163 this.xLabel.Location = new System.Drawing.Point(6, 29); 164 this.xLabel.Name = "xLabel"; 165 this.xLabel.Size = new System.Drawing.Size(17, 13); 166 this.xLabel.TabIndex = 2; 167 this.xLabel.Text = "X:"; 168 // 169 // comboBoxGroup 170 // 171 this.comboBoxGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 172 | System.Windows.Forms.AnchorStyles.Right))); 173 this.comboBoxGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 174 this.comboBoxGroup.FormattingEnabled = true; 175 this.comboBoxGroup.Location = new System.Drawing.Point(51, 94); 176 this.comboBoxGroup.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3); 177 this.comboBoxGroup.Name = "comboBoxGroup"; 178 this.comboBoxGroup.Size = new System.Drawing.Size(115, 21); 179 this.comboBoxGroup.TabIndex = 1; 180 this.comboBoxGroup.SelectedIndexChanged += new System.EventHandler(this.comboBoxGroup_SelectedIndexChanged); 103 181 // 104 182 // comboBoxYVariable 105 183 // 184 this.comboBoxYVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 185 | System.Windows.Forms.AnchorStyles.Right))); 106 186 this.comboBoxYVariable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 107 187 this.comboBoxYVariable.FormattingEnabled = true; 108 this.comboBoxYVariable.Location = new System.Drawing.Point( 20, 103);188 this.comboBoxYVariable.Location = new System.Drawing.Point(51, 60); 109 189 this.comboBoxYVariable.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3); 110 190 this.comboBoxYVariable.Name = "comboBoxYVariable"; 111 this.comboBoxYVariable.Size = new System.Drawing.Size(1 21, 21);191 this.comboBoxYVariable.Size = new System.Drawing.Size(115, 21); 112 192 this.comboBoxYVariable.TabIndex = 1; 113 this.comboBoxYVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox _SelectedIndexChanged);193 this.comboBoxYVariable.SelectedIndexChanged += new System.EventHandler(this.comboBoxYVariable_SelectedIndexChanged); 114 194 // 115 195 // comboBoxXVariable 116 196 // 197 this.comboBoxXVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 198 | System.Windows.Forms.AnchorStyles.Right))); 117 199 this.comboBoxXVariable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 118 200 this.comboBoxXVariable.FormattingEnabled = true; 119 this.comboBoxXVariable.Location = new System.Drawing.Point( 20, 48);201 this.comboBoxXVariable.Location = new System.Drawing.Point(51, 26); 120 202 this.comboBoxXVariable.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3); 121 203 this.comboBoxXVariable.Name = "comboBoxXVariable"; 122 this.comboBoxXVariable.Size = new System.Drawing.Size(1 21, 21);204 this.comboBoxXVariable.Size = new System.Drawing.Size(115, 21); 123 205 this.comboBoxXVariable.TabIndex = 0; 124 this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged); 125 // 126 // label3 127 // 128 this.label3.AutoSize = true; 129 this.label3.Location = new System.Drawing.Point(17, 141); 130 this.label3.Name = "label3"; 131 this.label3.Size = new System.Drawing.Size(31, 13); 132 this.label3.TabIndex = 3; 133 this.label3.Text = "Color"; 134 // 135 // comboBoxColor 136 // 137 this.comboBoxColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 138 this.comboBoxColor.FormattingEnabled = true; 139 this.comboBoxColor.Location = new System.Drawing.Point(20, 164); 140 this.comboBoxColor.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3); 141 this.comboBoxColor.Name = "comboBoxColor"; 142 this.comboBoxColor.Size = new System.Drawing.Size(121, 21); 143 this.comboBoxColor.TabIndex = 1; 144 this.comboBoxColor.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged); 206 this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBoxXVariable_SelectedIndexChanged); 207 // 208 // regressionGroupBox 209 // 210 this.regressionGroupBox.Controls.Add(this.regressionTypeComboBox); 211 this.regressionGroupBox.Controls.Add(this.polynomialRegressionOrderNumericUpDown); 212 this.regressionGroupBox.Controls.Add(this.orderLabel); 213 this.regressionGroupBox.Controls.Add(this.regressionTypeLabel); 214 this.regressionGroupBox.Dock = System.Windows.Forms.DockStyle.Top; 215 this.regressionGroupBox.Location = new System.Drawing.Point(0, 178); 216 this.regressionGroupBox.Name = "regressionGroupBox"; 217 this.regressionGroupBox.Size = new System.Drawing.Size(172, 78); 218 this.regressionGroupBox.TabIndex = 4; 219 this.regressionGroupBox.TabStop = false; 220 this.regressionGroupBox.Text = "Regression"; 221 // 222 // regressionTypeComboBox 223 // 224 this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 225 | System.Windows.Forms.AnchorStyles.Right))); 226 this.regressionTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 227 this.regressionTypeComboBox.FormattingEnabled = true; 228 this.regressionTypeComboBox.Location = new System.Drawing.Point(51, 19); 229 this.regressionTypeComboBox.Name = "regressionTypeComboBox"; 230 this.regressionTypeComboBox.Size = new System.Drawing.Size(115, 21); 231 this.regressionTypeComboBox.TabIndex = 14; 232 this.regressionTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.regressionTypeComboBox_SelectedIndexChanged); 233 // 234 // polynomialRegressionOrderNumericUpDown 235 // 236 this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 237 | System.Windows.Forms.AnchorStyles.Right))); 238 this.polynomialRegressionOrderNumericUpDown.Location = new System.Drawing.Point(51, 47); 239 this.polynomialRegressionOrderNumericUpDown.Margin = new System.Windows.Forms.Padding(9, 3, 3, 3); 240 this.polynomialRegressionOrderNumericUpDown.Maximum = new decimal(new int[] { 241 6, 242 0, 243 0, 244 0}); 245 this.polynomialRegressionOrderNumericUpDown.Minimum = new decimal(new int[] { 246 2, 247 0, 248 0, 249 0}); 250 this.polynomialRegressionOrderNumericUpDown.Name = "polynomialRegressionOrderNumericUpDown"; 251 this.polynomialRegressionOrderNumericUpDown.Size = new System.Drawing.Size(115, 20); 252 this.polynomialRegressionOrderNumericUpDown.TabIndex = 15; 253 this.polynomialRegressionOrderNumericUpDown.Value = new decimal(new int[] { 254 2, 255 0, 256 0, 257 0}); 258 this.polynomialRegressionOrderNumericUpDown.ValueChanged += new System.EventHandler(this.polynomialRegressionOrderNumericUpDown_ValueChanged); 259 // 260 // orderLabel 261 // 262 this.orderLabel.AutoSize = true; 263 this.orderLabel.Location = new System.Drawing.Point(6, 49); 264 this.orderLabel.Name = "orderLabel"; 265 this.orderLabel.Size = new System.Drawing.Size(36, 13); 266 this.orderLabel.TabIndex = 16; 267 this.orderLabel.Text = "Order:"; 268 // 269 // regressionTypeLabel 270 // 271 this.regressionTypeLabel.AutoSize = true; 272 this.regressionTypeLabel.Location = new System.Drawing.Point(6, 22); 273 this.regressionTypeLabel.Name = "regressionTypeLabel"; 274 this.regressionTypeLabel.Size = new System.Drawing.Size(34, 13); 275 this.regressionTypeLabel.TabIndex = 13; 276 this.regressionTypeLabel.Text = "Type:"; 277 // 278 // splitContainer 279 // 280 this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; 281 this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; 282 this.splitContainer.Location = new System.Drawing.Point(0, 0); 283 this.splitContainer.Name = "splitContainer"; 284 // 285 // splitContainer.Panel1 286 // 287 this.splitContainer.Panel1.Controls.Add(this.regressionGroupBox); 288 this.splitContainer.Panel1.Controls.Add(this.variablesGroupBox); 289 // 290 // splitContainer.Panel2 291 // 292 this.splitContainer.Panel2.Controls.Add(this.scatterPlotView); 293 this.splitContainer.Panel2.Controls.Add(this.gradientPanel); 294 this.splitContainer.Size = new System.Drawing.Size(863, 517); 295 this.splitContainer.SplitterDistance = 172; 296 this.splitContainer.TabIndex = 5; 297 // 298 // gradientPanel 299 // 300 this.gradientPanel.Controls.Add(this.gradientPictureBox); 301 this.gradientPanel.Controls.Add(this.gradientMinimumLabel); 302 this.gradientPanel.Controls.Add(this.gradientMaximumLabel); 303 this.gradientPanel.Dock = System.Windows.Forms.DockStyle.Right; 304 this.gradientPanel.Location = new System.Drawing.Point(618, 0); 305 this.gradientPanel.Name = "gradientPanel"; 306 this.gradientPanel.Size = new System.Drawing.Size(69, 517); 307 this.gradientPanel.TabIndex = 1; 308 this.gradientPanel.Visible = false; 309 // 310 // gradientPictureBox 311 // 312 this.gradientPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 313 | System.Windows.Forms.AnchorStyles.Left) 314 | System.Windows.Forms.AnchorStyles.Right))); 315 this.gradientPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 316 this.gradientPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("gradientPictureBox.Image"))); 317 this.gradientPictureBox.Location = new System.Drawing.Point(17, 29); 318 this.gradientPictureBox.Name = "gradientPictureBox"; 319 this.gradientPictureBox.Size = new System.Drawing.Size(35, 460); 320 this.gradientPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 321 this.gradientPictureBox.TabIndex = 19; 322 this.gradientPictureBox.TabStop = false; 323 // 324 // gradientMinimumLabel 325 // 326 this.gradientMinimumLabel.BackColor = System.Drawing.Color.Transparent; 327 this.gradientMinimumLabel.Dock = System.Windows.Forms.DockStyle.Bottom; 328 this.gradientMinimumLabel.Location = new System.Drawing.Point(0, 492); 329 this.gradientMinimumLabel.Name = "gradientMinimumLabel"; 330 this.gradientMinimumLabel.Size = new System.Drawing.Size(69, 25); 331 this.gradientMinimumLabel.TabIndex = 18; 332 this.gradientMinimumLabel.Text = "0.0"; 333 this.gradientMinimumLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; 334 // 335 // gradientMaximumLabel 336 // 337 this.gradientMaximumLabel.BackColor = System.Drawing.Color.Transparent; 338 this.gradientMaximumLabel.Dock = System.Windows.Forms.DockStyle.Top; 339 this.gradientMaximumLabel.Location = new System.Drawing.Point(0, 0); 340 this.gradientMaximumLabel.Name = "gradientMaximumLabel"; 341 this.gradientMaximumLabel.Size = new System.Drawing.Size(69, 25); 342 this.gradientMaximumLabel.TabIndex = 17; 343 this.gradientMaximumLabel.Text = "1.0"; 344 this.gradientMaximumLabel.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 145 345 // 146 346 // ScatterPlotSingleView … … 148 348 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 149 349 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 150 this.Controls.Add(this.groupBox1); 151 this.Controls.Add(this.scatterPlotView); 350 this.Controls.Add(this.splitContainer); 152 351 this.Name = "ScatterPlotSingleView"; 153 352 this.Size = new System.Drawing.Size(863, 517); 154 this.groupBox1.ResumeLayout(false); 155 this.groupBox1.PerformLayout(); 353 this.variablesGroupBox.ResumeLayout(false); 354 this.variablesGroupBox.PerformLayout(); 355 this.regressionGroupBox.ResumeLayout(false); 356 this.regressionGroupBox.PerformLayout(); 357 ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).EndInit(); 358 this.splitContainer.Panel1.ResumeLayout(false); 359 this.splitContainer.Panel2.ResumeLayout(false); 360 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 361 this.splitContainer.ResumeLayout(false); 362 this.gradientPanel.ResumeLayout(false); 363 ((System.ComponentModel.ISupportInitialize)(this.gradientPictureBox)).EndInit(); 156 364 this.ResumeLayout(false); 157 365 … … 160 368 #endregion 161 369 162 private HeuristicLab. DataPreprocessing.Views.PreprocessingScatterPlotView scatterPlotView;163 private System.Windows.Forms.GroupBox groupBox1;164 private System.Windows.Forms.Label label2;165 private System.Windows.Forms.Label label1;370 private HeuristicLab.Analysis.Views.ScatterPlotView scatterPlotView; 371 private System.Windows.Forms.GroupBox variablesGroupBox; 372 private System.Windows.Forms.Label yLabel; 373 private System.Windows.Forms.Label xLabel; 166 374 private System.Windows.Forms.ComboBox comboBoxYVariable; 167 375 private System.Windows.Forms.ComboBox comboBoxXVariable; 168 private System.Windows.Forms.ComboBox comboBoxColor; 169 private System.Windows.Forms.Label label3; 376 private System.Windows.Forms.ComboBox comboBoxGroup; 377 private System.Windows.Forms.Label groupLabel; 378 private System.Windows.Forms.GroupBox regressionGroupBox; 379 private System.Windows.Forms.ComboBox regressionTypeComboBox; 380 private System.Windows.Forms.NumericUpDown polynomialRegressionOrderNumericUpDown; 381 private System.Windows.Forms.Label orderLabel; 382 private System.Windows.Forms.Label regressionTypeLabel; 383 private System.Windows.Forms.SplitContainer splitContainer; 384 private System.Windows.Forms.CheckBox useGradientCheckBox; 385 private System.Windows.Forms.Panel gradientPanel; 386 private System.Windows.Forms.Label gradientMinimumLabel; 387 private System.Windows.Forms.Label gradientMaximumLabel; 388 private System.Windows.Forms.PictureBox gradientPictureBox; 389 private System.Windows.Forms.Label legendOrderLabel; 390 private System.Windows.Forms.ComboBox orderComboBox; 170 391 } 171 392 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs
r14186 r15242 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing; 24 25 using System.Linq; 25 26 using HeuristicLab.Analysis; 27 using HeuristicLab.Common; 26 28 using HeuristicLab.Core.Views; 27 29 using HeuristicLab.MainForm; 30 using RegressionType = HeuristicLab.Analysis.ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType; 28 31 29 32 namespace HeuristicLab.DataPreprocessing.Views { 30 33 31 34 [View("Scatter Plot Single View")] 32 [Content(typeof(ScatterPlotContent), true)] 33 public partial class ScatterPlotSingleView : ItemView { 34 35 public new ScatterPlotContent Content { 36 get { return (ScatterPlotContent)base.Content; } 35 [Content(typeof(SingleScatterPlotContent), true)] 36 public sealed partial class ScatterPlotSingleView : ItemView { 37 private readonly string NoGroupItem = ""; 38 39 public new SingleScatterPlotContent Content { 40 get { return (SingleScatterPlotContent)base.Content; } 37 41 set { base.Content = value; } 38 42 } … … 40 44 public ScatterPlotSingleView() { 41 45 InitializeComponent(); 42 } 43 44 public void InitData() { 46 47 regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType)); 48 regressionTypeComboBox.SelectedItem = RegressionType.None; 49 orderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder)); 50 orderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Alphabetically; 51 } 52 53 protected override void SetEnabledStateOfControls() { 54 base.SetEnabledStateOfControls(); 55 useGradientCheckBox.Enabled = (string)comboBoxGroup.SelectedItem != NoGroupItem; 56 gradientPanel.Visible = useGradientCheckBox.Enabled && useGradientCheckBox.Checked; ; 57 } 58 59 protected override void OnContentChanged() { 60 base.OnContentChanged(); 61 if (Content != null) { 62 InitData(); 63 } 64 } 65 66 private void InitData() { 45 67 IEnumerable<string> variables = Content.PreprocessingData.GetDoubleVariableNames(); 46 68 47 // add variables to combo boxes48 69 comboBoxXVariable.Items.Clear(); 49 70 comboBoxYVariable.Items.Clear(); 50 comboBoxColor.Items.Clear(); 71 comboBoxGroup.Items.Clear(); 72 51 73 comboBoxXVariable.Items.AddRange(variables.ToArray()); 52 74 comboBoxYVariable.Items.AddRange(variables.ToArray()); 53 comboBoxColor.Items.Add("-"); 54 for (int i = 0; i < Content.PreprocessingData.Columns; ++i) { 55 if (Content.PreprocessingData.VariableHasType<double>(i)) { 56 double distinctValueCount = Content.PreprocessingData.GetValues<double>(i).GroupBy(x => x).Count(); 57 if (distinctValueCount <= 20) 58 comboBoxColor.Items.Add(Content.PreprocessingData.GetVariableName(i)); 59 } 60 } 75 comboBoxGroup.Items.Add(NoGroupItem); 76 foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData, 50)) { 77 comboBoxGroup.Items.Add(var); 78 } 79 comboBoxGroup.SelectedItem = Content.GroupingVariable ?? NoGroupItem; 61 80 62 81 // use x and y variable from content 63 if (Content.SelectedXVariable != null && Content.SelectedYVariable != null && Content. SelectedColorVariable != null) {82 if (Content.SelectedXVariable != null && Content.SelectedYVariable != null && Content.GroupingVariable != null) { 64 83 comboBoxXVariable.SelectedItem = Content.SelectedXVariable; 65 84 comboBoxYVariable.SelectedItem = Content.SelectedYVariable; 66 comboBox Color.SelectedItem = Content.SelectedColorVariable;85 comboBoxGroup.SelectedItem = Content.GroupingVariable; 67 86 } else { 68 87 if (variables.Count() >= 2) { 69 88 comboBoxXVariable.SelectedIndex = 0; 70 89 comboBoxYVariable.SelectedIndex = 1; 71 comboBox Color.SelectedIndex = 0;90 comboBoxGroup.SelectedIndex = 0; 72 91 UpdateScatterPlot(); 73 92 } … … 75 94 } 76 95 77 protected override void OnContentChanged() {78 base.OnContentChanged();79 if (Content != null) {80 InitData();81 }82 }83 84 private void comboBox_SelectedIndexChanged(object sender, EventArgs e) {85 UpdateScatterPlot();86 }87 88 96 private void UpdateScatterPlot() { 89 if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null && comboBoxColor.SelectedItem != null) { 90 //get scatter plot with selected x and y variable 91 ScatterPlot scatterPlot = Content.CreateScatterPlot( 92 (string)comboBoxXVariable.SelectedItem, 93 (string)comboBoxYVariable.SelectedItem, 94 (string)comboBoxColor.SelectedItem); 97 if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null && comboBoxGroup.SelectedItem != null) { 98 var xVariable = (string)comboBoxXVariable.SelectedItem; 99 var yVariable = (string)comboBoxYVariable.SelectedItem; 100 var groupVariable = (string)comboBoxGroup.SelectedItem; 101 var legendOrder = (PreprocessingChartContent.LegendOrder)orderComboBox.SelectedItem; 102 103 ScatterPlot scatterPlot = ScatterPlotContent.CreateScatterPlot(Content.PreprocessingData, xVariable, yVariable, groupVariable, legendOrder); 104 //rows are saved and removed to avoid firing of visual property changed events 105 var rows = scatterPlot.Rows.ToList(); 106 scatterPlot.Rows.Clear(); 107 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 108 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 109 foreach (var row in rows) { 110 row.VisualProperties.PointSize = 6; 111 row.VisualProperties.IsRegressionVisibleInLegend = false; 112 row.VisualProperties.RegressionType = regressionType; 113 row.VisualProperties.PolynomialRegressionOrder = order; 114 row.VisualProperties.IsVisibleInLegend = !useGradientCheckBox.Checked; 115 } 116 scatterPlot.Rows.AddRange(rows); 117 var vp = scatterPlot.VisualProperties; 118 vp.Title = string.Empty; 119 vp.XAxisTitle = xVariable; 120 vp.YAxisTitle = yVariable; 121 95 122 scatterPlotView.Content = scatterPlot; 96 123 … … 98 125 this.Content.SelectedXVariable = (string)comboBoxXVariable.SelectedItem; 99 126 this.Content.SelectedYVariable = (string)comboBoxYVariable.SelectedItem; 100 this.Content.SelectedColorVariable = (string)comboBoxColor.SelectedItem; 101 } 127 this.Content.GroupingVariable = (string)comboBoxGroup.SelectedItem; 128 } 129 } 130 131 private void comboBoxXVariable_SelectedIndexChanged(object sender, EventArgs e) { 132 var oldPlot = scatterPlotView.Content; 133 UpdateScatterPlot(); 134 var newPlot = scatterPlotView.Content; 135 136 if (oldPlot == null || newPlot == null) return; 137 newPlot.VisualProperties.YAxisMinimumAuto = oldPlot.VisualProperties.YAxisMinimumAuto; 138 newPlot.VisualProperties.YAxisMaximumAuto = oldPlot.VisualProperties.YAxisMaximumAuto; 139 newPlot.VisualProperties.YAxisMinimumFixedValue = oldPlot.VisualProperties.YAxisMinimumFixedValue; 140 newPlot.VisualProperties.YAxisMaximumFixedValue = oldPlot.VisualProperties.YAxisMaximumFixedValue; 141 142 foreach (var x in newPlot.Rows.Zip(oldPlot.Rows, (nr, or) => new { nr, or })) { 143 var newVisuapProperties = (ScatterPlotDataRowVisualProperties)x.or.VisualProperties.Clone(); 144 newVisuapProperties.DisplayName = x.nr.VisualProperties.DisplayName; 145 x.nr.VisualProperties = newVisuapProperties; 146 } 147 } 148 149 private void comboBoxYVariable_SelectedIndexChanged(object sender, EventArgs e) { 150 SuspendRepaint(); 151 var oldPlot = scatterPlotView.Content; 152 UpdateScatterPlot(); 153 var newPlot = scatterPlotView.Content; 154 155 if (oldPlot == null || newPlot == null) return; 156 newPlot.VisualProperties.XAxisMinimumAuto = oldPlot.VisualProperties.XAxisMinimumAuto; 157 newPlot.VisualProperties.XAxisMaximumAuto = oldPlot.VisualProperties.XAxisMaximumAuto; 158 newPlot.VisualProperties.XAxisMinimumFixedValue = oldPlot.VisualProperties.XAxisMinimumFixedValue; 159 newPlot.VisualProperties.XAxisMaximumFixedValue = oldPlot.VisualProperties.XAxisMaximumFixedValue; 160 161 foreach (var x in newPlot.Rows.Zip(oldPlot.Rows, (nr, or) => new { nr, or })) { 162 var newVisuapProperties = (ScatterPlotDataRowVisualProperties)x.or.VisualProperties.Clone(); 163 newVisuapProperties.DisplayName = x.nr.VisualProperties.DisplayName; 164 x.nr.VisualProperties = newVisuapProperties; 165 } 166 ResumeRepaint(true); 167 } 168 169 private void comboBoxGroup_SelectedIndexChanged(object sender, EventArgs e) { 170 useGradientCheckBox.Enabled = (string)comboBoxGroup.SelectedItem != NoGroupItem && Content.PreprocessingData.GetDoubleVariableNames().Contains((string)comboBoxGroup.SelectedItem); 171 gradientPanel.Visible = useGradientCheckBox.Enabled && useGradientCheckBox.Checked; 172 UpdateScatterPlot(); 173 } 174 175 #region Regression Line 176 private void regressionTypeComboBox_SelectedIndexChanged(object sender, EventArgs e) { 177 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 178 polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial; 179 180 UpdateRegressionLine(); 181 } 182 183 private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) { 184 UpdateRegressionLine(); 185 } 186 187 private void UpdateRegressionLine() { 188 if (Content == null) return; 189 190 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 191 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 192 193 foreach (var row in scatterPlotView.Content.Rows) { 194 row.VisualProperties.IsRegressionVisibleInLegend = false; 195 row.VisualProperties.RegressionType = regressionType; 196 row.VisualProperties.PolynomialRegressionOrder = order; 197 } 198 } 199 #endregion 200 201 private void useGradientCheckBox_CheckedChanged(object sender, EventArgs e) { 202 gradientPanel.Visible = useGradientCheckBox.Enabled && useGradientCheckBox.Checked; 203 204 // remove rows and re-add them later to avoid firing visual property changd events 205 var rows = scatterPlotView.Content.Rows.ToDictionary(r => r.Name, r => r); 206 scatterPlotView.Content.Rows.Clear(); 207 208 if (useGradientCheckBox.Checked) { 209 var groupVariable = (string)comboBoxGroup.SelectedItem; 210 if (groupVariable == NoGroupItem) return; 211 212 var groupValues = Content.PreprocessingData.GetValues<double>(Content.PreprocessingData.GetColumnIndex(groupVariable)) 213 .Distinct().OrderBy(x => x).ToList(); 214 double min = groupValues.FirstOrDefault(x => !double.IsNaN(x)), max = groupValues.LastOrDefault(x => !double.IsNaN(x)); 215 foreach (var group in groupValues) { 216 ScatterPlotDataRow row; 217 if (rows.TryGetValue(group.ToString("R"), out row)) { 218 row.VisualProperties.Color = GetColor(group, min, max); 219 row.VisualProperties.IsVisibleInLegend = false; 220 } 221 } 222 gradientMinimumLabel.Text = min.ToString("G5"); 223 gradientMaximumLabel.Text = max.ToString("G5"); 224 } else { 225 foreach (var row in rows.Values) { 226 row.VisualProperties.Color = Color.Empty; 227 row.VisualProperties.IsVisibleInLegend = true; 228 } 229 } 230 scatterPlotView.Content.Rows.AddRange(rows.Values); 231 } 232 233 private static Color GetColor(double value, double min, double max) { 234 if (double.IsNaN(value)) { 235 return Color.Black; 236 } 237 var colors = ColorGradient.Colors; 238 int index = (int)((colors.Count - 1) * (value - min) / (max - min)); 239 if (index >= colors.Count) index = colors.Count - 1; 240 if (index < 0) index = 0; 241 return colors[index]; 242 } 243 244 private void orderComboBox_SelectedIndexChanged(object sender, EventArgs e) { 245 UpdateScatterPlot(); 102 246 } 103 247 } 104 248 } 249 -
stable/HeuristicLab.DataPreprocessing.Views/3.4/SearchAndReplaceDialog.cs
r14186 r15242 43 43 44 44 public partial class SearchAndReplaceDialog : Form { 45 private st ring[] cmbItemsText = { "Value", "Average", "Median", "Random", "Most Common", "Interpolation" };46 private st ring[] cmbComparisonOperatorText = { "==", "<", "<=", ">", ">=", "!=" };45 private static readonly string[] ItemsText = { "Value", "Average", "Median", "Random", "Most Common", "Interpolation" }; 46 private static readonly string[] ComparisonOperatorText = { "==", "<", "<=", ">", ">=", "!=" }; 47 47 48 48 public SearchAndReplaceDialog() { 49 49 InitializeComponent(); 50 cmbReplaceWith.Items.AddRange( cmbItemsText);50 cmbReplaceWith.Items.AddRange(ItemsText); 51 51 cmbReplaceWith.SelectedIndex = (int)ReplaceAction.Value; 52 cmbComparisonOperator.Items.AddRange( cmbComparisonOperatorText);52 cmbComparisonOperator.Items.AddRange(ComparisonOperatorText); 53 53 cmbComparisonOperator.SelectedIndex = (int)ComparisonOperation.Equal; 54 54 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.Designer.cs
r14186 r15242 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.lblRows = new System.Windows.Forms.Label(); 48 this.txtRows = new System.Windows.Forms.Label();49 49 this.lblColumns = new System.Windows.Forms.Label(); 50 50 this.lblMissingValuesTotal = new System.Windows.Forms.Label(); 51 this.txtColumns = new System.Windows.Forms.Label();52 this.txtNumericColumns = new System.Windows.Forms.Label();53 this.txtNominalColumns = new System.Windows.Forms.Label();54 51 this.lblNumericColumns = new System.Windows.Forms.Label(); 55 52 this.lblNominalColumns = new System.Windows.Forms.Label(); 56 this.txtMissingValuesTotal = new System.Windows.Forms.Label(); 57 this.dataGridView = new System.Windows.Forms.DataGridView(); 58 ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); 53 this.stringMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView(); 54 this.showVariablesGroupBox = new System.Windows.Forms.GroupBox(); 55 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 56 this.lblTNumValues = new System.Windows.Forms.Label(); 57 this.orientationGroupBox = new System.Windows.Forms.GroupBox(); 58 this.verticalRadioButton = new System.Windows.Forms.RadioButton(); 59 this.horizontalRadioButton = new System.Windows.Forms.RadioButton(); 60 this.rowsTextBox = new System.Windows.Forms.TextBox(); 61 this.columnsTextBox = new System.Windows.Forms.TextBox(); 62 this.totalValuesTextBox = new System.Windows.Forms.TextBox(); 63 this.overviewTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 64 this.numericColumnsTextBox = new System.Windows.Forms.TextBox(); 65 this.nominalColumnsTextBox5 = new System.Windows.Forms.TextBox(); 66 this.missingValuesTextBox = new System.Windows.Forms.TextBox(); 67 this.overviewGroupBox = new System.Windows.Forms.GroupBox(); 68 this.checkInputsTargetButton = new System.Windows.Forms.Button(); 69 this.uncheckAllButton = new System.Windows.Forms.Button(); 70 this.checkAllButton = new System.Windows.Forms.Button(); 71 this.showVariablesGroupBox.SuspendLayout(); 72 this.orientationGroupBox.SuspendLayout(); 73 this.overviewTableLayoutPanel.SuspendLayout(); 74 this.overviewGroupBox.SuspendLayout(); 59 75 this.SuspendLayout(); 60 76 // … … 62 78 // 63 79 this.lblRows.AutoSize = true; 64 this.lblRows.Location = new System.Drawing.Point(3, 11); 80 this.lblRows.Dock = System.Windows.Forms.DockStyle.Fill; 81 this.lblRows.Location = new System.Drawing.Point(3, 0); 65 82 this.lblRows.Name = "lblRows"; 66 this.lblRows.Size = new System.Drawing.Size( 34, 13);83 this.lblRows.Size = new System.Drawing.Size(52, 26); 67 84 this.lblRows.TabIndex = 0; 68 this.lblRows.Text = "Rows"; 69 // 70 // txtRows 71 // 72 this.txtRows.AutoSize = true; 73 this.txtRows.Location = new System.Drawing.Point(115, 11); 74 this.txtRows.Name = "txtRows"; 75 this.txtRows.Size = new System.Drawing.Size(19, 13); 76 this.txtRows.TabIndex = 1; 77 this.txtRows.Text = "12"; 85 this.lblRows.Text = "Datarows"; 86 this.lblRows.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 78 87 // 79 88 // lblColumns 80 89 // 81 90 this.lblColumns.AutoSize = true; 82 this.lblColumns.Location = new System.Drawing.Point(3, 31); 91 this.lblColumns.Dock = System.Windows.Forms.DockStyle.Fill; 92 this.lblColumns.Location = new System.Drawing.Point(3, 26); 83 93 this.lblColumns.Name = "lblColumns"; 84 this.lblColumns.Size = new System.Drawing.Size( 47, 13);94 this.lblColumns.Size = new System.Drawing.Size(52, 26); 85 95 this.lblColumns.TabIndex = 2; 86 this.lblColumns.Text = "Columns"; 96 this.lblColumns.Text = "Variables"; 97 this.lblColumns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 87 98 // 88 99 // lblMissingValuesTotal 89 100 // 90 101 this.lblMissingValuesTotal.AutoSize = true; 91 this.lblMissingValuesTotal.Location = new System.Drawing.Point(3, 92); 102 this.lblMissingValuesTotal.Dock = System.Windows.Forms.DockStyle.Fill; 103 this.lblMissingValuesTotal.Location = new System.Drawing.Point(275, 26); 92 104 this.lblMissingValuesTotal.Name = "lblMissingValuesTotal"; 93 this.lblMissingValuesTotal.Size = new System.Drawing.Size( 100, 13);105 this.lblMissingValuesTotal.Size = new System.Drawing.Size(77, 26); 94 106 this.lblMissingValuesTotal.TabIndex = 3; 95 this.lblMissingValuesTotal.Text = "Missing Values total"; 96 // 97 // txtColumns 98 // 99 this.txtColumns.AutoSize = true; 100 this.txtColumns.Location = new System.Drawing.Point(115, 31); 101 this.txtColumns.Name = "txtColumns"; 102 this.txtColumns.Size = new System.Drawing.Size(25, 13); 103 this.txtColumns.TabIndex = 1; 104 this.txtColumns.Text = "123"; 105 // 106 // txtNumericColumns 107 // 108 this.txtNumericColumns.AutoSize = true; 109 this.txtNumericColumns.Location = new System.Drawing.Point(115, 51); 110 this.txtNumericColumns.Name = "txtNumericColumns"; 111 this.txtNumericColumns.Size = new System.Drawing.Size(25, 13); 112 this.txtNumericColumns.TabIndex = 1; 113 this.txtNumericColumns.Text = "456"; 114 // 115 // txtNominalColumns 116 // 117 this.txtNominalColumns.AutoSize = true; 118 this.txtNominalColumns.Location = new System.Drawing.Point(115, 72); 119 this.txtNominalColumns.Name = "txtNominalColumns"; 120 this.txtNominalColumns.Size = new System.Drawing.Size(25, 13); 121 this.txtNominalColumns.TabIndex = 1; 122 this.txtNominalColumns.Text = "789"; 107 this.lblMissingValuesTotal.Text = "Missing Values"; 108 this.lblMissingValuesTotal.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 123 109 // 124 110 // lblNumericColumns 125 111 // 126 112 this.lblNumericColumns.AutoSize = true; 127 this.lblNumericColumns.Location = new System.Drawing.Point(3, 51); 113 this.lblNumericColumns.Dock = System.Windows.Forms.DockStyle.Fill; 114 this.lblNumericColumns.Location = new System.Drawing.Point(119, 0); 128 115 this.lblNumericColumns.Name = "lblNumericColumns"; 129 this.lblNumericColumns.Size = new System.Drawing.Size( 89, 13);116 this.lblNumericColumns.Size = new System.Drawing.Size(92, 26); 130 117 this.lblNumericColumns.TabIndex = 3; 131 this.lblNumericColumns.Text = "Numeric Columns"; 118 this.lblNumericColumns.Text = "Numeric Variables"; 119 this.lblNumericColumns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 132 120 // 133 121 // lblNominalColumns 134 122 // 135 123 this.lblNominalColumns.AutoSize = true; 136 this.lblNominalColumns.Location = new System.Drawing.Point(3, 72); 124 this.lblNominalColumns.Dock = System.Windows.Forms.DockStyle.Fill; 125 this.lblNominalColumns.Location = new System.Drawing.Point(119, 26); 137 126 this.lblNominalColumns.Name = "lblNominalColumns"; 138 this.lblNominalColumns.Size = new System.Drawing.Size( 88, 13);127 this.lblNominalColumns.Size = new System.Drawing.Size(92, 26); 139 128 this.lblNominalColumns.TabIndex = 3; 140 this.lblNominalColumns.Text = "Nominal Columns"; 141 // 142 // txtMissingValuesTotal 143 // 144 this.txtMissingValuesTotal.AutoSize = true; 145 this.txtMissingValuesTotal.Location = new System.Drawing.Point(115, 92); 146 this.txtMissingValuesTotal.Name = "txtMissingValuesTotal"; 147 this.txtMissingValuesTotal.Size = new System.Drawing.Size(25, 13); 148 this.txtMissingValuesTotal.TabIndex = 1; 149 this.txtMissingValuesTotal.Text = "102"; 150 // 151 // dataGridView 152 // 153 this.dataGridView.AllowUserToAddRows = false; 154 this.dataGridView.AllowUserToDeleteRows = false; 155 this.dataGridView.AllowUserToOrderColumns = true; 156 this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 157 | System.Windows.Forms.AnchorStyles.Left) 129 this.lblNominalColumns.Text = "Nominal Variables"; 130 this.lblNominalColumns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 131 // 132 // stringMatrixView 133 // 134 this.stringMatrixView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 135 | System.Windows.Forms.AnchorStyles.Left) 158 136 | System.Windows.Forms.AnchorStyles.Right))); 159 this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 160 this.dataGridView.Location = new System.Drawing.Point(5, 117); 161 this.dataGridView.Name = "dataGridView"; 162 this.dataGridView.ReadOnly = true; 163 this.dataGridView.RowHeadersWidth = 80; 164 this.dataGridView.Size = new System.Drawing.Size(530, 278); 165 this.dataGridView.TabIndex = 4; 166 this.dataGridView.VirtualMode = true; 167 this.dataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dataGridView_CellValueNeeded); 137 this.stringMatrixView.Caption = "StringConvertibleMatrix View"; 138 this.stringMatrixView.Content = null; 139 this.stringMatrixView.Location = new System.Drawing.Point(3, 74); 140 this.stringMatrixView.Name = "stringMatrixView"; 141 this.stringMatrixView.ReadOnly = true; 142 this.stringMatrixView.ShowRowsAndColumnsTextBox = false; 143 this.stringMatrixView.ShowStatisticalInformation = true; 144 this.stringMatrixView.Size = new System.Drawing.Size(655, 374); 145 this.stringMatrixView.TabIndex = 4; 146 // 147 // showVariablesGroupBox 148 // 149 this.showVariablesGroupBox.Controls.Add(this.checkInputsTargetButton); 150 this.showVariablesGroupBox.Controls.Add(this.uncheckAllButton); 151 this.showVariablesGroupBox.Controls.Add(this.checkAllButton); 152 this.showVariablesGroupBox.Location = new System.Drawing.Point(458, 0); 153 this.showVariablesGroupBox.Name = "showVariablesGroupBox"; 154 this.showVariablesGroupBox.Size = new System.Drawing.Size(97, 71); 155 this.showVariablesGroupBox.TabIndex = 16; 156 this.showVariablesGroupBox.TabStop = false; 157 this.showVariablesGroupBox.Text = "Show Variables"; 158 // 159 // lblTNumValues 160 // 161 this.lblTNumValues.AutoSize = true; 162 this.lblTNumValues.Dock = System.Windows.Forms.DockStyle.Fill; 163 this.lblTNumValues.Location = new System.Drawing.Point(275, 0); 164 this.lblTNumValues.Name = "lblTNumValues"; 165 this.lblTNumValues.Size = new System.Drawing.Size(77, 26); 166 this.lblTNumValues.TabIndex = 2; 167 this.lblTNumValues.Text = "Total Values"; 168 this.lblTNumValues.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 169 this.toolTip.SetToolTip(this.lblTNumValues, "Valid Values (excl. missing Values)"); 170 // 171 // orientationGroupBox 172 // 173 this.orientationGroupBox.Controls.Add(this.verticalRadioButton); 174 this.orientationGroupBox.Controls.Add(this.horizontalRadioButton); 175 this.orientationGroupBox.Location = new System.Drawing.Point(561, 0); 176 this.orientationGroupBox.Name = "orientationGroupBox"; 177 this.orientationGroupBox.Size = new System.Drawing.Size(94, 71); 178 this.orientationGroupBox.TabIndex = 17; 179 this.orientationGroupBox.TabStop = false; 180 this.orientationGroupBox.Text = "Orientation"; 181 // 182 // verticalRadioButton 183 // 184 this.verticalRadioButton.AutoSize = true; 185 this.verticalRadioButton.Checked = true; 186 this.verticalRadioButton.Location = new System.Drawing.Point(6, 32); 187 this.verticalRadioButton.Name = "verticalRadioButton"; 188 this.verticalRadioButton.Size = new System.Drawing.Size(60, 17); 189 this.verticalRadioButton.TabIndex = 1; 190 this.verticalRadioButton.TabStop = true; 191 this.verticalRadioButton.Text = "Vertical"; 192 this.verticalRadioButton.UseVisualStyleBackColor = true; 193 this.verticalRadioButton.CheckedChanged += new System.EventHandler(this.verticalRadioButton_CheckedChanged); 194 // 195 // horizontalRadioButton 196 // 197 this.horizontalRadioButton.AutoSize = true; 198 this.horizontalRadioButton.Location = new System.Drawing.Point(6, 14); 199 this.horizontalRadioButton.Name = "horizontalRadioButton"; 200 this.horizontalRadioButton.Size = new System.Drawing.Size(72, 17); 201 this.horizontalRadioButton.TabIndex = 0; 202 this.horizontalRadioButton.Text = "Horizontal"; 203 this.horizontalRadioButton.UseVisualStyleBackColor = true; 204 this.horizontalRadioButton.CheckedChanged += new System.EventHandler(this.horizontalRadioButton_CheckedChanged); 205 // 206 // rowsTextBox 207 // 208 this.rowsTextBox.Dock = System.Windows.Forms.DockStyle.Fill; 209 this.rowsTextBox.Location = new System.Drawing.Point(61, 3); 210 this.rowsTextBox.Name = "rowsTextBox"; 211 this.rowsTextBox.ReadOnly = true; 212 this.rowsTextBox.Size = new System.Drawing.Size(52, 20); 213 this.rowsTextBox.TabIndex = 18; 214 this.rowsTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 215 // 216 // columnsTextBox 217 // 218 this.columnsTextBox.Dock = System.Windows.Forms.DockStyle.Fill; 219 this.columnsTextBox.Location = new System.Drawing.Point(61, 29); 220 this.columnsTextBox.Name = "columnsTextBox"; 221 this.columnsTextBox.ReadOnly = true; 222 this.columnsTextBox.Size = new System.Drawing.Size(52, 20); 223 this.columnsTextBox.TabIndex = 18; 224 this.columnsTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 225 // 226 // totalValuesTextBox 227 // 228 this.totalValuesTextBox.Dock = System.Windows.Forms.DockStyle.Fill; 229 this.totalValuesTextBox.Location = new System.Drawing.Point(358, 3); 230 this.totalValuesTextBox.Name = "totalValuesTextBox"; 231 this.totalValuesTextBox.ReadOnly = true; 232 this.totalValuesTextBox.Size = new System.Drawing.Size(82, 20); 233 this.totalValuesTextBox.TabIndex = 18; 234 this.totalValuesTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 235 // 236 // overviewTableLayoutPanel 237 // 238 this.overviewTableLayoutPanel.ColumnCount = 6; 239 this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); 240 this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 28.57143F)); 241 this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); 242 this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 28.57143F)); 243 this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); 244 this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 42.85715F)); 245 this.overviewTableLayoutPanel.Controls.Add(this.lblRows, 0, 0); 246 this.overviewTableLayoutPanel.Controls.Add(this.lblColumns, 0, 1); 247 this.overviewTableLayoutPanel.Controls.Add(this.columnsTextBox, 1, 1); 248 this.overviewTableLayoutPanel.Controls.Add(this.lblNominalColumns, 2, 1); 249 this.overviewTableLayoutPanel.Controls.Add(this.lblNumericColumns, 2, 0); 250 this.overviewTableLayoutPanel.Controls.Add(this.rowsTextBox, 1, 0); 251 this.overviewTableLayoutPanel.Controls.Add(this.numericColumnsTextBox, 3, 0); 252 this.overviewTableLayoutPanel.Controls.Add(this.nominalColumnsTextBox5, 3, 1); 253 this.overviewTableLayoutPanel.Controls.Add(this.missingValuesTextBox, 5, 1); 254 this.overviewTableLayoutPanel.Controls.Add(this.lblTNumValues, 4, 0); 255 this.overviewTableLayoutPanel.Controls.Add(this.totalValuesTextBox, 5, 0); 256 this.overviewTableLayoutPanel.Controls.Add(this.lblMissingValuesTotal, 4, 1); 257 this.overviewTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; 258 this.overviewTableLayoutPanel.Location = new System.Drawing.Point(3, 16); 259 this.overviewTableLayoutPanel.Name = "overviewTableLayoutPanel"; 260 this.overviewTableLayoutPanel.RowCount = 3; 261 this.overviewTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); 262 this.overviewTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); 263 this.overviewTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 264 this.overviewTableLayoutPanel.Size = new System.Drawing.Size(443, 52); 265 this.overviewTableLayoutPanel.TabIndex = 19; 266 // 267 // numericColumnsTextBox 268 // 269 this.numericColumnsTextBox.Dock = System.Windows.Forms.DockStyle.Fill; 270 this.numericColumnsTextBox.Location = new System.Drawing.Point(217, 3); 271 this.numericColumnsTextBox.Name = "numericColumnsTextBox"; 272 this.numericColumnsTextBox.ReadOnly = true; 273 this.numericColumnsTextBox.Size = new System.Drawing.Size(52, 20); 274 this.numericColumnsTextBox.TabIndex = 18; 275 this.numericColumnsTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 276 // 277 // nominalColumnsTextBox5 278 // 279 this.nominalColumnsTextBox5.Dock = System.Windows.Forms.DockStyle.Fill; 280 this.nominalColumnsTextBox5.Location = new System.Drawing.Point(217, 29); 281 this.nominalColumnsTextBox5.Name = "nominalColumnsTextBox5"; 282 this.nominalColumnsTextBox5.ReadOnly = true; 283 this.nominalColumnsTextBox5.Size = new System.Drawing.Size(52, 20); 284 this.nominalColumnsTextBox5.TabIndex = 18; 285 this.nominalColumnsTextBox5.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 286 // 287 // missingValuesTextBox 288 // 289 this.missingValuesTextBox.Dock = System.Windows.Forms.DockStyle.Fill; 290 this.missingValuesTextBox.Location = new System.Drawing.Point(358, 29); 291 this.missingValuesTextBox.Name = "missingValuesTextBox"; 292 this.missingValuesTextBox.ReadOnly = true; 293 this.missingValuesTextBox.Size = new System.Drawing.Size(82, 20); 294 this.missingValuesTextBox.TabIndex = 18; 295 this.missingValuesTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 296 // 297 // overviewGroupBox 298 // 299 this.overviewGroupBox.Controls.Add(this.overviewTableLayoutPanel); 300 this.overviewGroupBox.Location = new System.Drawing.Point(3, 0); 301 this.overviewGroupBox.Name = "overviewGroupBox"; 302 this.overviewGroupBox.Size = new System.Drawing.Size(449, 71); 303 this.overviewGroupBox.TabIndex = 20; 304 this.overviewGroupBox.TabStop = false; 305 this.overviewGroupBox.Text = "Overview"; 306 // 307 // checkInputsTargetButton 308 // 309 this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs; 310 this.checkInputsTargetButton.Location = new System.Drawing.Point(36, 19); 311 this.checkInputsTargetButton.Name = "checkInputsTargetButton"; 312 this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24); 313 this.checkInputsTargetButton.TabIndex = 14; 314 this.toolTip.SetToolTip(this.checkInputsTargetButton, "Show Inputs & Target"); 315 this.checkInputsTargetButton.UseVisualStyleBackColor = true; 316 this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click); 317 // 318 // uncheckAllButton 319 // 320 this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None; 321 this.uncheckAllButton.Location = new System.Drawing.Point(66, 19); 322 this.uncheckAllButton.Name = "uncheckAllButton"; 323 this.uncheckAllButton.Size = new System.Drawing.Size(24, 24); 324 this.uncheckAllButton.TabIndex = 12; 325 this.toolTip.SetToolTip(this.uncheckAllButton, "Show None"); 326 this.uncheckAllButton.UseVisualStyleBackColor = true; 327 this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click); 328 // 329 // checkAllButton 330 // 331 this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All; 332 this.checkAllButton.Location = new System.Drawing.Point(6, 19); 333 this.checkAllButton.Name = "checkAllButton"; 334 this.checkAllButton.Size = new System.Drawing.Size(24, 24); 335 this.checkAllButton.TabIndex = 13; 336 this.toolTip.SetToolTip(this.checkAllButton, "Show All"); 337 this.checkAllButton.UseVisualStyleBackColor = true; 338 this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click); 168 339 // 169 340 // StatisticsView … … 171 342 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 172 343 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 173 this.Controls.Add(this.dataGridView); 174 this.Controls.Add(this.lblNominalColumns); 175 this.Controls.Add(this.lblNumericColumns); 176 this.Controls.Add(this.lblMissingValuesTotal); 177 this.Controls.Add(this.txtMissingValuesTotal); 178 this.Controls.Add(this.txtNominalColumns); 179 this.Controls.Add(this.lblColumns); 180 this.Controls.Add(this.txtNumericColumns); 181 this.Controls.Add(this.txtColumns); 182 this.Controls.Add(this.txtRows); 183 this.Controls.Add(this.lblRows); 344 this.Controls.Add(this.overviewGroupBox); 345 this.Controls.Add(this.orientationGroupBox); 346 this.Controls.Add(this.showVariablesGroupBox); 347 this.Controls.Add(this.stringMatrixView); 184 348 this.Name = "StatisticsView"; 185 this.Size = new System.Drawing.Size(549, 408); 186 ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); 349 this.Size = new System.Drawing.Size(661, 451); 350 this.showVariablesGroupBox.ResumeLayout(false); 351 this.orientationGroupBox.ResumeLayout(false); 352 this.orientationGroupBox.PerformLayout(); 353 this.overviewTableLayoutPanel.ResumeLayout(false); 354 this.overviewTableLayoutPanel.PerformLayout(); 355 this.overviewGroupBox.ResumeLayout(false); 187 356 this.ResumeLayout(false); 188 this.PerformLayout();189 357 190 358 } … … 193 361 194 362 private System.Windows.Forms.Label lblRows; 195 private System.Windows.Forms.Label txtRows;196 363 private System.Windows.Forms.Label lblColumns; 197 364 private System.Windows.Forms.Label lblMissingValuesTotal; 198 private System.Windows.Forms.Label txtColumns;199 private System.Windows.Forms.Label txtNumericColumns;200 private System.Windows.Forms.Label txtNominalColumns;201 365 private System.Windows.Forms.Label lblNumericColumns; 202 366 private System.Windows.Forms.Label lblNominalColumns; 203 private System.Windows.Forms.Label txtMissingValuesTotal; 204 private System.Windows.Forms.DataGridView dataGridView; 367 private HeuristicLab.Data.Views.StringConvertibleMatrixView stringMatrixView; 368 private System.Windows.Forms.GroupBox showVariablesGroupBox; 369 private System.Windows.Forms.Button checkInputsTargetButton; 370 private System.Windows.Forms.Button uncheckAllButton; 371 private System.Windows.Forms.Button checkAllButton; 372 private System.Windows.Forms.ToolTip toolTip; 373 private System.Windows.Forms.GroupBox orientationGroupBox; 374 private System.Windows.Forms.RadioButton verticalRadioButton; 375 private System.Windows.Forms.RadioButton horizontalRadioButton; 376 private System.Windows.Forms.Label lblTNumValues; 377 private System.Windows.Forms.TextBox rowsTextBox; 378 private System.Windows.Forms.TextBox columnsTextBox; 379 private System.Windows.Forms.TextBox totalValuesTextBox; 380 private System.Windows.Forms.TableLayoutPanel overviewTableLayoutPanel; 381 private System.Windows.Forms.TextBox numericColumnsTextBox; 382 private System.Windows.Forms.TextBox nominalColumnsTextBox5; 383 private System.Windows.Forms.TextBox missingValuesTextBox; 384 private System.Windows.Forms.GroupBox overviewGroupBox; 205 385 } 206 386 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.cs
r14186 r15242 21 21 22 22 using System; 23 using System.Collections; 23 24 using System.Collections.Generic; 25 using System.Linq; 24 26 using System.Windows.Forms; 25 27 using HeuristicLab.Core.Views; 28 using HeuristicLab.Data; 26 29 using HeuristicLab.MainForm; 30 using HeuristicLab.MainForm.WindowsForms; 27 31 28 32 namespace HeuristicLab.DataPreprocessing.Views { 29 30 33 [View("Statistics View")] 31 34 [Content(typeof(StatisticsContent), true)] 32 35 public partial class StatisticsView : ItemView { 33 34 private List<List<string>> columnsRowsMatrix; 35 private readonly int COLUMNS = 12; 36 private bool horizontal = false; 37 private StringMatrix statisticsMatrix; 38 private static readonly string[] StatisticsNames = new[] { 39 "Type", 40 "Missing Values", 41 "Min", 42 "Max", 43 "Median", 44 "Average", 45 "Std. Deviation", 46 "Variance", 47 "25th Percentile", 48 "75th Percentile", 49 "Most Common Value", 50 "Num. diff. Values" 51 }; 36 52 37 53 public new StatisticsContent Content { … … 47 63 base.OnContentChanged(); 48 64 if (Content == null) { 49 txtRows.Text = ""; 50 txtColumns.Text = ""; 51 txtNumericColumns.Text = ""; 52 txtNominalColumns.Text = ""; 53 txtMissingValuesTotal.Text = ""; 54 dataGridView.Columns.Clear(); 65 rowsTextBox.Text = string.Empty; 66 columnsTextBox.Text = string.Empty; 67 numericColumnsTextBox.Text = string.Empty; 68 nominalColumnsTextBox5.Text = string.Empty; 69 missingValuesTextBox.Text = string.Empty; 70 totalValuesTextBox.Text = string.Empty; 71 stringMatrixView.Content = null; 72 statisticsMatrix = null; 55 73 } else { 56 74 UpdateData(); … … 58 76 } 59 77 60 /// <summary>61 /// Adds eventhandlers to the current instance.62 /// </summary>63 78 protected override void RegisterContentEvents() { 79 base.RegisterContentEvents(); 64 80 Content.Changed += Content_Changed; 65 81 } 66 82 67 68 /// <summary>69 /// Removes the eventhandlers from the current instance.70 /// </summary>71 83 protected override void DeregisterContentEvents() { 72 84 Content.Changed -= Content_Changed; 73 } 74 75 private void UpdateData() { 76 var logic = Content.StatisticsLogic; 77 var rowCount = logic.GetRowCount(); 78 txtRows.Text = rowCount.ToString(); 79 txtColumns.Text = logic.GetColumnCount().ToString(); 80 txtNumericColumns.Text = logic.GetNumericColumnCount().ToString(); 81 txtNominalColumns.Text = logic.GetNominalColumnCount().ToString(); 82 txtMissingValuesTotal.Text = logic.GetMissingValueCount().ToString(); 83 84 columnsRowsMatrix = new List<List<string>>(); 85 DataGridViewColumn[] columns = new DataGridViewColumn[COLUMNS]; 86 for (int i = 0; i < COLUMNS; ++i) { 87 var column = new DataGridViewTextBoxColumn(); 88 column.SortMode = DataGridViewColumnSortMode.Automatic; 89 column.FillWeight = 1; 90 columns[i] = column; 91 } 92 93 columns[0].HeaderCell.Value = "Type"; 94 columns[1].HeaderCell.Value = "Missing Values"; 95 columns[2].HeaderCell.Value = "Min"; 96 columns[3].HeaderCell.Value = "Max"; 97 columns[4].HeaderCell.Value = "Median"; 98 columns[5].HeaderCell.Value = "Average"; 99 columns[6].HeaderCell.Value = "std. Deviation"; 100 columns[7].HeaderCell.Value = "Variance"; 101 columns[8].HeaderCell.Value = "25th Percentile"; 102 columns[9].HeaderCell.Value = "75th Percentile"; 103 columns[10].HeaderCell.Value = "Most Common Value"; 104 columns[11].HeaderCell.Value = "Num. diff. Values"; 105 106 if (rowCount > 0) { 107 for (int i = 0; i < logic.GetColumnCount(); ++i) { 108 columnsRowsMatrix.Add(GetList(i)); 109 } 110 } 111 112 dataGridView.Columns.Clear(); 113 dataGridView.Columns.AddRange(columns); 114 dataGridView.RowCount = columnsRowsMatrix.Count; 115 116 for (int i = 0; i < columnsRowsMatrix.Count; ++i) { 117 dataGridView.Rows[i].HeaderCell.Value = logic.GetVariableName(i); 118 } 119 120 dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells); 121 dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders); 122 dataGridView.AllowUserToResizeColumns = true; 123 } 124 125 private List<string> GetList(int i) { 85 base.DeregisterContentEvents(); 86 } 87 88 private void UpdateData(Dictionary<string, bool> oldVisibility = null) { 89 var logic = Content.StatisticsLogic; 90 rowsTextBox.Text = logic.GetRowCount().ToString(); 91 columnsTextBox.Text = logic.GetColumnCount().ToString(); 92 numericColumnsTextBox.Text = logic.GetNumericColumnCount().ToString(); 93 nominalColumnsTextBox5.Text = logic.GetNominalColumnCount().ToString(); 94 missingValuesTextBox.Text = logic.GetMissingValueCount().ToString(); 95 totalValuesTextBox.Text = (logic.GetColumnCount() * logic.GetRowCount() - logic.GetMissingValueCount()).ToString(); 96 97 var variableNames = Content.PreprocessingData.VariableNames.ToList(); 98 if (horizontal) 99 statisticsMatrix = new StringMatrix(StatisticsNames.Length, Content.PreprocessingData.Columns) { 100 RowNames = StatisticsView.StatisticsNames, 101 ColumnNames = variableNames 102 }; 103 else 104 statisticsMatrix = new StringMatrix(Content.PreprocessingData.Columns, StatisticsNames.Length) { 105 RowNames = variableNames, 106 ColumnNames = StatisticsView.StatisticsNames 107 }; 108 109 for (int i = 0; i < logic.GetColumnCount(); i++) { 110 var data = GetStatistics(i); 111 for (int j = 0; j < data.Count; j++) { 112 if (horizontal) 113 statisticsMatrix[j, i] = data[j]; 114 else 115 statisticsMatrix[i, j] = data[j]; 116 } 117 } 118 119 stringMatrixView.Parent.SuspendRepaint(); 120 stringMatrixView.Content = statisticsMatrix; 121 122 var grid = stringMatrixView.DataGridView; 123 int idx = 0; 124 var list = horizontal ? grid.Columns : grid.Rows as IList; 125 foreach (DataGridViewBand band in list) { 126 var variable = variableNames[idx++]; 127 if (oldVisibility != null) { 128 band.Visible = !oldVisibility.ContainsKey(variable) || oldVisibility[variable]; 129 } 130 } 131 if (horizontal) 132 stringMatrixView.UpdateColumnHeaders(); 133 else 134 stringMatrixView.UpdateRowHeaders(); 135 136 stringMatrixView.DataGridView.AutoResizeColumns(); 137 stringMatrixView.Parent.ResumeRepaint(true); 138 } 139 140 private List<string> GetStatistics(int varIdx) { 126 141 List<string> list; 127 142 var logic = Content.StatisticsLogic; 128 if (logic.VariableHasType<double>( i)) {129 list = GetDoubleColumns( i);130 } else if (logic.VariableHasType<string>( i)) {131 list = GetStringColumns( i);132 } else if (logic.VariableHasType<DateTime>( i)) {133 list = GetDateTimeColumns( i);143 if (logic.VariableHasType<double>(varIdx)) { 144 list = GetDoubleColumns(varIdx); 145 } else if (logic.VariableHasType<string>(varIdx)) { 146 list = GetStringColumns(varIdx); 147 } else if (logic.VariableHasType<DateTime>(varIdx)) { 148 list = GetDateTimeColumns(varIdx); 134 149 } else { 135 150 list = new List<string>(); 136 for (int j = 0; j < COLUMNS; ++j) {151 for (int j = 0; j < StatisticsNames.Length; ++j) { 137 152 list.Add("unknown column type"); 138 153 } … … 141 156 } 142 157 143 private List<string> GetDoubleColumns(int columnIndex) {158 private List<string> GetDoubleColumns(int statIdx) { 144 159 var logic = Content.StatisticsLogic; 145 160 return new List<string> { 146 logic.GetColumnTypeAsString( columnIndex),147 logic.GetMissingValueCount( columnIndex).ToString(),148 logic.GetMin<double>( columnIndex,double.NaN).ToString(),149 logic.GetMax<double>( columnIndex,double.NaN).ToString(),150 logic.GetMedian( columnIndex).ToString(),151 logic.GetAverage( columnIndex).ToString(),152 logic.GetStandardDeviation( columnIndex).ToString(),153 logic.GetVariance( columnIndex).ToString(),154 logic.GetOneQuarterPercentile( columnIndex).ToString(),155 logic.GetThreeQuarterPercentile( columnIndex).ToString(),156 logic.GetMostCommonValue<double>( columnIndex,double.NaN).ToString(),157 logic.GetDifferentValuesCount<double>( columnIndex).ToString()161 logic.GetColumnTypeAsString(statIdx), 162 logic.GetMissingValueCount(statIdx).ToString(), 163 logic.GetMin<double>(statIdx, double.NaN).ToString(), 164 logic.GetMax<double>(statIdx, double.NaN).ToString(), 165 logic.GetMedian(statIdx).ToString(), 166 logic.GetAverage(statIdx).ToString(), 167 logic.GetStandardDeviation(statIdx).ToString(), 168 logic.GetVariance(statIdx).ToString(), 169 logic.GetOneQuarterPercentile(statIdx).ToString(), 170 logic.GetThreeQuarterPercentile(statIdx).ToString(), 171 logic.GetMostCommonValue<double>(statIdx, double.NaN).ToString(), 172 logic.GetDifferentValuesCount<double>(statIdx).ToString() 158 173 }; 159 174 } 160 175 161 private List<string> GetStringColumns(int columnIndex) {176 private List<string> GetStringColumns(int statIdx) { 162 177 var logic = Content.StatisticsLogic; 163 178 return new List<string> { 164 logic.GetColumnTypeAsString( columnIndex),165 logic.GetMissingValueCount( columnIndex).ToString(),179 logic.GetColumnTypeAsString(statIdx), 180 logic.GetMissingValueCount(statIdx).ToString(), 166 181 "", //min 167 182 "", //max … … 172 187 "", //quarter percentile 173 188 "", //three quarter percentile 174 logic.GetMostCommonValue<string>( columnIndex,string.Empty) ?? "",175 logic.GetDifferentValuesCount<string>( columnIndex).ToString()189 logic.GetMostCommonValue<string>(statIdx,string.Empty) ?? "", 190 logic.GetDifferentValuesCount<string>(statIdx).ToString() 176 191 }; 177 192 } 178 193 179 private List<string> GetDateTimeColumns(int columnIndex) {194 private List<string> GetDateTimeColumns(int statIdx) { 180 195 var logic = Content.StatisticsLogic; 181 196 return new List<string> { 182 logic.GetColumnTypeAsString( columnIndex),183 logic.GetMissingValueCount( columnIndex).ToString(),184 logic.GetMin<DateTime>( columnIndex,DateTime.MinValue).ToString(),185 logic.GetMax<DateTime>( columnIndex,DateTime.MinValue).ToString(),186 logic.GetMedianDateTime( columnIndex).ToString(),187 logic.GetAverageDateTime( columnIndex).ToString(),188 logic.GetStandardDeviation( columnIndex).ToString(),189 logic.GetVariance( columnIndex).ToString(), //variance190 logic.GetOneQuarterPercentile( columnIndex).ToString(),191 logic.GetThreeQuarterPercentile( columnIndex).ToString(),192 logic.GetMostCommonValue<DateTime>( columnIndex,DateTime.MinValue).ToString(),193 logic.GetDifferentValuesCount<DateTime>( columnIndex).ToString()197 logic.GetColumnTypeAsString(statIdx), 198 logic.GetMissingValueCount(statIdx).ToString(), 199 logic.GetMin<DateTime>(statIdx, DateTime.MinValue).ToString(), 200 logic.GetMax<DateTime>(statIdx, DateTime.MinValue).ToString(), 201 logic.GetMedianDateTime(statIdx).ToString(), 202 logic.GetAverageDateTime(statIdx).ToString(), 203 logic.GetStandardDeviation(statIdx).ToString(), 204 logic.GetVariance(statIdx).ToString(), 205 logic.GetOneQuarterPercentile(statIdx).ToString(), 206 logic.GetThreeQuarterPercentile(statIdx).ToString(), 207 logic.GetMostCommonValue<DateTime>(statIdx, DateTime.MinValue).ToString(), 208 logic.GetDifferentValuesCount<DateTime>(statIdx).ToString() 194 209 }; 195 210 } 196 211 197 private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {198 if (Content != null && e.RowIndex < columnsRowsMatrix.Count && e.ColumnIndex < columnsRowsMatrix[0].Count) {199 e.Value = columnsRowsMatrix[e.RowIndex][e.ColumnIndex];200 }201 }202 203 212 private void Content_Changed(object sender, DataPreprocessingChangedEventArgs e) { 204 switch (e.Type) { 205 case DataPreprocessingChangedEventType.DeleteColumn: 206 columnsRowsMatrix.RemoveAt(e.Column); 207 break; 208 case DataPreprocessingChangedEventType.AddColumn: 209 columnsRowsMatrix.Insert(e.Row, GetList(e.Column)); 210 dataGridView.RowCount++; 211 break; 212 case DataPreprocessingChangedEventType.ChangeItem: 213 columnsRowsMatrix[e.Column] = GetList(e.Column); 214 break; 215 case DataPreprocessingChangedEventType.DeleteRow: 216 case DataPreprocessingChangedEventType.AddRow: 217 default: 218 for (int i = 0; i < columnsRowsMatrix.Count; ++i) { 219 columnsRowsMatrix[i] = GetList(e.Column); 220 } 221 break; 222 } 223 dataGridView.Refresh(); 224 } 213 UpdateData(); 214 } 215 216 #region Show/Hide Variables 217 private void checkInputsTargetButton_Click(object sender, EventArgs e) { 218 var grid = stringMatrixView.DataGridView; 219 var list = horizontal ? grid.Columns : grid.Rows as IList; 220 var variableNames = Content.PreprocessingData.VariableNames.ToList(); 221 int idx = 0; 222 foreach (DataGridViewBand band in list) { 223 var variable = variableNames[idx++]; 224 bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable) 225 || Content.PreprocessingData.TargetVariable == variable; 226 band.Visible = isInputTarget; 227 if (horizontal) 228 stringMatrixView.UpdateColumnHeaders(); 229 else 230 stringMatrixView.UpdateRowHeaders(); 231 } 232 233 } 234 private void checkAllButton_Click(object sender, EventArgs e) { 235 var grid = stringMatrixView.DataGridView; 236 var list = horizontal ? grid.Columns : grid.Rows as IList; 237 foreach (DataGridViewBand band in list) { 238 band.Visible = true; 239 } 240 if (horizontal) 241 stringMatrixView.UpdateColumnHeaders(); 242 else 243 stringMatrixView.UpdateRowHeaders(); 244 } 245 private void uncheckAllButton_Click(object sender, EventArgs e) { 246 var grid = stringMatrixView.DataGridView; 247 var list = horizontal ? grid.Columns : grid.Rows as IList; 248 foreach (DataGridViewBand band in list) { 249 band.Visible = false; 250 } 251 } 252 #endregion 253 254 #region Orientation 255 private void horizontalRadioButton_CheckedChanged(object sender, EventArgs e) { 256 var grid = stringMatrixView.DataGridView; 257 var oldVisibility = new Dictionary<string, bool>(); 258 var variableNames = Content.PreprocessingData.VariableNames.ToList(); 259 if (stringMatrixView.Content != null) { 260 var list = horizontal ? grid.Columns : grid.Rows as IList; 261 int idx = 0; 262 foreach (DataGridViewBand band in list) { 263 var variable = variableNames[idx++]; 264 oldVisibility.Add(variable, band.Visible); 265 } 266 } 267 horizontal = horizontalRadioButton.Checked; 268 UpdateData(oldVisibility); 269 } 270 private void verticalRadioButton_CheckedChanged(object sender, EventArgs e) { 271 // everything is handled in horizontalRadioButton_CheckedChanged 272 } 273 #endregion 225 274 } 226 275 } -
stable/HeuristicLab.DataPreprocessing.Views/3.4/TransformationView.cs
r14186 r15242 28 28 29 29 namespace HeuristicLab.DataPreprocessing.Views { 30 31 30 [View("Transformation View")] 32 31 [Content(typeof(TransformationContent), true)] 33 32 public partial class TransformationView : AsynchronousContentView { 34 35 33 public new TransformationContent Content { 36 34 get { return (TransformationContent)base.Content; } … … 52 50 } 53 51 54 /// <summary>55 /// Adds eventhandlers to the current instance.56 /// </summary>57 52 protected override void RegisterContentEvents() { 58 53 Content.FilterLogic.FilterChanged += FilterLogic_FilterChanged; 59 54 } 60 55 61 /// <summary>62 /// Removes the eventhandlers from the current instance.63 /// </summary>64 56 protected override void DeregisterContentEvents() { 65 57 Content.FilterLogic.FilterChanged -= FilterLogic_FilterChanged; -
stable/HeuristicLab.DataPreprocessing.Views/3.4/Utils/FindPreprocessingItemsIterator.cs
r14186 r15242 26 26 namespace HeuristicLab.DataPreprocessing.Views { 27 27 class FindPreprocessingItemsIterator : IFindPreprocessingItemsIterator { 28 29 28 private IDictionary<int, IList<int>> items; 30 29 private Tuple<int, int> currentCell; … … 32 31 public FindPreprocessingItemsIterator(IDictionary<int, IList<int>> items) { 33 32 this.items = items; 34 Reset(); 33 Reset(); 35 34 } 36 35 -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.Designer.cs
r14186 r15242 53 53 this.SuspendLayout(); 54 54 // 55 // splitContainer56 //57 this.splitContainer.Size = new System.Drawing.Size(526, 364);58 //59 // itemsGroupBox60 //61 this.itemsGroupBox.Size = new System.Drawing.Size(532, 383);62 //63 55 // itemsListView 64 56 // 65 this.itemsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));66 57 this.itemsListView.Dock = System.Windows.Forms.DockStyle.Fill; 67 this.itemsListView.Location = new System.Drawing.Point(0, 0);68 this.itemsListView.Size = new System.Drawing.Size(200, 364);69 //70 // detailsGroupBox71 //72 this.detailsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));73 this.detailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;74 this.detailsGroupBox.Location = new System.Drawing.Point(0, 0);75 this.detailsGroupBox.Size = new System.Drawing.Size(322, 364);76 //77 // addButton78 //79 this.toolTip.SetToolTip(this.addButton, "Add");80 this.addButton.Visible = false;81 //82 // removeButton83 //84 this.toolTip.SetToolTip(this.removeButton, "Remove");85 this.removeButton.Visible = false;86 //87 // moveUpButton88 //89 this.toolTip.SetToolTip(this.moveUpButton, "Move Up");90 this.moveUpButton.Visible = false;91 //92 // moveDownButton93 //94 this.toolTip.SetToolTip(this.moveDownButton, "Move Down");95 this.moveDownButton.Visible = false;96 58 // 97 59 // viewHost 98 60 // 99 this.viewHost.Size = new System.Drawing.Size(310, 339); 61 this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill; 62 this.viewHost.ViewsLabelVisible = false; 100 63 // 101 64 // showDetailsCheckBox -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.cs
r14186 r15242 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Core.Views; … … 30 29 [Content(typeof(IItemList<IViewShortcut>), true)] 31 30 public partial class ViewShortcutListView : ItemListView<IViewShortcut> { 32 33 31 public ViewShortcutListView() { 34 32 InitializeComponent(); 35 itemsGroupBox.Text = "View Shortcuts"; 33 Controls.Clear(); 34 Controls.Add(splitContainer); 35 splitContainer.Panel1.Controls.Clear(); 36 splitContainer.Panel1.Controls.Add(itemsListView); 37 splitContainer.Panel2.Controls.Clear(); 38 splitContainer.Panel2.Controls.Add(viewHost); 36 39 } 37 40 … … 42 45 IViewShortcut item = itemsListView.SelectedItems[0].Tag as IViewShortcut; 43 46 if (item != null) { 44 45 if (item is IViewChartShortcut) 46 item = (IViewChartShortcut)item.Clone(new Cloner()); 47 48 IContentView view = MainFormManager.MainForm.ShowContent(item); 49 if (view != null) { 50 view.ReadOnly = ReadOnly; 51 view.Locked = Locked; 47 try { 48 item = (IViewShortcut)item.Clone(); 49 var view = MainFormManager.MainForm.ShowContent(item); 50 if (view != null) { 51 view.ReadOnly = ReadOnly; 52 view.Locked = Locked; 53 } 54 } catch (NullReferenceException) { 55 // cloning for preprocessing not done properly yet 52 56 } 53 57 }
Note: See TracChangeset
for help on using the changeset viewer.