Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/15/12 13:54:24 (12 years ago)
Author:
sforsten
Message:

#1784: merge branch ProblemInstancesRegressionAndClassification into trunk

Location:
trunk/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Optimization.Views

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Viewsmergedeligible
      /branches/Benchmarking/sources/HeuristicLab.Optimization.Views6917-7005
      /branches/CloningRefactoring/HeuristicLab.Optimization.Views4656-4721
      /branches/DataAnalysis Refactoring/HeuristicLab.Optimization.Views5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Optimization.Views5815-6180
      /branches/DataAnalysis/HeuristicLab.Optimization.Views4458-4459,​4462,​4464
      /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Optimization.Views5060
      /branches/NET40/sources/HeuristicLab.Optimization.Views5138-5162
      /branches/ParallelEngine/HeuristicLab.Optimization.Views5175-5192
      /branches/QAPAlgorithms/HeuristicLab.Optimization.Views6350-6627
      /branches/Restructure trunk solution/HeuristicLab.Optimization.Views6828
      /branches/SuccessProgressAnalysis/HeuristicLab.Optimization.Views5370-5682
      /branches/Trunk/HeuristicLab.Optimization.Views6829-6865
      /branches/VNS/HeuristicLab.Optimization.Views5594-5752
      /branches/histogram/HeuristicLab.Optimization.Views5959-6341
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r7646 r7823  
    115115    <Reference Include="System.Data" />
    116116    <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>
    118120  </ItemGroup>
    119121  <ItemGroup>
     
    138140    </Compile>
    139141    <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>
    146142    <Compile Include="ProblemView.cs">
    147143      <SubType>UserControl</SubType>
     
    333329      <Private>False</Private>
    334330    </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>
    340331    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    341332      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    342333      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    343334      <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>
    344339    </ProjectReference>
    345340    <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  
    3939  [PluginDependency("HeuristicLab.Optimization", "3.3")]
    4040  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
     41  [PluginDependency("HeuristicLab.Problems.Instances.Views", "3.4")]
    4142  [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions","3.3")]
    4243  public class HeuristicLabOptimizationViewsPlugin : PluginBase {
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/ProblemView.Designer.cs

    r7641 r7823  
    4545    /// </summary>
    4646    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();
    5047      this.problemInstanceSplitContainer = new System.Windows.Forms.SplitContainer();
    51       this.problemInstanceProviderViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     48      this.problemInstanceConsumerView = new HeuristicLab.Problems.Instances.Views.ProblemInstanceConsumerView();
    5249      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5350      ((System.ComponentModel.ISupportInitialize)(this.problemInstanceSplitContainer)).BeginInit();
     
    7774      this.infoLabel.Location = new System.Drawing.Point(491, 4);
    7875      //
    79       // problemInstanceProviderComboBox
    80       //
    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       // libraryLabel
    91       //
    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       // libraryInfoButton
    100       //
    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       //
    10976      // problemInstanceSplitContainer
    11077      //
    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                   | System.Windows.Forms.AnchorStyles.Right)));
     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)));
    11481      this.problemInstanceSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
    11582      this.problemInstanceSplitContainer.IsSplitterFixed = true;
     
    12087      // problemInstanceSplitContainer.Panel1
    12188      //
    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);
    12690      this.problemInstanceSplitContainer.Panel1MinSize = 10;
    12791      //
     
    136100      this.problemInstanceSplitContainer.TabIndex = 13;
    137101      //
    138       // problemInstanceProviderViewHost
     102      // problemInstanceConsumerView
    139103      //
    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;
    152114      //
    153115      // ProblemView
     
    160122      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    161123      this.problemInstanceSplitContainer.Panel1.ResumeLayout(false);
    162       this.problemInstanceSplitContainer.Panel1.PerformLayout();
    163124      this.problemInstanceSplitContainer.Panel2.ResumeLayout(false);
    164125      this.problemInstanceSplitContainer.Panel2.PerformLayout();
     
    171132    #endregion
    172133
    173     protected System.Windows.Forms.ComboBox problemInstanceProviderComboBox;
    174     protected System.Windows.Forms.Label libraryLabel;
    175     protected System.Windows.Forms.Button libraryInfoButton;
    176134    protected System.Windows.Forms.SplitContainer problemInstanceSplitContainer;
    177     protected MainForm.WindowsForms.ViewHost problemInstanceProviderViewHost;
     135    protected HeuristicLab.Problems.Instances.Views.ProblemInstanceConsumerView problemInstanceConsumerView;
    178136  }
    179137}
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/ProblemView.cs

    r7641 r7823  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Diagnostics;
    2522using System.Linq;
    2623using System.Windows.Forms;
    27 using HeuristicLab.Common.Resources;
    2824using HeuristicLab.Core.Views;
    2925using HeuristicLab.MainForm;
    30 using HeuristicLab.PluginInfrastructure;
    3126using HeuristicLab.Problems.Instances;
    3227
     
    4338    }
    4439
    45     protected IProblemInstanceProvider SelectedProvider {
    46       get { return (problemInstanceProviderComboBox.SelectedIndex >= 0 ? (IProblemInstanceProvider)problemInstanceProviderComboBox.SelectedItem : null); }
    47     }
    48 
    4940    /// <summary>
    5041    /// Initializes a new instance of <see cref="ItemBaseView"/>.
     
    5243    public ProblemView() {
    5344      InitializeComponent();
    54       libraryInfoButton.Text = String.Empty;
    55       libraryInfoButton.Image = VSImageLibrary.Internet;
    5645    }
    5746
    5847    protected override void OnContentChanged() {
    5948      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();
    6253      } else {
    63         problemInstanceProviderComboBox.DisplayMember = "Name";
    64         problemInstanceProviderComboBox.DataSource = GetProblemInstanceProviders().ToList();
    65         problemInstanceSplitContainer.Panel1Collapsed = problemInstanceProviderComboBox.Items.Count <= 0;
    66 
     54        problemInstanceSplitContainer.Panel1Collapsed = true;
    6755      }
    6856      SetEnabledStateOfControls();
    6957    }
    7058
    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.IsGenericType
    104           && x.GetGenericTypeDefinition() == typeof(IProblemInstanceConsumer<>));
    105 
    106       if (consumerTypes.Any()) {
    107         var instanceTypes = consumerTypes
    108           .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 = toolTip
    131             + Environment.NewLine + Environment.NewLine
    132             + provider.ReferencePublication;
    133       }
    134       if (provider.WebLink != null) {
    135         toolTip = toolTip
    136             + Environment.NewLine
    137             + provider.WebLink.ToString();
    138       }
    139 
    140       return toolTip;
    141     }
    14259  }
    14360}
Note: See TracChangeset for help on using the changeset viewer.