Changeset 10818
- Timestamp:
- 05/07/14 15:15:45 (11 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.cs
r10771 r10818 16 16 chartType = DataRowVisualProperties.DataRowChartType.Histogram; 17 17 chartTitle = HISTOGRAM_CHART_TITLE; 18 allInOneMode = false;19 18 } 20 19 … … 25 24 26 25 private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) { 27 if (allInOne Mode == false)28 allInOneMode = true;26 if (allInOneCheckBox.Checked) 27 Content.AllInOneMode = true; 29 28 else 30 allInOneMode = false;29 Content.AllInOneMode = false; 31 30 GenerateChart(); 31 } 32 33 protected override void OnContentChanged() 34 { 35 base.OnContentChanged(); 36 if (Content != null) 37 { 38 allInOneCheckBox.Checked = Content.AllInOneMode; 39 } 32 40 } 33 41 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/LineChartView.cs
r10736 r10818 45 45 46 46 private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) { 47 if (allInOne Mode == false)48 allInOneMode = true;47 if (allInOneCheckBox.Checked) 48 Content.AllInOneMode = true; 49 49 else 50 allInOneMode = false;50 Content.AllInOneMode = false; 51 51 GenerateChart(); 52 } 53 54 protected override void OnContentChanged() 55 { 56 base.OnContentChanged(); 57 if (Content != null) 58 { 59 allInOneCheckBox.Checked = Content.AllInOneMode; 60 } 52 61 } 53 62 } -
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 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingChartContent.cs
r10658 r10818 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Data; 26 using System; 27 using System.Collections.Generic; 25 28 26 29 namespace HeuristicLab.DataPreprocessing { 27 30 [Item("PreprocessingChart", "Represents a preprocessing chart.")] 28 31 public class PreprocessingChartContent : Item, IViewShortcut { 32 33 private bool allInOneMode = true; 34 35 private ICheckedItemList<StringValue> variableItemList = null; 36 29 37 30 38 private readonly IChartLogic chartLogic; … … 55 63 remove { chartLogic.Changed -= value; } 56 64 } 65 66 public bool AllInOneMode 67 { 68 get { return this.allInOneMode; } 69 set { this.allInOneMode = value; } 70 } 71 72 public ICheckedItemList<StringValue> VariableItemList 73 { 74 get { return this.variableItemList; } 75 set { this.variableItemList = value; } 76 } 57 77 } 58 78 }
Note: See TracChangeset
for help on using the changeset viewer.