Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.cs @ 13855

Last change on this file since 13855 was 13855, checked in by pfleck, 8 years ago

#2597

  • Added validation in GradientChartConfigurationDialog and DensityTrackbar.
  • Added optional configuration button for GradientChart.
File size: 22.8 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2016 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.Drawing;
25using System.Globalization;
26using System.Linq;
27using System.Threading;
28using System.Threading.Tasks;
29using System.Windows.Forms;
30using System.Windows.Forms.DataVisualization.Charting;
31using HeuristicLab.Common;
32using HeuristicLab.MainForm.WindowsForms;
33using HeuristicLab.Visualization.ChartControlsExtensions;
34
35namespace HeuristicLab.Problems.DataAnalysis.Views {
36  public partial class GradientChart : UserControl {
37    private ModifiableDataset sharedFixedVariables; // used for syncronising variable values between charts
38    private ModifiableDataset internalDataset; // holds the x values for each point drawn
39
40    private CancellationTokenSource cancelCurrentRecalculateSource;
41
42    private readonly List<IRegressionSolution> solutions;
43    private readonly Dictionary<IRegressionSolution, Series> seriesCache;
44    private readonly Dictionary<IRegressionSolution, Series> ciSeriesCache;
45
46    private readonly ToolStripMenuItem configToolStripMenuItem;
47    private readonly GradientChartConfigurationDialog configurationDialog;
48
49    #region Properties
50    public bool ShowLegend {
51      get { return chart.Legends[0].Enabled; }
52      set { chart.Legends[0].Enabled = value; }
53    }
54    public bool ShowCursor {
55      get { return chart.Annotations[0].Visible; }
56      set {
57        chart.Annotations[0].Visible = value;
58        if (!value) chart.ChartAreas[0].AxisX.Title = string.Empty;
59      }
60    }
61
62    public bool ShowConfigButton {
63      get { return configurationButton.Visible; }
64      set { configurationButton.Visible = value; }
65    }
66
67    private int xAxisTicks = 5;
68    public int XAxisTicks {
69      get { return xAxisTicks; }
70      set {
71        if (value != xAxisTicks) {
72          xAxisTicks = value;
73          SetupAxis(chart.ChartAreas[0].AxisX, trainingMin, trainingMax, XAxisTicks, FixedXAxisMin, FixedXAxisMax);
74          RecalculateInternalDataset();
75        }
76      }
77    }
78    private double? fixedXAxisMin;
79    public double? FixedXAxisMin {
80      get { return fixedXAxisMin; }
81      set {
82        if ((value.HasValue && fixedXAxisMin.HasValue && !value.Value.IsAlmost(fixedXAxisMin.Value)) || (value.HasValue != fixedXAxisMin.HasValue)) {
83          fixedXAxisMin = value;
84          SetupAxis(chart.ChartAreas[0].AxisX, trainingMin, trainingMax, XAxisTicks, FixedXAxisMin, FixedXAxisMax);
85          RecalculateInternalDataset();
86        }
87      }
88    }
89    private double? fixedXAxisMax;
90    public double? FixedXAxisMax {
91      get { return fixedXAxisMax; }
92      set {
93        if ((value.HasValue && fixedXAxisMax.HasValue && !value.Value.IsAlmost(fixedXAxisMax.Value)) || (value.HasValue != fixedXAxisMax.HasValue)) {
94          fixedXAxisMax = value;
95          SetupAxis(chart.ChartAreas[0].AxisX, trainingMin, trainingMax, XAxisTicks, FixedXAxisMin, FixedXAxisMax);
96          RecalculateInternalDataset();
97        }
98      }
99    }
100
101    private int yAxisTicks = 5;
102    public int YAxisTicks {
103      get { return yAxisTicks; }
104      set {
105        if (value != yAxisTicks) {
106          yAxisTicks = value;
107          SetupAxis(chart.ChartAreas[0].AxisY, yMin, yMax, YAxisTicks, FixedYAxisMin, FixedYAxisMax);
108          RecalculateInternalDataset();
109        }
110      }
111    }
112    private double? fixedYAxisMin;
113    public double? FixedYAxisMin {
114      get { return fixedYAxisMin; }
115      set {
116        if ((value.HasValue && fixedYAxisMin.HasValue && !value.Value.IsAlmost(fixedYAxisMin.Value)) || (value.HasValue != fixedYAxisMin.HasValue)) {
117          fixedYAxisMin = value;
118          SetupAxis(chart.ChartAreas[0].AxisY, yMin, yMax, YAxisTicks, FixedYAxisMin, FixedYAxisMax);
119        }
120      }
121    }
122    private double? fixedYAxisMax;
123    public double? FixedYAxisMax {
124      get { return fixedYAxisMax; }
125      set {
126        if ((value.HasValue && fixedYAxisMax.HasValue && !value.Value.IsAlmost(fixedYAxisMax.Value)) || (value.HasValue != fixedYAxisMax.HasValue)) {
127          fixedYAxisMax = value;
128          SetupAxis(chart.ChartAreas[0].AxisY, yMin, yMax, YAxisTicks, FixedYAxisMin, FixedYAxisMax);
129        }
130      }
131    }
132
133    private double trainingMin = 1;
134    private double trainingMax = -1;
135
136    private int drawingSteps = 1000;
137    public int DrawingSteps {
138      get { return drawingSteps; }
139      set {
140        if (value != drawingSteps) {
141          drawingSteps = value;
142          RecalculateInternalDataset();
143          ResizeAllSeriesData();
144        }
145      }
146    }
147
148    private string freeVariable;
149    public string FreeVariable {
150      get { return freeVariable; }
151      set {
152        if (value == freeVariable) return;
153        if (solutions.Any(s => !s.ProblemData.Dataset.DoubleVariables.Contains(value))) {
154          throw new ArgumentException("Variable does not exist in the ProblemData of the Solutions.");
155        }
156        freeVariable = value;
157        RecalculateInternalDataset();
158      }
159    }
160
161    private double yMin;
162    public double YMin {
163      get { return yMin; }
164    }
165    private double yMax;
166    public double YMax {
167      get { return yMax; }
168    }
169
170    private VerticalLineAnnotation VerticalLineAnnotation {
171      get { return (VerticalLineAnnotation)chart.Annotations.SingleOrDefault(x => x is VerticalLineAnnotation); }
172    }
173
174    internal ElementPosition InnerPlotPosition {
175      get { return chart.ChartAreas[0].InnerPlotPosition; }
176    }
177    #endregion
178
179    public GradientChart() {
180      InitializeComponent();
181
182      solutions = new List<IRegressionSolution>();
183      seriesCache = new Dictionary<IRegressionSolution, Series>();
184      ciSeriesCache = new Dictionary<IRegressionSolution, Series>();
185
186      // Configure axis
187      chart.CustomizeAllChartAreas();
188      chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
189      chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
190      chart.ChartAreas[0].CursorX.Interval = 0;
191
192      chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
193      chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
194      chart.ChartAreas[0].CursorY.Interval = 0;
195
196      configToolStripMenuItem = new ToolStripMenuItem("Configuration");
197      configToolStripMenuItem.Click += config_Click;
198      chart.ContextMenuStrip.Items.Add(new ToolStripSeparator());
199      chart.ContextMenuStrip.Items.Add(configToolStripMenuItem);
200
201      configurationDialog = new GradientChartConfigurationDialog(this);
202
203      Disposed += GradientChart_Disposed;
204    }
205
206    private void GradientChart_Disposed(object sender, EventArgs e) {
207      if (cancelCurrentRecalculateSource != null)
208        cancelCurrentRecalculateSource.Cancel();
209    }
210
211    public void Configure(IEnumerable<IRegressionSolution> solutions, ModifiableDataset sharedFixedVariables, string freeVariable, int drawingSteps, bool initializeAxisRanges = true) {
212      if (!SolutionsCompatible(solutions))
213        throw new ArgumentException("Solutions are not compatible with the problem data.");
214      this.freeVariable = freeVariable;
215      this.drawingSteps = drawingSteps;
216
217      this.solutions.Clear();
218      this.solutions.AddRange(solutions);
219
220      // add an event such that whenever a value is changed in the shared dataset,
221      // this change is reflected in the internal dataset (where the value becomes a whole column)
222      if (this.sharedFixedVariables != null)
223        this.sharedFixedVariables.ItemChanged -= sharedFixedVariables_ItemChanged;
224      this.sharedFixedVariables = sharedFixedVariables;
225      this.sharedFixedVariables.ItemChanged += sharedFixedVariables_ItemChanged;
226
227      RecalculateTrainingLimits(initializeAxisRanges);
228      RecalculateInternalDataset();
229
230      chart.Series.Clear();
231      seriesCache.Clear();
232      ciSeriesCache.Clear();
233      foreach (var solution in this.solutions) {
234        var series = CreateSeries(solution);
235        seriesCache.Add(solution, series.Item1);
236        if (series.Item2 != null)
237          ciSeriesCache.Add(solution, series.Item2);
238      }
239
240      ResizeAllSeriesData();
241      OrderAndColorSeries();
242    }
243
244    public async Task RecalculateAsync(bool updateOnFinish = true, bool resetYAxis = true) {
245      if (IsDisposed
246        || sharedFixedVariables == null || !solutions.Any() || string.IsNullOrEmpty(freeVariable)
247        || trainingMin.IsAlmost(trainingMax) || trainingMin > trainingMax || drawingSteps == 0)
248        return;
249
250      calculationPendingTimer.Start();
251
252      Update(); // immediately show label
253
254      // cancel previous recalculate call
255      if (cancelCurrentRecalculateSource != null)
256        cancelCurrentRecalculateSource.Cancel();
257      cancelCurrentRecalculateSource = new CancellationTokenSource();
258
259      // Set cursor and x-axis
260      var defaultValue = sharedFixedVariables.GetDoubleValue(freeVariable, 0);
261      VerticalLineAnnotation.X = defaultValue;
262      if (ShowCursor)
263        chart.ChartAreas[0].AxisX.Title = FreeVariable + " : " + defaultValue.ToString("N3", CultureInfo.CurrentCulture);
264
265      // Update series
266      var cancellationToken = cancelCurrentRecalculateSource.Token;
267      try {
268        var limits = await UpdateAllSeriesDataAsync(cancellationToken);
269        //cancellationToken.ThrowIfCancellationRequested();
270
271        yMin = limits.Lower;
272        yMax = limits.Upper;
273        // Set y-axis
274        if (resetYAxis)
275          SetupAxis(chart.ChartAreas[0].AxisY, yMin, yMax, YAxisTicks, FixedYAxisMin, FixedYAxisMax);
276
277        UpdateOutOfTrainingRangeStripLines();
278
279        calculationPendingTimer.Stop();
280        calculationPendingLabel.Visible = false;
281        if (updateOnFinish)
282          Update();
283      }
284      catch (OperationCanceledException) { }
285      catch (AggregateException ae) {
286        if (!ae.InnerExceptions.Any(e => e is OperationCanceledException))
287          throw;
288      }
289    }
290
291    private void SetupAxis(Axis axis, double minValue, double maxValue, int ticks, double? fixedAxisMin, double? fixedAxisMax) {
292      double axisMin, axisMax, axisInterval;
293      ChartUtil.CalculateAxisInterval(minValue, maxValue, ticks, out axisMin, out axisMax, out axisInterval);
294      axis.Minimum = fixedAxisMin ?? axisMin;
295      axis.Maximum = fixedAxisMax ?? axisMax;
296      axis.Interval = (axis.Maximum - axis.Minimum) / ticks;
297
298      try {
299        chart.ChartAreas[0].RecalculateAxesScale();
300      }
301      catch (InvalidOperationException) {
302        // Can occur if eg. axis min == axis max
303      }
304    }
305
306    private void RecalculateTrainingLimits(bool initializeAxisRanges) {
307      trainingMin = solutions.Select(s => s.ProblemData.Dataset.GetDoubleValues(freeVariable, s.ProblemData.TrainingIndices).Min()).Max();
308      trainingMax = solutions.Select(s => s.ProblemData.Dataset.GetDoubleValues(freeVariable, s.ProblemData.TrainingIndices).Max()).Min();
309
310      if (initializeAxisRanges) {
311        double xmin, xmax, xinterval;
312        ChartUtil.CalculateAxisInterval(trainingMin, trainingMax, XAxisTicks, out xmin, out xmax, out xinterval);
313        FixedXAxisMin = xmin;
314        FixedXAxisMax = xmax;
315      }
316    }
317
318    private void RecalculateInternalDataset() {
319      if (sharedFixedVariables == null)
320        return;
321
322      // we expand the range in order to get nice tick intervals on the x axis
323      double xmin, xmax, xinterval;
324      ChartUtil.CalculateAxisInterval(trainingMin, trainingMax, XAxisTicks, out xmin, out xmax, out xinterval);
325
326      if (FixedXAxisMin.HasValue) xmin = FixedXAxisMin.Value;
327      if (FixedXAxisMax.HasValue) xmax = FixedXAxisMax.Value;
328      double step = (xmax - xmin) / drawingSteps;
329
330      var xvalues = new List<double>();
331      for (int i = 0; i < drawingSteps; i++)
332        xvalues.Add(xmin + i * step);
333
334      var variables = sharedFixedVariables.DoubleVariables.ToList();
335      internalDataset = new ModifiableDataset(variables,
336        variables.Select(x => x == FreeVariable
337          ? xvalues
338          : Enumerable.Repeat(sharedFixedVariables.GetDoubleValue(x, 0), xvalues.Count).ToList()
339        )
340      );
341    }
342
343    private Tuple<Series, Series> CreateSeries(IRegressionSolution solution) {
344      var series = new Series {
345        ChartType = SeriesChartType.Line,
346        Name = solution.ProblemData.TargetVariable + " " + solutions.IndexOf(solution)
347      };
348      series.LegendText = series.Name;
349
350      var confidenceBoundSolution = solution as IConfidenceBoundRegressionSolution;
351      Series confidenceIntervalSeries = null;
352      if (confidenceBoundSolution != null) {
353        confidenceIntervalSeries = new Series {
354          ChartType = SeriesChartType.Range,
355          YValuesPerPoint = 2,
356          Name = "95% Conf. Interval " + series.Name,
357          IsVisibleInLegend = false
358        };
359      }
360      return Tuple.Create(series, confidenceIntervalSeries);
361    }
362
363    private void OrderAndColorSeries() {
364      chart.SuspendRepaint();
365
366      chart.Series.Clear();
367      // Add mean series for applying palette colors
368      foreach (var solution in solutions) {
369        chart.Series.Add(seriesCache[solution]);
370      }
371
372      chart.Palette = ChartColorPalette.BrightPastel;
373      chart.ApplyPaletteColors();
374      chart.Palette = ChartColorPalette.None;
375
376      // Add confidence interval series before its coresponding series for correct z index
377      foreach (var solution in solutions) {
378        Series ciSeries;
379        if (ciSeriesCache.TryGetValue(solution, out ciSeries)) {
380          var series = seriesCache[solution];
381          ciSeries.Color =  Color.FromArgb(40, series.Color);
382          int idx = chart.Series.IndexOf(seriesCache[solution]);
383          chart.Series.Insert(idx, ciSeries);
384        }
385      }
386
387      chart.ResumeRepaint(true);
388    }
389
390    private async Task<DoubleLimit> UpdateAllSeriesDataAsync(CancellationToken cancellationToken) {
391      var updateTasks = solutions.Select(solution => UpdateSeriesDataAsync(solution, cancellationToken));
392
393      double min = double.MaxValue, max = double.MinValue;
394      foreach (var update in updateTasks) {
395        var limit = await update;
396        if (limit.Lower < min) min = limit.Lower;
397        if (limit.Upper > max) max = limit.Upper;
398      }
399
400      return new DoubleLimit(min, max);
401    }
402
403    private Task<DoubleLimit> UpdateSeriesDataAsync(IRegressionSolution solution, CancellationToken cancellationToken) {
404      return Task.Run(() => {
405        var xvalues = internalDataset.GetDoubleValues(FreeVariable).ToList();
406        var yvalues = solution.Model.GetEstimatedValues(internalDataset, Enumerable.Range(0, internalDataset.Rows)).ToList();
407
408        double min = double.MaxValue, max = double.MinValue;
409
410        var series = seriesCache[solution];
411        for (int i = 0; i < xvalues.Count; i++) {
412          series.Points[i].SetValueXY(xvalues[i], yvalues[i]);
413          if (yvalues[i] < min) min = yvalues[i];
414          if (yvalues[i] > max) max = yvalues[i];
415        }
416
417        var confidenceBoundSolution = solution as IConfidenceBoundRegressionSolution;
418        if (confidenceBoundSolution != null) {
419          var confidenceIntervalSeries = ciSeriesCache[solution];
420
421          cancellationToken.ThrowIfCancellationRequested();
422          var variances =
423            confidenceBoundSolution.Model.GetEstimatedVariances(internalDataset,
424              Enumerable.Range(0, internalDataset.Rows)).ToList();
425          for (int i = 0; i < xvalues.Count; i++) {
426            var lower = yvalues[i] - 1.96 * Math.Sqrt(variances[i]);
427            var upper = yvalues[i] + 1.96 * Math.Sqrt(variances[i]);
428            confidenceIntervalSeries.Points[i].SetValueXY(xvalues[i], lower, upper);
429            if (lower < min) min = lower;
430            if (upper > max) max = upper;
431          }
432        }
433
434        cancellationToken.ThrowIfCancellationRequested();
435        return new DoubleLimit(min, max);
436      }, cancellationToken);
437    }
438
439    private void ResizeAllSeriesData() {
440      if (internalDataset == null)
441        return;
442
443      var xvalues = internalDataset.GetDoubleValues(FreeVariable).ToList();
444      foreach (var solution in solutions)
445        ResizeSeriesData(solution, xvalues);
446    }
447    private void ResizeSeriesData(IRegressionSolution solution, IList<double> xvalues = null) {
448      if (xvalues == null)
449        xvalues = internalDataset.GetDoubleValues(FreeVariable).ToList();
450
451      var series = seriesCache[solution];
452      series.Points.SuspendUpdates();
453      series.Points.Clear();
454      for (int i = 0; i < xvalues.Count; i++)
455        series.Points.Add(new DataPoint(xvalues[i], 0.0));
456      series.Points.ResumeUpdates();
457
458      Series confidenceIntervalSeries;
459      if (ciSeriesCache.TryGetValue(solution, out confidenceIntervalSeries)) {
460        confidenceIntervalSeries.Points.SuspendUpdates();
461        confidenceIntervalSeries.Points.Clear();
462        for (int i = 0; i < xvalues.Count; i++)
463          confidenceIntervalSeries.Points.Add(new DataPoint(xvalues[i], new[] { -1.0, 1.0 }));
464        confidenceIntervalSeries.Points.ResumeUpdates();
465      }
466    }
467
468    public async Task AddSolutionAsync(IRegressionSolution solution) {
469      if (!SolutionsCompatible(solutions.Concat(new[] { solution })))
470        throw new ArgumentException("The solution is not compatible with the problem data.");
471      if (solutions.Contains(solution))
472        return;
473
474      solutions.Add(solution);
475      RecalculateTrainingLimits(true);
476
477      var series = CreateSeries(solution);
478      seriesCache.Add(solution, series.Item1);
479      if (series.Item2 != null)
480        ciSeriesCache.Add(solution, series.Item2);
481
482      ResizeSeriesData(solution);
483      OrderAndColorSeries();
484
485      await RecalculateAsync();
486    }
487    public async Task RemoveSolutionAsync(IRegressionSolution solution) {
488      if (!solutions.Remove(solution))
489        return;
490
491      RecalculateTrainingLimits(true);
492
493      seriesCache.Remove(solution);
494      ciSeriesCache.Remove(solution);
495
496      await RecalculateAsync();
497    }
498
499    private static bool SolutionsCompatible(IEnumerable<IRegressionSolution> solutions) {
500      foreach (var solution1 in solutions) {
501        var variables1 = solution1.ProblemData.Dataset.DoubleVariables;
502        foreach (var solution2 in solutions) {
503          if (solution1 == solution2)
504            continue;
505          var variables2 = solution2.ProblemData.Dataset.DoubleVariables;
506          if (!variables1.All(variables2.Contains))
507            return false;
508        }
509      }
510      return true;
511    }
512
513    private void UpdateOutOfTrainingRangeStripLines() {
514      var axisX = chart.ChartAreas[0].AxisX;
515      var lowerStripLine = axisX.StripLines[0];
516      var upperStripLine = axisX.StripLines[1];
517
518      lowerStripLine.IntervalOffset = axisX.Minimum;
519      lowerStripLine.StripWidth = trainingMin - axisX.Minimum;
520
521      upperStripLine.IntervalOffset = trainingMax;
522      upperStripLine.StripWidth = axisX.Maximum - trainingMax;
523    }
524
525    #region Events
526    public event EventHandler VariableValueChanged;
527    public void OnVariableValueChanged(object sender, EventArgs args) {
528      var changed = VariableValueChanged;
529      if (changed == null) return;
530      changed(sender, args);
531    }
532
533    private void sharedFixedVariables_ItemChanged(object o, EventArgs<int, int> e) {
534      if (o != sharedFixedVariables) return;
535      var variables = sharedFixedVariables.DoubleVariables.ToList();
536      var rowIndex = e.Value;
537      var columnIndex = e.Value2;
538
539      var variableName = variables[columnIndex];
540      if (variableName == FreeVariable) return;
541      var v = sharedFixedVariables.GetDoubleValue(variableName, rowIndex);
542      var values = new List<double>(Enumerable.Repeat(v, DrawingSteps));
543      internalDataset.ReplaceVariable(variableName, values);
544    }
545
546    private double oldCurserPosition = double.NaN;
547    private void chart_AnnotationPositionChanging(object sender, AnnotationPositionChangingEventArgs e) {
548      var step = (trainingMax - trainingMin) / drawingSteps;
549      double newLocation = step * (long)Math.Round(e.NewLocationX / step);
550      var axisX = chart.ChartAreas[0].AxisX;
551      if (newLocation > axisX.Maximum)
552        newLocation = axisX.Maximum;
553      if (newLocation < axisX.Minimum)
554        newLocation = axisX.Minimum;
555
556      if (oldCurserPosition.IsAlmost(newLocation))
557        return;
558
559      e.NewLocationX = newLocation;
560      oldCurserPosition = e.NewLocationX;
561
562      var annotation = VerticalLineAnnotation;
563      var x = annotation.X;
564      sharedFixedVariables.SetVariableValue(x, FreeVariable, 0);
565
566      if (ShowCursor) {
567        chart.ChartAreas[0].AxisX.Title = FreeVariable + " : " + x.ToString("N3", CultureInfo.CurrentCulture);
568        chart.Update();
569      }
570
571      OnVariableValueChanged(this, EventArgs.Empty);
572    }
573
574    private void chart_MouseMove(object sender, MouseEventArgs e) {
575      bool hitCursor = chart.HitTest(e.X, e.Y).ChartElementType == ChartElementType.Annotation;
576      chart.Cursor = hitCursor ? Cursors.VSplit : Cursors.Default;
577    }
578
579    private void chart_DragDrop(object sender, DragEventArgs e) {
580      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
581      if (data != null) {
582        var solution = data as IRegressionSolution;
583        if (!solutions.Contains(solution))
584          AddSolutionAsync(solution);
585      }
586    }
587    private void chart_DragEnter(object sender, DragEventArgs e) {
588      if (!e.Data.GetDataPresent(HeuristicLab.Common.Constants.DragDropDataFormat)) return;
589      e.Effect = DragDropEffects.None;
590
591      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
592      var regressionSolution = data as IRegressionSolution;
593      if (regressionSolution != null) {
594        e.Effect = DragDropEffects.Copy;
595      }
596    }
597
598    private void calculationPendingTimer_Tick(object sender, EventArgs e) {
599      calculationPendingLabel.Visible = true;
600      Update();
601    }
602
603    private void config_Click(object sender, EventArgs e) {
604      configurationDialog.ShowDialog(this);
605    }
606    #endregion
607  }
608}
Note: See TracBrowser for help on using the repository browser.