Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.DiversityAnalysis/HeuristicLab.Problems.TravelingSalesman.Views/3.3/HeatmapView.cs @ 4700

Last change on this file since 4700 was 4700, checked in by swinkler, 14 years ago

Worked on population diversity analysis (added current similarities result) and heatmap view. (#1188)

File size: 3.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 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;
23using System.Collections.Generic;
24using System.ComponentModel;
25using System.Drawing;
26using System.Data;
27using System.Linq;
28using System.Text;
29using System.Windows.Forms;
30using HeuristicLab.Core.Views;
31using HeuristicLab.MainForm;
32using HeuristicLab.Data;
33using System.Windows.Forms.DataVisualization.Charting;
34
35namespace HeuristicLab.Problems.TravelingSalesman.Views {
36
37  [View("DoubleMatrix Heatmap View")]
38  [Content(typeof(DoubleMatrix), false)]
39  public partial class HeatmapView : ItemView {
40
41    public new DoubleMatrix Content {
42      get { return (DoubleMatrix)base.Content; }
43      set { base.Content = value; }
44    }
45
46    public HeatmapView() {
47      InitializeComponent();
48      chart.CustomizeAllChartAreas();
49      /*
50      Series s = new Series();
51      DataPoint p = new DataPoint(0.4, 0.2);
52      p.Color = Color.Red;
53      p.MarkerStyle = MarkerStyle.None;
54      p.MarkerSize = 10;
55      s.Points.Add(p);
56      DataPoint p2 = new DataPoint(0.6, 0.5);
57      p2.Color = Color.Red;
58      p2.MarkerStyle = MarkerStyle.None;
59      p2.MarkerSize = 40;
60      s.Points.Add(p2);
61      DataPoint p3 = new DataPoint(0.8, 0.2);
62      p3.Color = Color.Red;
63      p3.MarkerStyle = MarkerStyle.None;
64      p3.MarkerSize = 40;
65      s.Points.Add(p3);
66      DataPoint p4 = new DataPoint(0.7, 0.3);
67      p4.Color = Color.Red;
68      p4.MarkerStyle = MarkerStyle.None;
69      p4.MarkerSize = 40;
70      s.Points.Add(p4);
71      s.ChartType = SeriesChartType.Area;
72      s.XValueType = ChartValueType.String;
73      s.YValueType = ChartValueType.Double;
74      s.YAxisType = AxisType.Primary;
75      chart.Series.Add(s);
76      chart.Update();*/
77    }
78
79    #region Chart Events
80    protected virtual void chart_MouseDown(object sender, MouseEventArgs e) {
81      HitTestResult result = chart.HitTest(e.X, e.Y);
82      //
83    }
84
85    protected virtual void chart_MouseMove(object sender, MouseEventArgs e) {
86      HitTestResult result = chart.HitTest(e.X, e.Y);
87      if (result.ChartElementType == ChartElementType.LegendItem)
88        this.Cursor = Cursors.Hand;
89      else
90        this.Cursor = Cursors.Default;
91    }
92
93    protected virtual void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
94      foreach (LegendItem legendItem in e.LegendItems) {
95        var series = chart.Series[legendItem.SeriesName];
96        //
97      }
98    }
99
100    #endregion
101
102  }
103
104}
Note: See TracBrowser for help on using the repository browser.