Changeset 6387 for branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views
- Timestamp:
- 06/08/11 10:42:57 (13 years ago)
- Location:
- branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs
r6377 r6387 178 178 VisualSymbolicExpressionTreeNode clickedNode = (VisualSymbolicExpressionTreeNode)sender; 179 179 var selectedNode = clickedNode.SymbolicExpressionTreeNode; 180 if (selectedNode.Subtree sCount == 0) {180 if (selectedNode.SubtreeCount == 0) { 181 181 if (!selectedSymbolicExpressionTreeNodes.Contains(selectedNode)) 182 182 selectedSymbolicExpressionTreeNodes.Add(selectedNode); … … 349 349 [NonDiscoverableType] 350 350 internal class DummySymbol : Symbol { 351 private const int minimumArity = 1; 352 private const int maximumArity = byte.MaxValue; 353 354 public override int MinimumArity { 355 get { return minimumArity; } 356 } 357 public override int MaximumArity { 358 get { return maximumArity; } 359 } 360 351 361 public DummySymbol(DummySymbol original, Cloner cloner) : base(original, cloner) { } 352 362 public DummySymbol(string name) : base(name, "DummySymbol for views") { } -
branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
r6377 r6387 262 262 263 263 //draw terminal node 264 if (node.Subtree sCount == 0) {264 if (node.SubtreeCount == 0) { 265 265 graphics.FillRectangle(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height); 266 266 graphics.DrawRectangle(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height); … … 280 280 //calculate areas for the subtrees according to their tree size and call drawFunctionTree 281 281 Point connectFrom = new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y + visualTreeNode.Height); 282 int[] xBoundaries = new int[node.Subtree sCount + 1];282 int[] xBoundaries = new int[node.SubtreeCount + 1]; 283 283 xBoundaries[0] = x; 284 for (int i = 0; i < node.Subtree sCount; i++) {284 for (int i = 0; i < node.SubtreeCount; i++) { 285 285 xBoundaries[i + 1] = (int)(xBoundaries[i] + (width * (double)node.GetSubtree(i).GetLength()) / (node.GetLength() - 1)); 286 286 DrawFunctionTree(node.GetSubtree(i), graphics, xBoundaries[i], y + height,
Note: See TracChangeset
for help on using the changeset viewer.