Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/26/14 01:52:16 (11 years ago)
Author:
bburlacu
Message:

#1772: Re-added old behavior: highlight received fragment when genealogy graph node is clicked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/FragmentGraphView.cs

    r10655 r10656  
    2323        base.Content = value;
    2424        MakeTiles();
     25        Draw();
    2526      }
    2627    }
     
    3132      layoutEngine = new ReingoldTilfordLayoutEngine<TileLayoutNode>(n => n.Children);
    3233      symbolicExpressionEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(n => n.Subtrees);
     34      tileDictionary = new Dictionary<IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>, TileLayoutNode>();
    3335    }
    3436
    3537    private void MakeTiles() {
    3638      var chart = symbolicExpressionChartControl.Chart;
     39      tileDictionary.Clear();
    3740      foreach (var node in Content.Nodes.Cast<IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>>()) {
    38         var tile = new SymbolicExpressionTreeTile(chart) {
    39           Root = node.Content.Root,
    40           LayoutEngine = symbolicExpressionEngine
    41         };
     41        var tile = new SymbolicExpressionTreeTile(chart);
     42        tile.LayoutEngine = symbolicExpressionEngine;
     43        tile.Root = node.Content.Root;
    4244        var tileNode = new TileLayoutNode {
    4345          Tile = tile
     
    5961      var root = tileDictionary[(IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>)Content.Nodes[0]];
    6062      var visualNodes = layoutEngine.CalculateLayout(root);
     63
     64      symbolicExpressionChartControl.UpdateEnabled = false;
     65      foreach (var visualNode in visualNodes) {
     66        var tile = visualNode.Content.Tile;
     67        symbolicExpressionChartControl.Add(tile);
     68      }
     69      symbolicExpressionChartControl.UpdateEnabled = true;
     70      symbolicExpressionChartControl.EnforceUpdate();
    6171    }
    6272
Note: See TracChangeset for help on using the changeset viewer.