- Timestamp:
- 10/27/14 20:47:37 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4
- Files:
-
- 2 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
Note: See TracChangeset
for help on using the changeset viewer.