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 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.ComponentModel;
|
---|
25 | using System.Drawing;
|
---|
26 | using System.Data;
|
---|
27 | using System.Linq;
|
---|
28 | using System.Text;
|
---|
29 | using System.Windows.Forms;
|
---|
30 | using HeuristicLab.Core.Views;
|
---|
31 | using HeuristicLab.MainForm;
|
---|
32 | using HeuristicLab.Data;
|
---|
33 | using System.Windows.Forms.DataVisualization.Charting;
|
---|
34 |
|
---|
35 | namespace 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 | }
|
---|