Changeset 11120 for stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 10496,10499,10520-10523,10531,10561,10564-10565,10799-10800,10862,10885,10953,10956,11065
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs
r9456 r11120 29 29 using HeuristicLab.PluginInfrastructure; 30 30 31 using VisualSymbolicExpressionTreeNode = HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.VisualTreeNode<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTreeNode>; 32 31 33 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views { 32 34 public sealed partial class SymbolicExpressionGrammarAllowedChildSymbolsControl : UserControl { … … 103 105 104 106 var tree = new SymbolicExpressionTree(new SymbolicExpressionTreeNode(Symbol)); 105 symbolicExpressionTreeChart.SuspendRepaint = true;106 107 if (Grammar.GetMaximumSubtreeCount(Symbol) > 0) { 107 108 for (int i = 0; i < Grammar.GetMaximumSubtreeCount(Symbol); i++) { … … 116 117 } 117 118 symbolicExpressionTreeChart.Tree = tree; 118 119 symbolicExpressionTreeChart.SuspendRepaint = true; 119 120 foreach (var subtreeNode in tree.Root.Subtrees) { 120 121 foreach (var allowedChildNode in subtreeNode.Subtrees) { … … 142 143 } 143 144 } 144 145 145 symbolicExpressionTreeChart.SuspendRepaint = false; 146 146 UpdateSelectedSymbolicExpressionTreeNodes(); … … 153 153 else visualNode.FillColor = Color.LightSteelBlue; 154 154 } 155 symbolicExpressionTreeChart.Repaint ();155 symbolicExpressionTreeChart.RepaintNodes(); 156 156 } 157 157 … … 162 162 163 163 VisualSymbolicExpressionTreeNode clickedNode = (VisualSymbolicExpressionTreeNode)sender; 164 var selectedNode = clickedNode. SymbolicExpressionTreeNode;164 var selectedNode = clickedNode.Content; 165 165 if (selectedNode.SubtreeCount == 0) { 166 166 if (!selectedSymbolicExpressionTreeNodes.Contains(selectedNode)) … … 207 207 var visualNode = symbolicExpressionTreeChart.FindVisualSymbolicExpressionTreeNodeAt(coordinates.X, coordinates.Y); 208 208 if (visualNode != null) { 209 var node = visualNode. SymbolicExpressionTreeNode;209 var node = visualNode.Content; 210 210 var root = symbolicExpressionTreeChart.Tree.Root; 211 211 if (node == root || node.Parent == root) e.Effect = DragDropEffects.Copy; … … 223 223 var symbols = data as IEnumerable<ISymbol>; 224 224 225 if (node. SymbolicExpressionTreeNode== root) {225 if (node.Content == root) { 226 226 if (symbol != null) 227 227 Grammar.AddAllowedChildSymbol(root.Symbol, symbol); … … 229 229 foreach (var s in symbols) Grammar.AddAllowedChildSymbol(root.Symbol, s); 230 230 } else { 231 int argumentIndex = root.IndexOfSubtree(node. SymbolicExpressionTreeNode);231 int argumentIndex = root.IndexOfSubtree(node.Content); 232 232 if (symbol != null) 233 233 Grammar.AddAllowedChildSymbol(root.Symbol, symbol, argumentIndex);
Note: See TracChangeset
for help on using the changeset viewer.