Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/13 13:01:40 (11 years ago)
Author:
bburlacu
Message:

#1772: Merged remaining trunk changes into the EvolutionaryTracking branch.

Location:
branches/HeuristicLab.EvolutionaryTracking
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionaryTracking

  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs

    r9420 r9835  
    8888
    8989    public GenealogyGraphChart() {
     90      //      InitializeComponent();
    9091      Chart = new Chart(0, 0, PreferredSize.Width, PreferredSize.Height);
    9192      x = 0;
    9293      y = PreferredSize.Height + Cx + 2 * Diameter;
     94      Chart.Mode = ChartMode.Select;
    9395    }
    9496
     
    190192
    191193    protected override void pictureBox_MouseMove(object sender, MouseEventArgs e) {
    192       if (!drawing)
     194      if (!drawing) {
     195        switch (e.Button) {
     196          case MouseButtons.Left:
     197            Chart.Mode = ChartMode.Select;
     198            Cursor = Cursors.Default;
     199            break;
     200          case MouseButtons.Middle:
     201            Chart.Mode = ChartMode.Move;
     202            Cursor = Cursors.Hand;
     203            break;
     204        }
    193205        base.pictureBox_MouseMove(sender, e);
     206      }
    194207    }
    195208
    196209    protected override void pictureBox_MouseUp(object sender, MouseEventArgs e) {
     210      Cursor = Cursors.Default;
     211      if (Chart.Mode == ChartMode.Move) {
     212        Chart.Mode = ChartMode.Select;
     213        return;
     214      }
     215
    197216      if (Chart.Mode != ChartMode.Select) {
    198217        base.pictureBox_MouseUp(sender, e);
    199218        return;
    200219      }
     220
    201221      var visualNodes = Chart.GetAllPrimitives(e.Location).Where(p => p is VisualGenealogyGraphNode).ToList();
    202222      if (visualNodes.Count <= 0) {
     
    280300    }
    281301
     302    public void HighlightNodes(IEnumerable<SymbolicExpressionGenealogyGraphNode> nodes) {
     303      Chart.UpdateEnabled = false;
     304      ClearAllNodes();
     305      foreach (var node in nodes) {
     306        GetVisualGenealogyGraphNode(node).Brush = new SolidBrush(node.GetColor());
     307      }
     308      Chart.UpdateEnabled = true;
     309      Chart.EnforceUpdate();
     310    }
     311
    282312    // TODO: optimize and reduce complexity of this method
    283313    public void HighlightNodes(IEnumerable<ISymbolicExpressionTree> trees) {
Note: See TracChangeset for help on using the changeset viewer.