Changeset 11438 for branches/OptimizationNetworks
- Timestamp:
- 10/10/14 02:35:44 (10 years ago)
- Location:
- branches/OptimizationNetworks
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/InputPortView.Designer.cs
r11412 r11438 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.outputPort Label = new System.Windows.Forms.Label();48 this.outputPort TextBox = new System.Windows.Forms.TextBox();47 this.outputPortGroupBox = new System.Windows.Forms.GroupBox(); 48 this.outputPortView = new HeuristicLab.Optimization.Networks.Views.PortView(); 49 49 this.valueGroupBox.SuspendLayout(); 50 50 this.valuePanel.SuspendLayout(); 51 51 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 52 this.outputPortGroupBox.SuspendLayout(); 52 53 this.SuspendLayout(); 53 54 // 54 55 // valueGroupBox 55 56 // 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; 59 60 // 60 61 // valuePanel 61 62 // 62 this.valuePanel.Size = new System.Drawing.Size(633, 440);63 this.valuePanel.Size = new System.Drawing.Size(633, 363); 63 64 // 64 65 // valueViewHost 65 66 // 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); 67 73 // 68 74 // nameTextBox … … 70 76 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 71 77 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 72 this.nameTextBox.Location = new System.Drawing.Point(7 3, 0);73 this.nameTextBox.Size = new System.Drawing.Size(54 7, 20);78 this.nameTextBox.Location = new System.Drawing.Point(71, 0); 79 this.nameTextBox.Size = new System.Drawing.Size(549, 20); 74 80 // 75 // outputPort Label81 // outputPortGroupBox 76 82 // 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); 83 95 // 84 // outputPort TextBox96 // outputPortView 85 97 // 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; 97 106 // 98 107 // InputPortView 99 108 // 100 109 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); 103 111 this.Name = "InputPortView"; 112 this.Controls.SetChildIndex(this.pathLabel, 0); 113 this.Controls.SetChildIndex(this.pathTextBox, 0); 104 114 this.Controls.SetChildIndex(this.nameLabel, 0); 105 115 this.Controls.SetChildIndex(this.nameTextBox, 0); 106 116 this.Controls.SetChildIndex(this.infoLabel, 0); 107 117 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); 110 119 this.valueGroupBox.ResumeLayout(false); 111 120 this.valuePanel.ResumeLayout(false); 112 121 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 122 this.outputPortGroupBox.ResumeLayout(false); 113 123 this.ResumeLayout(false); 114 124 this.PerformLayout(); … … 118 128 #endregion 119 129 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; 122 132 123 133 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/InputPortView.cs
r11431 r11438 39 39 } 40 40 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 49 41 protected override void DeregisterContentEvents() { 50 42 Content.OutputPortChanged -= Content_OutputPortChanged; … … 58 50 protected override void OnContentChanged() { 59 51 base.OnContentChanged(); 60 UpdateOutputPortTextBoxText();52 outputPortView.Content = Content == null ? null : Content.OutputPort; 61 53 } 62 54 63 55 protected override void SetEnabledStateOfControls() { 64 56 base.SetEnabledStateOfControls(); 65 outputPort TextBox.Enabled = Content != null && !ReadOnly;57 outputPortGroupBox.Enabled = Content != null && !ReadOnly; 66 58 } 67 59 … … 70 62 Invoke(new EventHandler(Content_OutputPortChanged), sender, e); 71 63 else { 72 UpdateOutputPortTextBoxText();64 outputPortView.Content = Content.OutputPort; 73 65 } 74 66 } 75 67 76 protected virtual void outputPort TextBox_DragEnterOver(object sender, DragEventArgs e) {68 protected virtual void outputPortGroupBox_DragEnterOver(object sender, DragEventArgs e) { 77 69 e.Effect = DragDropEffects.None; 78 70 if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IOutputPort)) { … … 80 72 } 81 73 } 82 protected virtual void outputPort TextBox_DragDrop(object sender, DragEventArgs e) {74 protected virtual void outputPortGroupBox_DragDrop(object sender, DragEventArgs e) { 83 75 if (e.Effect != DragDropEffects.None) { 84 76 IOutputPort port = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IOutputPort; -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/PortView.Designer.cs
r11421 r11438 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.pathLabel = new System.Windows.Forms.Label(); 48 this.pathTextBox = new System.Windows.Forms.TextBox(); 47 49 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 48 50 this.SuspendLayout(); … … 59 61 this.infoLabel.Location = new System.Drawing.Point(626, 3); 60 62 // 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 // 61 82 // PortView 62 83 // 63 84 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 85 this.Controls.Add(this.pathTextBox); 86 this.Controls.Add(this.pathLabel); 64 87 this.Name = "PortView"; 65 88 this.Size = new System.Drawing.Size(645, 517); … … 67 90 this.Controls.SetChildIndex(this.nameTextBox, 0); 68 91 this.Controls.SetChildIndex(this.infoLabel, 0); 92 this.Controls.SetChildIndex(this.pathLabel, 0); 93 this.Controls.SetChildIndex(this.pathTextBox, 0); 69 94 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 70 95 this.ResumeLayout(false); … … 75 100 #endregion 76 101 102 protected System.Windows.Forms.Label pathLabel; 103 protected System.Windows.Forms.TextBox pathTextBox; 104 77 105 78 106 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/PortView.cs
r11421 r11438 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core.Views; 24 23 using HeuristicLab.MainForm; … … 39 38 InitializeComponent(); 40 39 } 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 } 41 67 } 42 68 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ValuePortView.Designer.cs
r11421 r11438 57 57 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 58 58 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 // infoLabel63 //64 this.infoLabel.Location = new System.Drawing.Point(626, 3);65 59 // 66 60 // valueGroupBox … … 70 64 | System.Windows.Forms.AnchorStyles.Right))); 71 65 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); 73 67 this.valueGroupBox.Name = "valueGroupBox"; 74 this.valueGroupBox.Size = new System.Drawing.Size(645, 4 91);75 this.valueGroupBox.TabIndex = 3;68 this.valueGroupBox.Size = new System.Drawing.Size(645, 465); 69 this.valueGroupBox.TabIndex = 5; 76 70 this.valueGroupBox.TabStop = false; 77 71 this.valueGroupBox.Text = "Value"; … … 85 79 this.valuePanel.Location = new System.Drawing.Point(6, 19); 86 80 this.valuePanel.Name = "valuePanel"; 87 this.valuePanel.Size = new System.Drawing.Size(633, 4 66);81 this.valuePanel.Size = new System.Drawing.Size(633, 440); 88 82 this.valuePanel.TabIndex = 0; 89 83 // … … 97 91 this.valueViewHost.Name = "valueViewHost"; 98 92 this.valueViewHost.ReadOnly = false; 99 this.valueViewHost.Size = new System.Drawing.Size(633, 4 66);93 this.valueViewHost.Size = new System.Drawing.Size(633, 440); 100 94 this.valueViewHost.TabIndex = 0; 101 95 this.valueViewHost.ViewsLabelVisible = true; … … 107 101 this.Controls.Add(this.valueGroupBox); 108 102 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); 110 105 this.Controls.SetChildIndex(this.nameLabel, 0); 111 106 this.Controls.SetChildIndex(this.nameTextBox, 0); -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/InputPort.cs
r11431 r11438 88 88 if (outputPort != null) { 89 89 outputPort.ValueChanged += OutputPort_ValueChanged; 90 outputPort.PathChanged += OutputPort_PathChanged;91 90 } 92 91 } … … 94 93 if (outputPort != null) { 95 94 outputPort.ValueChanged -= OutputPort_ValueChanged; 96 outputPort.PathChanged -= OutputPort_PathChanged;97 95 } 98 96 } … … 105 103 //DISCUSS: switch threads to decouple value propagation and to make communication asynchronous -> should be done in Node? 106 104 } 107 protected void OutputPort_PathChanged(object sender, EventArgs e) {108 OnOutputPortChanged();109 }110 105 } 111 106 }
Note: See TracChangeset
for help on using the changeset viewer.