- Timestamp:
- 01/22/14 16:32:24 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/LineChartLogic.cs
r10377 r10382 7 7 namespace HeuristicLab.DataPreprocessing 8 8 { 9 public class LineChartLogic :ILineChartLogic9 public class LineChartLogic : ILineChartLogic 10 10 { 11 11 private IPreprocessingData preprocessingData; 12 private DataTable dataTable; 12 13 13 14 public LineChartLogic(IPreprocessingData preprocessingData) { 14 15 this.preprocessingData = preprocessingData; 15 16 dataTable = new DataTable("LineChart"); 17 FillDataTable(); 16 18 } 17 19 18 p ublic void FillDataTable(DataTable dataTable) {20 private void FillDataTable() { 19 21 IEnumerable<string> variableNames = preprocessingData.VariableNames; 20 22 … … 27 29 28 30 } 31 32 public IEnumerable<object> GetVariableNames() 33 { 34 return preprocessingData.VariableNames; 35 } 36 37 public DataTable GetDataTable() 38 { 39 return dataTable; 40 } 41 42 43 #region ILineChartLogic Members 44 45 public void RemoveVariable(string name) { 46 dataTable.Rows.Remove(name); 47 } 48 49 public void AddVariable(string name) { 50 IList<double> values = preprocessingData.GetValues<double>(name); 51 DataRow row = new DataRow(name, "", values); 52 dataTable.Rows.Add(row); 53 } 54 55 #endregion 56 57 public bool VariableIsDisplayed(string name) { 58 59 foreach (var item in dataTable.Rows) { 60 if(item.Name == name) 61 return true; 62 } 63 return false; 64 } 65 29 66 } 30 67 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ILineChartLogic.cs
r10377 r10382 9 9 public interface ILineChartLogic 10 10 { 11 void FillDataTable(DataTable dataTable); 11 12 void RemoveVariable(string name); 13 14 void AddVariable(string name); 15 16 IEnumerable<object> GetVariableNames(); 17 18 DataTable GetDataTable(); 19 20 bool VariableIsDisplayed(string name); 12 21 } 13 22 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/LineChartView.Designer.cs
r10377 r10382 36 36 this.viewHost.Content = null; 37 37 this.viewHost.Enabled = false; 38 this.viewHost.Location = new System.Drawing.Point(155, 3);38 this.viewHost.Location = new System.Drawing.Point(155, 4); 39 39 this.viewHost.Name = "viewHost"; 40 40 this.viewHost.ReadOnly = false; 41 this.viewHost.Size = new System.Drawing.Size(922, 5 76);41 this.viewHost.Size = new System.Drawing.Size(922, 559); 42 42 this.viewHost.TabIndex = 0; 43 43 this.viewHost.ViewsLabelVisible = true; … … 49 49 | System.Windows.Forms.AnchorStyles.Left))); 50 50 this.variablesListBox.FormattingEnabled = true; 51 this.variablesListBox.Location = new System.Drawing.Point( 4, 4);51 this.variablesListBox.Location = new System.Drawing.Point(3, 4); 52 52 this.variablesListBox.Name = "variablesListBox"; 53 this.variablesListBox.Size = new System.Drawing.Size(14 5, 574);53 this.variablesListBox.Size = new System.Drawing.Size(146, 559); 54 54 this.variablesListBox.TabIndex = 1; 55 55 this.variablesListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.variablesListBox_ItemCheck); -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/LineChartView.cs
r10377 r10382 19 19 public partial class LineChartView : ItemView { 20 20 21 private DataTable dataTable;22 23 21 public LineChartView() { 24 22 InitializeComponent(); … … 26 24 27 25 private void InitDataTable() { 28 dataTable = new DataTable("LineChart");29 26 ILineChartLogic logic = Content.LineChartLogic; 30 logic.FillDataTable(dataTable);27 viewHost.Content = logic.GetDataTable(); 31 28 } 32 29 … … 41 38 InitDataTable(); 42 39 InitVariablesListBox(); 43 viewHost.Content = dataTable;44 45 40 } 46 41 } … … 49 44 ILineChartLogic logic = Content.LineChartLogic; 50 45 51 //foreach (var variableName in logic.GetVariableNames()) {52 //variablesListBox.Items.Add(variableName,true);53 //}46 foreach (var variableName in logic.GetVariableNames()) { 47 variablesListBox.Items.Add(variableName,true); 48 } 54 49 } 55 50 56 51 private void variablesListBox_ItemCheck(object sender, ItemCheckEventArgs e) { 57 //string item = variablesListBox.Items[e.Index] as string;52 string item = variablesListBox.Items[e.Index] as string; 58 53 54 55 if (e.NewValue == CheckState.Checked && !Content.LineChartLogic.VariableIsDisplayed(item)) 56 Content.LineChartLogic.AddVariable(item); 57 else if(e.NewValue == CheckState.Unchecked && Content.LineChartLogic.VariableIsDisplayed(item)) 58 Content.LineChartLogic.RemoveVariable(item); 59 59 } 60 60 }
Note: See TracChangeset
for help on using the changeset viewer.