Last change
on this file since 10463 was
10462,
checked in by bburlacu, 11 years ago
|
#1772: Fixed bug in configuration of the tracking operators, fixed null reference exception when trying to access fragments in SymbolicDataAnalysisGenealogyGraphView
|
File size:
1.3 KB
|
Line | |
---|
1 | using System.Drawing;
|
---|
2 | using System.Linq;
|
---|
3 | using System.Windows.Forms;
|
---|
4 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
5 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
|
---|
6 | using HeuristicLab.EvolutionTracking;
|
---|
7 | using HeuristicLab.EvolutionTracking.Views;
|
---|
8 | using HeuristicLab.MainForm;
|
---|
9 | using HeuristicLab.MainForm.WindowsForms;
|
---|
10 |
|
---|
11 | namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
|
---|
12 | [View("GenealogyGraphView")]
|
---|
13 | [Content(typeof(GenealogyGraph), IsDefaultView = false)]
|
---|
14 | public class SymbolicDataAnalysisGenealogyGraphView : GenealogyGraphView {
|
---|
15 | public override void graphChart_GenealogyGraphNodeClicked(object sender, MouseEventArgs args) {
|
---|
16 | base.graphChart_GenealogyGraphNodeClicked(sender, args);
|
---|
17 | var visualNode = (VisualGenealogyGraphNode)sender;
|
---|
18 | var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)visualNode.Data;
|
---|
19 | IFragment<ISymbolicExpressionTreeNode> fragment = null;
|
---|
20 | if (graphNode.InArcs != null)
|
---|
21 | fragment = (IFragment<ISymbolicExpressionTreeNode>)graphNode.InArcs.Last().Data;
|
---|
22 | if (fragment != null) {
|
---|
23 | var treeView = (GraphicalSymbolicExpressionTreeView)viewHost.ActiveView;
|
---|
24 | treeView.HighlightSubtree(fragment.Root, Color.RoyalBlue);
|
---|
25 | }
|
---|
26 | }
|
---|
27 | }
|
---|
28 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.