Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/27/14 20:47:37 (10 years ago)
Author:
bburlacu
Message:

#1772: Updated views (fixed position and anchors).

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  
    5050    }
    5151
    52     public IGenealogyGraphNode SelectedGraphNode { get; private set; }
     52    public IGenealogyGraphNode SelectedGraphNode {
     53      get {
     54        return SelectedVisualNode == null ? null : SelectedVisualNode.Data;
     55      }
     56    }
    5357
    5458    private void Clear() {
     
    7074    private Visualization.Rectangle TargetRectangle { get; set; }
    7175    private bool DrawInProgress { get; set; } // do not try to update the chart while the drawing is not finished
    72     private VisualGenealogyGraphNode SelectedVisualNode { get; set; }
     76    protected VisualGenealogyGraphNode SelectedVisualNode { get; set; }
    7377
    7478    private VisualGenealogyGraphNode GetMappedNode(IGenealogyGraphNode node) {
     
    156160
    157161    public event MouseEventHandler GenealogyGraphNodeClicked;
    158     private void OnGenealogyGraphNodeClicked(object sender, MouseEventArgs e) {
     162    protected void OnGenealogyGraphNodeClicked(object sender, MouseEventArgs e) {
    159163      var clicked = GenealogyGraphNodeClicked;
    160164      if (clicked != null) clicked(sender, e);
    161165    }
    162166
     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    }
    163173    #region event handlers
     174
    164175    protected override void pictureBox_MouseMove(object sender, MouseEventArgs e) {
    165176      if (!DrawInProgress) {
     
    195206      SelectedVisualNode = visualNodes[0] as VisualGenealogyGraphNode;
    196207      if (SelectedVisualNode == null) return;
    197       SelectedGraphNode = SelectedVisualNode.Data;
    198208
    199209      if (!LockGenealogy) {
     
    334344      Chart.EnforceUpdate();
    335345    }
     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    }
    336355  }
    337356
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.Designer.cs

    r10347 r11506  
    2626    private void InitializeComponent() {
    2727      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();
    3029      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    31       this.genealogyGraphChart = new HeuristicLab.EvolutionTracking.Views.GenealogyGraphChart();
    3230      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    3331      this.splitContainer.Panel1.SuspendLayout();
    3432      this.splitContainer.Panel2.SuspendLayout();
    3533      this.splitContainer.SuspendLayout();
    36       this.panel1.SuspendLayout();
    37       this.panel2.SuspendLayout();
    3834      this.SuspendLayout();
    3935      //
     
    4642      // splitContainer.Panel1
    4743      //
    48       this.splitContainer.Panel1.Controls.Add(this.panel1);
     44      this.splitContainer.Panel1.Controls.Add(this.genealogyGraphChart);
    4945      //
    5046      // splitContainer.Panel2
    5147      //
    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;
    5551      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;
    9052      //
    9153      // genealogyGraphChart
     
    9961      this.genealogyGraphChart.ScaleOnResize = true;
    10062      this.genealogyGraphChart.SimpleLineages = false;
    101       this.genealogyGraphChart.Size = new System.Drawing.Size(498, 698);
     63      this.genealogyGraphChart.Size = new System.Drawing.Size(417, 678);
    10264      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;
    10380      //
    10481      // GenealogyGraphView
     
    10885      this.Controls.Add(this.splitContainer);
    10986      this.Name = "GenealogyGraphView";
    110       this.Size = new System.Drawing.Size(1128, 700);
     87      this.Size = new System.Drawing.Size(894, 678);
    11188      this.splitContainer.Panel1.ResumeLayout(false);
    11289      this.splitContainer.Panel2.ResumeLayout(false);
    11390      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    11491      this.splitContainer.ResumeLayout(false);
    115       this.panel1.ResumeLayout(false);
    116       this.panel2.ResumeLayout(false);
    11792      this.ResumeLayout(false);
    11893
     
    12398    protected System.Windows.Forms.SplitContainer splitContainer;
    12499    protected MainForm.WindowsForms.ViewHost viewHost;
    125     protected System.Windows.Forms.Panel panel1;
    126     protected System.Windows.Forms.Panel panel2;
    127100    protected GenealogyGraphChart genealogyGraphChart;
    128101
Note: See TracChangeset for help on using the changeset viewer.