Changeset 10827 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views
- Timestamp:
- 05/08/14 17:26:32 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs
r10797 r10827 41 41 42 42 private const int labelHeight = 30; 43 44 private readonly SolidBrush defaultBrush; 45 private readonly Pen defaultPen; 46 private readonly Font defaultFont; 43 47 44 48 public ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> LayoutEngine { get; set; } … … 127 131 PreferredNodeHeight = 40; 128 132 Group = new Group(chart); 133 134 defaultBrush = new SolidBrush(Color.Transparent); 135 defaultPen = new Pen(Color.Black); 136 defaultFont = new Font(FontFamily.GenericSansSerif, 12, GraphicsUnit.Pixel); 129 137 } 130 138 public SymbolicExpressionTreeTile(IChart chart, ISymbolicExpressionTree tree) … … 142 150 var visualNodes = LayoutEngine.CalculateLayout(actualRoot).ToList(); 143 151 144 var font = new Font(FontFamily.GenericSansSerif, 10, GraphicsUnit.Pixel);145 146 152 var visualNodeMap = visualNodes.ToDictionary(x => x.Content, x => x); 147 153 … … 154 160 var shortenedLabel = ShortenLabel(node); 155 161 if (node.SubtreeCount == 0) { 156 rectangularPrimitive = new Rectangle(Chart, lowerLeft, upperRight) { Font = font, Text = shortenedLabel }; 162 rectangularPrimitive = new Rectangle(Chart, lowerLeft, upperRight) { 163 Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f 164 }; 157 165 } else { 158 rectangularPrimitive = new Ellipse(Chart, lowerLeft, upperRight) { Font = font, Text = shortenedLabel }; 166 rectangularPrimitive = new Ellipse(Chart, lowerLeft, upperRight) { 167 Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f 168 }; 159 169 } 160 170 … … 189 199 // draw a primitive to display the label 190 200 var labelRect = new Rectangle(this.Chart, new PointD(0, height), new PointD(width, height + labelHeight)) { 191 Pen = new Pen(Color.Black),192 Brush = new SolidBrush(Color.Transparent),201 Pen = defaultPen, 202 Brush = defaultBrush, 193 203 Text = Label, 194 Font = new Font(FontFamily.GenericSansSerif, 12)204 Font = defaultFont 195 205 }; 196 206 this.Add(labelRect); … … 200 210 201 211 var rectangle = new Rectangle(this.Chart, new PointD(0, 0), new PointD(Size.Width, Size.Height)) { 202 Pen = new Pen(Color.Gray),203 Brush = new SolidBrush(Color.Transparent)212 Pen = defaultPen, 213 Brush = defaultBrush 204 214 }; 205 215 this.Add(rectangle);
Note: See TracChangeset
for help on using the changeset viewer.