Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/10 03:59:59 (14 years ago)
Author:
swagner
Message:

Enhanced !PathTSPTourView by showing the quality of the tour and a textual representation (#924)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/PathTSPTourView.cs

    r3566 r3693  
    4848
    4949    protected override void DeregisterContentEvents() {
     50      Content.QualityChanged -= new EventHandler(Content_QualityChanged);
    5051      Content.CoordinatesChanged -= new EventHandler(Content_CoordinatesChanged);
    5152      Content.PermutationChanged -= new EventHandler(Content_PermutationChanged);
     
    5455    protected override void RegisterContentEvents() {
    5556      base.RegisterContentEvents();
     57      Content.QualityChanged += new EventHandler(Content_QualityChanged);
    5658      Content.CoordinatesChanged += new EventHandler(Content_CoordinatesChanged);
    5759      Content.PermutationChanged += new EventHandler(Content_PermutationChanged);
     
    6163      base.OnContentChanged();
    6264      if (Content == null) {
     65        qualityViewHost.Content = null;
    6366        pictureBox.Image = null;
     67        tourViewHost.Content = null;
    6468      } else {
     69        qualityViewHost.Content = Content.Quality;
    6570        GenerateImage();
     71        tourViewHost.Content = Content.Permutation;
    6672      }
    6773      SetEnabledStateOfControls();
     
    7480
    7581    private void SetEnabledStateOfControls() {
     82      qualityGroupBox.Enabled = Content != null;
    7683      pictureBox.Enabled = Content != null;
     84      tourGroupBox.Enabled = Content != null;
    7785    }
    7886
     
    121129    }
    122130
     131    private void Content_QualityChanged(object sender, EventArgs e) {
     132      if (InvokeRequired)
     133        Invoke(new EventHandler(Content_QualityChanged), sender, e);
     134      else
     135        qualityViewHost.Content = Content.Quality;
     136    }
    123137    private void Content_CoordinatesChanged(object sender, EventArgs e) {
    124138      if (InvokeRequired)
     
    130144      if (InvokeRequired)
    131145        Invoke(new EventHandler(Content_PermutationChanged), sender, e);
    132       else
     146      else {
    133147        GenerateImage();
     148        tourViewHost.Content = Content.Permutation;
     149      }
    134150    }
    135151
Note: See TracChangeset for help on using the changeset viewer.