- Timestamp:
- 07/03/12 16:46:35 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:mergeinfo changed
/trunk/sources merged: 8084,8088-8090,8092-8100,8102-8113,8115,8117-8132,8134-8146,8148-8156,8158-8160,8163-8170,8173-8176,8178-8190,8192-8205
- Property svn:mergeinfo changed
-
branches/GP-MoveOperators/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceConsumerViewGeneric.Designer.cs
r7967 r8206 55 55 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 56 56 this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); 57 this.problemInstanceProviderSplitContainer = new System.Windows.Forms.SplitContainer(); 58 ((System.ComponentModel.ISupportInitialize)(this.problemInstanceProviderSplitContainer)).BeginInit(); 59 this.problemInstanceProviderSplitContainer.Panel1.SuspendLayout(); 60 this.problemInstanceProviderSplitContainer.Panel2.SuspendLayout(); 61 this.problemInstanceProviderSplitContainer.SuspendLayout(); 57 this.ProviderExportSplitContainer = new System.Windows.Forms.SplitContainer(); 58 this.ProviderImportSplitContainer = new System.Windows.Forms.SplitContainer(); 59 ((System.ComponentModel.ISupportInitialize)(this.ProviderExportSplitContainer)).BeginInit(); 60 this.ProviderExportSplitContainer.Panel1.SuspendLayout(); 61 this.ProviderExportSplitContainer.Panel2.SuspendLayout(); 62 this.ProviderExportSplitContainer.SuspendLayout(); 63 ((System.ComponentModel.ISupportInitialize)(this.ProviderImportSplitContainer)).BeginInit(); 64 this.ProviderImportSplitContainer.Panel1.SuspendLayout(); 65 this.ProviderImportSplitContainer.Panel2.SuspendLayout(); 66 this.ProviderImportSplitContainer.SuspendLayout(); 62 67 this.SuspendLayout(); 63 68 // 64 69 // problemInstanceProviderComboBox 65 70 // 66 this.problemInstanceProviderComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 67 | System.Windows.Forms.AnchorStyles.Right)));71 this.problemInstanceProviderComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 72 | System.Windows.Forms.AnchorStyles.Right))); 68 73 this.problemInstanceProviderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 69 74 this.problemInstanceProviderComboBox.FormattingEnabled = true; 70 75 this.problemInstanceProviderComboBox.Location = new System.Drawing.Point(50, 1); 71 76 this.problemInstanceProviderComboBox.Name = "problemInstanceProviderComboBox"; 72 this.problemInstanceProviderComboBox.Size = new System.Drawing.Size(17 1, 21);77 this.problemInstanceProviderComboBox.Size = new System.Drawing.Size(174, 21); 73 78 this.problemInstanceProviderComboBox.TabIndex = 16; 74 79 this.problemInstanceProviderComboBox.SelectedIndexChanged += new System.EventHandler(this.problemInstanceProviderComboBox_SelectedIndexChanged); … … 77 82 // 78 83 this.libraryInfoButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 79 this.libraryInfoButton.Location = new System.Drawing.Point(2 27, -1);84 this.libraryInfoButton.Location = new System.Drawing.Point(230, -1); 80 85 this.libraryInfoButton.Name = "libraryInfoButton"; 81 86 this.libraryInfoButton.Size = new System.Drawing.Size(24, 24); … … 88 93 // 89 94 this.libraryLabel.AutoSize = true; 90 this.libraryLabel.Location = new System.Drawing.Point( 4, 4);95 this.libraryLabel.Location = new System.Drawing.Point(3, 5); 91 96 this.libraryLabel.Name = "libraryLabel"; 92 97 this.libraryLabel.Size = new System.Drawing.Size(41, 13); … … 96 101 // problemInstanceProviderViewHost 97 102 // 98 this.problemInstanceProviderViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 99 | System.Windows.Forms.AnchorStyles.Right)));103 this.problemInstanceProviderViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 104 | System.Windows.Forms.AnchorStyles.Right))); 100 105 this.problemInstanceProviderViewHost.Caption = "View"; 101 106 this.problemInstanceProviderViewHost.Content = null; … … 112 117 // 113 118 this.importButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 114 this.importButton.Location = new System.Drawing.Point( 257, -1);119 this.importButton.Location = new System.Drawing.Point(1, -1); 115 120 this.importButton.Name = "importButton"; 116 121 this.importButton.Size = new System.Drawing.Size(24, 24); … … 140 145 this.saveFileDialog.Title = "Save RegressionInstance..."; 141 146 // 142 // problemInstanceProviderSplitContainer 143 // 144 this.problemInstanceProviderSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; 145 this.problemInstanceProviderSplitContainer.IsSplitterFixed = true; 146 this.problemInstanceProviderSplitContainer.Location = new System.Drawing.Point(0, 0); 147 this.problemInstanceProviderSplitContainer.Name = "problemInstanceProviderSplitContainer"; 148 // 149 // problemInstanceProviderSplitContainer.Panel1 150 // 151 this.problemInstanceProviderSplitContainer.Panel1.Controls.Add(this.problemInstanceProviderComboBox); 152 this.problemInstanceProviderSplitContainer.Panel1.Controls.Add(this.importButton); 153 this.problemInstanceProviderSplitContainer.Panel1.Controls.Add(this.libraryLabel); 154 this.problemInstanceProviderSplitContainer.Panel1.Controls.Add(this.libraryInfoButton); 155 // 156 // problemInstanceProviderSplitContainer.Panel2 157 // 158 this.problemInstanceProviderSplitContainer.Panel2.Controls.Add(this.exportButton); 159 this.problemInstanceProviderSplitContainer.Size = new System.Drawing.Size(312, 22); 160 this.problemInstanceProviderSplitContainer.SplitterDistance = 280; 161 this.problemInstanceProviderSplitContainer.TabIndex = 20; 147 // ProviderExportSplitContainer 148 // 149 this.ProviderExportSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; 150 this.ProviderExportSplitContainer.IsSplitterFixed = true; 151 this.ProviderExportSplitContainer.Location = new System.Drawing.Point(0, 0); 152 this.ProviderExportSplitContainer.Name = "ProviderExportSplitContainer"; 153 // 154 // ProviderExportSplitContainer.Panel1 155 // 156 this.ProviderExportSplitContainer.Panel1.Controls.Add(this.ProviderImportSplitContainer); 157 // 158 // ProviderExportSplitContainer.Panel2 159 // 160 this.ProviderExportSplitContainer.Panel2.Controls.Add(this.exportButton); 161 this.ProviderExportSplitContainer.Size = new System.Drawing.Size(312, 22); 162 this.ProviderExportSplitContainer.SplitterDistance = 283; 163 this.ProviderExportSplitContainer.TabIndex = 20; 164 // 165 // ProviderImportSplitContainer 166 // 167 this.ProviderImportSplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 168 | System.Windows.Forms.AnchorStyles.Right))); 169 this.ProviderImportSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; 170 this.ProviderImportSplitContainer.IsSplitterFixed = true; 171 this.ProviderImportSplitContainer.Location = new System.Drawing.Point(0, 0); 172 this.ProviderImportSplitContainer.Name = "ProviderImportSplitContainer"; 173 // 174 // ProviderImportSplitContainer.Panel1 175 // 176 this.ProviderImportSplitContainer.Panel1.Controls.Add(this.libraryLabel); 177 this.ProviderImportSplitContainer.Panel1.Controls.Add(this.problemInstanceProviderComboBox); 178 this.ProviderImportSplitContainer.Panel1.Controls.Add(this.libraryInfoButton); 179 // 180 // ProviderImportSplitContainer.Panel2 181 // 182 this.ProviderImportSplitContainer.Panel2.Controls.Add(this.importButton); 183 this.ProviderImportSplitContainer.Size = new System.Drawing.Size(282, 23); 184 this.ProviderImportSplitContainer.SplitterDistance = 253; 185 this.ProviderImportSplitContainer.TabIndex = 21; 162 186 // 163 187 // ProblemInstanceConsumerViewGeneric 164 188 // 165 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);166 189 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 167 this.Controls.Add(this. problemInstanceProviderSplitContainer);190 this.Controls.Add(this.ProviderExportSplitContainer); 168 191 this.Controls.Add(this.problemInstanceProviderViewHost); 169 192 this.Name = "ProblemInstanceConsumerViewGeneric"; 170 this.problemInstanceProviderSplitContainer.Panel1.ResumeLayout(false); 171 this.problemInstanceProviderSplitContainer.Panel1.PerformLayout(); 172 this.problemInstanceProviderSplitContainer.Panel2.ResumeLayout(false); 173 ((System.ComponentModel.ISupportInitialize)(this.problemInstanceProviderSplitContainer)).EndInit(); 174 this.problemInstanceProviderSplitContainer.ResumeLayout(false); 193 this.ProviderExportSplitContainer.Panel1.ResumeLayout(false); 194 this.ProviderExportSplitContainer.Panel2.ResumeLayout(false); 195 ((System.ComponentModel.ISupportInitialize)(this.ProviderExportSplitContainer)).EndInit(); 196 this.ProviderExportSplitContainer.ResumeLayout(false); 197 this.ProviderImportSplitContainer.Panel1.ResumeLayout(false); 198 this.ProviderImportSplitContainer.Panel1.PerformLayout(); 199 this.ProviderImportSplitContainer.Panel2.ResumeLayout(false); 200 ((System.ComponentModel.ISupportInitialize)(this.ProviderImportSplitContainer)).EndInit(); 201 this.ProviderImportSplitContainer.ResumeLayout(false); 175 202 this.ResumeLayout(false); 176 203 … … 180 207 181 208 protected System.Windows.Forms.ComboBox problemInstanceProviderComboBox; 182 pr ivateSystem.Windows.Forms.Button libraryInfoButton;183 pr ivateSystem.Windows.Forms.Label libraryLabel;209 protected System.Windows.Forms.Button libraryInfoButton; 210 protected System.Windows.Forms.Label libraryLabel; 184 211 protected MainForm.WindowsForms.ViewHost problemInstanceProviderViewHost; 185 pr ivateSystem.Windows.Forms.ToolTip toolTip;186 pr ivateSystem.Windows.Forms.Button importButton;187 pr ivateSystem.Windows.Forms.Button exportButton;212 protected System.Windows.Forms.ToolTip toolTip; 213 protected System.Windows.Forms.Button importButton; 214 protected System.Windows.Forms.Button exportButton; 188 215 protected System.Windows.Forms.SaveFileDialog saveFileDialog; 189 216 protected System.Windows.Forms.OpenFileDialog openFileDialog; 190 private System.Windows.Forms.SplitContainer problemInstanceProviderSplitContainer; 217 protected System.Windows.Forms.SplitContainer ProviderExportSplitContainer; 218 protected System.Windows.Forms.SplitContainer ProviderImportSplitContainer; 191 219 } 192 220 } -
branches/GP-MoveOperators/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceConsumerViewGeneric.cs
r8031 r8206 92 92 problemInstanceProviderComboBox.Enabled = !ReadOnly && !Locked && Content != null && problemInstanceProviderComboBox.Items.Count > 0; 93 93 libraryInfoButton.Enabled = SelectedProvider != null && SelectedProvider.WebLink != null; 94 importButton.Enabled = !ReadOnly && !Locked && Content != null && Consumer != null; 95 exportButton.Enabled = !ReadOnly && !Locked && Content != null && Exporter != null; 96 problemInstanceProviderSplitContainer.Panel2Collapsed = !exportButton.Enabled; 94 importButton.Enabled = !ReadOnly && !Locked && Content != null && Consumer != null && 95 GenericSelectedProvider != null && GenericSelectedProvider.CanImportData; 96 ProviderImportSplitContainer.Panel2Collapsed = !importButton.Enabled; 97 exportButton.Enabled = !ReadOnly && !Locked && Content != null && Exporter != null && 98 GenericSelectedProvider != null && GenericSelectedProvider.CanExportData; 99 ProviderExportSplitContainer.Panel2Collapsed = !exportButton.Enabled; 97 100 } 98 101 … … 131 134 T instance = default(T); 132 135 try { 133 instance = GenericSelectedProvider. LoadData(openFileDialog.FileName);136 instance = GenericSelectedProvider.ImportData(openFileDialog.FileName); 134 137 } 135 138 catch (Exception ex) { … … 146 149 } 147 150 148 protected v oid exportButton_Click(object sender, EventArgs e) {151 protected virtual void exportButton_Click(object sender, EventArgs e) { 149 152 if (saveFileDialog.ShowDialog(this) == DialogResult.OK) { 150 153 try { 151 GenericSelectedProvider. SaveData(GenericExporter.Export(), saveFileDialog.FileName);154 GenericSelectedProvider.ExportData(GenericExporter.Export(), saveFileDialog.FileName); 152 155 } 153 156 catch (Exception ex) { … … 164 167 protected void SetTooltip() { 165 168 toolTip.SetToolTip(problemInstanceProviderComboBox, GetProviderToolTip()); 166 toolTip.SetToolTip(importButton, " Opena " + GetProblemType() + " problem from file.");169 toolTip.SetToolTip(importButton, "Import a " + GetProblemType() + " problem from file."); 167 170 toolTip.SetToolTip(exportButton, "Export currently loaded " + GetProblemType() + " problem to a file."); 168 171 if (SelectedProvider.WebLink != null) -
branches/GP-MoveOperators/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceProviderViewGeneric.Designer.cs
r8031 r8206 46 46 private void InitializeComponent() { 47 47 this.components = new System.ComponentModel.Container(); 48 this.loadButton = new System.Windows.Forms.Button();49 48 this.instanceLabel = new System.Windows.Forms.Label(); 50 49 this.instancesComboBox = new System.Windows.Forms.ComboBox(); 51 50 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 52 this.toolTip = new System.Windows.Forms.ToolTip(this.components);53 51 this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); 54 52 this.SuspendLayout(); 55 //56 // loadButton57 //58 this.loadButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));59 this.loadButton.Location = new System.Drawing.Point(667, -1);60 this.loadButton.Name = "loadButton";61 this.loadButton.Size = new System.Drawing.Size(24, 24);62 this.loadButton.TabIndex = 6;63 this.loadButton.Text = "Load";64 this.loadButton.UseVisualStyleBackColor = true;65 this.loadButton.Click += new System.EventHandler(this.loadButton_Click);66 53 // 67 54 // instanceLabel … … 76 63 // instancesComboBox 77 64 // 78 this.instancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 65 this.instancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 79 66 | System.Windows.Forms.AnchorStyles.Right))); 80 67 this.instancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; … … 82 69 this.instancesComboBox.Location = new System.Drawing.Point(60, 1); 83 70 this.instancesComboBox.Name = "instancesComboBox"; 84 this.instancesComboBox.Size = new System.Drawing.Size(6 01, 21);71 this.instancesComboBox.Size = new System.Drawing.Size(632, 21); 85 72 this.instancesComboBox.TabIndex = 7; 86 73 this.instancesComboBox.DataSourceChanged += new System.EventHandler(this.instancesComboBox_DataSourceChanged); 87 this.instancesComboBox.Select edIndexChanged += new System.EventHandler(this.instancesComboBox_SelectedIndexChanged);74 this.instancesComboBox.SelectionChangeCommitted += new System.EventHandler(instancesComboBox_SelectionChangeCommitted); 88 75 // 89 76 // openFileDialog … … 102 89 this.Controls.Add(this.instanceLabel); 103 90 this.Controls.Add(this.instancesComboBox); 104 this.Controls.Add(this.loadButton);105 91 this.Name = "ProblemInstanceProviderViewGeneric"; 106 92 this.Size = new System.Drawing.Size(694, 21); … … 109 95 110 96 } 111 112 97 #endregion 113 98 114 99 protected System.Windows.Forms.OpenFileDialog openFileDialog; 115 protected System.Windows.Forms.ToolTip toolTip;116 protected System.Windows.Forms.Button loadButton;117 100 protected System.Windows.Forms.Label instanceLabel; 118 101 protected System.Windows.Forms.ComboBox instancesComboBox; -
branches/GP-MoveOperators/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceProviderViewGeneric.cs
r8031 r8206 24 24 using System.Linq; 25 25 using System.Windows.Forms; 26 using HeuristicLab.Common.Resources;27 26 using HeuristicLab.MainForm; 28 27 using HeuristicLab.MainForm.WindowsForms; 28 using HeuristicLab.PluginInfrastructure; 29 29 30 30 namespace HeuristicLab.Problems.Instances.Views { … … 51 51 public ProblemInstanceProviderViewGeneric() { 52 52 InitializeComponent(); 53 loadButton.Text = String.Empty;54 loadButton.Image = VSImageLibrary.RefreshDocument;55 toolTip.SetToolTip(loadButton, "Load the selected problem.");56 53 } 57 54 … … 73 70 instanceLabel.Show(); 74 71 instancesComboBox.Show(); 75 loadButton.Show();76 72 } else { 77 73 instanceLabel.Hide(); 78 74 instancesComboBox.Hide(); 79 loadButton.Hide();80 75 } 81 76 } … … 84 79 base.SetEnabledStateOfControls(); 85 80 instancesComboBox.Enabled = !ReadOnly && !Locked && Content != null && GenericConsumer != null; 86 loadButton.Enabled = !ReadOnly && !Locked && Content != null && GenericConsumer != null && instancesComboBox.SelectedIndex >= 0;87 }88 89 protected virtual void loadButton_Click(object sender, EventArgs e) {90 var descriptor = (IDataDescriptor)instancesComboBox.SelectedItem;91 T instance = Content.LoadData(descriptor);92 try {93 GenericConsumer.Load(instance);94 }95 catch (Exception ex) {96 MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", descriptor.Name, Environment.NewLine + ex.Message), "Cannot load instance");97 }98 81 } 99 82 … … 104 87 } 105 88 106 private void instancesComboBox_SelectedIndexChanged(object sender, System.EventArgs e) { 107 SetEnabledStateOfControls(); 89 private void instancesComboBox_SelectionChangeCommitted(object sender, System.EventArgs e) { 90 if (instancesComboBox.SelectedIndex >= 0) { 91 var descriptor = (IDataDescriptor)instancesComboBox.SelectedItem; 92 T instance = Content.LoadData(descriptor); 93 try { 94 GenericConsumer.Load(instance); 95 } 96 catch (Exception ex) { 97 ErrorHandling.ShowErrorDialog(String.Format("This problem does not support loading the instance {0}", descriptor.Name), ex); 98 } 99 } 108 100 } 109 101 }
Note: See TracChangeset
for help on using the changeset viewer.