Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/03/14 17:04:46 (10 years ago)
Author:
bburlacu
Message:

#1772: Merged trunk changes. Updated PhenotypicSimilarityCalculator, updated FragmentGraphView.

Location:
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views

  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs

    r11208 r11638  
    4949      this.lineColor = Color.Black;
    5050      this.backgroundColor = Color.White;
    51       this.textFont = new Font(FontFamily.GenericSansSerif, 10);
     51      this.textFont = new Font(FontFamily.GenericSansSerif, 8);
    5252
    5353      visualTreeNodes = new Dictionary<ISymbolicExpressionTreeNode, VisualTreeNode<ISymbolicExpressionTreeNode>>();
     
    336336        }
    337337        //draw name of symbol
    338         var text = node.ToString();
     338        var text = ShortLabel(node);
    339339        graphics.DrawString(text, textFont, textBrush, new RectangleF(visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height), stringFormat);
    340340      }
     
    423423      Repaint();
    424424    }
     425
     426    private static string ShortLabel(ISymbolicExpressionTreeNode node) {
     427      var name = node.ToString();
     428
     429      if (node.SubtreeCount > 0) {
     430        switch (name) {
     431          case "Addition":
     432            return "Add";
     433          case "Subtraction":
     434            return "Sub";
     435          case "Multiplication":
     436            return "Mul";
     437          case "Division":
     438            return "Div";
     439          case "Exponential":
     440            return "Exp";
     441          case "Logarithm":
     442            return "Log";
     443        }
     444      }
     445
     446      return name;
     447    }
    425448  }
    426449}
Note: See TracChangeset for help on using the changeset viewer.