Changeset 3361
- Timestamp:
- 04/16/10 01:39:32 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorGraphView.cs
r3281 r3361 31 31 /// </summary> 32 32 [View("OperatorGraph View (Tree)",ShowInViewHost=true)] 33 [Content(typeof(OperatorGraph), true)]33 [Content(typeof(OperatorGraph), false)] 34 34 public partial class OperatorGraphView : ItemView { 35 35 /// <summary> -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.cs
r3350 r3361 63 63 viewContextMenuStrip.Item = content; 64 64 cachedViews.Clear(); 65 this.viewsLabel.Enabled = value != null; 65 66 Initialize(); 66 67 } … … 73 74 this.SuspendRepaint(); 74 75 base.Enabled = value; 75 this.viewsLabel.Enabled = value; 76 if (Content != null && value) 77 this.viewsLabel.Enabled = value; 76 78 this.ResumeRepaint(true); 77 79 } … … 113 115 114 116 if (Content != null) { 115 if (viewContextMenuStrip.Items.Count == 0) 117 if (viewContextMenuStrip.Items.Count == 0) 116 118 messageLabel.Visible = true; 117 else119 else 118 120 viewsLabel.Visible = true; 119 121 … … 140 142 UpdateActiveMenuItem(); 141 143 cachedViews.Clear(); 142 Control view = (Control)MainFormManager.CreateView(viewType, Content, ReadOnly);144 Control view = (Control)MainFormManager.CreateView(viewType, Content, ReadOnly); 143 145 cachedViews.Add(viewType, ((IView)view)); 144 146 view.Dock = DockStyle.Fill; … … 168 170 169 171 private void viewsLabel_DoubleClick(object sender, EventArgs e) { 170 MainFormManager.CreateView(viewType, Content, ReadOnly).Show();172 MainFormManager.CreateView(viewType, Content, ReadOnly).Show(); 171 173 } 172 174 -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.cs
r3355 r3361 38 38 namespace HeuristicLab.Operators.Views.GraphVisualization { 39 39 [View("OperatorGraph View (Chart)")] 40 [Content(typeof(OperatorGraph), false)]40 [Content(typeof(OperatorGraph), true)] 41 41 public partial class OperatorGraphView : ContentView { 42 42 public OperatorGraphView() { … … 93 93 graphVisualizationInfoView.ReadOnly = true; 94 94 connectButton.Enabled = false; 95 96 95 } else { 97 96 selectButton.Enabled = true; -
trunk/sources/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.Designer.cs
r3306 r3361 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EngineAlgorithmView)); 47 48 this.engineLabel = new System.Windows.Forms.Label(); 48 49 this.createUserDefinedAlgorithmButton = new System.Windows.Forms.Button(); … … 50 51 this.engineTabPage = new System.Windows.Forms.TabPage(); 51 52 this.engineViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 53 this.operatorGraphTabPage = new System.Windows.Forms.TabPage(); 54 this.saveOperatorGraphButton = new System.Windows.Forms.Button(); 55 this.openOperatorGraphButton = new System.Windows.Forms.Button(); 56 this.newOperatorGraphButton = new System.Windows.Forms.Button(); 57 this.operatorGraphViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 52 58 this.tabControl.SuspendLayout(); 53 59 this.parametersTabPage.SuspendLayout(); … … 58 64 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 59 65 this.engineTabPage.SuspendLayout(); 66 this.operatorGraphTabPage.SuspendLayout(); 60 67 this.SuspendLayout(); 61 68 // 62 69 // tabControl 63 70 // 71 this.tabControl.Controls.Add(this.operatorGraphTabPage); 64 72 this.tabControl.Controls.Add(this.engineTabPage); 65 73 this.tabControl.Size = new System.Drawing.Size(713, 467); 74 this.tabControl.Controls.SetChildIndex(this.engineTabPage, 0); 75 this.tabControl.Controls.SetChildIndex(this.operatorGraphTabPage, 0); 66 76 this.tabControl.Controls.SetChildIndex(this.runsTabPage, 0); 67 77 this.tabControl.Controls.SetChildIndex(this.resultsTabPage, 0); 68 this.tabControl.Controls.SetChildIndex(this.engineTabPage, 0);69 78 this.tabControl.Controls.SetChildIndex(this.problemTabPage, 0); 70 79 this.tabControl.Controls.SetChildIndex(this.parametersTabPage, 0); … … 187 196 this.engineComboBox.Location = new System.Drawing.Point(55, 6); 188 197 this.engineComboBox.Name = "engineComboBox"; 189 this.engineComboBox.Size = new System.Drawing.Size(6 44, 21);198 this.engineComboBox.Size = new System.Drawing.Size(610, 21); 190 199 this.engineComboBox.TabIndex = 1; 191 200 this.engineComboBox.SelectedIndexChanged += new System.EventHandler(this.engineComboBox_SelectedIndexChanged); … … 212 221 this.engineViewHost.Location = new System.Drawing.Point(6, 33); 213 222 this.engineViewHost.Name = "engineViewHost"; 214 this.engineViewHost.Size = new System.Drawing.Size(693, 402); 223 this.engineViewHost.ReadOnly = false; 224 this.engineViewHost.Size = new System.Drawing.Size(659, 335); 215 225 this.engineViewHost.TabIndex = 2; 216 226 this.engineViewHost.ViewType = null; 227 // 228 // operatorGraphTabPage 229 // 230 this.operatorGraphTabPage.Controls.Add(this.saveOperatorGraphButton); 231 this.operatorGraphTabPage.Controls.Add(this.openOperatorGraphButton); 232 this.operatorGraphTabPage.Controls.Add(this.newOperatorGraphButton); 233 this.operatorGraphTabPage.Controls.Add(this.operatorGraphViewHost); 234 this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22); 235 this.operatorGraphTabPage.Name = "operatorGraphTabPage"; 236 this.operatorGraphTabPage.Size = new System.Drawing.Size(705, 441); 237 this.operatorGraphTabPage.TabIndex = 4; 238 this.operatorGraphTabPage.Text = "Operator Graph"; 239 this.operatorGraphTabPage.UseVisualStyleBackColor = true; 240 // 241 // saveOperatorGraphButton 242 // 243 this.saveOperatorGraphButton.Enabled = false; 244 this.saveOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save; 245 this.saveOperatorGraphButton.Location = new System.Drawing.Point(63, 3); 246 this.saveOperatorGraphButton.Name = "saveOperatorGraphButton"; 247 this.saveOperatorGraphButton.Size = new System.Drawing.Size(24, 24); 248 this.saveOperatorGraphButton.TabIndex = 1; 249 this.toolTip.SetToolTip(this.saveOperatorGraphButton, "Save Operator Graph"); 250 this.saveOperatorGraphButton.UseVisualStyleBackColor = true; 251 // 252 // openOperatorGraphButton 253 // 254 this.openOperatorGraphButton.Enabled = false; 255 this.openOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Open; 256 this.openOperatorGraphButton.Location = new System.Drawing.Point(33, 3); 257 this.openOperatorGraphButton.Name = "openOperatorGraphButton"; 258 this.openOperatorGraphButton.Size = new System.Drawing.Size(24, 24); 259 this.openOperatorGraphButton.TabIndex = 1; 260 this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph"); 261 this.openOperatorGraphButton.UseVisualStyleBackColor = true; 262 // 263 // newOperatorGraphButton 264 // 265 this.newOperatorGraphButton.Enabled = false; 266 this.newOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument; 267 this.newOperatorGraphButton.Location = new System.Drawing.Point(3, 3); 268 this.newOperatorGraphButton.Name = "newOperatorGraphButton"; 269 this.newOperatorGraphButton.Size = new System.Drawing.Size(24, 24); 270 this.newOperatorGraphButton.TabIndex = 1; 271 this.toolTip.SetToolTip(this.newOperatorGraphButton, "New Operator Graph"); 272 this.newOperatorGraphButton.UseVisualStyleBackColor = true; 273 // 274 // operatorGraphViewHost 275 // 276 this.operatorGraphViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 277 | System.Windows.Forms.AnchorStyles.Left) 278 | System.Windows.Forms.AnchorStyles.Right))); 279 this.operatorGraphViewHost.Content = null; 280 this.operatorGraphViewHost.Location = new System.Drawing.Point(3, 33); 281 this.operatorGraphViewHost.Name = "operatorGraphViewHost"; 282 this.operatorGraphViewHost.ReadOnly = true; 283 this.operatorGraphViewHost.Size = new System.Drawing.Size(699, 405); 284 this.operatorGraphViewHost.TabIndex = 0; 285 this.operatorGraphViewHost.ViewType = null; 217 286 // 218 287 // EngineAlgorithmView … … 244 313 this.engineTabPage.ResumeLayout(false); 245 314 this.engineTabPage.PerformLayout(); 315 this.operatorGraphTabPage.ResumeLayout(false); 246 316 this.ResumeLayout(false); 247 317 this.PerformLayout(); … … 256 326 protected System.Windows.Forms.TabPage engineTabPage; 257 327 protected HeuristicLab.MainForm.WindowsForms.ViewHost engineViewHost; 328 protected System.Windows.Forms.TabPage operatorGraphTabPage; 329 protected HeuristicLab.MainForm.WindowsForms.ViewHost operatorGraphViewHost; 330 protected System.Windows.Forms.Button saveOperatorGraphButton; 331 protected System.Windows.Forms.Button openOperatorGraphButton; 332 protected System.Windows.Forms.Button newOperatorGraphButton; 258 333 259 334 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.cs
r3262 r3361 59 59 60 60 protected override void DeregisterContentEvents() { 61 Content.EngineChanged -= new System.EventHandler(Content_EngineChanged); 61 Content.EngineChanged -= new EventHandler(Content_EngineChanged); 62 Content.OperatorGraphChanged -= new EventHandler(Content_OperatorGraphChanged); 62 63 base.DeregisterContentEvents(); 63 64 } 64 65 protected override void RegisterContentEvents() { 65 66 base.RegisterContentEvents(); 66 Content.EngineChanged += new System.EventHandler(Content_EngineChanged); 67 Content.EngineChanged += new EventHandler(Content_EngineChanged); 68 Content.OperatorGraphChanged += new EventHandler(Content_OperatorGraphChanged); 67 69 } 68 70 … … 87 89 engineViewHost.Content = null; 88 90 createUserDefinedAlgorithmButton.Enabled = false; 91 operatorGraphViewHost.Content = null; 89 92 } else { 90 93 if (Content.Engine == null) … … 94 97 engineViewHost.ViewType = null; 95 98 engineViewHost.Content = Content.Engine; 99 operatorGraphViewHost.ViewType = null; 100 operatorGraphViewHost.Content = Content.OperatorGraph; 96 101 createUserDefinedAlgorithmButton.Enabled = true; 97 102 } … … 105 110 engineComboBox.Enabled = Content.ExecutionState != ExecutionState.Started; 106 111 engineViewHost.Enabled = Content.ExecutionState != ExecutionState.Started; 112 operatorGraphViewHost.Enabled = Content.ExecutionState != ExecutionState.Started; 107 113 base.Content_ExecutionStateChanged(sender, e); 108 114 } … … 118 124 engineViewHost.ViewType = null; 119 125 engineViewHost.Content = Content.Engine; 126 } 127 } 128 private void Content_OperatorGraphChanged(object sender, EventArgs e) { 129 if (InvokeRequired) 130 Invoke(new EventHandler(Content_OperatorGraphChanged), sender, e); 131 else { 132 operatorGraphViewHost.ViewType = null; 133 operatorGraphViewHost.Content = Content.OperatorGraph; 120 134 } 121 135 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.Designer.cs
r3306 r3361 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.operatorGraphTabPage = new System.Windows.Forms.TabPage();48 this.saveOperatorGraphButton = new System.Windows.Forms.Button();49 this.openOperatorGraphButton = new System.Windows.Forms.Button();50 this.newOperatorGraphButton = new System.Windows.Forms.Button();51 this.operatorGraphViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();52 47 this.globalScopeTabPage = new System.Windows.Forms.TabPage(); 53 48 this.globalScopeView = new HeuristicLab.Core.Views.ScopeView(); … … 60 55 this.problemPanel.SuspendLayout(); 61 56 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 62 this.operatorGraphTabPage.SuspendLayout();63 57 this.globalScopeTabPage.SuspendLayout(); 64 58 this.SuspendLayout(); … … 72 66 // tabControl 73 67 // 74 this.tabControl.Controls.Add(this.operatorGraphTabPage);75 68 this.tabControl.Controls.Add(this.globalScopeTabPage); 76 69 this.tabControl.Controls.SetChildIndex(this.globalScopeTabPage, 0); … … 115 108 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 116 109 // 117 // operatorGraphTabPage118 //119 this.operatorGraphTabPage.Controls.Add(this.saveOperatorGraphButton);120 this.operatorGraphTabPage.Controls.Add(this.openOperatorGraphButton);121 this.operatorGraphTabPage.Controls.Add(this.newOperatorGraphButton);122 this.operatorGraphTabPage.Controls.Add(this.operatorGraphViewHost);123 this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22);124 this.operatorGraphTabPage.Name = "operatorGraphTabPage";125 this.operatorGraphTabPage.Size = new System.Drawing.Size(705, 441);126 this.operatorGraphTabPage.TabIndex = 2;127 this.operatorGraphTabPage.Text = "Operator Graph";128 this.operatorGraphTabPage.UseVisualStyleBackColor = true;129 //130 // saveOperatorGraphButton131 //132 this.saveOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save;133 this.saveOperatorGraphButton.Location = new System.Drawing.Point(63, 3);134 this.saveOperatorGraphButton.Name = "saveOperatorGraphButton";135 this.saveOperatorGraphButton.Size = new System.Drawing.Size(24, 24);136 this.saveOperatorGraphButton.TabIndex = 1;137 this.toolTip.SetToolTip(this.saveOperatorGraphButton, "Save Operator Graph");138 this.saveOperatorGraphButton.UseVisualStyleBackColor = true;139 this.saveOperatorGraphButton.Click += new System.EventHandler(this.saveOperatorGraphButton_Click);140 //141 // openOperatorGraphButton142 //143 this.openOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Open;144 this.openOperatorGraphButton.Location = new System.Drawing.Point(33, 3);145 this.openOperatorGraphButton.Name = "openOperatorGraphButton";146 this.openOperatorGraphButton.Size = new System.Drawing.Size(24, 24);147 this.openOperatorGraphButton.TabIndex = 1;148 this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph");149 this.openOperatorGraphButton.UseVisualStyleBackColor = true;150 this.openOperatorGraphButton.Click += new System.EventHandler(this.openOperatorGraphButton_Click);151 //152 // newOperatorGraphButton153 //154 this.newOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument;155 this.newOperatorGraphButton.Location = new System.Drawing.Point(3, 3);156 this.newOperatorGraphButton.Name = "newOperatorGraphButton";157 this.newOperatorGraphButton.Size = new System.Drawing.Size(24, 24);158 this.newOperatorGraphButton.TabIndex = 1;159 this.toolTip.SetToolTip(this.newOperatorGraphButton, "New Operator Graph");160 this.newOperatorGraphButton.UseVisualStyleBackColor = true;161 this.newOperatorGraphButton.Click += new System.EventHandler(this.newOperatorGraphButton_Click);162 //163 // operatorGraphViewHost164 //165 this.operatorGraphViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)166 | System.Windows.Forms.AnchorStyles.Left)167 | System.Windows.Forms.AnchorStyles.Right)));168 this.operatorGraphViewHost.Content = null;169 this.operatorGraphViewHost.Location = new System.Drawing.Point(3, 33);170 this.operatorGraphViewHost.Name = "operatorGraphViewHost";171 this.operatorGraphViewHost.Size = new System.Drawing.Size(699, 405);172 this.operatorGraphViewHost.TabIndex = 0;173 this.operatorGraphViewHost.ViewType = null;174 //175 110 // globalScopeTabPage 176 111 // … … 192 127 this.globalScopeView.Location = new System.Drawing.Point(3, 3); 193 128 this.globalScopeView.Name = "globalScopeView"; 129 this.globalScopeView.ReadOnly = false; 194 130 this.globalScopeView.Size = new System.Drawing.Size(699, 435); 195 131 this.globalScopeView.TabIndex = 0; … … 209 145 this.problemPanel.ResumeLayout(false); 210 146 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 211 this.operatorGraphTabPage.ResumeLayout(false);212 147 this.globalScopeTabPage.ResumeLayout(false); 213 148 this.ResumeLayout(false); … … 218 153 #endregion 219 154 220 private System.Windows.Forms.TabPage operatorGraphTabPage;221 155 private System.Windows.Forms.TabPage globalScopeTabPage; 222 156 private HeuristicLab.Core.Views.ScopeView globalScopeView; 223 private System.Windows.Forms.Button saveOperatorGraphButton;224 private System.Windows.Forms.Button openOperatorGraphButton;225 private System.Windows.Forms.Button newOperatorGraphButton;226 private HeuristicLab.MainForm.WindowsForms.ViewHost operatorGraphViewHost;227 157 228 158 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs
r3262 r3361 54 54 } 55 55 56 protected override void DeregisterContentEvents() {57 Content.OperatorGraphChanged -= new EventHandler(Content_OperatorGraphChanged);58 base.DeregisterContentEvents();59 }60 protected override void RegisterContentEvents() {61 base.RegisterContentEvents();62 Content.OperatorGraphChanged += new EventHandler(Content_OperatorGraphChanged);63 }64 65 56 protected override void OnContentChanged() { 66 57 base.OnContentChanged(); 67 if (Content == null) { 68 operatorGraphViewHost.Content = null; 58 if (Content == null) 69 59 globalScopeView.Content = null; 70 } else { 71 operatorGraphViewHost.ViewType = null; 72 operatorGraphViewHost.Content = Content.OperatorGraph; 60 else 73 61 globalScopeView.Content = Content.GlobalScope; 74 }75 62 } 76 63 … … 80 67 else { 81 68 newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = Content.ExecutionState != ExecutionState.Started; 82 operatorGraphViewHost.Enabled = Content.ExecutionState != ExecutionState.Started;83 69 globalScopeView.Enabled = Content.ExecutionState != ExecutionState.Started; 84 70 base.Content_ExecutionStateChanged(sender, e); 85 }86 }87 private void Content_OperatorGraphChanged(object sender, EventArgs e) {88 if (InvokeRequired)89 Invoke(new EventHandler(Content_OperatorGraphChanged), sender, e);90 else {91 operatorGraphViewHost.ViewType = null;92 operatorGraphViewHost.Content = Content.OperatorGraph;93 71 } 94 72 } -
trunk/sources/HeuristicLab.Optimization/3.3/EngineAlgorithm.cs
r3303 r3361 36 36 [Storable] 37 37 private OperatorGraph operatorGraph; 38 p rotectedOperatorGraph OperatorGraph {38 public OperatorGraph OperatorGraph { 39 39 get { return operatorGraph; } 40 set {40 protected set { 41 41 if (value == null) throw new ArgumentNullException(); 42 42 if (value != operatorGraph) { … … 194 194 EngineChanged(this, EventArgs.Empty); 195 195 } 196 protected virtual void OnOperatorGraphChanged() { } 196 public event EventHandler OperatorGraphChanged; 197 protected virtual void OnOperatorGraphChanged() { 198 EventHandler handler = OperatorGraphChanged; 199 if (handler != null) handler(this, EventArgs.Empty); 200 } 197 201 protected override void OnStopped() { 198 202 if (Problem != null) { -
trunk/sources/HeuristicLab.Optimization/3.3/UserDefinedAlgorithm.cs
r3286 r3361 54 54 [StorableConstructor] 55 55 private UserDefinedAlgorithm(bool deserializing) : base(deserializing) { } 56 57 public event EventHandler OperatorGraphChanged;58 protected override void OnOperatorGraphChanged() {59 EventHandler handler = OperatorGraphChanged;60 if (handler != null) handler(this, EventArgs.Empty);61 }62 56 } 63 57 }
Note: See TracChangeset
for help on using the changeset viewer.