Changeset 15044
- Timestamp:
- 06/22/17 14:15:10 (8 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.Designer.cs
r14185 r15044 59 59 this.symbolicExpressionTreeChart.Name = "functionTreeChart"; 60 60 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(407, 367); 61 this.symbolicExpressionTreeChart.Spacing = 5;62 61 this.symbolicExpressionTreeChart.TabIndex = 0; 63 62 this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font(FontFamily.GenericSerif, 8F); -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs
r14185 r15044 70 70 this.symbolicExpressionTreeChart.Name = "allowedChildSymbolsControl"; 71 71 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(645, 386); 72 this.symbolicExpressionTreeChart.Spacing = 5;73 72 this.symbolicExpressionTreeChart.SuspendRepaint = false; 74 73 this.symbolicExpressionTreeChart.TabIndex = 0; -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
r15040 r15044 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 37 37 private ILayoutEngine<ISymbolicExpressionTreeNode> layoutEngine; 38 38 39 private int preferredNodeWidth = 70;40 public int PreferredNodeWidth {41 get { return preferredNodeWidth; }42 set { preferredNodeWidth = value; }43 }44 45 private int preferredNodeHeight = 46;46 public int PreferredNodeHeight {47 get { return preferredNodeHeight; }48 set { preferredNodeHeight = value; }49 }50 51 private int minHorizontalDistance = 30;52 public int MinimumHorizontalDistance {53 get { return minHorizontalDistance; }54 set { minHorizontalDistance = value; }55 }56 57 private int minVerticalDistance = 30;58 public int MinimumVerticalDistance {59 get { return minVerticalDistance; }60 set { minVerticalDistance = value; }61 }62 63 private int minHorizontalPadding = 20;64 public int MinimumHorizontalPadding {65 get { return minHorizontalPadding; }66 set { minHorizontalPadding = value; }67 }68 69 private int minVerticalPadding = 20;70 public int MinimumVerticalPadding {71 get { return minVerticalPadding; }72 set { minVerticalPadding = value; }73 }74 75 39 public SymbolicExpressionTreeChart() { 76 40 InitializeComponent(); 77 41 this.image = new Bitmap(Width, Height); 78 42 this.stringFormat = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }; 79 this.spacing = 5;80 43 this.lineColor = Color.Black; 81 44 this.backgroundColor = Color.White; … … 86 49 87 50 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(n => n.Subtrees) { 88 NodeWidth = preferredNodeWidth,89 NodeHeight = preferredNodeHeight,90 HorizontalSpacing = minHorizontalDistance,91 VerticalSpacing = minVerticalDistance51 NodeWidth = PreferredNodeWidth, 52 NodeHeight = PreferredNodeHeight, 53 HorizontalSpacing = MinimumHorizontalDistance, 54 VerticalSpacing = MinimumVerticalDistance 92 55 }; 93 56 reingoldTilfordToolStripMenuItem.Checked = true; … … 100 63 101 64 #region Public properties 102 private int spacing; 103 public int Spacing { 104 get { return this.spacing; } 105 set { 106 this.spacing = value; 107 this.Repaint(); 65 private int preferredNodeWidth = 70; 66 public int PreferredNodeWidth { 67 get { return preferredNodeWidth; } 68 set { 69 preferredNodeWidth = value; 70 Repaint(); 71 } 72 } 73 74 private int preferredNodeHeight = 46; 75 public int PreferredNodeHeight { 76 get { return preferredNodeHeight; } 77 set { 78 preferredNodeHeight = value; 79 Repaint(); 80 } 81 } 82 83 private int minHorizontalDistance = 30; 84 public int MinimumHorizontalDistance { 85 get { return minHorizontalDistance; } 86 set { 87 minHorizontalDistance = value; 88 Repaint(); 89 } 90 } 91 92 private int minVerticalDistance = 30; 93 public int MinimumVerticalDistance { 94 get { return minVerticalDistance; } 95 set { 96 minVerticalDistance = value; 97 Repaint(); 98 } 99 } 100 101 private int minHorizontalPadding = 20; 102 public int MinimumHorizontalPadding { 103 get { return minHorizontalPadding; } 104 set { 105 minHorizontalPadding = value; 106 Repaint(); 107 } 108 } 109 110 private int minVerticalPadding = 20; 111 public int MinimumVerticalPadding { 112 get { return minVerticalPadding; } 113 set { 114 minVerticalPadding = value; 115 Repaint(); 108 116 } 109 117 } … … 217 225 graphics.Clear(backgroundColor); 218 226 if (tree != null) { 219 DrawFunctionTree(graphics, preferredNodeWidth, preferredNodeHeight, minHorizontalDistance, minVerticalDistance);227 DrawFunctionTree(graphics, PreferredNodeWidth, PreferredNodeHeight, MinimumHorizontalDistance, MinimumVerticalDistance); 220 228 } 221 229 } … … 318 326 actualRoot = tree.Root.GetSubtree(0); 319 327 } 320 var visualNodes = layoutEngine.CalculateLayout(actualRoot, Width - minHorizontalPadding, Height - minVerticalPadding).ToList();328 var visualNodes = layoutEngine.CalculateLayout(actualRoot, Width - MinimumHorizontalPadding, Height - MinimumVerticalPadding).ToList(); 321 329 // add the padding 322 330 foreach (var vn in visualNodes) { 323 vn.X += minHorizontalPadding / 2;324 vn.Y += minVerticalPadding / 2;331 vn.X += MinimumHorizontalPadding / 2; 332 vn.Y += MinimumVerticalPadding / 2; 325 333 } 326 334 … … 408 416 Image image = new Bitmap(Width, Height); 409 417 using (Graphics g = Graphics.FromImage(image)) { 410 DrawFunctionTree(g, preferredNodeWidth, preferredNodeHeight, minHorizontalDistance, minVerticalDistance, false);418 DrawFunctionTree(g, PreferredNodeWidth, PreferredNodeHeight, MinimumHorizontalDistance, MinimumVerticalDistance, false); 411 419 } 412 420 image.Save(filename); … … 418 426 using (Metafile file = new Metafile(filename, g.GetHdc())) { 419 427 using (Graphics emfFile = Graphics.FromImage(file)) { 420 DrawFunctionTree(emfFile, preferredNodeWidth, preferredNodeHeight, minHorizontalDistance, minVerticalDistance, false);428 DrawFunctionTree(emfFile, PreferredNodeWidth, PreferredNodeHeight, MinimumHorizontalDistance, MinimumVerticalDistance, false); 421 429 } 422 430 } … … 439 447 440 448 private void reingoldTilfordToolStripMenuItem_Click(object sender, EventArgs e) { 441 minHorizontalDistance = 30;442 minVerticalDistance = 30;443 449 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(n => n.Subtrees) { 444 NodeWidth = preferredNodeWidth,445 NodeHeight = preferredNodeHeight,446 HorizontalSpacing = minHorizontalDistance,447 VerticalSpacing = minVerticalDistance450 NodeWidth = PreferredNodeWidth, 451 NodeHeight = PreferredNodeHeight, 452 HorizontalSpacing = MinimumHorizontalDistance, 453 VerticalSpacing = MinimumVerticalDistance 448 454 }; 449 455 reingoldTilfordToolStripMenuItem.Checked = true; … … 453 459 454 460 private void boxesToolStripMenuItem_Click(object sender, EventArgs e) { 455 minHorizontalDistance = 5;456 minVerticalDistance = 5;457 461 layoutEngine = new BoxesLayoutEngine<ISymbolicExpressionTreeNode>(n => n.Subtrees, n => n.GetLength(), n => n.GetDepth()) { 458 NodeWidth = preferredNodeWidth,459 NodeHeight = preferredNodeHeight,460 HorizontalSpacing = minHorizontalDistance,461 VerticalSpacing = minVerticalDistance462 NodeWidth = PreferredNodeWidth, 463 NodeHeight = PreferredNodeHeight, 464 HorizontalSpacing = MinimumHorizontalDistance, 465 VerticalSpacing = MinimumVerticalDistance 462 466 }; 463 467 reingoldTilfordToolStripMenuItem.Checked = false; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs
r14185 r15044 187 187 this.treeChart.Name = "treeChart"; 188 188 this.treeChart.Size = new System.Drawing.Size(201, 348); 189 this.treeChart.Spacing = 5;190 189 this.treeChart.SuspendRepaint = false; 191 190 this.treeChart.TabIndex = 0;
Note: See TracChangeset
for help on using the changeset viewer.