- Timestamp:
- 03/15/12 09:11:17 (12 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.QuadraticAssignment.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.QuadraticAssignment.Views merged: 7558
- Property svn:mergeinfo changed
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/HeuristicLab.Problems.QuadraticAssignment.Views-3.3.csproj
r7021 r7615 102 102 </PropertyGroup> 103 103 <ItemGroup> 104 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 105 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 106 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 107 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 108 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 109 <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 104 110 <Reference Include="System" /> 105 111 <Reference Include="System.Core" /> … … 209 215 <Private>False</Private> 210 216 </ProjectReference> 217 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.csproj"> 218 <Project>{BF1E4DF4-A4CC-451F-9D50-303F405E265E}</Project> 219 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4</Name> 220 </ProjectReference> 221 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 222 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project> 223 <Name>HeuristicLab.Problems.Instances-3.3</Name> 224 </ProjectReference> 211 225 <ProjectReference Include="..\..\HeuristicLab.Problems.QuadraticAssignment\3.3\HeuristicLab.Problems.QuadraticAssignment-3.3.csproj"> 212 226 <Project>{79271BC8-4446-40E2-BB89-9BE4E17174FE}</Project> -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Plugin.cs.frame
r7268 r7615 34 34 [PluginDependency("HeuristicLab.MainForm", "3.3")] 35 35 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 36 [PluginDependency("HeuristicLab.Optimization", "3.3")] 37 [PluginDependency("HeuristicLab.Optimization.Views", "3.3")] 36 38 [PluginDependency("HeuristicLab.Problems.QuadraticAssignment", "3.3")] 37 39 public class HeuristicLabProblemsQuadraticAssignmentViewsPlugin : PluginBase { -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.Designer.cs
r7268 r7615 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.importInstanceButton = new System.Windows.Forms.Button();48 47 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 49 this.QAPLIBInstancesLabel = new System.Windows.Forms.Label();50 this.instancesComboBox = new System.Windows.Forms.ComboBox();51 this.loadInstanceButton = new System.Windows.Forms.Button();52 48 this.tabControl = new System.Windows.Forms.TabControl(); 53 49 this.problemTabPage = new System.Windows.Forms.TabPage(); … … 68 64 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 69 65 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 70 this.nameTextBox.Location = new System.Drawing.Point( 105, 29);71 this.nameTextBox.Size = new System.Drawing.Size(5 17, 20);66 this.nameTextBox.Location = new System.Drawing.Point(50, 29); 67 this.nameTextBox.Size = new System.Drawing.Size(572, 20); 72 68 // 73 69 // nameLabel … … 79 75 this.infoLabel.Location = new System.Drawing.Point(628, 32); 80 76 // 81 // importInstanceButton82 //83 this.importInstanceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));84 this.importInstanceButton.Location = new System.Drawing.Point(548, 0);85 this.importInstanceButton.Name = "importInstanceButton";86 this.importInstanceButton.Size = new System.Drawing.Size(99, 23);87 this.importInstanceButton.TabIndex = 5;88 this.importInstanceButton.Text = "Import...";89 this.importInstanceButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;90 this.toolTip.SetToolTip(this.importInstanceButton, "Import files in QAPLIB format.");91 this.importInstanceButton.UseVisualStyleBackColor = true;92 this.importInstanceButton.Click += new System.EventHandler(this.importInstanceButton_Click);93 //94 77 // openFileDialog 95 78 // … … 97 80 this.openFileDialog.Filter = "Dat files|*.dat|All files|*.*"; 98 81 // 99 // QAPLIBInstancesLabel100 //101 this.QAPLIBInstancesLabel.AutoSize = true;102 this.QAPLIBInstancesLabel.Cursor = System.Windows.Forms.Cursors.Hand;103 this.QAPLIBInstancesLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(0)));104 this.QAPLIBInstancesLabel.ForeColor = System.Drawing.Color.Blue;105 this.QAPLIBInstancesLabel.Location = new System.Drawing.Point(3, 5);106 this.QAPLIBInstancesLabel.Name = "QAPLIBInstancesLabel";107 this.QAPLIBInstancesLabel.Size = new System.Drawing.Size(96, 13);108 this.QAPLIBInstancesLabel.TabIndex = 6;109 this.QAPLIBInstancesLabel.Text = "QAPLIB instances:";110 this.toolTip.SetToolTip(this.QAPLIBInstancesLabel, "These instances were taken from the QAPLIB homepage at http://www.seas.upenn.edu/" +111 "qaplib/");112 this.QAPLIBInstancesLabel.Click += new System.EventHandler(this.QAPLIBInstancesLabel_Click);113 this.QAPLIBInstancesLabel.MouseEnter += new System.EventHandler(this.QAPLIBInstancesLabel_MouseEnter);114 this.QAPLIBInstancesLabel.MouseLeave += new System.EventHandler(this.QAPLIBInstancesLabel_MouseLeave);115 //116 // instancesComboBox117 //118 this.instancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)119 | System.Windows.Forms.AnchorStyles.Right)));120 this.instancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;121 this.instancesComboBox.FormattingEnabled = true;122 this.instancesComboBox.Location = new System.Drawing.Point(105, 2);123 this.instancesComboBox.Name = "instancesComboBox";124 this.instancesComboBox.Size = new System.Drawing.Size(358, 21);125 this.instancesComboBox.TabIndex = 7;126 this.instancesComboBox.SelectedValueChanged += new System.EventHandler(this.instancesComboBox_SelectedValueChanged);127 //128 // loadInstanceButton129 //130 this.loadInstanceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));131 this.loadInstanceButton.Location = new System.Drawing.Point(469, 0);132 this.loadInstanceButton.Name = "loadInstanceButton";133 this.loadInstanceButton.Size = new System.Drawing.Size(73, 23);134 this.loadInstanceButton.TabIndex = 5;135 this.loadInstanceButton.Text = "Load";136 this.loadInstanceButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;137 this.toolTip.SetToolTip(this.loadInstanceButton, "Load the selected QAPLIB instance.");138 this.loadInstanceButton.UseVisualStyleBackColor = true;139 this.loadInstanceButton.Click += new System.EventHandler(this.loadInstanceButton_Click);140 //141 82 // tabControl 142 83 // 143 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 144 | System.Windows.Forms.AnchorStyles.Left)145 84 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 85 | System.Windows.Forms.AnchorStyles.Left) 86 | System.Windows.Forms.AnchorStyles.Right))); 146 87 this.tabControl.Controls.Add(this.problemTabPage); 147 88 this.tabControl.Controls.Add(this.visualizationTabPage); … … 188 129 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 189 130 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 190 this.Controls.Add(this.instancesComboBox);191 131 this.Controls.Add(this.tabControl); 192 this.Controls.Add(this.importInstanceButton);193 this.Controls.Add(this.loadInstanceButton);194 this.Controls.Add(this.QAPLIBInstancesLabel);195 132 this.Name = "QuadraticAssignmentProblemView"; 196 133 this.Size = new System.Drawing.Size(647, 492); 197 this.Controls.SetChildIndex(this.QAPLIBInstancesLabel, 0);198 this.Controls.SetChildIndex(this.loadInstanceButton, 0);199 this.Controls.SetChildIndex(this.importInstanceButton, 0);200 134 this.Controls.SetChildIndex(this.tabControl, 0); 201 this.Controls.SetChildIndex(this.instancesComboBox, 0);202 135 this.Controls.SetChildIndex(this.infoLabel, 0); 203 136 this.Controls.SetChildIndex(this.parameterCollectionView, 0); … … 214 147 #endregion 215 148 216 private System.Windows.Forms.Button importInstanceButton;217 149 private System.Windows.Forms.OpenFileDialog openFileDialog; 218 private System.Windows.Forms.Label QAPLIBInstancesLabel;219 private System.Windows.Forms.ComboBox instancesComboBox;220 private System.Windows.Forms.Button loadInstanceButton;221 150 private System.Windows.Forms.TabControl tabControl; 222 151 private System.Windows.Forms.TabPage problemTabPage; -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.cs
r7268 r7615 21 21 22 22 using System; 23 using System.Drawing;24 using System.IO;25 23 using System.Windows.Forms; 26 using HeuristicLab.Common.Resources;27 using HeuristicLab.Core.Views;28 24 using HeuristicLab.MainForm; 29 25 using HeuristicLab.MainForm.WindowsForms; 26 using HeuristicLab.Optimization.Views; 30 27 31 28 namespace HeuristicLab.Problems.QuadraticAssignment.Views { 32 29 [View("Quadratic Assignment Problem View")] 33 30 [Content(typeof(QuadraticAssignmentProblem), IsDefaultView = true)] 34 public sealed partial class QuadraticAssignmentProblemView : ParameterizedNamedItemView {31 public sealed partial class QuadraticAssignmentProblemView : HeuristicOptimizationProblemView { 35 32 public new QuadraticAssignmentProblem Content { 36 33 get { return (QuadraticAssignmentProblem)base.Content; } … … 40 37 public QuadraticAssignmentProblemView() { 41 38 InitializeComponent(); 42 importInstanceButton.Image = VSImageLibrary.Open;43 39 Controls.Remove(parameterCollectionView); 44 40 parameterCollectionView.Dock = DockStyle.Fill; … … 74 70 protected override void OnContentChanged() { 75 71 base.OnContentChanged(); 76 instancesComboBox.Items.Clear();77 72 if (Content != null) { 78 foreach (string instance in Content.Instances) {79 instancesComboBox.Items.Add(instance);80 }81 73 qapView.Distances = Content.Distances; 82 74 qapView.Weights = Content.Weights; … … 91 83 protected override void SetEnabledStateOfControls() { 92 84 base.SetEnabledStateOfControls(); 93 instancesComboBox.Enabled = !ReadOnly && !Locked && Content != null;94 loadInstanceButton.Enabled = !ReadOnly && !Locked && Content != null && instancesComboBox.SelectedItem != null;95 importInstanceButton.Enabled = !ReadOnly && !Locked && Content != null;96 }97 98 private void instancesComboBox_SelectedValueChanged(object sender, System.EventArgs e) {99 loadInstanceButton.Enabled = instancesComboBox.SelectedItem != null;100 }101 102 private void loadInstanceButton_Click(object sender, System.EventArgs e) {103 string instance = instancesComboBox.SelectedItem as string;104 try {105 Content.LoadInstanceFromEmbeddedResource(instance);106 } catch (Exception ex) {107 PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);108 }109 }110 111 private void importInstanceButton_Click(object sender, System.EventArgs e) {112 if (openFileDialog.ShowDialog() == DialogResult.OK) {113 try {114 string datFile = openFileDialog.FileName;115 string directory = Path.GetDirectoryName(datFile);116 string solFile = Path.Combine(directory, Path.GetFileNameWithoutExtension(datFile) + ".sln");117 if (File.Exists(solFile)) {118 Content.LoadInstanceFromFile(datFile, solFile);119 } else {120 Content.LoadInstanceFromFile(datFile);121 }122 } catch (Exception ex) {123 PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);124 }125 }126 }127 128 private void QAPLIBInstancesLabel_Click(object sender, System.EventArgs e) {129 System.Diagnostics.Process.Start("http://www.seas.upenn.edu/qaplib/");130 }131 132 private void QAPLIBInstancesLabel_MouseEnter(object sender, EventArgs e) {133 Cursor = Cursors.Hand;134 QAPLIBInstancesLabel.ForeColor = Color.Red;135 toolTip.SetToolTip(QAPLIBInstancesLabel, "Browse to http://www.seas.upenn.edu/qaplib/");136 }137 138 private void QAPLIBInstancesLabel_MouseLeave(object sender, EventArgs e) {139 Cursor = Cursors.Default;140 QAPLIBInstancesLabel.ForeColor = Color.Blue;141 toolTip.SetToolTip(QAPLIBInstancesLabel, String.Empty);142 85 } 143 86 }
Note: See TracChangeset
for help on using the changeset viewer.