Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3693


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

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

Location:
trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3
Files:
2 edited

Legend:

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

    r3158 r3693  
    4646    private void InitializeComponent() {
    4747      this.pictureBox = new System.Windows.Forms.PictureBox();
     48      this.tabControl = new System.Windows.Forms.TabControl();
     49      this.visualizationTabPage = new System.Windows.Forms.TabPage();
     50      this.valueTabPage = new System.Windows.Forms.TabPage();
     51      this.tourGroupBox = new System.Windows.Forms.GroupBox();
     52      this.tourViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     53      this.splitContainer = new System.Windows.Forms.SplitContainer();
     54      this.qualityGroupBox = new System.Windows.Forms.GroupBox();
     55      this.qualityViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    4856      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
     57      this.tabControl.SuspendLayout();
     58      this.visualizationTabPage.SuspendLayout();
     59      this.valueTabPage.SuspendLayout();
     60      this.tourGroupBox.SuspendLayout();
     61      this.splitContainer.Panel1.SuspendLayout();
     62      this.splitContainer.Panel2.SuspendLayout();
     63      this.splitContainer.SuspendLayout();
     64      this.qualityGroupBox.SuspendLayout();
    4965      this.SuspendLayout();
    5066      //
     
    5672      this.pictureBox.BackColor = System.Drawing.Color.White;
    5773      this.pictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
    58       this.pictureBox.Location = new System.Drawing.Point(0, 0);
     74      this.pictureBox.Location = new System.Drawing.Point(6, 6);
    5975      this.pictureBox.Name = "pictureBox";
    60       this.pictureBox.Size = new System.Drawing.Size(392, 310);
     76      this.pictureBox.Size = new System.Drawing.Size(403, 288);
    6177      this.pictureBox.TabIndex = 0;
    6278      this.pictureBox.TabStop = false;
    6379      this.pictureBox.SizeChanged += new System.EventHandler(this.pictureBox_SizeChanged);
    6480      //
     81      // tabControl
     82      //
     83      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     84                  | System.Windows.Forms.AnchorStyles.Left)
     85                  | System.Windows.Forms.AnchorStyles.Right)));
     86      this.tabControl.Controls.Add(this.visualizationTabPage);
     87      this.tabControl.Controls.Add(this.valueTabPage);
     88      this.tabControl.Location = new System.Drawing.Point(0, 3);
     89      this.tabControl.Name = "tabControl";
     90      this.tabControl.SelectedIndex = 0;
     91      this.tabControl.Size = new System.Drawing.Size(423, 326);
     92      this.tabControl.TabIndex = 0;
     93      //
     94      // visualizationTabPage
     95      //
     96      this.visualizationTabPage.Controls.Add(this.pictureBox);
     97      this.visualizationTabPage.Location = new System.Drawing.Point(4, 22);
     98      this.visualizationTabPage.Name = "visualizationTabPage";
     99      this.visualizationTabPage.Padding = new System.Windows.Forms.Padding(3);
     100      this.visualizationTabPage.Size = new System.Drawing.Size(415, 300);
     101      this.visualizationTabPage.TabIndex = 0;
     102      this.visualizationTabPage.Text = "Visualization";
     103      this.visualizationTabPage.UseVisualStyleBackColor = true;
     104      //
     105      // valueTabPage
     106      //
     107      this.valueTabPage.Controls.Add(this.tourGroupBox);
     108      this.valueTabPage.Location = new System.Drawing.Point(4, 22);
     109      this.valueTabPage.Name = "valueTabPage";
     110      this.valueTabPage.Padding = new System.Windows.Forms.Padding(3);
     111      this.valueTabPage.Size = new System.Drawing.Size(415, 300);
     112      this.valueTabPage.TabIndex = 1;
     113      this.valueTabPage.Text = "Value";
     114      this.valueTabPage.UseVisualStyleBackColor = true;
     115      //
     116      // tourGroupBox
     117      //
     118      this.tourGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     119                  | System.Windows.Forms.AnchorStyles.Left)
     120                  | System.Windows.Forms.AnchorStyles.Right)));
     121      this.tourGroupBox.Controls.Add(this.tourViewHost);
     122      this.tourGroupBox.Location = new System.Drawing.Point(6, 6);
     123      this.tourGroupBox.Name = "tourGroupBox";
     124      this.tourGroupBox.Size = new System.Drawing.Size(403, 288);
     125      this.tourGroupBox.TabIndex = 0;
     126      this.tourGroupBox.TabStop = false;
     127      this.tourGroupBox.Text = "Tour";
     128      //
     129      // tourViewHost
     130      //
     131      this.tourViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     132                  | System.Windows.Forms.AnchorStyles.Left)
     133                  | System.Windows.Forms.AnchorStyles.Right)));
     134      this.tourViewHost.Caption = null;
     135      this.tourViewHost.Content = null;
     136      this.tourViewHost.Location = new System.Drawing.Point(6, 19);
     137      this.tourViewHost.Name = "tourViewHost";
     138      this.tourViewHost.ReadOnly = false;
     139      this.tourViewHost.Size = new System.Drawing.Size(391, 263);
     140      this.tourViewHost.TabIndex = 0;
     141      this.tourViewHost.ViewType = null;
     142      //
     143      // splitContainer
     144      //
     145      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
     146      this.splitContainer.Location = new System.Drawing.Point(0, 0);
     147      this.splitContainer.Name = "splitContainer";
     148      this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
     149      //
     150      // splitContainer.Panel1
     151      //
     152      this.splitContainer.Panel1.Controls.Add(this.qualityGroupBox);
     153      //
     154      // splitContainer.Panel2
     155      //
     156      this.splitContainer.Panel2.Controls.Add(this.tabControl);
     157      this.splitContainer.Size = new System.Drawing.Size(423, 402);
     158      this.splitContainer.SplitterDistance = 69;
     159      this.splitContainer.TabIndex = 0;
     160      //
     161      // qualityGroupBox
     162      //
     163      this.qualityGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     164                  | System.Windows.Forms.AnchorStyles.Left)
     165                  | System.Windows.Forms.AnchorStyles.Right)));
     166      this.qualityGroupBox.Controls.Add(this.qualityViewHost);
     167      this.qualityGroupBox.Location = new System.Drawing.Point(0, 0);
     168      this.qualityGroupBox.Name = "qualityGroupBox";
     169      this.qualityGroupBox.Size = new System.Drawing.Size(423, 66);
     170      this.qualityGroupBox.TabIndex = 0;
     171      this.qualityGroupBox.TabStop = false;
     172      this.qualityGroupBox.Text = "Quality";
     173      //
     174      // qualityViewHost
     175      //
     176      this.qualityViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     177                  | System.Windows.Forms.AnchorStyles.Left)
     178                  | System.Windows.Forms.AnchorStyles.Right)));
     179      this.qualityViewHost.Caption = null;
     180      this.qualityViewHost.Content = null;
     181      this.qualityViewHost.Location = new System.Drawing.Point(6, 19);
     182      this.qualityViewHost.Name = "qualityViewHost";
     183      this.qualityViewHost.ReadOnly = false;
     184      this.qualityViewHost.Size = new System.Drawing.Size(411, 41);
     185      this.qualityViewHost.TabIndex = 0;
     186      this.qualityViewHost.ViewType = null;
     187      //
    65188      // PathTSPTourView
    66189      //
    67190      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    68191      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    69       this.Controls.Add(this.pictureBox);
     192      this.Controls.Add(this.splitContainer);
    70193      this.Name = "PathTSPTourView";
    71       this.Size = new System.Drawing.Size(392, 310);
     194      this.Size = new System.Drawing.Size(423, 402);
    72195      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
     196      this.tabControl.ResumeLayout(false);
     197      this.visualizationTabPage.ResumeLayout(false);
     198      this.valueTabPage.ResumeLayout(false);
     199      this.tourGroupBox.ResumeLayout(false);
     200      this.splitContainer.Panel1.ResumeLayout(false);
     201      this.splitContainer.Panel2.ResumeLayout(false);
     202      this.splitContainer.ResumeLayout(false);
     203      this.qualityGroupBox.ResumeLayout(false);
    73204      this.ResumeLayout(false);
    74205
     
    78209
    79210    private System.Windows.Forms.PictureBox pictureBox;
     211    private System.Windows.Forms.TabControl tabControl;
     212    private System.Windows.Forms.TabPage visualizationTabPage;
     213    private System.Windows.Forms.TabPage valueTabPage;
     214    private System.Windows.Forms.GroupBox tourGroupBox;
     215    private HeuristicLab.MainForm.WindowsForms.ViewHost tourViewHost;
     216    private System.Windows.Forms.SplitContainer splitContainer;
     217    private System.Windows.Forms.GroupBox qualityGroupBox;
     218    private HeuristicLab.MainForm.WindowsForms.ViewHost qualityViewHost;
    80219
    81220
  • 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.