Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/09/11 03:23:32 (13 years ago)
Author:
abeham
Message:

#1330

  • worked on visualization (and MDS)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.cs

    r5583 r5641  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Common.Resources;
     
    3839      InitializeComponent();
    3940      importInstanceButton.Image = VSImageLibrary.Open;
     41      Controls.Remove(parameterCollectionView);
     42      parameterCollectionView.Dock = DockStyle.Fill;
     43      problemTabPage.Controls.Add(parameterCollectionView);
     44    }
     45
     46    protected override void RegisterContentEvents() {
     47      base.RegisterContentEvents();
     48      Content.DistanceMatrixParameter.ValueChanged += new EventHandler(DistanceMatrixParameter_ValueChanged);
     49      Content.WeightsParameter.ValueChanged += new EventHandler(WeightsParameter_ValueChanged);
     50      Content.BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged);
     51    }
     52
     53    protected override void DeregisterContentEvents() {
     54      Content.DistanceMatrixParameter.ValueChanged -= new EventHandler(DistanceMatrixParameter_ValueChanged);
     55      Content.WeightsParameter.ValueChanged -= new EventHandler(WeightsParameter_ValueChanged);
     56      Content.BestKnownSolutionParameter.ValueChanged -= new EventHandler(BestKnownSolutionParameter_ValueChanged);
     57      base.DeregisterContentEvents();
     58    }
     59
     60    private void DistanceMatrixParameter_ValueChanged(object sender, System.EventArgs e) {
     61      qapView.Distances = Content.DistanceMatrix;
     62    }
     63
     64    private void WeightsParameter_ValueChanged(object sender, System.EventArgs e) {
     65      qapView.Weights = Content.Weights;
     66    }
     67
     68    private void BestKnownSolutionParameter_ValueChanged(object sender, System.EventArgs e) {
     69      qapView.Assignment = Content.BestKnownSolution;
    4070    }
    4171
     
    4777          instancesComboBox.Items.Add(instance);
    4878        }
     79        qapView.Distances = Content.DistanceMatrix;
     80        qapView.Weights = Content.Weights;
     81        qapView.Assignment = Content.BestKnownSolution;
     82      } else {
     83        qapView.Distances = null;
     84        qapView.Weights = null;
     85        qapView.Assignment = null;
    4986      }
    5087    }
     
    63100    private void loadInstanceButton_Click(object sender, System.EventArgs e) {
    64101      string instance = instancesComboBox.SelectedItem as string;
    65       Content.LoadEmbeddedInstance(instance);
     102      try {
     103        Content.LoadEmbeddedInstance(instance);
     104      } catch (Exception ex) {
     105        PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);
     106      }
    66107    }
    67108
    68109    private void importInstanceButton_Click(object sender, System.EventArgs e) {
    69110      if (openFileDialog.ShowDialog() == DialogResult.OK) {
    70         Content.ImportFileInstance(openFileDialog.FileName);
     111        try {
     112          Content.ImportFileInstance(openFileDialog.FileName);
     113        } catch (Exception ex) {
     114          PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex);
     115        }
    71116      }
    72117    }
Note: See TracChangeset for help on using the changeset viewer.