Changeset 10302
- Timestamp:
- 01/08/14 13:58:54 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs
r9456 r10302 50 50 this.saveImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 51 51 this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); 52 this.exportLatexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 52 53 this.contextMenuStrip.SuspendLayout(); 53 54 this.SuspendLayout(); … … 56 57 // 57 58 this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 58 this.saveImageToolStripMenuItem}); 59 this.saveImageToolStripMenuItem, 60 this.exportLatexToolStripMenuItem}); 59 61 this.contextMenuStrip.Name = "contextMenuStrip"; 60 this.contextMenuStrip.Size = new System.Drawing.Size(1 35, 26);62 this.contextMenuStrip.Size = new System.Drawing.Size(161, 70); 61 63 // 62 64 // saveImageToolStripMenuItem 63 65 // 64 66 this.saveImageToolStripMenuItem.Name = "saveImageToolStripMenuItem"; 65 this.saveImageToolStripMenuItem.Size = new System.Drawing.Size(1 34, 22);67 this.saveImageToolStripMenuItem.Size = new System.Drawing.Size(160, 22); 66 68 this.saveImageToolStripMenuItem.Text = "Save Image"; 67 69 this.saveImageToolStripMenuItem.Click += new System.EventHandler(this.saveImageToolStripMenuItem_Click); … … 70 72 // 71 73 this.saveFileDialog.Filter = "Bitmap (*.bmp)|*.bmp|EMF (*.emf)|*.emf"; 72 this.saveFileDialog.FilterIndex = 1; 74 // 75 // exportLatexToolStripMenuItem 76 // 77 this.exportLatexToolStripMenuItem.Name = "exportLatexToolStripMenuItem"; 78 this.exportLatexToolStripMenuItem.Size = new System.Drawing.Size(160, 22); 79 this.exportLatexToolStripMenuItem.Text = "Export Pgf/Latex"; 80 this.exportLatexToolStripMenuItem.Click += new System.EventHandler(this.exportLatexToolStripMenuItem_Click); 81 // 73 82 // SymbolicExpressionTreeChart 74 83 // 75 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);76 84 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 77 85 this.ContextMenuStrip = this.contextMenuStrip; 86 this.DoubleBuffered = true; 78 87 this.Name = "SymbolicExpressionTreeChart"; 79 88 this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseClick); … … 93 102 protected System.Windows.Forms.ToolStripMenuItem saveImageToolStripMenuItem; 94 103 protected System.Windows.Forms.SaveFileDialog saveFileDialog; 104 private System.Windows.Forms.ToolStripMenuItem exportLatexToolStripMenuItem; 95 105 } 96 106 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
r9587 r10302 24 24 using System.Drawing; 25 25 using System.Drawing.Imaging; 26 using System.IO; 27 using System.Linq; 26 28 using System.Windows.Forms; 29 using Point = System.Drawing.Point; 27 30 28 31 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views { … … 32 35 private Dictionary<ISymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode> visualTreeNodes; 33 36 private Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualSymbolicExpressionTreeNodeConnection> visualLines; 37 private readonly ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> layoutEngine; 38 private readonly SymbolicExpressionTreeLayoutAdapter layoutAdapter; 39 40 private const int preferredNodeWidth = 70; 41 private const int preferredNodeHeight = 46; 42 private const int minHorizontalDistance = 20; 43 private const int minVerticalDistance = 20; 44 34 45 35 46 public SymbolicExpressionTreeChart() { … … 40 51 this.lineColor = Color.Black; 41 52 this.backgroundColor = Color.White; 42 this.textFont = new Font("Times New Roman", 8); 53 this.textFont = new Font("Times New Roman", 14); 54 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(); 55 layoutAdapter = new SymbolicExpressionTreeLayoutAdapter(); 43 56 } 44 57 45 58 public SymbolicExpressionTreeChart(ISymbolicExpressionTree tree) 46 59 : this() { 60 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(); 61 layoutAdapter = new SymbolicExpressionTreeLayoutAdapter(); 47 62 this.Tree = tree; 48 63 } 49 64 65 #region Public properties 50 66 private int spacing; 51 67 public int Spacing { … … 106 122 set { suspendRepaint = value; } 107 123 } 124 #endregion 108 125 109 126 protected override void OnPaint(PaintEventArgs e) { … … 157 174 graphics.Clear(backgroundColor); 158 175 if (tree != null) { 159 int height = this.Height / tree.Depth; 160 DrawFunctionTree(tree, graphics, 0, 0, this.Width, height); 176 DrawFunctionTree(tree, graphics, preferredNodeWidth, preferredNodeHeight, minHorizontalDistance, minVerticalDistance); 161 177 } 162 178 } … … 250 266 251 267 #region methods for painting the symbolic expression tree 252 private void DrawFunctionTree(ISymbolicExpressionTree tree, Graphics graphics, int x, int y, int width, int height) { 253 DrawFunctionTree(tree.Root, graphics, x, y, width, height, Point.Empty); 254 } 255 256 /// <summary> 257 /// 258 /// </summary> 259 /// <param name="functionTree"> function tree to draw</param> 260 /// <param name="graphics">graphics object to draw on</param> 261 /// <param name="x">x coordinate of drawing area</param> 262 /// <param name="y">y coordinate of drawing area</param> 263 /// <param name="width">width of drawing area</param> 264 /// <param name="height">height of drawing area</param> 265 private void DrawFunctionTree(ISymbolicExpressionTreeNode node, Graphics graphics, int x, int y, int width, int height, Point connectionPoint) { 266 VisualSymbolicExpressionTreeNode visualTreeNode = visualTreeNodes[node]; 267 float center_x = x + width / 2; 268 float center_y = y + height / 2; 269 int actualWidth = width - spacing; 270 int actualHeight = height - spacing; 271 272 using (var textBrush = new SolidBrush(visualTreeNode.TextColor)) 273 using (var nodeLinePen = new Pen(visualTreeNode.LineColor)) 274 using (var nodeFillBrush = new SolidBrush(visualTreeNode.FillColor)) { 275 276 //calculate size of node 277 if (actualWidth >= visualTreeNode.PreferredWidth && actualHeight >= visualTreeNode.PreferredHeight) { 278 visualTreeNode.Width = visualTreeNode.PreferredWidth; 279 visualTreeNode.Height = visualTreeNode.PreferredHeight; 280 visualTreeNode.X = (int)center_x - visualTreeNode.Width / 2; 281 visualTreeNode.Y = (int)center_y - visualTreeNode.Height / 2; 282 } 283 //width too small to draw in desired sized 284 else if (actualWidth < visualTreeNode.PreferredWidth && actualHeight >= visualTreeNode.PreferredHeight) { 285 visualTreeNode.Width = actualWidth; 286 visualTreeNode.Height = visualTreeNode.PreferredHeight; 287 visualTreeNode.X = x; 288 visualTreeNode.Y = (int)center_y - visualTreeNode.Height / 2; 289 } 290 //height too small to draw in desired sized 291 else if (actualWidth >= visualTreeNode.PreferredWidth && actualHeight < visualTreeNode.PreferredHeight) { 292 visualTreeNode.Width = visualTreeNode.PreferredWidth; 293 visualTreeNode.Height = actualHeight; 294 visualTreeNode.X = (int)center_x - visualTreeNode.Width / 2; 295 visualTreeNode.Y = y; 296 } 297 //width and height too small to draw in desired size 298 else { 299 visualTreeNode.Width = actualWidth; 300 visualTreeNode.Height = actualHeight; 301 visualTreeNode.X = x; 302 visualTreeNode.Y = y; 303 } 304 305 //draw terminal node 306 if (node.SubtreeCount == 0) { 307 graphics.FillRectangle(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height); 308 graphics.DrawRectangle(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height); 309 } else { 310 graphics.FillEllipse(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height); 311 graphics.DrawEllipse(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height); 312 } 313 314 //draw name of symbol 315 var text = node.ToString(); 316 graphics.DrawString(text, textFont, textBrush, new RectangleF(visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height), stringFormat); 317 318 //draw connection line to parent node 319 if (!connectionPoint.IsEmpty && node.Parent != null) { 320 var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node.Parent, node); 321 using (Pen linePen = new Pen(visualLine.LineColor)) { 268 269 private void DrawFunctionTree(ISymbolicExpressionTree tree, Graphics graphics, int preferredWidth, int preferredHeight, int minHDistance, int minVDistance) { 270 var layoutNodes = layoutAdapter.Convert(tree).ToList(); 271 layoutEngine.Reset(); 272 layoutEngine.Root = layoutNodes[0]; 273 foreach (var ln in layoutNodes) 274 layoutEngine.AddNode(ln.Content, ln); 275 layoutEngine.MinHorizontalSpacing = (preferredNodeWidth + minHDistance); 276 layoutEngine.MinVerticalSpacing = (preferredNodeHeight + minVDistance); 277 layoutEngine.CalculateLayout(); 278 var bounds = layoutEngine.Bounds(); 279 double sx = this.Width / (bounds.Width + preferredWidth); 280 if (sx > 1) sx = 1; 281 double sy = this.Height / bounds.Height; 282 if (sy > 1) sy = 1; 283 double dx = (this.Width - bounds.Width) / 2; 284 if (dx < 0) dx = 0; 285 double dy = (this.Height - bounds.Height) / 2; 286 if (dy < 0) dy = 0; 287 288 var levels = layoutNodes.GroupBy(n => n.Level, n => n); 289 290 foreach (var level in levels) { 291 var nodes = level.ToList(); 292 double min = 0; 293 for (int i = 0; i < nodes.Count - 1; ++i) { 294 var w = (nodes[i + 1].X - nodes[i].X) * sx - preferredWidth; 295 if (w < min) min = w; 296 } 297 if (min > 0) min = 0; 298 299 foreach (var layoutNode in level) { 300 var visualNode = visualTreeNodes[layoutNode.Content]; 301 visualNode.Width = (int)Math.Round(preferredWidth + min) - 2; // -2 to allow enough padding (1px on each side) for the node contour to be drawn 302 visualNode.Height = (int)Math.Round(preferredHeight * sy); 303 visualNode.X = (int)(Math.Round(layoutNode.X * sx + dx)); 304 visualNode.Y = (int)(Math.Round(layoutNode.Y * sy + dy)); 305 DrawTreeNode(graphics, visualNode); 306 } 307 } 308 309 graphics.ResetClip(); // reset clip region 310 // draw node connections 311 foreach (var visualNode in visualTreeNodes.Values) { 312 var node = visualNode.SymbolicExpressionTreeNode; 313 foreach (var subtree in node.Subtrees) { 314 var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node, subtree); 315 var visualSubtree = visualTreeNodes[subtree]; 316 var origin = new Point(visualNode.X + visualNode.Width / 2, visualNode.Y + visualNode.Height); 317 var target = new Point(visualSubtree.X + visualSubtree.Width / 2, visualSubtree.Y); 318 using (var linePen = new Pen(visualLine.LineColor)) { 322 319 linePen.DashStyle = visualLine.DashStyle; 323 graphics.DrawLine(linePen, connectionPoint, new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y));320 graphics.DrawLine(linePen, origin, target); 324 321 } 325 }326 327 //calculate areas for the subtrees according to their tree size and call drawFunctionTree328 Point connectFrom = new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y + visualTreeNode.Height);329 int[] xBoundaries = new int[node.SubtreeCount + 1];330 xBoundaries[0] = x;331 for (int i = 0; i < node.SubtreeCount; i++) {332 xBoundaries[i + 1] = (int)(xBoundaries[i] + (width * (double)node.GetSubtree(i).GetLength()) / (node.GetLength() - 1));333 DrawFunctionTree(node.GetSubtree(i), graphics, xBoundaries[i], y + height, xBoundaries[i + 1] - xBoundaries[i], height, connectFrom);334 322 } 335 323 } … … 365 353 } 366 354 #endregion 367 368 355 #region save image 369 356 private void saveImageToolStripMenuItem_Click(object sender, EventArgs e) { … … 388 375 public void SaveImageAsEmf(string filename) { 389 376 if (tree == null) return; 390 using (Graphics g = CreateGraphics()) { 391 using (Metafile file = new Metafile(filename, g.GetHdc())) { 392 using (Graphics emfFile = Graphics.FromImage(file)) { 393 int height = this.Height / tree.Depth; 394 DrawFunctionTree(tree, emfFile, 0, 0, Width, height); 377 using (var graphics = Graphics.FromImage(image)) { 378 var rectangle = new Rectangle(0, 0, image.Width, image.Height); 379 using (var metafile = new Metafile(filename, graphics.GetHdc(), rectangle, MetafileFrameUnit.Pixel, EmfType.EmfPlusDual)) { 380 graphics.ReleaseHdc(); 381 using (var g = Graphics.FromImage(metafile)) { 382 DrawFunctionTree(tree, g, 0, 0, image.Width, image.Height); 395 383 } 396 384 } 397 g.ReleaseHdc(); 385 } 386 } 387 #endregion 388 #region export pgf/tikz 389 private void exportLatexToolStripMenuItem_Click(object sender, EventArgs e) { 390 using (var dialog = new SaveFileDialog { Filter = "Tex (*.tex)|*.tex" }) { 391 if (dialog.ShowDialog() != DialogResult.OK) return; 392 string filename = dialog.FileName.ToLower(); 393 var formatter = new SymbolicExpressionTreeLatexFormatter(); 394 File.WriteAllText(filename, formatter.Format(Tree)); 398 395 } 399 396 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeLatexFormatter.cs
r10269 r10302 1 1 using System.Collections.Generic; 2 using System.Linq; 2 3 using System.Text; 3 4 using HeuristicLab.Common; … … 12 13 {"StartSymbol","RPB"} 13 14 }; 14 private ReingoldTilfordLayoutEngine layoutEngine; 15 private readonly ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> layoutEngine; 16 private readonly SymbolicExpressionTreeLayoutAdapter layoutAdapter; 17 15 18 16 19 public SymbolicExpressionTreeLatexFormatter() { 17 layoutEngine = new ReingoldTilfordLayoutEngine ();20 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(); 18 21 } 19 22 20 23 protected SymbolicExpressionTreeLatexFormatter(SymbolicExpressionTreeLatexFormatter original, Cloner cloner) 21 24 : base(original, cloner) { 22 layoutEngine = new ReingoldTilfordLayoutEngine(); 25 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(); 26 layoutAdapter = new SymbolicExpressionTreeLayoutAdapter(); 23 27 } 24 28 … … 28 32 29 33 public string Format(ISymbolicExpressionTree symbolicExpressionTree) { 30 layoutEngine.SymbolicExpressionTree = symbolicExpressionTree; 34 var layoutNodes = layoutAdapter.Convert(symbolicExpressionTree).ToList(); 35 layoutEngine.Reset(); 36 layoutEngine.Root = layoutNodes[0]; 37 foreach (var ln in layoutNodes) 38 layoutEngine.AddNode(ln.Content, ln); 31 39 var nodeCoordinates = layoutEngine.GetNodeCoordinates(); 32 40 var sb = new StringBuilder(); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
r10269 r10302 186 186 <Compile Include="Creators\RampedHalfAndHalfTreeCreator.cs" /> 187 187 <Compile Include="Formatters\SymbolicExpressionTreeGraphvizFormatter.cs" /> 188 <Compile Include="Formatters\SymbolicExpressionTreeLatexFormatter.cs" /> 188 189 <Compile Include="Interfaces\IFragment.cs" /> 189 190 <Compile Include="Interfaces\ILayoutAdapter.cs" /> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.Designer.cs
r10300 r10302 1 1 2 using HeuristicLab.Visualization; 3 2 4 namespace HeuristicLab.EvolutionTracking.Views { 3 5 partial class GenealogyGraphChart { … … 27 29 components = new System.ComponentModel.Container(); 28 30 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 31 Chart = new Chart(0, 0, PreferredSize.Width, PreferredSize.Height); 29 32 } 30 33 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs
r10300 r10302 70 70 if (clicked != null) clicked(sender, e); 71 71 } 72 public GenealogyGraphChart() { 72 public GenealogyGraphChart() 73 : base() { 73 74 InitializeComponent(); 74 75 } … … 263 264 public static Color GetColor(this IGenealogyGraphNode node) { 264 265 var colorIndex = (int)(node.Quality * ColorGradient.Colors.Count); 265 if (colorIndex >= ColorGradient.Colors.Count) --colorIndex; 266 return ColorGradient.Colors[colorIndex]; 266 return colorIndex < ColorGradient.Colors.Count ? ColorGradient.Colors[colorIndex] : Color.Transparent; 267 267 } 268 268 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.Designer.cs
r10300 r10302 1 using HeuristicLab.Visualization; 2 1 3 2 namespace HeuristicLab.EvolutionTracking.Views { 4 3 partial class GenealogyGraphView { … … 26 25 /// </summary> 27 26 private void InitializeComponent() { 27 this.splitContainer = new System.Windows.Forms.SplitContainer(); 28 this.panel1 = new System.Windows.Forms.Panel(); 29 this.panel2 = new System.Windows.Forms.Panel(); 30 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 28 31 this.genealogyGraphChart = new HeuristicLab.EvolutionTracking.Views.GenealogyGraphChart(); 32 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 33 this.splitContainer.Panel1.SuspendLayout(); 34 this.splitContainer.Panel2.SuspendLayout(); 35 this.splitContainer.SuspendLayout(); 36 this.panel1.SuspendLayout(); 37 this.panel2.SuspendLayout(); 29 38 this.SuspendLayout(); 39 // 40 // splitContainer 41 // 42 this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; 43 this.splitContainer.Location = new System.Drawing.Point(0, 0); 44 this.splitContainer.Name = "splitContainer"; 45 // 46 // splitContainer.Panel1 47 // 48 this.splitContainer.Panel1.Controls.Add(this.panel1); 49 // 50 // splitContainer.Panel2 51 // 52 this.splitContainer.Panel2.Controls.Add(this.panel2); 53 this.splitContainer.Size = new System.Drawing.Size(1128, 700); 54 this.splitContainer.SplitterDistance = 500; 55 this.splitContainer.TabIndex = 0; 56 // 57 // panel1 58 // 59 this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 60 this.panel1.Controls.Add(this.genealogyGraphChart); 61 this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; 62 this.panel1.Location = new System.Drawing.Point(0, 0); 63 this.panel1.Name = "panel1"; 64 this.panel1.Size = new System.Drawing.Size(500, 700); 65 this.panel1.TabIndex = 0; 66 // 67 // panel2 68 // 69 this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 70 this.panel2.Controls.Add(this.viewHost); 71 this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; 72 this.panel2.Location = new System.Drawing.Point(0, 0); 73 this.panel2.Name = "panel2"; 74 this.panel2.Size = new System.Drawing.Size(624, 700); 75 this.panel2.TabIndex = 0; 76 // 77 // viewHost 78 // 79 this.viewHost.Caption = "View"; 80 this.viewHost.Content = null; 81 this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill; 82 this.viewHost.Enabled = false; 83 this.viewHost.Location = new System.Drawing.Point(0, 0); 84 this.viewHost.Name = "viewHost"; 85 this.viewHost.ReadOnly = false; 86 this.viewHost.Size = new System.Drawing.Size(622, 698); 87 this.viewHost.TabIndex = 0; 88 this.viewHost.ViewsLabelVisible = true; 89 this.viewHost.ViewType = null; 30 90 // 31 91 // genealogyGraphChart 32 92 // 33 93 this.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control; 34 this.genealogyGraphChart.Chart = new Chart(0, 0, genealogyGraphChart.PreferredSize.Width, genealogyGraphChart.PreferredSize.Height);35 94 this.genealogyGraphChart.Dock = System.Windows.Forms.DockStyle.Fill; 95 this.genealogyGraphChart.GenealogyGraph = null; 36 96 this.genealogyGraphChart.Location = new System.Drawing.Point(0, 0); 37 97 this.genealogyGraphChart.LockGenealogy = false; … … 39 99 this.genealogyGraphChart.ScaleOnResize = true; 40 100 this.genealogyGraphChart.SimpleLineages = false; 41 this.genealogyGraphChart.Size = new System.Drawing.Size( 150, 150);42 this.genealogyGraphChart.TabIndex = 0;101 this.genealogyGraphChart.Size = new System.Drawing.Size(498, 698); 102 this.genealogyGraphChart.TabIndex = 2; 43 103 // 44 // SymbolicDataAnalysisGenealogyView104 // GenealogyGraphView 45 105 // 46 106 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 47 107 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 48 this.Controls.Add(this.genealogyGraphChart); 49 this.Name = "SymbolicDataAnalysisGenealogyView"; 108 this.Controls.Add(this.splitContainer); 109 this.Name = "GenealogyGraphView"; 110 this.Size = new System.Drawing.Size(1128, 700); 111 this.splitContainer.Panel1.ResumeLayout(false); 112 this.splitContainer.Panel2.ResumeLayout(false); 113 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 114 this.splitContainer.ResumeLayout(false); 115 this.panel1.ResumeLayout(false); 116 this.panel2.ResumeLayout(false); 50 117 this.ResumeLayout(false); 51 118 … … 54 121 #endregion 55 122 56 private EvolutionTracking.Views.GenealogyGraphChart genealogyGraphChart; 123 private System.Windows.Forms.SplitContainer splitContainer; 124 private MainForm.WindowsForms.ViewHost viewHost; 125 private System.Windows.Forms.Panel panel1; 126 private System.Windows.Forms.Panel panel2; 127 private GenealogyGraphChart genealogyGraphChart; 128 57 129 } 58 130 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.cs
r10300 r10302 1 using HeuristicLab.Core.Views; 1 using System.Windows.Forms; 2 using HeuristicLab.Common; 3 using HeuristicLab.Core.Views; 2 4 using HeuristicLab.MainForm; 3 5 … … 13 15 public GenealogyGraphView() { 14 16 InitializeComponent(); 17 18 genealogyGraphChart.GenealogyGraphNodeClicked += graphChart_GenealogyGraphNodeClicked; 15 19 } 16 20 … … 26 30 27 31 #region Event Handlers (Content) 32 33 public void graphChart_GenealogyGraphNodeClicked(object sender, MouseEventArgs args) { 34 var content = ((VisualGenealogyGraphNode)sender).Data.Content; 35 if (content != null) { 36 viewHost.Content = (IContent)content; 37 } 38 } 28 39 // TODO: Put event handlers of the content here 29 40 #endregion -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/HeuristicLab.EvolutionTracking.Views-3.4.csproj
r10300 r10302 161 161 </ItemGroup> 162 162 <ItemGroup> 163 <EmbeddedResource Include="GenealogyGraphView.resx"> 164 <DependentUpon>GenealogyGraphView.cs</DependentUpon> 165 </EmbeddedResource> 163 166 <EmbeddedResource Include="Properties\Resources.resx"> 164 167 <Generator>ResXFileCodeGenerator</Generator> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs
r10300 r10302 49 49 } 50 50 public override void AddVertex(IVertex vertex) { 51 var ggn= (IGenealogyGraphNode)vertex;52 if (!Ranks.ContainsKey( ggn.Rank))53 Ranks[ ggn.Rank] = new LinkedList<IGenealogyGraphNode>();54 Ranks[ ggn.Rank].AddLast(ggn);51 var node = (IGenealogyGraphNode)vertex; 52 if (!Ranks.ContainsKey(node.Rank)) 53 Ranks[node.Rank] = new LinkedList<IGenealogyGraphNode>(); 54 Ranks[node.Rank].AddLast(node); 55 55 base.AddVertex(vertex); 56 56 } 57 57 public override void RemoveVertex(IVertex vertex) { 58 var ggn= (IGenealogyGraphNode)vertex;59 if (Ranks.ContainsKey( ggn.Rank)) {60 Ranks[ ggn.Rank].Remove(ggn);58 var node = (IGenealogyGraphNode)vertex; 59 if (Ranks.ContainsKey(node.Rank)) { 60 Ranks[node.Rank].Remove(node); 61 61 } 62 62 base.RemoveVertex(vertex); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r10293 r10302 193 193 <Compile Include="SlidingWindow\SlidingWindowQualitiesAnalyzer.cs" /> 194 194 <Compile Include="SlidingWindow\SlidingWindowVisualizer.cs" /> 195 <Compile Include="SymbolicDataAnalysisExpressionTreeMatching.cs" /> 196 <Compile Include="SymbolicDataAnalysisExpressionTreeSimilarityCalculator.cs" /> 195 197 <Compile Include="SymbolicDataAnalysisSolutionPruningOptimizer.cs" /> 196 198 <Compile Include="Analyzers\SymbolicDataAnalysisVariableFrequencyAnalyzer.cs" />
Note: See TracChangeset
for help on using the changeset viewer.