Changeset 10175 for trunk/sources
- Timestamp:
- 12/02/13 17:18:26 (11 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs
r10173 r10175 37 37 } 38 38 39 protected override void SetEnabledStateOfControls() { 40 base.SetEnabledStateOfControls(); 41 //loading of problemdata is currently not support for ensemble solutions 42 loadProblemDataButton.Enabled = false; 43 loadProblemDataButton.Visible = false; 44 } 45 39 46 protected override void OnContentChanged() { 40 47 base.OnContentChanged(); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs
r10174 r10175 22 22 using System; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.MainForm; … … 55 56 56 57 protected override bool CheckCompatibilityOfProblemData(IDataAnalysisProblemData problemData) { 57 IClassificationProblemData classificationProblemData = (IClassificationProblemData)problemData; 58 IClassificationProblemData classificationProblemData = problemData as IClassificationProblemData; 59 if (classificationProblemData == null) { 60 ErrorHandling.ShowErrorDialog(this, new ArgumentException("The problem data is no classification problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.")); 61 return false; 62 } 58 63 59 64 if (!classificationProblemData.TargetVariable.Equals(Content.ProblemData.TargetVariable)) { -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.Designer.cs
r9973 r10175 19 19 */ 20 20 #endregion 21 22 21 23 namespace HeuristicLab.Problems.DataAnalysis.Views { 22 24 partial class DataAnalysisSolutionView { … … 46 48 this.exportButton = new System.Windows.Forms.Button(); 47 49 this.exportFileDialog = new System.Windows.Forms.SaveFileDialog(); 50 this.loadProblemDataButton = new System.Windows.Forms.Button(); 51 this.loadProblemDataFileDialog = new System.Windows.Forms.OpenFileDialog(); 48 52 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 49 53 this.splitContainer.Panel1.SuspendLayout(); … … 59 63 // splitContainer.Panel2 60 64 // 65 this.splitContainer.Panel2.Controls.Add(this.loadProblemDataButton); 61 66 this.splitContainer.Panel2.Controls.Add(this.exportButton); 62 67 // … … 76 81 // 77 82 this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 78 this.exportButton.Location = new System.Drawing.Point( 215, 4);83 this.exportButton.Location = new System.Drawing.Point(194, 3); 79 84 this.exportButton.Name = "exportButton"; 80 this.exportButton.Size = new System.Drawing.Size( 54, 23);85 this.exportButton.Size = new System.Drawing.Size(75, 24); 81 86 this.exportButton.TabIndex = 6; 82 87 this.exportButton.Text = "Export"; 83 88 this.exportButton.UseVisualStyleBackColor = true; 84 89 this.exportButton.Click += new System.EventHandler(this.exportButton_Click); 90 // 91 // loadProblemDataButton 92 // 93 this.loadProblemDataButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); 94 this.loadProblemDataButton.Location = new System.Drawing.Point(3, 3); 95 this.loadProblemDataButton.Name = "loadProblemDataButton"; 96 this.loadProblemDataButton.Size = new System.Drawing.Size(75, 24); 97 this.loadProblemDataButton.TabIndex = 7; 98 this.loadProblemDataButton.Text = "Load Data"; 99 this.loadProblemDataButton.UseVisualStyleBackColor = true; 100 this.loadProblemDataButton.Click += new System.EventHandler(this.loadProblemDataButton_Click); 101 this.toolTip.SetToolTip(this.loadProblemDataButton, "Load new data"); 102 // 103 // openFileDialog 104 // 105 this.loadProblemDataFileDialog.Filter = "HL files|*.hl"; 106 this.loadProblemDataFileDialog.Title = "Load new ProblemData or Problem..."; 85 107 // 86 108 // DataAnalysisSolutionView … … 102 124 private System.Windows.Forms.SaveFileDialog exportFileDialog; 103 125 protected System.Windows.Forms.Button exportButton; 126 protected System.Windows.Forms.Button loadProblemDataButton; 127 protected System.Windows.Forms.OpenFileDialog loadProblemDataFileDialog; 104 128 105 129 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs
r10174 r10175 32 32 using HeuristicLab.Optimization; 33 33 using HeuristicLab.Optimization.Views; 34 using HeuristicLab.Persistence.Default.Xml; 34 35 using HeuristicLab.PluginInfrastructure; 35 36 … … 55 56 if (Content == null) { 56 57 exportButton.Enabled = false; 58 loadProblemDataButton.Enabled = false; 57 59 } else { 58 60 exportButton.Enabled = !Locked; 61 loadProblemDataButton.Enabled = !Locked; 59 62 } 60 63 } … … 128 131 } 129 132 133 protected virtual void loadProblemDataButton_Click(object sender, EventArgs e) { 134 if (loadProblemDataFileDialog.ShowDialog(this) != DialogResult.OK) return; 135 object hlFile = XmlParser.Deserialize(loadProblemDataFileDialog.FileName); 136 137 IDataAnalysisProblemData problemData = null; 138 if (hlFile is IDataAnalysisProblemData) { 139 problemData = (IDataAnalysisProblemData)hlFile; 140 } else if (hlFile is IDataAnalysisProblem) { 141 problemData = ((IDataAnalysisProblem)hlFile).ProblemData; 142 } else if (hlFile is IDataAnalysisSolution) { 143 problemData = ((IDataAnalysisSolution)hlFile).ProblemData; 144 } 145 146 if (problemData == null) { 147 ErrorHandling.ShowErrorDialog(this, new NullReferenceException("The problem data is null." + Environment.NewLine 148 + "The .hl-file contains no DataAnalysisProblemData or DataAnylsisProblem.")); 149 return; 150 } 151 152 if (CheckCompatibilityOfProblemData(problemData)) { 153 var solution = (IDataAnalysisSolution)Content.Clone(); 154 solution.ProblemData = problemData; 155 solution.Name += " with loaded problem data (" + loadProblemDataFileDialog + ")"; 156 MainFormManager.MainForm.ShowContent(solution); 157 } 158 } 130 159 131 160 private void exportButton_Click(object sender, EventArgs e) { -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs
r10173 r10175 32 32 } 33 33 34 protected override void SetEnabledStateOfControls() { 35 base.SetEnabledStateOfControls(); 36 //loading of problemdata is currently not support for ensemble solutions 37 loadProblemDataButton.Enabled = false; 38 loadProblemDataButton.Visible = false; 39 } 40 34 41 public new RegressionEnsembleSolution Content { 35 42 get { return (RegressionEnsembleSolution)base.Content; } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs
r10174 r10175 22 22 using System; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.MainForm; … … 55 56 56 57 protected override bool CheckCompatibilityOfProblemData(IDataAnalysisProblemData problemData) { 57 IRegressionProblemData regressionProblemData = (IRegressionProblemData)problemData; 58 IRegressionProblemData regressionProblemData = problemData as IRegressionProblemData; 59 if (regressionProblemData == null) { 60 ErrorHandling.ShowErrorDialog(this, new ArgumentException("The problem data is no regression problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.")); 61 return false; 62 } 58 63 59 64 if (!regressionProblemData.TargetVariable.Equals(Content.ProblemData.TargetVariable)) {
Note: See TracChangeset
for help on using the changeset viewer.