Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisExpressionGenealogyGraphChart.cs @ 11733

Last change on this file since 11733 was 11503, checked in by bburlacu, 10 years ago

#1772: Added handling of double click event in the genealogy graph (opens a new view of the selected symbolic expression tree). Added highlighting of trace data. Very minor cosmetic changes to the TraceCalculator. Removed resx file from project.

File size: 2.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System.Linq;
23using System.Windows.Forms;
24using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
25using HeuristicLab.EvolutionTracking;
26using HeuristicLab.EvolutionTracking.Views;
27
28namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
29  public partial class SymbolicDataAnalysisExpressionGenealogyGraphChart : GenealogyGraphChart {
30    public SymbolicDataAnalysisExpressionGenealogyGraphChart() {
31      InitializeComponent();
32    }
33
34    public new IGenealogyGraph<ISymbolicExpressionTree> GenealogyGraph {
35      get { return (IGenealogyGraph<ISymbolicExpressionTree>)base.GenealogyGraph; }
36      set { base.GenealogyGraph = value; }
37    }
38
39    private void pictureBox_DoubleClick(object sender, MouseEventArgs e) {
40      var visualNodes = Chart.GetAllPrimitives(e.Location).Where(p => p is VisualGenealogyGraphNode).ToList();
41      if (!visualNodes.Any()) {
42        SelectedVisualNode = null;
43        return;
44      }
45      var visualNode = visualNodes.First();
46
47      base.OnGenealogyGraphNodeDoubleClicked(visualNode, e);
48    }
49    // add event handlers here for processing events coming from the tree chart
50  }
51}
Note: See TracBrowser for help on using the repository browser.