Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11438


Ignore:
Timestamp:
10/10/14 02:35:44 (10 years ago)
Author:
swagner
Message:

#2205: Worked on optimization networks

Location:
branches/OptimizationNetworks
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/InputPortView.Designer.cs

    r11412 r11438  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.outputPortLabel = new System.Windows.Forms.Label();
    48       this.outputPortTextBox = new System.Windows.Forms.TextBox();
     47      this.outputPortGroupBox = new System.Windows.Forms.GroupBox();
     48      this.outputPortView = new HeuristicLab.Optimization.Networks.Views.PortView();
    4949      this.valueGroupBox.SuspendLayout();
    5050      this.valuePanel.SuspendLayout();
    5151      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
     52      this.outputPortGroupBox.SuspendLayout();
    5253      this.SuspendLayout();
    5354      //
    5455      // valueGroupBox
    5556      //
    56       this.valueGroupBox.Location = new System.Drawing.Point(0, 52);
    57       this.valueGroupBox.Size = new System.Drawing.Size(645, 465);
    58       this.valueGroupBox.TabIndex = 5;
     57      this.valueGroupBox.Location = new System.Drawing.Point(0, 129);
     58      this.valueGroupBox.Size = new System.Drawing.Size(645, 388);
     59      this.valueGroupBox.TabIndex = 6;
    5960      //
    6061      // valuePanel
    6162      //
    62       this.valuePanel.Size = new System.Drawing.Size(633, 440);
     63      this.valuePanel.Size = new System.Drawing.Size(633, 363);
    6364      //
    6465      // valueViewHost
    6566      //
    66       this.valueViewHost.Size = new System.Drawing.Size(633, 440);
     67      this.valueViewHost.Size = new System.Drawing.Size(633, 363);
     68      //
     69      // pathTextBox
     70      //
     71      this.pathTextBox.Location = new System.Drawing.Point(71, 26);
     72      this.pathTextBox.Size = new System.Drawing.Size(549, 20);
    6773      //
    6874      // nameTextBox
     
    7076      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    7177      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    72       this.nameTextBox.Location = new System.Drawing.Point(73, 0);
    73       this.nameTextBox.Size = new System.Drawing.Size(547, 20);
     78      this.nameTextBox.Location = new System.Drawing.Point(71, 0);
     79      this.nameTextBox.Size = new System.Drawing.Size(549, 20);
    7480      //
    75       // outputPortLabel
     81      // outputPortGroupBox
    7682      //
    77       this.outputPortLabel.AutoSize = true;
    78       this.outputPortLabel.Location = new System.Drawing.Point(3, 29);
    79       this.outputPortLabel.Name = "outputPortLabel";
    80       this.outputPortLabel.Size = new System.Drawing.Size(64, 13);
    81       this.outputPortLabel.TabIndex = 3;
    82       this.outputPortLabel.Text = "&Output Port:";
     83      this.outputPortGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     84            | System.Windows.Forms.AnchorStyles.Right)));
     85      this.outputPortGroupBox.Controls.Add(this.outputPortView);
     86      this.outputPortGroupBox.Location = new System.Drawing.Point(0, 52);
     87      this.outputPortGroupBox.Name = "outputPortGroupBox";
     88      this.outputPortGroupBox.Size = new System.Drawing.Size(645, 71);
     89      this.outputPortGroupBox.TabIndex = 5;
     90      this.outputPortGroupBox.TabStop = false;
     91      this.outputPortGroupBox.Text = "&Output Port";
     92      this.outputPortGroupBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.outputPortGroupBox_DragDrop);
     93      this.outputPortGroupBox.DragEnter += new System.Windows.Forms.DragEventHandler(this.outputPortGroupBox_DragEnterOver);
     94      this.outputPortGroupBox.DragOver += new System.Windows.Forms.DragEventHandler(this.outputPortGroupBox_DragEnterOver);
    8395      //
    84       // outputPortTextBox
     96      // outputPortView
    8597      //
    86       this.outputPortTextBox.AllowDrop = true;
    87       this.outputPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    88             | System.Windows.Forms.AnchorStyles.Right)));
    89       this.outputPortTextBox.Location = new System.Drawing.Point(73, 26);
    90       this.outputPortTextBox.Name = "outputPortTextBox";
    91       this.outputPortTextBox.ReadOnly = true;
    92       this.outputPortTextBox.Size = new System.Drawing.Size(547, 20);
    93       this.outputPortTextBox.TabIndex = 4;
    94       this.outputPortTextBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.outputPortTextBox_DragDrop);
    95       this.outputPortTextBox.DragEnter += new System.Windows.Forms.DragEventHandler(this.outputPortTextBox_DragEnterOver);
    96       this.outputPortTextBox.DragOver += new System.Windows.Forms.DragEventHandler(this.outputPortTextBox_DragEnterOver);
     98      this.outputPortView.Caption = "Port View";
     99      this.outputPortView.Content = null;
     100      this.outputPortView.Dock = System.Windows.Forms.DockStyle.Fill;
     101      this.outputPortView.Location = new System.Drawing.Point(3, 16);
     102      this.outputPortView.Name = "outputPortView";
     103      this.outputPortView.ReadOnly = true;
     104      this.outputPortView.Size = new System.Drawing.Size(639, 52);
     105      this.outputPortView.TabIndex = 0;
    97106      //
    98107      // InputPortView
    99108      //
    100109      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    101       this.Controls.Add(this.outputPortTextBox);
    102       this.Controls.Add(this.outputPortLabel);
     110      this.Controls.Add(this.outputPortGroupBox);
    103111      this.Name = "InputPortView";
     112      this.Controls.SetChildIndex(this.pathLabel, 0);
     113      this.Controls.SetChildIndex(this.pathTextBox, 0);
    104114      this.Controls.SetChildIndex(this.nameLabel, 0);
    105115      this.Controls.SetChildIndex(this.nameTextBox, 0);
    106116      this.Controls.SetChildIndex(this.infoLabel, 0);
    107117      this.Controls.SetChildIndex(this.valueGroupBox, 0);
    108       this.Controls.SetChildIndex(this.outputPortLabel, 0);
    109       this.Controls.SetChildIndex(this.outputPortTextBox, 0);
     118      this.Controls.SetChildIndex(this.outputPortGroupBox, 0);
    110119      this.valueGroupBox.ResumeLayout(false);
    111120      this.valuePanel.ResumeLayout(false);
    112121      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
     122      this.outputPortGroupBox.ResumeLayout(false);
    113123      this.ResumeLayout(false);
    114124      this.PerformLayout();
     
    118128    #endregion
    119129
    120     protected System.Windows.Forms.Label outputPortLabel;
    121     protected System.Windows.Forms.TextBox outputPortTextBox;
     130    protected System.Windows.Forms.GroupBox outputPortGroupBox;
     131    protected PortView outputPortView;
    122132
    123133
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/InputPortView.cs

    r11431 r11438  
    3939    }
    4040
    41     private void UpdateOutputPortTextBoxText() {
    42       if ((Content == null) || (Content.OutputPort == null)) {
    43         outputPortTextBox.Text = string.Empty;
    44       } else {
    45         outputPortTextBox.Text = Content.OutputPort.Path + "." + Content.OutputPort.ToString();
    46       }
    47     }
    48 
    4941    protected override void DeregisterContentEvents() {
    5042      Content.OutputPortChanged -= Content_OutputPortChanged;
     
    5850    protected override void OnContentChanged() {
    5951      base.OnContentChanged();
    60       UpdateOutputPortTextBoxText();
     52      outputPortView.Content = Content == null ? null : Content.OutputPort;
    6153    }
    6254
    6355    protected override void SetEnabledStateOfControls() {
    6456      base.SetEnabledStateOfControls();
    65       outputPortTextBox.Enabled = Content != null && !ReadOnly;
     57      outputPortGroupBox.Enabled = Content != null && !ReadOnly;
    6658    }
    6759
     
    7062        Invoke(new EventHandler(Content_OutputPortChanged), sender, e);
    7163      else {
    72         UpdateOutputPortTextBoxText();
     64        outputPortView.Content = Content.OutputPort;
    7365      }
    7466    }
    7567
    76     protected virtual void outputPortTextBox_DragEnterOver(object sender, DragEventArgs e) {
     68    protected virtual void outputPortGroupBox_DragEnterOver(object sender, DragEventArgs e) {
    7769      e.Effect = DragDropEffects.None;
    7870      if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IOutputPort)) {
     
    8072      }
    8173    }
    82     protected virtual void outputPortTextBox_DragDrop(object sender, DragEventArgs e) {
     74    protected virtual void outputPortGroupBox_DragDrop(object sender, DragEventArgs e) {
    8375      if (e.Effect != DragDropEffects.None) {
    8476        IOutputPort port = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IOutputPort;
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/PortView.Designer.cs

    r11421 r11438  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      this.pathLabel = new System.Windows.Forms.Label();
     48      this.pathTextBox = new System.Windows.Forms.TextBox();
    4749      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    4850      this.SuspendLayout();
     
    5961      this.infoLabel.Location = new System.Drawing.Point(626, 3);
    6062      //
     63      // pathLabel
     64      //
     65      this.pathLabel.AutoSize = true;
     66      this.pathLabel.Location = new System.Drawing.Point(3, 29);
     67      this.pathLabel.Name = "pathLabel";
     68      this.pathLabel.Size = new System.Drawing.Size(32, 13);
     69      this.pathLabel.TabIndex = 3;
     70      this.pathLabel.Text = "&Path:";
     71      //
     72      // pathTextBox
     73      //
     74      this.pathTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     75            | System.Windows.Forms.AnchorStyles.Right)));
     76      this.pathTextBox.Location = new System.Drawing.Point(69, 26);
     77      this.pathTextBox.Name = "pathTextBox";
     78      this.pathTextBox.ReadOnly = true;
     79      this.pathTextBox.Size = new System.Drawing.Size(551, 20);
     80      this.pathTextBox.TabIndex = 4;
     81      //
    6182      // PortView
    6283      //
    6384      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     85      this.Controls.Add(this.pathTextBox);
     86      this.Controls.Add(this.pathLabel);
    6487      this.Name = "PortView";
    6588      this.Size = new System.Drawing.Size(645, 517);
     
    6790      this.Controls.SetChildIndex(this.nameTextBox, 0);
    6891      this.Controls.SetChildIndex(this.infoLabel, 0);
     92      this.Controls.SetChildIndex(this.pathLabel, 0);
     93      this.Controls.SetChildIndex(this.pathTextBox, 0);
    6994      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    7095      this.ResumeLayout(false);
     
    75100    #endregion
    76101
     102    protected System.Windows.Forms.Label pathLabel;
     103    protected System.Windows.Forms.TextBox pathTextBox;
     104
    77105
    78106  }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/PortView.cs

    r11421 r11438  
    2020#endregion
    2121
    22 using HeuristicLab.Common;
    2322using HeuristicLab.Core.Views;
    2423using HeuristicLab.MainForm;
     
    3938      InitializeComponent();
    4039    }
     40
     41    protected override void DeregisterContentEvents() {
     42      Content.PathChanged -= Content_PathChanged;
     43      base.DeregisterContentEvents();
     44    }
     45    protected override void RegisterContentEvents() {
     46      base.RegisterContentEvents();
     47      Content.PathChanged += Content_PathChanged;
     48    }
     49
     50    protected override void OnContentChanged() {
     51      base.OnContentChanged();
     52      pathTextBox.Text = Content == null ? string.Empty : Content.Path;
     53    }
     54
     55    protected override void SetEnabledStateOfControls() {
     56      base.SetEnabledStateOfControls();
     57      pathTextBox.Enabled = Content != null;
     58    }
     59
     60    protected virtual void Content_PathChanged(object sender, System.EventArgs e) {
     61      if (InvokeRequired)
     62        Invoke(new EventHandler(Content_PathChanged), sender, e);
     63      else {
     64        pathTextBox.Text = Content.Path;
     65      }
     66    }
    4167  }
    4268}
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ValuePortView.Designer.cs

    r11421 r11438  
    5757      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    5858      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    59       this.nameTextBox.Location = new System.Drawing.Point(69, 0);
    60       this.nameTextBox.Size = new System.Drawing.Size(551, 20);
    61       //
    62       // infoLabel
    63       //
    64       this.infoLabel.Location = new System.Drawing.Point(626, 3);
    6559      //
    6660      // valueGroupBox
     
    7064            | System.Windows.Forms.AnchorStyles.Right)));
    7165      this.valueGroupBox.Controls.Add(this.valuePanel);
    72       this.valueGroupBox.Location = new System.Drawing.Point(0, 26);
     66      this.valueGroupBox.Location = new System.Drawing.Point(0, 52);
    7367      this.valueGroupBox.Name = "valueGroupBox";
    74       this.valueGroupBox.Size = new System.Drawing.Size(645, 491);
    75       this.valueGroupBox.TabIndex = 3;
     68      this.valueGroupBox.Size = new System.Drawing.Size(645, 465);
     69      this.valueGroupBox.TabIndex = 5;
    7670      this.valueGroupBox.TabStop = false;
    7771      this.valueGroupBox.Text = "Value";
     
    8579      this.valuePanel.Location = new System.Drawing.Point(6, 19);
    8680      this.valuePanel.Name = "valuePanel";
    87       this.valuePanel.Size = new System.Drawing.Size(633, 466);
     81      this.valuePanel.Size = new System.Drawing.Size(633, 440);
    8882      this.valuePanel.TabIndex = 0;
    8983      //
     
    9791      this.valueViewHost.Name = "valueViewHost";
    9892      this.valueViewHost.ReadOnly = false;
    99       this.valueViewHost.Size = new System.Drawing.Size(633, 466);
     93      this.valueViewHost.Size = new System.Drawing.Size(633, 440);
    10094      this.valueViewHost.TabIndex = 0;
    10195      this.valueViewHost.ViewsLabelVisible = true;
     
    107101      this.Controls.Add(this.valueGroupBox);
    108102      this.Name = "ValuePortView";
    109       this.Size = new System.Drawing.Size(645, 517);
     103      this.Controls.SetChildIndex(this.pathLabel, 0);
     104      this.Controls.SetChildIndex(this.pathTextBox, 0);
    110105      this.Controls.SetChildIndex(this.nameLabel, 0);
    111106      this.Controls.SetChildIndex(this.nameTextBox, 0);
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/InputPort.cs

    r11431 r11438  
    8888      if (outputPort != null) {
    8989        outputPort.ValueChanged += OutputPort_ValueChanged;
    90         outputPort.PathChanged += OutputPort_PathChanged;
    9190      }
    9291    }
     
    9493      if (outputPort != null) {
    9594        outputPort.ValueChanged -= OutputPort_ValueChanged;
    96         outputPort.PathChanged -= OutputPort_PathChanged;
    9795      }
    9896    }
     
    105103      //DISCUSS: switch threads to decouple value propagation and to make communication asynchronous -> should be done in Node?
    106104    }
    107     protected void OutputPort_PathChanged(object sender, EventArgs e) {
    108       OnOutputPortChanged();
    109     }
    110105  }
    111106}
Note: See TracChangeset for help on using the changeset viewer.