Changeset 10173


Ignore:
Timestamp:
12/02/13 14:58:17 (6 years ago)
Author:
mkommend
Message:

#1758: Extended the drap and drop functionality of DataAnalysisSolutionViews to allow dropping the problem itself in addition to the problem data.

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs

    r9456 r10173  
    4747        var droppedData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    4848        if (droppedData is IValueParameter) droppedData = ((IValueParameter)droppedData).Value;
     49        else if (droppedData is IClassificationProblem) droppedData = ((IClassificationProblem)droppedData).ProblemData;
    4950
    5051        ClassificationEnsembleProblemData ensembleProblemData = droppedData as ClassificationEnsembleProblemData;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs

    r9456 r10173  
    4343
    4444      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    45       if (dropData is ClassificationProblemData) validDragOperation = true;
     45      if (dropData is IClassificationProblemData) validDragOperation = true;
     46      else if (dropData is IClassificationProblem) validDragOperation = true;
    4647      else if (dropData is IValueParameter) {
    4748        var param = (IValueParameter)dropData;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs

    r9456 r10173  
    4343
    4444      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    45       if (dropData is ClusteringProblemData) validDragOperation = true;
     45      if (dropData is IClusteringProblemData) validDragOperation = true;
     46      else if (dropData is IClusteringProblem) validDragOperation = true;
    4647      else if (dropData is IValueParameter) {
    4748        var param = (IValueParameter)dropData;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs

    r9974 r10173  
    197197      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    198198      if (dropData is DataAnalysisProblemData) validDragOperation = true;
     199      else if (dropData is IDataAnalysisProblem) validDragOperation = true;
    199200      else if (dropData is IValueParameter) {
    200201        var param = (IValueParameter)dropData;
    201         if (param.Value is DataAnalysisProblemData) validDragOperation = true;
     202        if (param.Value is IDataAnalysisProblemData) validDragOperation = true;
    202203      }
    203204    }
     
    206207      if (e.Effect != DragDropEffects.None) {
    207208        var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    208         if (dropData is DataAnalysisProblemData) {
     209        if (dropData is IDataAnalysisProblemData) {
    209210          DataAnalysisProblemData problemData = (DataAnalysisProblemData)dropData;
    210211          Content.ProblemData = (DataAnalysisProblemData)problemData.Clone();
     212        } else if (dropData is IDataAnalysisProblem) {
     213          IDataAnalysisProblemData problemData = ((IDataAnalysisProblem)dropData).ProblemData;
     214          Content.ProblemData = (IDataAnalysisProblemData)problemData.Clone();
    211215        } else if (dropData is IValueParameter) {
    212216          var param = (IValueParameter)dropData;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs

    r9456 r10173  
    4747        var droppedData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    4848        if (droppedData is IValueParameter) droppedData = ((IValueParameter)droppedData).Value;
     49        if (droppedData is IRegressionProblem) droppedData = ((IRegressionProblem)droppedData).ProblemData;
    4950
    5051        RegressionEnsembleProblemData ensembleProblemData = droppedData as RegressionEnsembleProblemData;
    51         RegressionProblemData problemData = droppedData as RegressionProblemData;
     52        IRegressionProblemData problemData = droppedData as IRegressionProblemData;
    5253        if (ensembleProblemData != null) {
    5354          Content.ProblemData = (RegressionEnsembleProblemData)ensembleProblemData.Clone();
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs

    r9456 r10173  
    4343
    4444      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    45       if (dropData is RegressionProblemData) validDragOperation = true;
     45      if (dropData is IRegressionProblemData) validDragOperation = true;
     46      else if (dropData is IRegressionProblem) validDragOperation = true;
    4647      else if (dropData is IValueParameter) {
    4748        var param = (IValueParameter)dropData;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.cs

    r9456 r10173  
    4444      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    4545      if (dropData is ITimeSeriesPrognosisProblemData) validDragOperation = true;
     46      else if (dropData is ITimeSeriesPrognosisProblem) validDragOperation = true;
    4647      else if (dropData is IValueParameter) {
    4748        var param = (IValueParameter)dropData;
Note: See TracChangeset for help on using the changeset viewer.