Changeset 10818 for branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs
- Timestamp:
- 05/07/14 15:15:45 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs
r10817 r10818 41 41 private PreprocessingDataTable dataTable; 42 42 private List<PreprocessingDataTable> dataTablePerVariable; 43 private ICheckedItemList<StringValue> variableItemList;44 43 private List<DataRow> dataRows; 45 44 46 45 protected DataRowVisualProperties.DataRowChartType chartType; 47 46 protected string chartTitle; 48 protected bool allInOneMode;49 47 50 48 private const string DEFAULT_CHART_TITLE = "Chart"; … … 55 53 chartType = DataRowVisualProperties.DataRowChartType.Line; 56 54 chartTitle = DEFAULT_CHART_TITLE; 57 allInOneMode = true;58 55 } 59 56 … … 73 70 } 74 71 75 if (!allInOneMode) 72 //if (!Content.AllInOneMode) 73 if (Content != null && !Content.AllInOneMode) 76 74 GenerateChart(); 77 75 … … 104 102 105 103 private void InitData() { 106 variableItemList = logic.CreateVariableItemList(); 107 checkedItemList.Content = variableItemList; 104 if (Content.VariableItemList == null) 105 { 106 Content.VariableItemList = logic.CreateVariableItemList(); 107 } 108 checkedItemList.Content = Content.VariableItemList; 108 109 dataRows = logic.CreateAllDataRows(chartType); 109 110 … … 115 116 // init data table per variable 116 117 dataTablePerVariable = new List<PreprocessingDataTable>(); 117 foreach (var checkedItem in variableItemList.CheckedItems) { 118 string variableName = variableItemList[checkedItem.Index].Value; 118 foreach (var checkedItem in Content.VariableItemList.CheckedItems) 119 { 120 string variableName = Content.VariableItemList[checkedItem.Index].Value; 119 121 PreprocessingDataTable d = new PreprocessingDataTable(variableName); 120 122 DataRow row = GetDataRow(variableName); … … 144 146 logic = Content.ChartLogic; 145 147 InitData(); 146 variableItemList.CheckedItemsChanged += CheckedItemsChanged;148 Content.VariableItemList.CheckedItemsChanged += CheckedItemsChanged; 147 149 GenerateChart(); 148 150 } … … 190 192 d.Rows.Add(row); 191 193 dataTablePerVariable.Add(d); 192 variableItemList.Add(new StringValue(name));193 if (! allInOneMode)194 Content.VariableItemList.Add(new StringValue(name)); 195 if (!Content.AllInOneMode) 194 196 GenerateChart(); 195 197 } … … 202 204 StringValue stringValue = FindVariableItemList(name); 203 205 if (stringValue != null) 204 variableItemList.Remove(stringValue);205 if (! allInOneMode)206 Content.VariableItemList.Remove(stringValue); 207 if (!Content.AllInOneMode) 206 208 GenerateChart(); 207 209 } 208 210 209 211 private StringValue FindVariableItemList(string name) { 210 foreach (StringValue stringValue in variableItemList) { 212 foreach (StringValue stringValue in Content.VariableItemList) 213 { 211 214 if (stringValue.Value == name) 212 215 return stringValue; … … 219 222 ClearTableLayout(); 220 223 221 if (allInOneMode) { 224 if (Content.AllInOneMode) 225 { 222 226 GenerateSingleChartLayout(); 223 227 } else … … 247 251 private void GenerateMultiChartLayout() { 248 252 int checkedItemsCnt = 0; 249 foreach (var item in variableItemList.CheckedItems)253 foreach (var item in Content.VariableItemList.CheckedItems) 250 254 checkedItemsCnt++; 251 255 … … 320 324 321 325 private void radioButton1_CheckedChanged(object sender, EventArgs e) { 322 if ( allInOneMode == false)323 allInOneMode = true;326 if (Content.AllInOneMode == false) 327 Content.AllInOneMode = true; 324 328 else 325 allInOneMode = false;329 Content.AllInOneMode = false; 326 330 GenerateChart(); 327 331 }
Note: See TracChangeset
for help on using the changeset viewer.