- Timestamp:
- 05/15/17 16:30:45 (8 years ago)
- Location:
- branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.cs
r14902 r14983 38 38 protected Dictionary<string, DataRow> allInOneDataRows; 39 39 protected DataTable allInOneDataTable; 40 protected DataTable Control allInOneDataTableControl;40 protected DataTableView allInOneDataTableView; 41 41 42 42 public LineChartView() { … … 45 45 46 46 allInOneDataRows = new Dictionary<string, DataRow>(); 47 allInOneDataTable = new DataTable();47 allInOneDataTable = new DataTable(); 48 48 } 49 49 … … 71 71 return Content.AllInOneMode ? 1 : base.GetNumberOfVisibleDataTables(); 72 72 } 73 protected override IEnumerable<DataTable Control> GetVisibleDataTables() {73 protected override IEnumerable<DataTableView> GetVisibleDataTables() { 74 74 if (Content.AllInOneMode) { 75 if (allInOneDataTable Control== null)76 allInOneDataTable Control = new DataTableControl() { Content = allInOneDataTable };77 return new[] { allInOneDataTable Control};75 if (allInOneDataTableView == null) 76 allInOneDataTableView = new DataTableView() { Content = allInOneDataTable }; 77 return new[] { allInOneDataTableView }; 78 78 } 79 79 return base.GetVisibleDataTables(); -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
r14975 r14983 37 37 public partial class PreprocessingChartView : PreprocessingCheckedVariablesView { 38 38 protected Dictionary<string, DataTable> dataTables; 39 protected Dictionary<string, DataTable Control> dataTableControls;39 protected Dictionary<string, DataTableView> dataTableViews; 40 40 41 41 public static readonly Color[] Colors = { … … 51 51 InitializeComponent(); 52 52 dataTables = new Dictionary<string, DataTable>(); 53 dataTable Controls = new Dictionary<string, DataTableControl>();53 dataTableViews = new Dictionary<string, DataTableView>(); 54 54 } 55 55 … … 66 66 } 67 67 68 protected virtual IEnumerable<DataTable Control> GetVisibleDataTables() {68 protected virtual IEnumerable<DataTableView> GetVisibleDataTables() { 69 69 foreach (var name in Content.VariableItemList.CheckedItems) { 70 if (!dataTable Controls.ContainsKey(name.Value.Value))71 dataTable Controls.Add(name.Value.Value, new DataTableControl() { Content = dataTables[name.Value.Value]});72 yield return dataTable Controls[name.Value.Value];70 if (!dataTableViews.ContainsKey(name.Value.Value)) 71 dataTableViews.Add(name.Value.Value, new DataTableView() { Content = dataTables[name.Value.Value], ShowName = false }); 72 yield return dataTableViews[name.Value.Value]; 73 73 } 74 74 } … … 80 80 protected virtual void InitData() { 81 81 dataTables.Clear(); 82 dataTable Controls.Clear();82 dataTableViews.Clear(); 83 83 foreach (var variable in Content.VariableItemList.Select(v => v.Value)) { 84 84 dataTables.Add(variable, CreateDataTable(variable)); … … 129 129 base.RemoveVariable(name); 130 130 dataTables.Remove(name); 131 dataTable Controls.Remove(name);131 dataTableViews.Remove(name); 132 132 133 133 GenerateLayout(); … … 139 139 var newDataTable = CreateDataTable(name); 140 140 dataTables.Add(name, newDataTable); 141 dataTable Controls[name].Content = newDataTable;141 dataTableViews[name].Content = newDataTable; 142 142 GenerateLayout(); 143 143 } … … 191 191 } 192 192 193 private void AddDataTableToTableLayout(DataTable ControldataTable, int row, int col) {193 private void AddDataTableToTableLayout(DataTableView dataTable, int row, int col) { 194 194 //dataView.Classification = Classification; 195 195 //dataView.IsDetailedChartViewEnabled = IsDetailedChartViewEnabled; -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
r14975 r14983 416 416 foreach (var dataRow in dataTable.Rows) 417 417 dataRow.VisualProperties.IsVisibleInLegend = groupingComboBox.SelectedIndex > 0; 418 var pcv = new DataTable Control{418 var pcv = new DataTableView { 419 419 Name = key.ToString(), 420 420 Content = dataTable, 421 421 Dock = DockStyle.Fill, 422 ShowName = false 422 423 //ShowLegend = false, 423 424 //XAxisFormat = "G3" … … 444 445 } 445 446 scatterPlot.VisualProperties.Title = string.Empty; 446 var scatterPlot Control = new ScatterPlotControl{447 var scatterPlotView = new ScatterPlotView { 447 448 Name = key.ToString(), 448 449 Content = scatterPlot, 449 450 Dock = DockStyle.Fill, 451 ShowName = false 450 452 //ShowLegend = false, 451 453 //XAxisFormat = "G3" 452 454 }; 453 //scatterPlot Control.DoubleClick += ScatterPlotDoubleClick; // ToDo: not working; double click is already handled by the chart454 bodyCache.Add(key, scatterPlot Control);455 //scatterPlotView.DoubleClick += ScatterPlotDoubleClick; // ToDo: not working; double click is already handled by the chart 456 bodyCache.Add(key, scatterPlotView); 455 457 } 456 458 } … … 536 538 //Open scatter plot in new tab with new content when double clicked 537 539 private void ScatterPlotDoubleClick(object sender, EventArgs e) { 538 var scatterPlot Control = (ScatterPlotControl)sender;540 var scatterPlotView = (ScatterPlotView)sender; 539 541 var scatterContent = new SingleScatterPlotContent(Content.PreprocessingData); 540 ScatterPlot scatterPlot = scatterPlot Control.Content;542 ScatterPlot scatterPlot = scatterPlotView.Content; 541 543 542 544 //Extract variable names from scatter plot and set them in content … … 552 554 //open histogram in new tab with new content when double clicked 553 555 private void HistogramDoubleClick(object sender, EventArgs e) { 554 DataTable Control pcv = (DataTableControl)sender;556 DataTableView pcv = (DataTableView)sender; 555 557 HistogramContent histoContent = new HistogramContent(Content.PreprocessingData); // create new content 556 558 //ToDo: histoContent.VariableItemList = Content.CreateVariableItemList(); … … 655 657 int pointSize = (int)pointSizeNumericUpDown.Value; 656 658 foreach (var control in bodyCache.ToList()) { 657 var scatterPlot Control = control.Value as ScatterPlotControl;658 if (scatterPlot Control!= null) {659 foreach (var row in scatterPlot Control.Content.Rows) {659 var scatterPlotView = control.Value as ScatterPlotView; 660 if (scatterPlotView != null) { 661 foreach (var row in scatterPlotView.Content.Rows) { 660 662 row.VisualProperties.PointSize = pointSize; 661 663 } … … 666 668 float opacity = (float)pointOpacityNumericUpDown.Value; 667 669 foreach (var control in bodyCache.ToList()) { 668 var scatterPlot Control = control.Value as ScatterPlotControl;669 if (scatterPlot Control!= null) {670 foreach (var row in scatterPlot Control.Content.Rows) {670 var scatterPlotView = control.Value as ScatterPlotView; 671 if (scatterPlotView != null) { 672 foreach (var row in scatterPlotView.Content.Rows) { 671 673 var color = row.VisualProperties.Color; 672 674 if (color.IsEmpty) … … 700 702 } 701 703 702 var scatterPlot Control = control.Value as ScatterPlotControl;703 if (scatterPlot Control!= null) {704 foreach (var row in scatterPlot Control.Content.Rows) {704 var scatterPlotView = control.Value as ScatterPlotView; 705 if (scatterPlotView != null) { 706 foreach (var row in scatterPlotView.Content.Rows) { 705 707 row.VisualProperties.IsRegressionVisibleInLegend = false; 706 708 row.VisualProperties.RegressionType = regressionType; … … 726 728 } 727 729 728 var histogramControl = control.Value as DataTable Control;730 var histogramControl = control.Value as DataTableView; 729 731 if (histogramControl != null) { 730 732 foreach (var row in histogramControl.Content.Rows) { -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs
r14725 r14983 46 46 private void InitializeComponent() { 47 47 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ScatterPlotSingleView)); 48 this.scatterPlot Control = new HeuristicLab.Analysis.Views.ScatterPlotControl();48 this.scatterPlotView = new HeuristicLab.Analysis.Views.ScatterPlotView(); 49 49 this.groupBox1 = new System.Windows.Forms.GroupBox(); 50 50 this.useGradientCheckBox = new System.Windows.Forms.CheckBox(); … … 76 76 this.SuspendLayout(); 77 77 // 78 // scatterPlotControl79 // 80 this.scatterPlot Control.Caption = "View";81 this.scatterPlot Control.Content = null;82 this.scatterPlot Control.Dock = System.Windows.Forms.DockStyle.Fill;83 this.scatterPlot Control.Location = new System.Drawing.Point(0, 0);84 this.scatterPlot Control.Name = "scatterPlotControl";85 this.scatterPlot Control.ReadOnly = false;86 this.scatterPlot Control.Size = new System.Drawing.Size(618, 517);87 this.scatterPlot Control.TabIndex = 0;78 // ScatterPlotView 79 // 80 this.scatterPlotView.Caption = "View"; 81 this.scatterPlotView.Content = null; 82 this.scatterPlotView.Dock = System.Windows.Forms.DockStyle.Fill; 83 this.scatterPlotView.Location = new System.Drawing.Point(0, 0); 84 this.scatterPlotView.Name = "scatterPlotView"; 85 this.scatterPlotView.ReadOnly = false; 86 this.scatterPlotView.Size = new System.Drawing.Size(618, 517); 87 this.scatterPlotView.TabIndex = 0; 88 88 // 89 89 // groupBox1 … … 269 269 // splitContainer1.Panel2 270 270 // 271 this.splitContainer1.Panel2.Controls.Add(this.scatterPlot Control);271 this.splitContainer1.Panel2.Controls.Add(this.scatterPlotView); 272 272 this.splitContainer1.Panel2.Controls.Add(this.gradientPanel); 273 273 this.splitContainer1.Size = new System.Drawing.Size(863, 517); … … 345 345 #endregion 346 346 347 private HeuristicLab.Analysis.Views.ScatterPlot Control scatterPlotControl;347 private HeuristicLab.Analysis.Views.ScatterPlotView scatterPlotView; 348 348 private System.Windows.Forms.GroupBox groupBox1; 349 349 private System.Windows.Forms.Label label2; -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs
r14917 r14983 118 118 vp.YAxisTitle = yVariable; 119 119 120 scatterPlot Control.Content = scatterPlot;120 scatterPlotView.Content = scatterPlot; 121 121 122 122 //save selected x and y variable in content … … 128 128 129 129 private void comboBoxXVariable_SelectedIndexChanged(object sender, EventArgs e) { 130 var oldPlot = scatterPlot Control.Content;130 var oldPlot = scatterPlotView.Content; 131 131 UpdateScatterPlot(); 132 var newPlot = scatterPlot Control.Content;132 var newPlot = scatterPlotView.Content; 133 133 134 134 if (oldPlot == null || newPlot == null) return; … … 146 146 147 147 private void comboBoxYVariable_SelectedIndexChanged(object sender, EventArgs e) { 148 var oldPlot = scatterPlot Control.Content;148 var oldPlot = scatterPlotView.Content; 149 149 UpdateScatterPlot(); 150 var newPlot = scatterPlot Control.Content;150 var newPlot = scatterPlotView.Content; 151 151 152 152 if (oldPlot == null || newPlot == null) return; … … 187 187 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 188 188 189 foreach (var row in scatterPlot Control.Content.Rows) {189 foreach (var row in scatterPlotView.Content.Rows) { 190 190 row.VisualProperties.IsRegressionVisibleInLegend = false; 191 191 row.VisualProperties.RegressionType = regressionType; … … 199 199 200 200 // remove rows and re-add them later to avoid firing visual property changd events 201 var rows = scatterPlot Control.Content.Rows.ToDictionary(r => r.Name, r => r);202 scatterPlot Control.Content.Rows.Clear();201 var rows = scatterPlotView.Content.Rows.ToDictionary(r => r.Name, r => r); 202 scatterPlotView.Content.Rows.Clear(); 203 203 204 204 if (useGradientCheckBox.Checked) { … … 224 224 } 225 225 } 226 scatterPlot Control.Content.Rows.AddRange(rows.Values);226 scatterPlotView.Content.Rows.AddRange(rows.Values); 227 227 } 228 228
Note: See TracChangeset
for help on using the changeset viewer.