Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/07/14 16:55:50 (10 years ago)
Author:
gkronber
Message:

#2076,#2159, #2092
multi-ticket merge to stable:

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views

  • stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs

    r9456 r11120  
    2929using HeuristicLab.PluginInfrastructure;
    3030
     31using VisualSymbolicExpressionTreeNode = HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.VisualTreeNode<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTreeNode>;
     32
    3133namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
    3234  public sealed partial class SymbolicExpressionGrammarAllowedChildSymbolsControl : UserControl {
     
    103105
    104106      var tree = new SymbolicExpressionTree(new SymbolicExpressionTreeNode(Symbol));
    105       symbolicExpressionTreeChart.SuspendRepaint = true;
    106107      if (Grammar.GetMaximumSubtreeCount(Symbol) > 0) {
    107108        for (int i = 0; i < Grammar.GetMaximumSubtreeCount(Symbol); i++) {
     
    116117      }
    117118      symbolicExpressionTreeChart.Tree = tree;
    118 
     119      symbolicExpressionTreeChart.SuspendRepaint = true;
    119120      foreach (var subtreeNode in tree.Root.Subtrees) {
    120121        foreach (var allowedChildNode in subtreeNode.Subtrees) {
     
    142143        }
    143144      }
    144 
    145145      symbolicExpressionTreeChart.SuspendRepaint = false;
    146146      UpdateSelectedSymbolicExpressionTreeNodes();
     
    153153        else visualNode.FillColor = Color.LightSteelBlue;
    154154      }
    155       symbolicExpressionTreeChart.Repaint();
     155      symbolicExpressionTreeChart.RepaintNodes();
    156156    }
    157157
     
    162162
    163163      VisualSymbolicExpressionTreeNode clickedNode = (VisualSymbolicExpressionTreeNode)sender;
    164       var selectedNode = clickedNode.SymbolicExpressionTreeNode;
     164      var selectedNode = clickedNode.Content;
    165165      if (selectedNode.SubtreeCount == 0) {
    166166        if (!selectedSymbolicExpressionTreeNodes.Contains(selectedNode))
     
    207207        var visualNode = symbolicExpressionTreeChart.FindVisualSymbolicExpressionTreeNodeAt(coordinates.X, coordinates.Y);
    208208        if (visualNode != null) {
    209           var node = visualNode.SymbolicExpressionTreeNode;
     209          var node = visualNode.Content;
    210210          var root = symbolicExpressionTreeChart.Tree.Root;
    211211          if (node == root || node.Parent == root) e.Effect = DragDropEffects.Copy;
     
    223223      var symbols = data as IEnumerable<ISymbol>;
    224224
    225       if (node.SymbolicExpressionTreeNode == root) {
     225      if (node.Content == root) {
    226226        if (symbol != null)
    227227          Grammar.AddAllowedChildSymbol(root.Symbol, symbol);
     
    229229          foreach (var s in symbols) Grammar.AddAllowedChildSymbol(root.Symbol, s);
    230230      } else {
    231         int argumentIndex = root.IndexOfSubtree(node.SymbolicExpressionTreeNode);
     231        int argumentIndex = root.IndexOfSubtree(node.Content);
    232232        if (symbol != null)
    233233          Grammar.AddAllowedChildSymbol(root.Symbol, symbol, argumentIndex);
Note: See TracChangeset for help on using the changeset viewer.