- Timestamp:
- 02/28/14 12:48:01 (11 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r10492 r10521 97 97 98 98 private void treeChart_SymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) { 99 var visualNode = (Visual SymbolicExpressionTreeNode)sender;100 var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode. SymbolicExpressionTreeNode;99 var visualNode = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender; 100 var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode.Content; 101 101 if (symbExprTreeNode == null) return; 102 102 var tree = Content.Model.SymbolicExpressionTree; … … 126 126 double max = impacts.Max(); 127 127 double min = impacts.Min(); 128 foreach ( ISymbolicExpressionTreeNodetreeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) {129 Visual SymbolicExpressionTreeNodevisualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);128 foreach (var treeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) { 129 VisualTreeNode<ISymbolicExpressionTreeNode> visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode); 130 130 131 131 if (!(treeNode is ConstantTreeNode) && nodeImpacts.ContainsKey(treeNode)) { -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs
r9456 r10521 33 33 internal sealed partial class InteractiveSymbolicExpressionTreeChart : SymbolicExpressionTreeChart { 34 34 private ISymbolicExpressionTreeNode tempNode; // node in clipboard (to be cut/copy/pasted etc) 35 private Visual SymbolicExpressionTreeNodecurrSelected; // currently selected node35 private VisualTreeNode<ISymbolicExpressionTreeNode> currSelected; // currently selected node 36 36 private enum EditOp { NoOp, CopySubtree, CutSubtree } 37 37 private EditOp lastOp = EditOp.NoOp; … … 65 65 pasteToolStripMenuItem.Visible = false; 66 66 } else { 67 var node = currSelected. SymbolicExpressionTreeNode;67 var node = currSelected.Content; 68 68 insertNodeToolStripMenuItem.Visible = true; 69 69 changeNodeToolStripMenuItem.Visible = true; … … 77 77 pasteToolStripMenuItem.Enabled = tempNode != null && insertNodeToolStripMenuItem.Enabled 78 78 && !(lastOp == EditOp.CutSubtree 79 && tempNode.IterateNodesBreadth().Contains(currSelected. SymbolicExpressionTreeNode));79 && tempNode.IterateNodesBreadth().Contains(currSelected.Content)); 80 80 } 81 81 } 82 82 83 83 protected override void OnSymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) { 84 currSelected = (Visual SymbolicExpressionTreeNode)sender; ;84 currSelected = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender; ; 85 85 if (currSelected != null) { 86 86 currSelected.LineColor = Color.FromArgb(130, currSelected.LineColor); … … 104 104 105 105 private void insertNodeToolStripMenuItem_Click(object sender, EventArgs e) { 106 if (currSelected == null || currSelected. SymbolicExpressionTreeNodeis SymbolicExpressionTreeTerminalNode) return;107 var parent = currSelected. SymbolicExpressionTreeNode;106 if (currSelected == null || currSelected.Content is SymbolicExpressionTreeTerminalNode) return; 107 var parent = currSelected.Content; 108 108 109 109 using (var dialog = new InsertNodeDialog()) { … … 138 138 if (currSelected == null) return; 139 139 140 var node = (ISymbolicExpressionTreeNode)currSelected. SymbolicExpressionTreeNode.Clone();141 var originalNode = currSelected. SymbolicExpressionTreeNode;140 var node = (ISymbolicExpressionTreeNode)currSelected.Content.Clone(); 141 var originalNode = currSelected.Content; 142 142 143 143 ISymbolicExpressionTreeNode newNode = null; … … 180 180 } 181 181 } 182 tempNode = currSelected. SymbolicExpressionTreeNode;182 tempNode = currSelected.Content; 183 183 foreach (var node in tempNode.IterateNodesPostfix()) { 184 184 var visualNode = GetVisualSymbolicExpressionTreeNode(node); … … 194 194 } 195 195 private void removeNodeToolStripMenuItem_Click(object sender, EventArgs e) { 196 var node = currSelected. SymbolicExpressionTreeNode;196 var node = currSelected.Content; 197 197 if (node == tempNode) tempNode = null; 198 198 ModifyTree(Tree, node.Parent, node, null, removeSubtree: false); … … 200 200 } 201 201 private void removeSubtreeToolStripMenuItem_Click(object sender, EventArgs e) { 202 var node = currSelected. SymbolicExpressionTreeNode;202 var node = currSelected.Content; 203 203 if (node.IterateNodesPostfix().Contains(tempNode)) tempNode = null; 204 204 ModifyTree(Tree, node.Parent, node, null, removeSubtree: true); … … 209 209 if (!(lastOp == EditOp.CopySubtree || lastOp == EditOp.CutSubtree)) return; 210 210 // check if the copied/cut node (stored in the tempNode) can be inserted as a child of the current selected node 211 var node = currSelected. SymbolicExpressionTreeNode;211 var node = currSelected.Content; 212 212 if (node is ConstantTreeNode || node is VariableTreeNode) return; 213 213 // check if the currently selected node can accept the copied node as a child
Note: See TracChangeset
for help on using the changeset viewer.