Changeset 7823 for trunk/sources/HeuristicLab.Optimization.Views/3.3
- Timestamp:
- 05/15/12 13:54:24 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/ProblemInstancesRegressionAndClassification (added) merged: 7568-7572,7603,7605-7607,7610,7664-7667,7682-7685,7687,7698,7748-7755,7757-7759,7770-7774,7794,7805,7809-7810
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Optimization.Views
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views merged eligible /branches/Benchmarking/sources/HeuristicLab.Optimization.Views 6917-7005 /branches/CloningRefactoring/HeuristicLab.Optimization.Views 4656-4721 /branches/DataAnalysis Refactoring/HeuristicLab.Optimization.Views 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Optimization.Views 5815-6180 /branches/DataAnalysis/HeuristicLab.Optimization.Views 4458-4459,4462,4464 /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Optimization.Views 5060 /branches/NET40/sources/HeuristicLab.Optimization.Views 5138-5162 /branches/ParallelEngine/HeuristicLab.Optimization.Views 5175-5192 /branches/QAPAlgorithms/HeuristicLab.Optimization.Views 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Optimization.Views 6828 /branches/SuccessProgressAnalysis/HeuristicLab.Optimization.Views 5370-5682 /branches/Trunk/HeuristicLab.Optimization.Views 6829-6865 /branches/VNS/HeuristicLab.Optimization.Views 5594-5752 /branches/histogram/HeuristicLab.Optimization.Views 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj
r7646 r7823 115 115 <Reference Include="System.Data" /> 116 116 <Reference Include="System.Xml" /> 117 <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1, Version=2.3.1.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" /> 117 <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1, Version=2.3.1.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86"> 118 <Private>False</Private> 119 </Reference> 118 120 </ItemGroup> 119 121 <ItemGroup> … … 138 140 </Compile> 139 141 <Compile Include="Plugin.cs" /> 140 <Compile Include="ProblemInstanceProviderView.cs">141 <SubType>UserControl</SubType>142 </Compile>143 <Compile Include="ProblemInstanceProviderView.Designer.cs">144 <DependentUpon>ProblemInstanceProviderView.cs</DependentUpon>145 </Compile>146 142 <Compile Include="ProblemView.cs"> 147 143 <SubType>UserControl</SubType> … … 333 329 <Private>False</Private> 334 330 </ProjectReference> 335 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">336 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>337 <Name>HeuristicLab.Persistence-3.3</Name>338 <Private>False</Private>339 </ProjectReference>340 331 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 341 332 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 342 333 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 343 334 <Private>False</Private> 335 </ProjectReference> 336 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances.Views\3.4\HeuristicLab.Problems.Instances.Views-3.4.csproj"> 337 <Project>{B1BA398F-953F-4C3A-B07B-1E5E17A27DD9}</Project> 338 <Name>HeuristicLab.Problems.Instances.Views-3.4</Name> 344 339 </ProjectReference> 345 340 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> -
trunk/sources/HeuristicLab.Optimization.Views/3.3/Plugin.cs.frame
r7558 r7823 39 39 [PluginDependency("HeuristicLab.Optimization", "3.3")] 40 40 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 41 [PluginDependency("HeuristicLab.Problems.Instances.Views", "3.4")] 41 42 [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions","3.3")] 42 43 public class HeuristicLabOptimizationViewsPlugin : PluginBase { -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ProblemView.Designer.cs
r7641 r7823 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.problemInstanceProviderComboBox = new System.Windows.Forms.ComboBox();48 this.libraryLabel = new System.Windows.Forms.Label();49 this.libraryInfoButton = new System.Windows.Forms.Button();50 47 this.problemInstanceSplitContainer = new System.Windows.Forms.SplitContainer(); 51 this.problemInstance ProviderViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();48 this.problemInstanceConsumerView = new HeuristicLab.Problems.Instances.Views.ProblemInstanceConsumerView(); 52 49 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 53 50 ((System.ComponentModel.ISupportInitialize)(this.problemInstanceSplitContainer)).BeginInit(); … … 77 74 this.infoLabel.Location = new System.Drawing.Point(491, 4); 78 75 // 79 // problemInstanceProviderComboBox80 //81 this.problemInstanceProviderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;82 this.problemInstanceProviderComboBox.FormattingEnabled = true;83 this.problemInstanceProviderComboBox.Location = new System.Drawing.Point(47, 2);84 this.problemInstanceProviderComboBox.Name = "problemInstanceProviderComboBox";85 this.problemInstanceProviderComboBox.Size = new System.Drawing.Size(171, 21);86 this.problemInstanceProviderComboBox.TabIndex = 13;87 this.problemInstanceProviderComboBox.SelectedIndexChanged += new System.EventHandler(this.problemInstanceProviderComboBox_SelectedIndexChanged);88 this.problemInstanceProviderComboBox.DataSourceChanged += new System.EventHandler(this.comboBox_DataSourceChanged);89 //90 // libraryLabel91 //92 this.libraryLabel.AutoSize = true;93 this.libraryLabel.Location = new System.Drawing.Point(3, 6);94 this.libraryLabel.Name = "libraryLabel";95 this.libraryLabel.Size = new System.Drawing.Size(41, 13);96 this.libraryLabel.TabIndex = 12;97 this.libraryLabel.Text = "Library:";98 //99 // libraryInfoButton100 //101 this.libraryInfoButton.Location = new System.Drawing.Point(224, 1);102 this.libraryInfoButton.Name = "libraryInfoButton";103 this.libraryInfoButton.Size = new System.Drawing.Size(26, 23);104 this.libraryInfoButton.TabIndex = 14;105 this.libraryInfoButton.Text = "Info";106 this.libraryInfoButton.UseVisualStyleBackColor = true;107 this.libraryInfoButton.Click += new System.EventHandler(this.libraryInfoButton_Click);108 //109 76 // problemInstanceSplitContainer 110 77 // 111 this.problemInstanceSplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 112 | System.Windows.Forms.AnchorStyles.Left)113 78 this.problemInstanceSplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 79 | System.Windows.Forms.AnchorStyles.Left) 80 | System.Windows.Forms.AnchorStyles.Right))); 114 81 this.problemInstanceSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; 115 82 this.problemInstanceSplitContainer.IsSplitterFixed = true; … … 120 87 // problemInstanceSplitContainer.Panel1 121 88 // 122 this.problemInstanceSplitContainer.Panel1.Controls.Add(this.problemInstanceProviderViewHost); 123 this.problemInstanceSplitContainer.Panel1.Controls.Add(this.problemInstanceProviderComboBox); 124 this.problemInstanceSplitContainer.Panel1.Controls.Add(this.libraryInfoButton); 125 this.problemInstanceSplitContainer.Panel1.Controls.Add(this.libraryLabel); 89 this.problemInstanceSplitContainer.Panel1.Controls.Add(this.problemInstanceConsumerView); 126 90 this.problemInstanceSplitContainer.Panel1MinSize = 10; 127 91 // … … 136 100 this.problemInstanceSplitContainer.TabIndex = 13; 137 101 // 138 // problemInstance ProviderViewHost102 // problemInstanceConsumerView 139 103 // 140 this.problemInstanceProviderViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 141 | System.Windows.Forms.AnchorStyles.Right))); 142 this.problemInstanceProviderViewHost.Caption = "View"; 143 this.problemInstanceProviderViewHost.Content = null; 144 this.problemInstanceProviderViewHost.Enabled = false; 145 this.problemInstanceProviderViewHost.Location = new System.Drawing.Point(256, 3); 146 this.problemInstanceProviderViewHost.Name = "problemInstanceProviderViewHost"; 147 this.problemInstanceProviderViewHost.ReadOnly = false; 148 this.problemInstanceProviderViewHost.Size = new System.Drawing.Size(251, 22); 149 this.problemInstanceProviderViewHost.TabIndex = 15; 150 this.problemInstanceProviderViewHost.ViewsLabelVisible = false; 151 this.problemInstanceProviderViewHost.ViewType = null; 104 this.problemInstanceConsumerView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 105 | System.Windows.Forms.AnchorStyles.Left) 106 | System.Windows.Forms.AnchorStyles.Right))); 107 this.problemInstanceConsumerView.Caption = "ProblemInstanceProviderView"; 108 this.problemInstanceConsumerView.Content = null; 109 this.problemInstanceConsumerView.Location = new System.Drawing.Point(0, 1); 110 this.problemInstanceConsumerView.Name = "problemInstanceConsumerView"; 111 this.problemInstanceConsumerView.ReadOnly = false; 112 this.problemInstanceConsumerView.Size = new System.Drawing.Size(511, 23); 113 this.problemInstanceConsumerView.TabIndex = 0; 152 114 // 153 115 // ProblemView … … 160 122 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 161 123 this.problemInstanceSplitContainer.Panel1.ResumeLayout(false); 162 this.problemInstanceSplitContainer.Panel1.PerformLayout();163 124 this.problemInstanceSplitContainer.Panel2.ResumeLayout(false); 164 125 this.problemInstanceSplitContainer.Panel2.PerformLayout(); … … 171 132 #endregion 172 133 173 protected System.Windows.Forms.ComboBox problemInstanceProviderComboBox;174 protected System.Windows.Forms.Label libraryLabel;175 protected System.Windows.Forms.Button libraryInfoButton;176 134 protected System.Windows.Forms.SplitContainer problemInstanceSplitContainer; 177 protected MainForm.WindowsForms.ViewHost problemInstanceProviderViewHost;135 protected HeuristicLab.Problems.Instances.Views.ProblemInstanceConsumerView problemInstanceConsumerView; 178 136 } 179 137 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ProblemView.cs
r7641 r7823 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Diagnostics;25 22 using System.Linq; 26 23 using System.Windows.Forms; 27 using HeuristicLab.Common.Resources;28 24 using HeuristicLab.Core.Views; 29 25 using HeuristicLab.MainForm; 30 using HeuristicLab.PluginInfrastructure;31 26 using HeuristicLab.Problems.Instances; 32 27 … … 43 38 } 44 39 45 protected IProblemInstanceProvider SelectedProvider {46 get { return (problemInstanceProviderComboBox.SelectedIndex >= 0 ? (IProblemInstanceProvider)problemInstanceProviderComboBox.SelectedItem : null); }47 }48 49 40 /// <summary> 50 41 /// Initializes a new instance of <see cref="ItemBaseView"/>. … … 52 43 public ProblemView() { 53 44 InitializeComponent(); 54 libraryInfoButton.Text = String.Empty;55 libraryInfoButton.Image = VSImageLibrary.Internet;56 45 } 57 46 58 47 protected override void OnContentChanged() { 59 48 base.OnContentChanged(); 60 if (Content == null) { 61 problemInstanceProviderComboBox.DataSource = null; 49 IProblemInstanceConsumer consumer = Content as IProblemInstanceConsumer; 50 if (consumer != null) { 51 problemInstanceConsumerView.Content = consumer; 52 problemInstanceSplitContainer.Panel1Collapsed = !problemInstanceConsumerView.ProblemInstanceProviders.Any(); 62 53 } else { 63 problemInstanceProviderComboBox.DisplayMember = "Name"; 64 problemInstanceProviderComboBox.DataSource = GetProblemInstanceProviders().ToList(); 65 problemInstanceSplitContainer.Panel1Collapsed = problemInstanceProviderComboBox.Items.Count <= 0; 66 54 problemInstanceSplitContainer.Panel1Collapsed = true; 67 55 } 68 56 SetEnabledStateOfControls(); 69 57 } 70 58 71 protected override void SetEnabledStateOfControls() {72 base.SetEnabledStateOfControls();73 problemInstanceProviderComboBox.Enabled = !ReadOnly && !Locked && Content != null && problemInstanceProviderComboBox.Items.Count > 0;74 libraryInfoButton.Enabled = SelectedProvider != null && SelectedProvider.WebLink != null;75 }76 77 protected virtual void problemInstanceProviderComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {78 if (problemInstanceProviderComboBox.SelectedIndex >= 0) {79 dynamic provider = SelectedProvider;80 dynamic consumer = Content;81 provider.Consumer = consumer;82 problemInstanceProviderViewHost.Content = SelectedProvider;83 SetTooltip();84 }85 SetEnabledStateOfControls();86 }87 88 private void comboBox_DataSourceChanged(object sender, EventArgs e) {89 var comboBox = (ComboBox)sender;90 if (comboBox.DataSource == null)91 comboBox.Items.Clear();92 }93 94 protected virtual void libraryInfoButton_Click(object sender, EventArgs e) {95 if (problemInstanceProviderComboBox.SelectedIndex >= 0) {96 if (SelectedProvider != null && SelectedProvider.WebLink != null)97 Process.Start(SelectedProvider.WebLink.ToString());98 }99 }100 101 protected virtual IEnumerable<IProblemInstanceProvider> GetProblemInstanceProviders() {102 var consumerTypes = Content.GetType().GetInterfaces()103 .Where(x => x.IsGenericType104 && x.GetGenericTypeDefinition() == typeof(IProblemInstanceConsumer<>));105 106 if (consumerTypes.Any()) {107 var instanceTypes = consumerTypes108 .Select(x => x.GetGenericArguments().First())109 .Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x));110 111 foreach (var type in instanceTypes) {112 foreach (var provider in ApplicationManager.Manager.GetInstances(type))113 yield return (IProblemInstanceProvider)provider;114 }115 }116 }117 118 protected virtual void SetTooltip() {119 toolTip.SetToolTip(problemInstanceProviderComboBox, GetProviderToolTip());120 if (SelectedProvider.WebLink != null)121 toolTip.SetToolTip(libraryInfoButton, "Browse to " + SelectedProvider.WebLink.ToString());122 else toolTip.SetToolTip(libraryInfoButton, "Library does not have a web reference.");123 }124 125 protected virtual string GetProviderToolTip() {126 var provider = SelectedProvider;127 string toolTip = provider.Name;128 129 if (!String.IsNullOrEmpty(provider.ReferencePublication)) {130 toolTip = toolTip131 + Environment.NewLine + Environment.NewLine132 + provider.ReferencePublication;133 }134 if (provider.WebLink != null) {135 toolTip = toolTip136 + Environment.NewLine137 + provider.WebLink.ToString();138 }139 140 return toolTip;141 }142 59 } 143 60 }
Note: See TracChangeset
for help on using the changeset viewer.