Changeset 10677 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/FragmentGraphView.cs
- Timestamp:
- 03/28/14 16:23:40 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/FragmentGraphView.cs
r10656 r10677 20 20 public new IGenealogyGraph<IFragment<ISymbolicExpressionTreeNode>> Content { 21 21 get { return (IGenealogyGraph<IFragment<ISymbolicExpressionTreeNode>>)base.Content; } 22 set { 23 base.Content = value; 24 MakeTiles(); 25 Draw(); 26 } 22 set { base.Content = value; } 27 23 } 28 24 … … 38 34 var chart = symbolicExpressionChartControl.Chart; 39 35 tileDictionary.Clear(); 40 foreach (var node in Content.Nodes .Cast<IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>>()) {36 foreach (var node in Content.Nodes) { 41 37 var tile = new SymbolicExpressionTreeTile(chart); 42 38 tile.LayoutEngine = symbolicExpressionEngine; … … 48 44 } 49 45 50 foreach (var node in Content.Nodes.Where(n => n.InArcs != null && n.InArcs.Count > 0)) { 51 var graphNode = (IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>)node;52 var layoutNode = tileDictionary[ graphNode];46 47 foreach (var node in Content.Nodes.Where(n => n.Children.Any())) { 48 var layoutNode = tileDictionary[node]; 53 49 layoutNode.Children = new List<TileLayoutNode>(); 54 foreach (var c in node.InArcs.Select(x => x.Source as IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>)) {55 layoutNode.Children.Add(tileDictionary[c ]);50 foreach (var child in node.Children) { 51 layoutNode.Children.Add(tileDictionary[child]); 56 52 } 57 53 } … … 59 55 60 56 private void Draw() { 61 var root = tileDictionary[(IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>)Content.Nodes[0]]; 62 var visualNodes = layoutEngine.CalculateLayout(root); 57 var root = Content.Nodes.First(); 58 59 var fragmentRoot = tileDictionary[root]; 60 var visualNodes = layoutEngine.CalculateLayout(fragmentRoot); 63 61 64 62 symbolicExpressionChartControl.UpdateEnabled = false; … … 82 80 83 81 #region Event Handlers (Content) 84 85 82 // TODO: Put event handlers of the content here 86 87 #endregion88 89 83 protected override void OnContentChanged() { 90 84 base.OnContentChanged(); 91 if (Content == null) { 92 // TODO: Add code when content has been changed and is null 93 } else { 94 // TODO: Add code when content has been changed and is not null 85 if (Content != null) { 86 MakeTiles(); 87 Draw(); 95 88 } 96 89 } 97 90 #endregion 98 91 99 92 protected override void SetEnabledStateOfControls() {
Note: See TracChangeset
for help on using the changeset viewer.