Changeset 14641
- Timestamp:
- 02/03/17 01:21:08 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionParameterAnalysisView.Designer.cs
r14636 r14641 58 58 this.groupsTreeView = new System.Windows.Forms.TreeView(); 59 59 this.splitContainer = new System.Windows.Forms.SplitContainer(); 60 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 61 this.parametersGroupBox = new System.Windows.Forms.GroupBox(); 62 this.parametersTreeView = new System.Windows.Forms.TreeView(); 60 63 this.groupsGroupBox = new System.Windows.Forms.GroupBox(); 61 64 this.removeGroupButton = new System.Windows.Forms.Button(); 62 65 this.addGroupButton = new System.Windows.Forms.Button(); 63 this.parametersGroupBox = new System.Windows.Forms.GroupBox();64 this.parametersTreeView = new System.Windows.Forms.TreeView();65 66 this.dataRowsGroupBox = new System.Windows.Forms.GroupBox(); 66 67 this.minMaxCheckBox = new System.Windows.Forms.CheckBox(); … … 68 69 this.quartilesCheckBox = new System.Windows.Forms.CheckBox(); 69 70 this.averageCheckBox = new System.Windows.Forms.CheckBox(); 70 this.splitContainer1 = new System.Windows.Forms.SplitContainer();71 71 ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit(); 72 72 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); … … 75 75 this.splitContainer.Panel2.SuspendLayout(); 76 76 this.splitContainer.SuspendLayout(); 77 this.groupsGroupBox.SuspendLayout();78 this.parametersGroupBox.SuspendLayout();79 this.dataRowsGroupBox.SuspendLayout();80 77 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 81 78 this.splitContainer1.Panel1.SuspendLayout(); 82 79 this.splitContainer1.Panel2.SuspendLayout(); 83 80 this.splitContainer1.SuspendLayout(); 81 this.parametersGroupBox.SuspendLayout(); 82 this.groupsGroupBox.SuspendLayout(); 83 this.dataRowsGroupBox.SuspendLayout(); 84 84 this.SuspendLayout(); 85 85 // … … 124 124 title1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 125 125 title1.Name = "title"; 126 title1.Text = "Title";127 126 this.chart.Titles.Add(title1); 128 127 this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend); … … 175 174 | System.Windows.Forms.AnchorStyles.Left) 176 175 | System.Windows.Forms.AnchorStyles.Right))); 176 this.groupsTreeView.CheckBoxes = true; 177 177 this.groupsTreeView.HideSelection = false; 178 178 this.groupsTreeView.Location = new System.Drawing.Point(6, 49); … … 181 181 this.groupsTreeView.Size = new System.Drawing.Size(255, 524); 182 182 this.groupsTreeView.TabIndex = 2; 183 this.groupsTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.groupsTreeView_AfterCheck); 183 184 this.groupsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.groupsTreeView_AfterSelect); 184 185 // … … 203 204 this.splitContainer.SplitterDistance = 273; 204 205 this.splitContainer.TabIndex = 0; 206 // 207 // splitContainer1 208 // 209 this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 210 this.splitContainer1.Location = new System.Drawing.Point(0, 0); 211 this.splitContainer1.Name = "splitContainer1"; 212 this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; 213 // 214 // splitContainer1.Panel1 215 // 216 this.splitContainer1.Panel1.Controls.Add(this.parametersGroupBox); 217 // 218 // splitContainer1.Panel2 219 // 220 this.splitContainer1.Panel2.Controls.Add(this.groupsGroupBox); 221 this.splitContainer1.Size = new System.Drawing.Size(273, 851); 222 this.splitContainer1.SplitterDistance = 261; 223 this.splitContainer1.TabIndex = 0; 224 // 225 // parametersGroupBox 226 // 227 this.parametersGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 228 | System.Windows.Forms.AnchorStyles.Left) 229 | System.Windows.Forms.AnchorStyles.Right))); 230 this.parametersGroupBox.Controls.Add(this.parametersTreeView); 231 this.parametersGroupBox.Location = new System.Drawing.Point(3, 3); 232 this.parametersGroupBox.Name = "parametersGroupBox"; 233 this.parametersGroupBox.Size = new System.Drawing.Size(267, 255); 234 this.parametersGroupBox.TabIndex = 0; 235 this.parametersGroupBox.TabStop = false; 236 this.parametersGroupBox.Text = "&Parameters"; 237 // 238 // parametersTreeView 239 // 240 this.parametersTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 241 | System.Windows.Forms.AnchorStyles.Left) 242 | System.Windows.Forms.AnchorStyles.Right))); 243 this.parametersTreeView.CheckBoxes = true; 244 this.parametersTreeView.HideSelection = false; 245 this.parametersTreeView.Location = new System.Drawing.Point(6, 19); 246 this.parametersTreeView.Name = "parametersTreeView"; 247 this.parametersTreeView.ShowRootLines = false; 248 this.parametersTreeView.Size = new System.Drawing.Size(255, 230); 249 this.parametersTreeView.TabIndex = 0; 250 this.parametersTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.parametersTreeView_AfterCheck); 251 this.parametersTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.parametersTreeView_AfterSelect); 205 252 // 206 253 // groupsGroupBox … … 241 288 this.addGroupButton.Click += new System.EventHandler(this.addGroupButton_Click); 242 289 // 243 // parametersGroupBox244 //245 this.parametersGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)246 | System.Windows.Forms.AnchorStyles.Left)247 | System.Windows.Forms.AnchorStyles.Right)));248 this.parametersGroupBox.Controls.Add(this.parametersTreeView);249 this.parametersGroupBox.Location = new System.Drawing.Point(3, 3);250 this.parametersGroupBox.Name = "parametersGroupBox";251 this.parametersGroupBox.Size = new System.Drawing.Size(267, 255);252 this.parametersGroupBox.TabIndex = 0;253 this.parametersGroupBox.TabStop = false;254 this.parametersGroupBox.Text = "&Parameters";255 //256 // parametersTreeView257 //258 this.parametersTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)259 | System.Windows.Forms.AnchorStyles.Left)260 | System.Windows.Forms.AnchorStyles.Right)));261 this.parametersTreeView.HideSelection = false;262 this.parametersTreeView.Location = new System.Drawing.Point(6, 19);263 this.parametersTreeView.Name = "parametersTreeView";264 this.parametersTreeView.ShowRootLines = false;265 this.parametersTreeView.Size = new System.Drawing.Size(255, 230);266 this.parametersTreeView.TabIndex = 0;267 this.parametersTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.parametersTreeView_AfterSelect);268 //269 290 // dataRowsGroupBox 270 291 // … … 328 349 this.averageCheckBox.UseVisualStyleBackColor = true; 329 350 this.averageCheckBox.CheckedChanged += new System.EventHandler(this.dataRowCheckBox_CheckedChanged); 330 //331 // splitContainer1332 //333 this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;334 this.splitContainer1.Location = new System.Drawing.Point(0, 0);335 this.splitContainer1.Name = "splitContainer1";336 this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;337 //338 // splitContainer1.Panel1339 //340 this.splitContainer1.Panel1.Controls.Add(this.parametersGroupBox);341 //342 // splitContainer1.Panel2343 //344 this.splitContainer1.Panel2.Controls.Add(this.groupsGroupBox);345 this.splitContainer1.Size = new System.Drawing.Size(273, 851);346 this.splitContainer1.SplitterDistance = 261;347 this.splitContainer1.TabIndex = 0;348 351 // 349 352 // RunCollectionParameterAnalysisView … … 361 364 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 362 365 this.splitContainer.ResumeLayout(false); 363 this.groupsGroupBox.ResumeLayout(false);364 this.parametersGroupBox.ResumeLayout(false);365 this.dataRowsGroupBox.ResumeLayout(false);366 this.dataRowsGroupBox.PerformLayout();367 366 this.splitContainer1.Panel1.ResumeLayout(false); 368 367 this.splitContainer1.Panel2.ResumeLayout(false); 369 368 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 370 369 this.splitContainer1.ResumeLayout(false); 370 this.parametersGroupBox.ResumeLayout(false); 371 this.groupsGroupBox.ResumeLayout(false); 372 this.dataRowsGroupBox.ResumeLayout(false); 373 this.dataRowsGroupBox.PerformLayout(); 371 374 this.ResumeLayout(false); 372 375 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionParameterAnalysisView.cs
r14640 r14641 202 202 parametersTreeView.Nodes.Add(paramsRoot); 203 203 paramsRoot.Expand(); 204 paramsRoot.Checked = true; 204 205 parametersTreeView.SelectedNode = paramsRoot; 205 206 … … 244 245 chart.Series.Clear(); 245 246 chart.Legends[0].CustomItems.Clear(); 246 var selectedNode = groupsTreeView.Focused ? groupsTreeView.SelectedNode : parametersTreeView.SelectedNode; 247 if (selectedNode == null) return; 248 if (selectedNode.Parent == null) { 249 var series = BuildSeries(selectedNode.Tag as IEnumerable<IRun>, colors[0]); 250 chart.Titles[0].Text = selectedNode.Text; 251 foreach (var s in series) 252 chart.Series.Add(s); 253 var legendItem = new LegendItem(); 254 var legendItemInfo = new LegendItemInfo(colors[0], series); 255 legendItem.Color = legendItemInfo.Color; 256 legendItem.BorderColor = Color.Transparent; 257 legendItem.Name = selectedNode.Text; 258 legendItem.Tag = legendItemInfo; 259 chart.Legends[0].CustomItems.Add(legendItem); 260 } else if (selectedNode.Tag is ParameterInfo) { 261 var paramInfo = selectedNode.Tag as ParameterInfo; 262 chart.Titles[0].Text = paramInfo.Name + " (" + paramInfo.RunCount + ")"; 263 foreach (var value in paramInfo.Values) { 264 var series = BuildSeries(value.Value.Runs, value.Value.Color); 247 chart.Titles[0].Text = string.Empty; 248 249 var checkedNodes = TraverseTreeNodes(parametersTreeView.Nodes) 250 .Where(x => x.Checked) 251 .Concat( 252 TraverseTreeNodes(groupsTreeView.Nodes) 253 .Where(x => x.Checked) 254 ); 255 256 foreach (var node in checkedNodes) { 257 if (node.Parent == null) { 258 var series = BuildSeries(node.Tag as IEnumerable<IRun>, colors[0]); 259 chart.Titles[0].Text = node.Text; 265 260 foreach (var s in series) 266 261 chart.Series.Add(s); 267 262 var legendItem = new LegendItem(); 268 var legendItemInfo = new LegendItemInfo( value.Value.Color, series);263 var legendItemInfo = new LegendItemInfo(colors[0], series); 269 264 legendItem.Color = legendItemInfo.Color; 270 265 legendItem.BorderColor = Color.Transparent; 271 legendItem.Name = value.Key + " (" + value.Value.RunCount + ")";266 legendItem.Name = node.Text; 272 267 legendItem.Tag = legendItemInfo; 273 268 chart.Legends[0].CustomItems.Add(legendItem); 274 } 275 } else if (selectedNode.Tag is ParameterValueInfo) { 276 var valueInfo = selectedNode.Tag as ParameterValueInfo; 277 var series = BuildSeries(valueInfo.Runs, valueInfo.Color); 278 chart.Titles[0].Text = selectedNode.Parent.Text; 279 foreach (var s in series) 280 chart.Series.Add(s); 281 var legendItem = new LegendItem(); 282 var legendItemInfo = new LegendItemInfo(valueInfo.Color, series); 283 legendItem.Color = legendItemInfo.Color; 284 legendItem.BorderColor = Color.Transparent; 285 legendItem.Name = selectedNode.Text; 286 legendItem.Tag = legendItemInfo; 287 chart.Legends[0].CustomItems.Add(legendItem); 288 } else if (selectedNode.Tag is GroupInfo) { 289 var groupInfo = selectedNode.Tag as GroupInfo; 290 if (groupInfo.IsParameter) { 291 chart.Titles[0].Text = groupInfo.Text + " (" + groupInfo.Runs.Count + ")"; 292 foreach (TreeNode node in selectedNode.Nodes) { 293 var childInfo = node.Tag as GroupInfo; 294 var series = BuildSeries(childInfo.Runs, childInfo.Color); 269 } else if (node.Tag is ParameterInfo) { 270 var paramInfo = node.Tag as ParameterInfo; 271 chart.Titles[0].Text = paramInfo.Name + " (" + paramInfo.RunCount + ")"; 272 foreach (var value in paramInfo.Values) { 273 var series = BuildSeries(value.Value.Runs, value.Value.Color); 295 274 foreach (var s in series) 296 275 chart.Series.Add(s); 297 276 var legendItem = new LegendItem(); 298 var legendItemInfo = new LegendItemInfo( childInfo.Color, series);277 var legendItemInfo = new LegendItemInfo(value.Value.Color, series); 299 278 legendItem.Color = legendItemInfo.Color; 300 279 legendItem.BorderColor = Color.Transparent; 301 legendItem.Name = childInfo.Text + " (" + childInfo.Runs.Count + ")";280 legendItem.Name = value.Key + " (" + value.Value.RunCount + ")"; 302 281 legendItem.Tag = legendItemInfo; 303 282 chart.Legends[0].CustomItems.Add(legendItem); 304 283 } 305 } else {306 var parentInfo = selectedNode.Parent.Tag as GroupInfo;307 chart.Titles[0].Text = parentInfo.Text + " (" + parentInfo.Runs.Count + ")";308 var series = BuildSeries(groupInfo.Runs, groupInfo.Color);284 } else if (node.Tag is ParameterValueInfo) { 285 var valueInfo = node.Tag as ParameterValueInfo; 286 var series = BuildSeries(valueInfo.Runs, valueInfo.Color); 287 chart.Titles[0].Text = node.Parent.Text; 309 288 foreach (var s in series) 310 289 chart.Series.Add(s); 311 290 var legendItem = new LegendItem(); 312 var legendItemInfo = new LegendItemInfo( groupInfo.Color, series);291 var legendItemInfo = new LegendItemInfo(valueInfo.Color, series); 313 292 legendItem.Color = legendItemInfo.Color; 314 293 legendItem.BorderColor = Color.Transparent; 315 legendItem.Name = groupInfo.Text + " (" + groupInfo.Runs.Count + ")";294 legendItem.Name = node.Text; 316 295 legendItem.Tag = legendItemInfo; 317 296 chart.Legends[0].CustomItems.Add(legendItem); 297 } else if (node.Tag is GroupInfo) { 298 var groupInfo = node.Tag as GroupInfo; 299 if (groupInfo.IsParameter) { 300 chart.Titles[0].Text = groupInfo.Text + " (" + groupInfo.Runs.Count + ")"; 301 foreach (TreeNode child in node.Nodes) { 302 var childInfo = child.Tag as GroupInfo; 303 var series = BuildSeries(childInfo.Runs, childInfo.Color); 304 foreach (var s in series) 305 chart.Series.Add(s); 306 var legendItem = new LegendItem(); 307 var legendItemInfo = new LegendItemInfo(childInfo.Color, series); 308 legendItem.Color = legendItemInfo.Color; 309 legendItem.BorderColor = Color.Transparent; 310 legendItem.Name = childInfo.Text + " (" + childInfo.Runs.Count + ")"; 311 legendItem.Tag = legendItemInfo; 312 chart.Legends[0].CustomItems.Add(legendItem); 313 } 314 } else { 315 var parentInfo = node.Parent.Tag as GroupInfo; 316 chart.Titles[0].Text = parentInfo.Text + " (" + parentInfo.Runs.Count + ")"; 317 var series = BuildSeries(groupInfo.Runs, groupInfo.Color); 318 foreach (var s in series) 319 chart.Series.Add(s); 320 var legendItem = new LegendItem(); 321 var legendItemInfo = new LegendItemInfo(groupInfo.Color, series); 322 legendItem.Color = legendItemInfo.Color; 323 legendItem.BorderColor = Color.Transparent; 324 legendItem.Name = groupInfo.Text + " (" + groupInfo.Runs.Count + ")"; 325 legendItem.Tag = legendItemInfo; 326 chart.Legends[0].CustomItems.Add(legendItem); 327 } 318 328 } 319 329 } … … 474 484 #region parametersTreeView 475 485 private void parametersTreeView_AfterSelect(object sender, TreeViewEventArgs e) { 486 addGroupButton.Enabled = (parametersTreeView.SelectedNode != null) && (parametersTreeView.SelectedNode.Parent != null); 487 } 488 private void parametersTreeView_AfterCheck(object sender, TreeViewEventArgs e) { 476 489 UpdateChart(); 477 addGroupButton.Enabled = (parametersTreeView.SelectedNode != null) && (parametersTreeView.SelectedNode.Parent != null);478 490 } 479 491 #endregion 480 492 #region groupsTreeView 481 493 private void groupsTreeView_AfterSelect(object sender, TreeViewEventArgs e) { 494 removeGroupButton.Enabled = (groupsTreeView.SelectedNode != null) && (groupsTreeView.SelectedNode.Parent != null); 495 } 496 private void groupsTreeView_AfterCheck(object sender, TreeViewEventArgs e) { 482 497 UpdateChart(); 483 removeGroupButton.Enabled = (groupsTreeView.SelectedNode != null) && (groupsTreeView.SelectedNode.Parent != null);484 498 } 485 499 #endregion … … 493 507 var paramInfo = param.Tag as ParameterInfo; 494 508 var paramNode = new TreeNode(); 495 int count = 0;496 509 foreach (var valueInfo in paramInfo.Values.Values) { 497 var runs = groupRuns.Intersect(valueInfo.Runs); 498 var valueNode = new TreeNode(valueInfo.Value + " (" + runs.Count() + ")"); 499 count += runs.Count(); 500 valueNode.Tag = new GroupInfo(valueInfo.Value, valueInfo.Color, runs, false); 510 var valueRuns = groupRuns.Intersect(valueInfo.Runs); 511 var valueNode = new TreeNode(valueInfo.Value + " (" + valueRuns.Count() + ")"); 512 valueNode.Tag = new GroupInfo(valueInfo.Value, valueInfo.Color, valueRuns, false); 501 513 paramNode.Nodes.Add(valueNode); 502 514 } 503 paramNode.Text = paramInfo.Name + " (" + count + ")"; 504 paramNode.Tag = new GroupInfo(paramInfo.Name, Color.Empty, paramInfo.Values.Values.SelectMany(x => x.Runs), true); 515 var paramRuns = groupRuns.Intersect(paramInfo.Runs); 516 paramNode.Text = paramInfo.Name + " (" + paramRuns.Count() + ")"; 517 paramNode.Tag = new GroupInfo(paramInfo.Name, Color.Empty, paramRuns, true); 505 518 group.Nodes.Add(paramNode); 506 519 } else if (param.Tag is ParameterValueInfo) { 507 520 var paramInfo = param.Parent.Tag as ParameterInfo; 508 521 var valueInfo = param.Tag as ParameterValueInfo; 509 var runs = groupRuns.Intersect(valueInfo.Runs); 510 var paramNode = new TreeNode(paramInfo.Name + " (" + runs.Count() + ")"); 511 var valueNode = new TreeNode(valueInfo.Value + " (" + runs.Count() + ")"); 512 valueNode.Tag = new GroupInfo(valueInfo.Value, valueInfo.Color, runs, false); 513 paramNode.Tag = new GroupInfo(paramInfo.Name, Color.Empty, runs, true); 522 var valueRuns = groupRuns.Intersect(valueInfo.Runs); 523 var paramRuns = groupRuns.Intersect(paramInfo.Runs); 524 var paramNode = new TreeNode(paramInfo.Name + " (" + paramRuns.Count() + ")"); 525 var valueNode = new TreeNode(valueInfo.Value + " (" + valueRuns.Count() + ")"); 526 valueNode.Tag = new GroupInfo(valueInfo.Value, valueInfo.Color, valueRuns, false); 527 paramNode.Tag = new GroupInfo(paramInfo.Name, Color.Empty, paramRuns, true); 514 528 paramNode.Nodes.Add(valueNode); 515 529 group.Nodes.Add(paramNode); … … 528 542 } 529 543 #endregion 544 #endregion 545 546 #region Helpers 547 private IEnumerable<TreeNode> TraverseTreeNodes(TreeNodeCollection nodes) { 548 foreach (var node in nodes.OfType<TreeNode>()) { 549 yield return node; 550 foreach (var child in TraverseTreeNodes(node.Nodes)) 551 yield return child; 552 } 553 } 530 554 #endregion 531 555
Note: See TracChangeset
for help on using the changeset viewer.