Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/15/12 09:11:17 (13 years ago)
Author:
gkronber
Message:

#1081 merged r7462:7609 from trunk into time series branch

Location:
branches/HeuristicLab.TimeSeries
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries

  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs

    r7268 r7615  
    2222using System;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Core;
    25 using HeuristicLab.Core.Views;
    2624using HeuristicLab.MainForm;
    27 using HeuristicLab.PluginInfrastructure;
     25using HeuristicLab.Optimization.Views;
    2826
    2927namespace HeuristicLab.Problems.TravelingSalesman.Views {
     
    3331  [View("Traveling Salesman Problem View")]
    3432  [Content(typeof(TravelingSalesmanProblem), true)]
    35   public sealed partial class TravelingSalesmanProblemView : NamedItemView {
    36     private TSPLIBImportDialog tsplibImportDialog;
    37 
     33  public sealed partial class TravelingSalesmanProblemView : HeuristicOptimizationProblemView {
    3834    public new TravelingSalesmanProblem Content {
    3935      get { return (TravelingSalesmanProblem)base.Content; }
     
    4642    public TravelingSalesmanProblemView() {
    4743      InitializeComponent();
    48     }
    49 
    50     protected override void Dispose(bool disposing) {
    51       if (disposing) {
    52         if (tsplibImportDialog != null) tsplibImportDialog.Dispose();
    53         if (components != null) components.Dispose();
    54       }
    55       base.Dispose(disposing);
    5644    }
    5745
     
    7260      base.OnContentChanged();
    7361      if (Content == null) {
    74         parameterCollectionView.Content = null;
    7562        pathTSPTourView.Content = null;
    7663      } else {
    77         parameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters;
    7864        pathTSPTourView.Content = new PathTSPTour(Content.Coordinates, Content.BestKnownSolution, Content.BestKnownQuality);
    7965      }
     
    8268    protected override void SetEnabledStateOfControls() {
    8369      base.SetEnabledStateOfControls();
    84       parameterCollectionView.Enabled = Content != null;
    8570      pathTSPTourView.Enabled = Content != null;
    86       importButton.Enabled = Content != null && !ReadOnly;
    87     }
    88 
    89     private void importButton_Click(object sender, System.EventArgs e) {
    90       if (tsplibImportDialog == null) tsplibImportDialog = new TSPLIBImportDialog();
    91 
    92       if (tsplibImportDialog.ShowDialog(this) == DialogResult.OK) {
    93         try {
    94           if (tsplibImportDialog.Quality == null)
    95             Content.ImportFromTSPLIB(tsplibImportDialog.TSPFileName, tsplibImportDialog.TourFileName);
    96           else
    97             Content.ImportFromTSPLIB(tsplibImportDialog.TSPFileName, tsplibImportDialog.TourFileName, (double)tsplibImportDialog.Quality);
    98         }
    99         catch (Exception ex) {
    100           ErrorHandling.ShowErrorDialog(this, ex);
    101         }
    102       }
    10371    }
    10472
Note: See TracChangeset for help on using the changeset viewer.