source: branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.cs @ 14488

Last change on this file since 14488 was 14488, checked in by jzenisek, 6 years ago

#2719 initializing ticket: adding optimizer + views for datastream analysis

File size: 3.5 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.Windows.Forms;
24using HeuristicLab.MainForm;
25using HeuristicLab.Optimization;
26using HeuristicLab.Optimization.Views;
27using HeuristicLab.Problems.DataAnalysis;
28
29namespace HeuristicLab.DatastreamAnalysis {
30  [View("DatastreamAnalysisOptimizer View", "")]
31  [Content(typeof(DatastreamAnalysisOptimizer), true)]
32  public partial class DatastreamAnalysisOptimizerView : IOptimizerView {
33    public DatastreamAnalysisOptimizerView() {
34      InitializeComponent();
35      Content = new DatastreamAnalysisOptimizer();
36    }
37
38    public new DatastreamAnalysisOptimizer Content {
39      get { return (DatastreamAnalysisOptimizer)base.Content; }
40      set { base.Content = value; }
41    }
42
43    protected override void OnContentChanged() {
44      base.OnContentChanged();
45      if (Content == null)
46        return;
47
48      // TODO
49    }
50
51    protected override void RegisterContentEvents() {
52      base.RegisterContentEvents();
53
54      // TODO
55    }
56
57    protected override void DeregisterContentEvents() {
58      base.DeregisterContentEvents();
59    }
60
61    #region event handlers
62
63    private void ensemblesTab_DragDrop(object sender, DragEventArgs e) {
64      if (e.Data.GetDataPresent(HeuristicLab.Common.Constants.DragDropDataFormat)) {
65        try {
66          // TODO
67        }
68        catch (Exception ex) {
69          MessageBox.Show(ex.Message, "Set ensembles", MessageBoxButtons.OK, MessageBoxIcon.Error);
70        }
71      }
72    }
73
74    private void ensemblesTab_DragEnter(object sender, DragEventArgs e) {
75      e.Effect = DragDropEffects.None;
76      if (!e.Data.GetDataPresent(HeuristicLab.Common.Constants.DragDropDataFormat))
77        return;
78
79      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
80
81      // TODO: check if data is taggedEnsembles-data
82      if(data is IRegressionEnsembleModel)
83        e.Effect = DragDropEffects.Copy;
84    }
85
86    private void datastreamTab_DragDrop(object sender, DragEventArgs e) {
87      if (e.Data.GetDataPresent(HeuristicLab.Common.Constants.DragDropDataFormat)) {
88        try {
89          // TODO
90        }
91        catch (Exception ex) {
92          MessageBox.Show(ex.Message, "Set datastream", MessageBoxButtons.OK, MessageBoxIcon.Error);
93        }
94      }
95    }
96
97    private void datastreamTab_DragEnter(object sender, DragEventArgs e) {
98      e.Effect = DragDropEffects.None;
99      if (!e.Data.GetDataPresent(HeuristicLab.Common.Constants.DragDropDataFormat))
100        return;
101
102      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
103      if (data is IRegressionProblemData)
104        e.Effect = DragDropEffects.Copy;
105    }
106
107    #endregion event handlers
108  }
109}
Note: See TracBrowser for help on using the repository browser.