Changeset 10992 for branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
- Timestamp:
- 06/11/14 15:06:24 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
r10987 r10992 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.ComponentModel;4 3 using System.Drawing; 5 4 using System.Linq; 6 using System.Text;7 5 using System.Windows.Forms; 8 6 using HeuristicLab.Analysis; 9 using HeuristicLab.Analysis.Views;10 using HeuristicLab.Collections;11 7 using HeuristicLab.Common; 12 using HeuristicLab.Core;13 8 using HeuristicLab.Core.Views; 14 using HeuristicLab.Data;15 9 using HeuristicLab.DataPreprocessing.Implementations; 16 10 using HeuristicLab.MainForm; … … 47 41 private void addHeaderToTableLayoutPanels() { 48 42 49 List<string> variables = Content. GetVariableNames().ToList();43 List<string> variables = Content.PreprocessingData.GetDoubleVariableNames().ToList(); 50 44 51 45 for (int i = 1; i < variables.Count + 1; i++) { … … 66 60 } 67 61 68 private void GenerateMultiLayout() 69 { 70 List<string> variables = Content.GetVariableNames().ToList(); 62 private void GenerateMultiLayout() { 63 List<string> variables = Content.PreprocessingData.GetDoubleVariableNames().ToList(); 71 64 72 65 tableLayoutPanel.Controls.Clear(); … … 76 69 77 70 //Set row and column count 78 tableLayoutPanel.ColumnCount = variables.Count +1;79 tableLayoutPanel.RowCount = variables.Count +1;71 tableLayoutPanel.ColumnCount = variables.Count + 1; 72 tableLayoutPanel.RowCount = variables.Count + 1; 80 73 81 74 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, HEADER_WIDTH)); 82 75 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, HEADER_HEIGHT)); 83 76 // set column and row layout 84 for (int x = 0; x < variables.Count; x++) 85 { 77 for (int x = 0; x < variables.Count; x++) { 86 78 // auto size 87 79 if (variables.Count <= MAX_AUTO_SIZE_ELEMENTS) { 88 80 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, (tableLayoutPanel.Width - HEADER_WIDTH) / variables.Count)); 89 81 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, (tableLayoutPanel.Height - HEADER_HEIGHT) / variables.Count)); 90 } 91 // fixed size82 } 83 // fixed size 92 84 else { 93 85 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, FIXED_CHART_WIDTH)); … … 98 90 addHeaderToTableLayoutPanels(); 99 91 addChartsToTableLayoutPanel(); 100 92 101 93 } 102 94 103 95 private void addChartsToTableLayoutPanel() { 104 96 105 List<string> variables = Content. GetVariableNames().ToList();97 List<string> variables = Content.PreprocessingData.GetDoubleVariableNames().ToList(); 106 98 107 99 //set scatter plots and histograms … … 119 111 tableLayoutPanel.Controls.Add(pcv, y, x); 120 112 } 121 //scatter plot113 //scatter plot 122 114 else { 123 115 ScatterPlot scatterPlot = Content.CreateScatterPlot(variables[x - 1], variables[y - 1]); … … 147 139 // only one data row should be in scatter plot 148 140 if (scatterPlot.Rows.Count == 1) { 149 string[] variables = scatterPlot.Rows.ElementAt(0).Name.Split(new string[] {" - "},StringSplitOptions.None); // extract variable names from string141 string[] variables = scatterPlot.Rows.ElementAt(0).Name.Split(new string[] { " - " }, StringSplitOptions.None); // extract variable names from string 150 142 scatterContent.SelectedXVariable = variables[0]; 151 143 scatterContent.SelectedYVariable = variables[1]; … … 161 153 162 154 // set only variable name checked 163 foreach(var checkedItem in histoContent.VariableItemList) 164 { 165 if(checkedItem.Value == variableName) 166 histoContent.VariableItemList.SetItemCheckedState(checkedItem,true); 155 foreach (var checkedItem in histoContent.VariableItemList) { 156 if (checkedItem.Value == variableName) 157 histoContent.VariableItemList.SetItemCheckedState(checkedItem, true); 167 158 else 168 histoContent.VariableItemList.SetItemCheckedState(checkedItem, false);169 159 histoContent.VariableItemList.SetItemCheckedState(checkedItem, false); 160 170 161 } 171 162 } … … 174 165 //open histogram in new tab with new content when double clicked 175 166 private void HistogramDoubleClick(object sender, EventArgs e) { 176 //PreprocessingDataTableView pcv = (PreprocessingDataTableView)sender;177 //HistogramContent histoContent = new HistogramContent(Content,); // create new content178 //histoContent.VariableItemList = logic.CreateVariableItemList();179 //PreprocessingDataTable dataTable = pcv.Content;180 //setVariableItemListFromDataTable(histoContent, dataTable);167 PreprocessingDataTableView pcv = (PreprocessingDataTableView)sender; 168 HistogramContent histoContent = new HistogramContent(Content.PreprocessingData); // create new content 169 histoContent.VariableItemList = Content.CreateVariableItemList(); 170 PreprocessingDataTable dataTable = pcv.Content; 171 setVariableItemListFromDataTable(histoContent, dataTable); 181 172 182 //MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView)); // open in new tab173 MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView)); // open in new tab 183 174 } 184 175 185 176 186 177 } 187 178 188 179 189 180 }
Note: See TracChangeset
for help on using the changeset viewer.