Changeset 11506
- Timestamp:
- 10/27/14 20:47:37 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs
r11262 r11506 50 50 } 51 51 52 public IGenealogyGraphNode SelectedGraphNode { get; private set; } 52 public IGenealogyGraphNode SelectedGraphNode { 53 get { 54 return SelectedVisualNode == null ? null : SelectedVisualNode.Data; 55 } 56 } 53 57 54 58 private void Clear() { … … 70 74 private Visualization.Rectangle TargetRectangle { get; set; } 71 75 private bool DrawInProgress { get; set; } // do not try to update the chart while the drawing is not finished 72 pr ivateVisualGenealogyGraphNode SelectedVisualNode { get; set; }76 protected VisualGenealogyGraphNode SelectedVisualNode { get; set; } 73 77 74 78 private VisualGenealogyGraphNode GetMappedNode(IGenealogyGraphNode node) { … … 156 160 157 161 public event MouseEventHandler GenealogyGraphNodeClicked; 158 pr ivatevoid OnGenealogyGraphNodeClicked(object sender, MouseEventArgs e) {162 protected void OnGenealogyGraphNodeClicked(object sender, MouseEventArgs e) { 159 163 var clicked = GenealogyGraphNodeClicked; 160 164 if (clicked != null) clicked(sender, e); 161 165 } 162 166 167 public event MouseEventHandler GenealogyGraphNodeDoubleClicked; 168 protected void OnGenealogyGraphNodeDoubleClicked(object sender, MouseEventArgs e) { 169 var doubleClicked = GenealogyGraphNodeDoubleClicked; 170 if (doubleClicked != null) 171 doubleClicked(sender, e); 172 } 163 173 #region event handlers 174 164 175 protected override void pictureBox_MouseMove(object sender, MouseEventArgs e) { 165 176 if (!DrawInProgress) { … … 195 206 SelectedVisualNode = visualNodes[0] as VisualGenealogyGraphNode; 196 207 if (SelectedVisualNode == null) return; 197 SelectedGraphNode = SelectedVisualNode.Data;198 208 199 209 if (!LockGenealogy) { … … 334 344 Chart.EnforceUpdate(); 335 345 } 346 347 public void HighlightArc(IGenealogyGraphNode source, IGenealogyGraphNode target) { 348 var arc = GetMappedArc(source, target) ?? 349 AddArc(Chart, GetMappedNode(source), GetMappedNode(target), new Pen(Color.Transparent)); 350 var start = new Point((int)arc.Start.X, (int)arc.Start.Y); 351 var end = new Point((int)arc.End.X, (int)arc.End.Y); 352 arc.Pen = new Pen(Color.Transparent); 353 arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor()); 354 } 336 355 } 337 356 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.Designer.cs
r10347 r11506 26 26 private void InitializeComponent() { 27 27 this.splitContainer = new System.Windows.Forms.SplitContainer(); 28 this.panel1 = new System.Windows.Forms.Panel(); 29 this.panel2 = new System.Windows.Forms.Panel(); 28 this.genealogyGraphChart = new HeuristicLab.EvolutionTracking.Views.GenealogyGraphChart(); 30 29 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 31 this.genealogyGraphChart = new HeuristicLab.EvolutionTracking.Views.GenealogyGraphChart();32 30 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 33 31 this.splitContainer.Panel1.SuspendLayout(); 34 32 this.splitContainer.Panel2.SuspendLayout(); 35 33 this.splitContainer.SuspendLayout(); 36 this.panel1.SuspendLayout();37 this.panel2.SuspendLayout();38 34 this.SuspendLayout(); 39 35 // … … 46 42 // splitContainer.Panel1 47 43 // 48 this.splitContainer.Panel1.Controls.Add(this. panel1);44 this.splitContainer.Panel1.Controls.Add(this.genealogyGraphChart); 49 45 // 50 46 // splitContainer.Panel2 51 47 // 52 this.splitContainer.Panel2.Controls.Add(this. panel2);53 this.splitContainer.Size = new System.Drawing.Size( 1128, 700);54 this.splitContainer.SplitterDistance = 500;48 this.splitContainer.Panel2.Controls.Add(this.viewHost); 49 this.splitContainer.Size = new System.Drawing.Size(894, 678); 50 this.splitContainer.SplitterDistance = 417; 55 51 this.splitContainer.TabIndex = 0; 56 //57 // panel158 //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 // panel268 //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 // viewHost78 //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;90 52 // 91 53 // genealogyGraphChart … … 99 61 this.genealogyGraphChart.ScaleOnResize = true; 100 62 this.genealogyGraphChart.SimpleLineages = false; 101 this.genealogyGraphChart.Size = new System.Drawing.Size(4 98, 698);63 this.genealogyGraphChart.Size = new System.Drawing.Size(417, 678); 102 64 this.genealogyGraphChart.TabIndex = 2; 65 this.genealogyGraphChart.TraceFragments = false; 66 // 67 // viewHost 68 // 69 this.viewHost.Caption = "View"; 70 this.viewHost.Content = null; 71 this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill; 72 this.viewHost.Enabled = false; 73 this.viewHost.Location = new System.Drawing.Point(0, 0); 74 this.viewHost.Name = "viewHost"; 75 this.viewHost.ReadOnly = false; 76 this.viewHost.Size = new System.Drawing.Size(473, 678); 77 this.viewHost.TabIndex = 0; 78 this.viewHost.ViewsLabelVisible = true; 79 this.viewHost.ViewType = null; 103 80 // 104 81 // GenealogyGraphView … … 108 85 this.Controls.Add(this.splitContainer); 109 86 this.Name = "GenealogyGraphView"; 110 this.Size = new System.Drawing.Size( 1128, 700);87 this.Size = new System.Drawing.Size(894, 678); 111 88 this.splitContainer.Panel1.ResumeLayout(false); 112 89 this.splitContainer.Panel2.ResumeLayout(false); 113 90 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 114 91 this.splitContainer.ResumeLayout(false); 115 this.panel1.ResumeLayout(false);116 this.panel2.ResumeLayout(false);117 92 this.ResumeLayout(false); 118 93 … … 123 98 protected System.Windows.Forms.SplitContainer splitContainer; 124 99 protected MainForm.WindowsForms.ViewHost viewHost; 125 protected System.Windows.Forms.Panel panel1;126 protected System.Windows.Forms.Panel panel2;127 100 protected GenealogyGraphChart genealogyGraphChart; 128 101 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymboldDataAnalysisGenealogyView.Designer.cs
r10888 r11506 49 49 this.components = new System.ComponentModel.Container(); 50 50 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 51 this.genealogyGraphChart = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.SymbolicDataAnalysisExpressionGenealogyGraphChart();52 51 this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart(); 53 52 this.groupBox1 = new System.Windows.Forms.GroupBox(); 53 this.hotPaths_button = new System.Windows.Forms.Button(); 54 54 this.simpleLineages_checkBox = new System.Windows.Forms.CheckBox(); 55 55 this.lockGraph_checkBox = new System.Windows.Forms.CheckBox(); 56 56 this.trace_checkBox = new System.Windows.Forms.CheckBox(); 57 this. hotPaths_button = new System.Windows.Forms.Button();57 this.genealogyGraphChart = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.SymbolicDataAnalysisExpressionGenealogyGraphChart(); 58 58 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 59 59 this.splitContainer1.Panel1.SuspendLayout(); … … 65 65 // splitContainer1 66 66 // 67 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 68 | System.Windows.Forms.AnchorStyles.Left) 69 | System.Windows.Forms.AnchorStyles.Right))); 67 70 this.splitContainer1.Location = new System.Drawing.Point(0, 57); 68 71 this.splitContainer1.Name = "splitContainer1"; … … 75 78 // 76 79 this.splitContainer1.Panel2.Controls.Add(this.symbolicExpressionTreeChart); 77 this.splitContainer1.Size = new System.Drawing.Size(124 7, 698);78 this.splitContainer1.SplitterDistance = 60 7;80 this.splitContainer1.Size = new System.Drawing.Size(1244, 695); 81 this.splitContainer1.SplitterDistance = 605; 79 82 this.splitContainer1.TabIndex = 0; 80 83 // 81 // genealogyGraphChart82 //83 this.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control;84 this.genealogyGraphChart.Dock = System.Windows.Forms.DockStyle.Fill;85 this.genealogyGraphChart.GenealogyGraph = null;86 this.genealogyGraphChart.Location = new System.Drawing.Point(0, 0);87 this.genealogyGraphChart.LockGenealogy = false;88 this.genealogyGraphChart.Name = "genealogyGraphChart";89 this.genealogyGraphChart.ScaleOnResize = true;90 this.genealogyGraphChart.SimpleLineages = false;91 this.genealogyGraphChart.Size = new System.Drawing.Size(607, 698);92 this.genealogyGraphChart.TabIndex = 0;93 this.genealogyGraphChart.TraceFragments = false;94 //95 84 // symbolicExpressionTreeChart 96 85 // 86 this.symbolicExpressionTreeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 87 | System.Windows.Forms.AnchorStyles.Left) 88 | System.Windows.Forms.AnchorStyles.Right))); 97 89 this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White; 98 this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill;99 90 this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black; 100 91 this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0); 101 92 this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart"; 102 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(63 6, 698);93 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(635, 692); 103 94 this.symbolicExpressionTreeChart.Spacing = 5; 104 95 this.symbolicExpressionTreeChart.SuspendRepaint = false; … … 109 100 // groupBox1 110 101 // 102 this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 103 | System.Windows.Forms.AnchorStyles.Right))); 111 104 this.groupBox1.Controls.Add(this.hotPaths_button); 112 105 this.groupBox1.Controls.Add(this.simpleLineages_checkBox); … … 115 108 this.groupBox1.Location = new System.Drawing.Point(3, 3); 116 109 this.groupBox1.Name = "groupBox1"; 117 this.groupBox1.Size = new System.Drawing.Size(1 195, 48);110 this.groupBox1.Size = new System.Drawing.Size(1241, 48); 118 111 this.groupBox1.TabIndex = 4; 119 112 this.groupBox1.TabStop = false; 120 113 this.groupBox1.Text = "Controls"; 114 // 115 // hotPaths_button 116 // 117 this.hotPaths_button.Location = new System.Drawing.Point(263, 15); 118 this.hotPaths_button.Name = "hotPaths_button"; 119 this.hotPaths_button.Size = new System.Drawing.Size(75, 23); 120 this.hotPaths_button.TabIndex = 7; 121 this.hotPaths_button.Text = "Hot paths"; 122 this.hotPaths_button.UseVisualStyleBackColor = true; 123 this.hotPaths_button.Click += new System.EventHandler(this.hotPaths_button_Click); 121 124 // 122 125 // simpleLineages_checkBox … … 153 156 this.trace_checkBox.CheckedChanged += new System.EventHandler(this.trace_checkBox_CheckedChanged); 154 157 // 155 // hotPaths_button 156 // 157 this.hotPaths_button.Location = new System.Drawing.Point(263, 15); 158 this.hotPaths_button.Name = "hotPaths_button"; 159 this.hotPaths_button.Size = new System.Drawing.Size(75, 23); 160 this.hotPaths_button.TabIndex = 7; 161 this.hotPaths_button.Text = "Hot paths"; 162 this.hotPaths_button.UseVisualStyleBackColor = true; 163 this.hotPaths_button.Click += new System.EventHandler(this.hotPaths_button_Click); 158 // genealogyGraphChart 159 // 160 this.genealogyGraphChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 161 | System.Windows.Forms.AnchorStyles.Left) 162 | System.Windows.Forms.AnchorStyles.Right))); 163 this.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control; 164 this.genealogyGraphChart.GenealogyGraph = null; 165 this.genealogyGraphChart.Location = new System.Drawing.Point(-5, 0); 166 this.genealogyGraphChart.LockGenealogy = false; 167 this.genealogyGraphChart.Name = "genealogyGraphChart"; 168 this.genealogyGraphChart.ScaleOnResize = true; 169 this.genealogyGraphChart.SimpleLineages = false; 170 this.genealogyGraphChart.Size = new System.Drawing.Size(607, 692); 171 this.genealogyGraphChart.TabIndex = 0; 172 this.genealogyGraphChart.TraceFragments = false; 164 173 // 165 174 // SymboldDataAnalysisGenealogyView -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymboldDataAnalysisGenealogyView.cs
r11503 r11506 78 78 var tree = graphNode.Data; 79 79 symbolicExpressionTreeChart.Tree = tree; 80 81 80 if (graphNode.InArcs.Any()) { 82 81 var fragment = graphNode.InArcs.Last().Data as IFragment<ISymbolicExpressionTreeNode>; 83 82 if (fragment != null) { 84 83 treeChart_HighlightSubtree(graphNode.Data.NodeAt(fragment.Index1)); 85 } else { 86 var td = graphNode.InArcs.Last().Data as Tuple<int, int, int, int>; 87 if (td != null) { 88 var s = graphNode.Data.NodeAt(td.Item1); 89 var f = graphNode.Data.NodeAt(td.Item2); 90 treeChart_HighlightSubtree(s, Color.Orange); 91 treeChart_HighlightSubtree(f, Color.RoyalBlue); 92 } 84 } 85 } 86 if (graphNode.OutArcs.Any()) { 87 var td = graphNode.OutArcs.Last().Data as Tuple<int, int, int, int>; 88 if (td != null) { 89 var s = graphNode.Data.NodeAt(td.Item3); // subtree index 90 var f = graphNode.Data.NodeAt(td.Item4); // fragment index 91 treeChart_HighlightSubtree(s, Color.Orange); 92 treeChart_HighlightSubtree(f, Color.RoyalBlue); 93 93 } 94 94 } … … 98 98 var visualNode = (VisualGenealogyGraphNode)sender; 99 99 var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)visualNode.Data; 100 var tree = graphNode.Data; 101 MainFormManager.MainForm.ShowContent(tree); 100 // var tree = graphNode.Data; 101 // var model = new RegressionModel(); 102 // var solution = new RegressionSolution() 103 // MainFormManager.MainForm.ShowContent(tree); 102 104 } 103 105 … … 117 119 var subtreeIndex = graphNode.Data.IterateNodesPrefix().ToList().IndexOf(subtree); 118 120 var fragmentGraph = SymbolicDataAnalysisExpressionTracing.TraceSubtree(graphNode, subtreeIndex); 121 119 122 if (fragmentGraph.Vertices.Any()) { 123 var genealogyNodes = fragmentGraph.Vertices.Select(v => Content.GetByContent(v.Data)); 124 genealogyGraphChart.HighlightNodes(genealogyNodes); 125 foreach (var a in fragmentGraph.Arcs) { 126 genealogyGraphChart.HighlightArc(Content.GetByContent(a.Target.Data), Content.GetByContent(a.Source.Data)); 127 } 120 128 MainFormManager.MainForm.ShowContent(fragmentGraph); // display the fragment graph on the screen 121 129 }
Note: See TracChangeset
for help on using the changeset viewer.