Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/05/14 17:04:25 (10 years ago)
Author:
bburlacu
Message:

#1772: Added text labels to SymbolicExpressionTreeTiles so that the generation number is also displayed.

File:
1 edited

Legend:

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

    r10755 r10797  
    22using System.Drawing;
    33using System.Linq;
    4 using HeuristicLab.Common;
    54using HeuristicLab.Core.Views;
    65using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     
    5150        var tile = new SymbolicExpressionTreeTile(chart);
    5251        tile.LayoutEngine = symbolicExpressionEngine;
     52        tile.Label = "Generation " + node.Rank;
    5353        tile.Root = node.Content.Root;
    5454        var tileNode = new TileLayoutNode { Tile = tile };
     
    9494        var aPos = aTile.Position;
    9595
    96         if (node.Rank.IsAlmost(0)) {
    97           foreach (var s in node.Content.Root.IterateNodesPrefix()) {
     96        if (node.Content.Index1 > 0) {
     97          var subtree = node.Content.Root.NodeAt(node.Content.Index1);
     98          foreach (var s in subtree.IterateNodesPrefix()) {
    9899            var primitive = aTile.GetPrimitive(s);
    99100            if (primitive != null) {
    100101              var rpb = primitive as RectangularPrimitiveBase;
    101102              if (rpb != null) {
    102                 rpb.Pen = new Pen(Color.ForestGreen);
    103               }
    104             }
    105           }
    106         } else {
    107 
    108           if (node.Content.Index1 > 0) {
    109             var subtree = node.Content.Root.NodeAt(node.Content.Index1);
    110             foreach (var s in subtree.IterateNodesPrefix()) {
    111               var primitive = aTile.GetPrimitive(s);
    112               if (primitive != null) {
    113                 var rpb = primitive as RectangularPrimitiveBase;
    114                 if (rpb != null) {
    115                   rpb.Pen = new Pen(Color.RoyalBlue);
    116                 }
     103                rpb.Pen = new Pen(Color.RoyalBlue);
    117104              }
    118105            }
Note: See TracChangeset for help on using the changeset viewer.