Changeset 8990
- Timestamp:
- 12/03/12 15:29:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r8980 r8990 64 64 protected override void OnContentChanged() { 65 65 base.OnContentChanged(); 66 replacementNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(); 67 66 68 UpdateView(); 67 69 viewHost.Content = this.Content; … … 71 73 if (Content == null || Content.Model == null || Content.ProblemData == null) return; 72 74 var tree = Content.Model.SymbolicExpressionTree; 75 treeChart.Tree = tree.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(tree.Root) : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0)); 73 76 74 77 var replacementValues = CalculateReplacementValues(tree); … … 78 81 79 82 nodeImpacts = CalculateImpactValues(tree); 80 81 var model = Content.Model.SymbolicExpressionTree;82 treeChart.Tree = model.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(model.Root) : new SymbolicExpressionTree(model.Root.GetSubtree(0).GetSubtree(0));83 83 PaintNodeImpacts(); 84 84 } … … 101 101 if (symbExprTreeNode == null) return; 102 102 if (!replacementNodes.ContainsKey(symbExprTreeNode)) return; 103 103 104 var tree = Content.Model.SymbolicExpressionTree; 104 var replacementNode = replacementNodes[symbExprTreeNode];105 105 int indexOfReplacementNode = symbExprTreeNode.Parent.IndexOfSubtree(symbExprTreeNode); 106 106 SwitchNodeWithReplacementNode(symbExprTreeNode.Parent, indexOfReplacementNode); 107 // show only interesting part of solution108 treeChart.Tree = tree.Root.SubtreeCount > 1109 ? new SymbolicExpressionTree(tree.Root)110 : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0));111 107 UpdateModel(tree); 112 var vNode = treeChart.GetVisualSymbolicExpressionTreeNode(replacementNode);113 vNode.SymbolicExpressionTreeNode = replacementNode;114 115 vNode.LineColor = replacementNode is ConstantTreeNode ? Color.DarkOrange : Color.Black;116 treeChart.RepaintNode(vNode);117 108 } 118 109 119 110 private void treeChart_SymbolicExpressionTreeChanged(object sender, EventArgs e) { 120 111 UpdateModel(Content.Model.SymbolicExpressionTree); 121 UpdateView();122 112 } 123 113
Note: See TracChangeset
for help on using the changeset viewer.