- Timestamp:
- 05/14/14 13:37:28 (10 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs
r10811 r10847 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing; 24 25 using HeuristicLab.Analysis; 25 26 using HeuristicLab.Core; … … 35 36 this.preprocessingData = preprocessingData; 36 37 } 38 39 #region IChartLogic Members 37 40 38 41 public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) { … … 92 95 } 93 96 97 public event EventHandler SelectionChanged { 98 add { preprocessingData.SelectionChanged += value; } 99 remove { preprocessingData.SelectionChanged -= value; } 100 } 101 94 102 public string GetVariableNameByIndex(int index) { 95 103 return preprocessingData.GetVariableName(index); … … 104 112 } 105 113 114 public List<DataRow> CreateAllSelectedDataRows(DataRowVisualProperties.DataRowChartType chartType) { 115 List<DataRow> dataRows = new List<DataRow>(); 116 foreach (var name in GetVariableNames()) { 117 DataRow row = CreateSelectedDataRow(name, chartType); 118 if(row != null) 119 dataRows.Add(row); 120 } 121 return dataRows; 122 } 123 124 public DataRow CreateSelectedDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) { 125 126 IDictionary<int,IList<int>> selection = preprocessingData.GetSelection(); 127 int variableIndex = preprocessingData.GetColumnIndex(variableName); 128 129 if (selection.Keys.Contains(variableIndex)) 130 { 131 List<int> selectedIndices = new List<int>(selection[variableIndex]); 132 //need selection with more than 1 value 133 if(selectedIndices.Count < 2) 134 return null; 135 136 int end = selectedIndices[0]; // indices are provided in reverse order 137 int start = selectedIndices[selectedIndices.Count-1]; 138 139 DataRow rowSelect = CreateDataRowRange(variableName, start, end, chartType); 140 rowSelect.VisualProperties.Color = Color.Green; 141 return rowSelect; 142 } 143 else 144 return null; 145 } 146 147 #endregion 106 148 } 107 149 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilteredPreprocessingData.cs
r10810 r10847 186 186 } 187 187 188 public event EventHandler SelectionChanged; 188 public event EventHandler SelectionChanged { 189 add { originalData.SelectionChanged += value; } 190 remove { originalData.SelectionChanged -= value; } 191 } 189 192 190 193 #endregion -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingDataTable.cs
r10803 r10847 4 4 using System.Text; 5 5 using HeuristicLab.Analysis; 6 using HeuristicLab.Collections; 6 7 using HeuristicLab.Core; 7 8 … … 26 27 if (selectedRows != null) throw new InvalidOperationException("Rows already set"); 27 28 selectedRows = value; 28 //if (selectedRows != null) Register RowsEvents();29 //if (selectedRows != null) RegisterSelectedRowEvents(); 29 30 } 30 31 } 31 32 32 33 34 33 } 35 34 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IChartLogic.cs
r10803 r10847 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using HeuristicLab.Analysis; … … 32 33 event DataPreprocessingChangedEventHandler Changed; 33 34 35 event EventHandler SelectionChanged; 36 34 37 ICheckedItemList<StringValue> CreateVariableItemList(); 38 39 List<DataRow> CreateAllSelectedDataRows(DataRowVisualProperties.DataRowChartType chartType); 40 41 DataRow CreateSelectedDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType); 35 42 36 43 DataRow CreateDataRow(string variableName,DataRowVisualProperties.DataRowChartType chartType);
Note: See TracChangeset
for help on using the changeset viewer.