- Timestamp:
- 01/22/14 16:08:49 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj
r10377 r10380 78 78 <ItemGroup> 79 79 <Compile Include="Implementations\DataGridLogic.cs" /> 80 <Compile Include="Implementations\ManipulationLogic.cs" /> 80 81 <Compile Include="Interfaces\IDataGridLogic.cs" /> 81 <Compile Include="Interfaces\IManipulationLogic.cs" />82 82 <Compile Include="Implementations\FilterContent.cs" /> 83 83 <Compile Include="Implementations\DataPreprocessorStarter.cs" /> … … 93 93 <Compile Include="Interfaces\IHistogramLogic.cs" /> 94 94 <Compile Include="Interfaces\ILineChartLogic.cs" /> 95 <Compile Include="Interfaces\IManipulationLogic.cs" /> 95 96 <Compile Include="Interfaces\ITransformationLogic.cs" /> 96 97 <Compile Include="PreprocessingCloner.cs" /> … … 135 136 <Compile Include="Implementations\PreprocessingContext.cs" /> 136 137 <Compile Include="Implementations\PreprocessingData.cs" /> 137 <Compile Include="Implementations\ManipulationLogic.cs" />138 138 <Compile Include="Implementations\SearchLogic.cs" /> 139 139 <Compile Include="Implementations\StatisticsLogic.cs" /> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataGridContentView.Designer.cs
r10317 r10380 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 26 27 this.btnApplySort = new System.Windows.Forms.Button(); 28 this.contextMenuCell = new System.Windows.Forms.ContextMenuStrip(this.components); 29 this.replaceValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 30 this.averageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 31 this.medianToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 32 this.randomToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 33 this.mostCommonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 34 this.interpolationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 27 35 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 36 this.contextMenuCell.SuspendLayout(); 28 37 this.SuspendLayout(); 29 38 // … … 58 67 this.btnApplySort.Click += new System.EventHandler(this.btnApplySort_Click); 59 68 // 69 // contextMenuCell 70 // 71 this.contextMenuCell.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 72 this.replaceValueToolStripMenuItem}); 73 this.contextMenuCell.Name = "contextMenuCell"; 74 this.contextMenuCell.Size = new System.Drawing.Size(153, 48); 75 // 76 // replaceValueToolStripMenuItem 77 // 78 this.replaceValueToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 79 this.averageToolStripMenuItem, 80 this.medianToolStripMenuItem, 81 this.randomToolStripMenuItem, 82 this.mostCommonToolStripMenuItem, 83 this.interpolationToolStripMenuItem}); 84 this.replaceValueToolStripMenuItem.Name = "replaceValueToolStripMenuItem"; 85 this.replaceValueToolStripMenuItem.Size = new System.Drawing.Size(152, 22); 86 this.replaceValueToolStripMenuItem.Text = "Replace Value"; 87 // 88 // averageToolStripMenuItem 89 // 90 this.averageToolStripMenuItem.Name = "averageToolStripMenuItem"; 91 this.averageToolStripMenuItem.Size = new System.Drawing.Size(155, 22); 92 this.averageToolStripMenuItem.Text = "Average"; 93 this.averageToolStripMenuItem.Click += new System.EventHandler(this.ReplaceWithAverage_Click); 94 // 95 // medianToolStripMenuItem 96 // 97 this.medianToolStripMenuItem.Name = "medianToolStripMenuItem"; 98 this.medianToolStripMenuItem.Size = new System.Drawing.Size(155, 22); 99 this.medianToolStripMenuItem.Text = "Median"; 100 this.medianToolStripMenuItem.Click += new System.EventHandler(this.ReplaceWithMedian_Click); 101 // 102 // randomToolStripMenuItem 103 // 104 this.randomToolStripMenuItem.Name = "randomToolStripMenuItem"; 105 this.randomToolStripMenuItem.Size = new System.Drawing.Size(155, 22); 106 this.randomToolStripMenuItem.Text = "Random"; 107 this.randomToolStripMenuItem.Click += new System.EventHandler(this.ReplaceWithRandom_Click); 108 // 109 // mostCommonToolStripMenuItem 110 // 111 this.mostCommonToolStripMenuItem.Name = "mostCommonToolStripMenuItem"; 112 this.mostCommonToolStripMenuItem.Size = new System.Drawing.Size(155, 22); 113 this.mostCommonToolStripMenuItem.Text = "Most Common"; 114 this.mostCommonToolStripMenuItem.Click += new System.EventHandler(this.ReplaceWithMostCommon_Click); 115 // 116 // interpolationToolStripMenuItem 117 // 118 this.interpolationToolStripMenuItem.Name = "interpolationToolStripMenuItem"; 119 this.interpolationToolStripMenuItem.Size = new System.Drawing.Size(155, 22); 120 this.interpolationToolStripMenuItem.Text = "Interpolation"; 121 this.interpolationToolStripMenuItem.Click += new System.EventHandler(this.ReplaceWithInterpolation_Click); 122 // 60 123 // DataGridContentView 61 124 // … … 72 135 this.Controls.SetChildIndex(this.btnApplySort, 0); 73 136 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 137 this.contextMenuCell.ResumeLayout(false); 74 138 this.ResumeLayout(false); 75 139 this.PerformLayout(); … … 80 144 81 145 private System.Windows.Forms.Button btnApplySort; 146 private System.Windows.Forms.ContextMenuStrip contextMenuCell; 147 private System.Windows.Forms.ToolStripMenuItem replaceValueToolStripMenuItem; 148 private System.Windows.Forms.ToolStripMenuItem averageToolStripMenuItem; 149 private System.Windows.Forms.ToolStripMenuItem medianToolStripMenuItem; 150 private System.Windows.Forms.ToolStripMenuItem randomToolStripMenuItem; 151 private System.Windows.Forms.ToolStripMenuItem mostCommonToolStripMenuItem; 152 private System.Windows.Forms.ToolStripMenuItem interpolationToolStripMenuItem; 82 153 } 83 154 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataGridContentView.cs
r10345 r10380 8 8 using System.Collections.Generic; 9 9 using System.Linq; 10 using System; 10 11 11 12 namespace HeuristicLab.DataPreprocessing { … … 13 14 [Content(typeof(IDataGridContent), true)] 14 15 public partial class DataGridContentView : StringConvertibleMatrixView { 16 17 private int lastClickedRow; 18 private int lastClickedColumn; 15 19 16 20 public new IDataGridContent Content { … … 21 25 public DataGridContentView() { 22 26 InitializeComponent(); 27 dataGridView.CellMouseClick += dataGridView_CellMouseClick; 28 contextMenuCell.Items.Add(ShowHideColumns); 23 29 } 24 30 … … 49 55 } 50 56 57 private void dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { 58 if (Content == null) return; 59 if (e.Button == System.Windows.Forms.MouseButtons.Right) { 60 if (e.ColumnIndex == -1 || e.RowIndex == -1) { 61 contextMenu.Show(MousePosition); 62 } else { 63 interpolationToolStripMenuItem.Enabled = !(e.RowIndex == 0 || e.RowIndex == Content.Rows); 64 contextMenuCell.Show(MousePosition); 65 lastClickedColumn = e.ColumnIndex; 66 lastClickedRow = e.RowIndex; 67 } 68 } 69 } 70 51 71 protected override int[] Sort(IEnumerable<KeyValuePair<int, SortOrder>> sortedColumns) { 52 72 btnApplySort.Enabled = sortedColumns.Any(); … … 58 78 base.ClearSorting(); 59 79 } 80 81 private void ReplaceWithAverage_Click(object sender, EventArgs e) { 82 var asdf = new List<int>() { lastClickedRow }; 83 Content.PreprocessingDataManipulation.ReplaceIndicesByAverageValue(lastClickedColumn, new List<int>() { lastClickedRow }); 84 } 85 86 private void ReplaceWithMedian_Click(object sender, EventArgs e) { 87 Content.PreprocessingDataManipulation.ReplaceIndicesByMedianValue(lastClickedColumn, new List<int>() { lastClickedRow }); 88 } 89 90 private void ReplaceWithRandom_Click(object sender, EventArgs e) { 91 Content.PreprocessingDataManipulation.ReplaceIndicesByRandomValue(lastClickedColumn, new List<int>() { lastClickedRow }); 92 } 93 94 private void ReplaceWithMostCommon_Click(object sender, EventArgs e) { 95 Content.PreprocessingDataManipulation.ReplaceIndicesByMostCommonValue(lastClickedColumn, new List<int>() { lastClickedRow }); 96 } 97 98 private void ReplaceWithInterpolation_Click(object sender, EventArgs e) { 99 Content.PreprocessingDataManipulation.ReplaceIndicesByLinearInterpolationOfNeighbours(lastClickedColumn, new List<int>() { lastClickedRow }); 100 } 60 101 } 61 102 }
Note: See TracChangeset
for help on using the changeset viewer.