Changeset 6425
- Timestamp:
- 06/16/11 10:56:26 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.Designer.cs
r5832 r6425 34 34 /// </summary> 35 35 private void InitializeComponent() { 36 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AlgorithmView)); 36 37 this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl(); 37 38 this.problemTabPage = new System.Windows.Forms.TabPage(); … … 46 47 this.storeAlgorithmInEachRunCheckBox = new System.Windows.Forms.CheckBox(); 47 48 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView(); 48 this.startButton = new System.Windows.Forms.Button();49 this.pauseButton = new System.Windows.Forms.Button();50 this.resetButton = new System.Windows.Forms.Button();51 this.executionTimeLabel = new System.Windows.Forms.Label();52 this.executionTimeTextBox = new System.Windows.Forms.TextBox();53 49 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 54 this.stopButton = new System.Windows.Forms.Button();55 50 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 56 51 this.tabControl.SuspendLayout(); … … 61 56 this.SuspendLayout(); 62 57 // 58 // startButton 59 // 60 this.startButton.Location = new System.Drawing.Point(0, 458); 61 this.toolTip.SetToolTip(this.startButton, "Start/Resume Experiment"); 62 // 63 // executionTimeTextBox 64 // 65 this.executionTimeTextBox.Location = new System.Drawing.Point(542, 462); 66 // 67 // executionTimeLabel 68 // 69 this.executionTimeLabel.Location = new System.Drawing.Point(453, 465); 70 // 71 // pauseButton 72 // 73 this.pauseButton.Location = new System.Drawing.Point(30, 458); 74 this.toolTip.SetToolTip(this.pauseButton, "Pause Experiment"); 75 // 76 // stopButton 77 // 78 this.stopButton.Location = new System.Drawing.Point(60, 458); 79 this.toolTip.SetToolTip(this.stopButton, "Stop Experiment"); 80 // 81 // resetButton 82 // 83 this.resetButton.Location = new System.Drawing.Point(90, 458); 84 this.toolTip.SetToolTip(this.resetButton, "Reset Experiment"); 85 // 63 86 // nameTextBox 64 87 // … … 76 99 this.tabControl.AllowDrop = true; 77 100 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 78 79 101 | System.Windows.Forms.AnchorStyles.Left) 102 | System.Windows.Forms.AnchorStyles.Right))); 80 103 this.tabControl.Controls.Add(this.problemTabPage); 81 104 this.tabControl.Controls.Add(this.parametersTabPage); … … 85 108 this.tabControl.Name = "tabControl"; 86 109 this.tabControl.SelectedIndex = 0; 87 this.tabControl.Size = new System.Drawing.Size(679, 4 26);110 this.tabControl.Size = new System.Drawing.Size(679, 430); 88 111 this.tabControl.TabIndex = 3; 89 112 // … … 97 120 this.problemTabPage.Name = "problemTabPage"; 98 121 this.problemTabPage.Padding = new System.Windows.Forms.Padding(3); 99 this.problemTabPage.Size = new System.Drawing.Size(671, 40 0);122 this.problemTabPage.Size = new System.Drawing.Size(671, 404); 100 123 this.problemTabPage.TabIndex = 0; 101 124 this.problemTabPage.Text = "Problem"; … … 108 131 // 109 132 this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 110 111 133 | System.Windows.Forms.AnchorStyles.Left) 134 | System.Windows.Forms.AnchorStyles.Right))); 112 135 this.problemViewHost.Caption = "View"; 113 136 this.problemViewHost.Content = null; … … 116 139 this.problemViewHost.Name = "problemViewHost"; 117 140 this.problemViewHost.ReadOnly = false; 118 this.problemViewHost.Size = new System.Drawing.Size(659, 3 58);141 this.problemViewHost.Size = new System.Drawing.Size(659, 362); 119 142 this.problemViewHost.TabIndex = 3; 120 143 this.problemViewHost.ViewsLabelVisible = true; … … 156 179 // parameterCollectionView 157 180 // 181 this.parameterCollectionView.AllowEditingOfHiddenParameters = true; 158 182 this.parameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 159 160 183 | System.Windows.Forms.AnchorStyles.Left) 184 | System.Windows.Forms.AnchorStyles.Right))); 161 185 this.parameterCollectionView.Caption = "ParameterCollection View"; 162 186 this.parameterCollectionView.Content = null; … … 181 205 // 182 206 this.resultsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 183 184 207 | System.Windows.Forms.AnchorStyles.Left) 208 | System.Windows.Forms.AnchorStyles.Right))); 185 209 this.resultsView.Caption = "ResultCollection View"; 186 210 this.resultsView.Content = null; … … 222 246 // 223 247 this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 224 225 248 | System.Windows.Forms.AnchorStyles.Left) 249 | System.Windows.Forms.AnchorStyles.Right))); 226 250 this.runsView.Caption = "RunCollection View"; 227 251 this.runsView.Content = null; … … 232 256 this.runsView.TabIndex = 0; 233 257 // 234 // startButton235 //236 this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));237 this.startButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play;238 this.startButton.Location = new System.Drawing.Point(0, 458);239 this.startButton.Name = "startButton";240 this.startButton.Size = new System.Drawing.Size(24, 24);241 this.startButton.TabIndex = 4;242 this.toolTip.SetToolTip(this.startButton, "Start/Resume Algorithm");243 this.startButton.UseVisualStyleBackColor = true;244 this.startButton.Click += new System.EventHandler(this.startButton_Click);245 //246 // pauseButton247 //248 this.pauseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));249 this.pauseButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Pause;250 this.pauseButton.Location = new System.Drawing.Point(30, 458);251 this.pauseButton.Name = "pauseButton";252 this.pauseButton.Size = new System.Drawing.Size(24, 24);253 this.pauseButton.TabIndex = 5;254 this.toolTip.SetToolTip(this.pauseButton, "Pause Algorithm");255 this.pauseButton.UseVisualStyleBackColor = true;256 this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click);257 //258 // resetButton259 //260 this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));261 this.resetButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Restart;262 this.resetButton.Location = new System.Drawing.Point(90, 458);263 this.resetButton.Name = "resetButton";264 this.resetButton.Size = new System.Drawing.Size(24, 24);265 this.resetButton.TabIndex = 7;266 this.toolTip.SetToolTip(this.resetButton, "Reset Algorithm");267 this.resetButton.UseVisualStyleBackColor = true;268 this.resetButton.Click += new System.EventHandler(this.resetButton_Click);269 //270 // executionTimeLabel271 //272 this.executionTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));273 this.executionTimeLabel.AutoSize = true;274 this.executionTimeLabel.Location = new System.Drawing.Point(453, 465);275 this.executionTimeLabel.Name = "executionTimeLabel";276 this.executionTimeLabel.Size = new System.Drawing.Size(83, 13);277 this.executionTimeLabel.TabIndex = 8;278 this.executionTimeLabel.Text = "&Execution Time:";279 //280 // executionTimeTextBox281 //282 this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));283 this.executionTimeTextBox.Location = new System.Drawing.Point(542, 462);284 this.executionTimeTextBox.Name = "executionTimeTextBox";285 this.executionTimeTextBox.ReadOnly = true;286 this.executionTimeTextBox.Size = new System.Drawing.Size(137, 20);287 this.executionTimeTextBox.TabIndex = 9;288 //289 258 // openFileDialog 290 259 // … … 294 263 this.openFileDialog.Title = "Open Problem"; 295 264 // 296 // stopButton297 //298 this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));299 this.stopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Stop;300 this.stopButton.Location = new System.Drawing.Point(60, 458);301 this.stopButton.Name = "stopButton";302 this.stopButton.Size = new System.Drawing.Size(24, 24);303 this.stopButton.TabIndex = 6;304 this.toolTip.SetToolTip(this.stopButton, "Stop Algorithm");305 this.stopButton.UseVisualStyleBackColor = true;306 this.stopButton.Click += new System.EventHandler(this.stopButton_Click);307 //308 265 // AlgorithmView 309 266 // … … 311 268 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 312 269 this.Controls.Add(this.tabControl); 313 this.Controls.Add(this.startButton);314 this.Controls.Add(this.pauseButton);315 this.Controls.Add(this.executionTimeTextBox);316 this.Controls.Add(this.executionTimeLabel);317 this.Controls.Add(this.stopButton);318 this.Controls.Add(this.resetButton);319 270 this.Name = "AlgorithmView"; 320 271 this.Size = new System.Drawing.Size(679, 482); 321 this.Controls.SetChildIndex(this.infoLabel, 0);322 this.Controls.SetChildIndex(this.resetButton, 0);323 this.Controls.SetChildIndex(this.stopButton, 0);324 272 this.Controls.SetChildIndex(this.executionTimeLabel, 0); 325 273 this.Controls.SetChildIndex(this.executionTimeTextBox, 0); 274 this.Controls.SetChildIndex(this.resetButton, 0); 275 this.Controls.SetChildIndex(this.tabControl, 0); 276 this.Controls.SetChildIndex(this.stopButton, 0); 326 277 this.Controls.SetChildIndex(this.pauseButton, 0); 327 278 this.Controls.SetChildIndex(this.startButton, 0); 328 this.Controls.SetChildIndex(this. tabControl, 0);279 this.Controls.SetChildIndex(this.infoLabel, 0); 329 280 this.Controls.SetChildIndex(this.nameLabel, 0); 330 281 this.Controls.SetChildIndex(this.nameTextBox, 0); … … 350 301 protected System.Windows.Forms.Button newProblemButton; 351 302 protected System.Windows.Forms.Button openProblemButton; 352 protected System.Windows.Forms.Button startButton;353 protected System.Windows.Forms.Button pauseButton;354 protected System.Windows.Forms.Button resetButton;355 protected System.Windows.Forms.Label executionTimeLabel;356 protected System.Windows.Forms.TextBox executionTimeTextBox;357 303 protected System.Windows.Forms.OpenFileDialog openFileDialog; 358 304 protected System.Windows.Forms.TabPage resultsTabPage; 359 305 protected HeuristicLab.Optimization.Views.ResultCollectionView resultsView; 360 protected System.Windows.Forms.Button stopButton;361 306 protected System.Windows.Forms.TabPage runsTabPage; 362 307 protected RunCollectionView runsView; -
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs
r5837 r6425 31 31 32 32 namespace HeuristicLab.Optimization.Views { 33 /// <summary>34 /// The base class for visual representations of algorithms.35 /// </summary>36 33 [View("Algorithm View")] 37 34 [Content(typeof(Algorithm), true)] 38 35 [Content(typeof(IAlgorithm), false)] 39 public partial class AlgorithmView : NamedItemView {36 public partial class AlgorithmView : IOptimizerView { 40 37 private TypeSelectorDialog problemTypeSelectorDialog; 38 public AlgorithmView() { 39 InitializeComponent(); 40 } 41 41 42 42 public new IAlgorithm Content { 43 43 get { return (IAlgorithm)base.Content; } 44 44 set { base.Content = value; } 45 }46 47 /// <summary>48 /// Initializes a new instance of <see cref="ItemBaseView"/>.49 /// </summary>50 public AlgorithmView() {51 InitializeComponent();52 45 } 53 46 … … 75 68 76 69 protected override void DeregisterContentEvents() { 77 Content.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred);78 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);79 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);80 Content.Prepared -= new EventHandler(Content_Prepared);81 Content.Started -= new EventHandler(Content_Started);82 Content.Paused -= new EventHandler(Content_Paused);83 Content.Stopped -= new EventHandler(Content_Stopped);84 70 Content.ProblemChanged -= new EventHandler(Content_ProblemChanged); 85 71 Content.StoreAlgorithmInEachRunChanged -= new EventHandler(Content_StoreAlgorithmInEachRunChanged); … … 88 74 protected override void RegisterContentEvents() { 89 75 base.RegisterContentEvents(); 90 Content.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred);91 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);92 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);93 Content.Prepared += new EventHandler(Content_Prepared);94 Content.Started += new EventHandler(Content_Started);95 Content.Paused += new EventHandler(Content_Paused);96 Content.Stopped += new EventHandler(Content_Stopped);97 76 Content.ProblemChanged += new EventHandler(Content_ProblemChanged); 98 77 Content.StoreAlgorithmInEachRunChanged += new EventHandler(Content_StoreAlgorithmInEachRunChanged); … … 107 86 runsView.Content = null; 108 87 storeAlgorithmInEachRunCheckBox.Checked = true; 109 executionTimeTextBox.Text = "-";110 88 } else { 111 Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started;112 89 parameterCollectionView.Content = Content.Parameters; 113 90 problemViewHost.ViewType = null; … … 116 93 runsView.Content = Content.Runs; 117 94 storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun; 118 executionTimeTextBox.Text = Content.ExecutionTime.ToString();119 95 } 120 96 } … … 129 105 runsView.Enabled = Content != null; 130 106 storeAlgorithmInEachRunCheckBox.Enabled = Content != null && !ReadOnly; 131 executionTimeTextBox.Enabled = Content != null;132 SetEnabledStateOfExecutableButtons();133 107 } 134 108 … … 146 120 147 121 #region Content Events 122 protected override void Content_Prepared(object sender, EventArgs e) { 123 if (InvokeRequired) 124 Invoke(new EventHandler(Content_Prepared), sender, e); 125 else { 126 base.Content_Prepared(sender, e); 127 resultsView.Content = Content.Results.AsReadOnly(); 128 } 129 } 130 148 131 protected virtual void Content_ProblemChanged(object sender, EventArgs e) { 149 132 if (InvokeRequired) … … 154 137 } 155 138 } 156 protected virtual void Content_ExecutionStateChanged(object sender, EventArgs e) {157 if (InvokeRequired)158 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e);159 else160 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;161 }162 protected virtual void Content_ExecutionTimeChanged(object sender, EventArgs e) {163 if (InvokeRequired)164 Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e);165 else166 executionTimeTextBox.Text = Content == null ? "-" : Content.ExecutionTime.ToString();167 }168 139 protected virtual void Content_StoreAlgorithmInEachRunChanged(object sender, EventArgs e) { 169 140 if (InvokeRequired) … … 171 142 else 172 143 storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun; 173 }174 protected virtual void Content_Prepared(object sender, EventArgs e) {175 if (InvokeRequired)176 Invoke(new EventHandler(Content_Prepared), sender, e);177 else {178 resultsView.Content = Content.Results.AsReadOnly();179 ReadOnly = Locked = false;180 SetEnabledStateOfExecutableButtons();181 }182 }183 protected virtual void Content_Started(object sender, EventArgs e) {184 if (InvokeRequired)185 Invoke(new EventHandler(Content_Started), sender, e);186 else {187 ReadOnly = Locked = true;188 SetEnabledStateOfExecutableButtons();189 }190 }191 protected virtual void Content_Paused(object sender, EventArgs e) {192 if (InvokeRequired)193 Invoke(new EventHandler(Content_Paused), sender, e);194 else {195 ReadOnly = Locked = false;196 SetEnabledStateOfExecutableButtons();197 }198 }199 protected virtual void Content_Stopped(object sender, EventArgs e) {200 if (InvokeRequired)201 Invoke(new EventHandler(Content_Stopped), sender, e);202 else {203 ReadOnly = Locked = false;204 SetEnabledStateOfExecutableButtons();205 }206 }207 protected virtual void Content_ExceptionOccurred(object sender, EventArgs<Exception> e) {208 if (InvokeRequired)209 Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred), sender, e);210 else211 ErrorHandling.ShowErrorDialog(this, e.Value);212 144 } 213 145 #endregion … … 264 196 if (Content != null) Content.StoreAlgorithmInEachRun = storeAlgorithmInEachRunCheckBox.Checked; 265 197 } 266 protected virtual void startButton_Click(object sender, EventArgs e) {267 Content.Start();268 }269 protected virtual void pauseButton_Click(object sender, EventArgs e) {270 Content.Pause();271 }272 protected virtual void stopButton_Click(object sender, EventArgs e) {273 Content.Stop();274 }275 protected virtual void resetButton_Click(object sender, EventArgs e) {276 Content.Prepare(false);277 }278 198 protected virtual void problemTabPage_DragEnterOver(object sender, DragEventArgs e) { 279 199 e.Effect = DragDropEffects.None; … … 294 214 } 295 215 #endregion 296 297 #region Helpers298 private void SetEnabledStateOfExecutableButtons() {299 if (Content == null) {300 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;301 } else {302 startButton.Enabled = (Content.ExecutionState == ExecutionState.Prepared) || (Content.ExecutionState == ExecutionState.Paused);303 pauseButton.Enabled = Content.ExecutionState == ExecutionState.Started;304 stopButton.Enabled = (Content.ExecutionState == ExecutionState.Started) || (Content.ExecutionState == ExecutionState.Paused);305 resetButton.Enabled = Content.ExecutionState != ExecutionState.Started;306 }307 }308 #endregion309 216 } 310 217 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.Designer.cs
r5832 r6425 34 34 /// </summary> 35 35 private void InitializeComponent() { 36 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BatchRunView)); 36 37 this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl(); 37 38 this.optimizerTabPage = new System.Windows.Forms.TabPage(); … … 41 42 this.runsTabPage = new System.Windows.Forms.TabPage(); 42 43 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView(); 43 this.startButton = new System.Windows.Forms.Button();44 this.stopButton = new System.Windows.Forms.Button();45 this.resetButton = new System.Windows.Forms.Button();46 this.executionTimeLabel = new System.Windows.Forms.Label();47 this.executionTimeTextBox = new System.Windows.Forms.TextBox();48 44 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 49 45 this.repetitionsLabel = new System.Windows.Forms.Label(); 50 46 this.repetitionsNumericUpDown = new System.Windows.Forms.NumericUpDown(); 51 this.pauseButton = new System.Windows.Forms.Button();52 47 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 53 48 this.tabControl.SuspendLayout(); … … 57 52 this.SuspendLayout(); 58 53 // 54 // startButton 55 // 56 this.startButton.Location = new System.Drawing.Point(0, 459); 57 this.toolTip.SetToolTip(this.startButton, "Start/Resume Experiment"); 58 // 59 // executionTimeTextBox 60 // 61 this.executionTimeTextBox.Location = new System.Drawing.Point(542, 462); 62 // 63 // executionTimeLabel 64 // 65 this.executionTimeLabel.Location = new System.Drawing.Point(453, 465); 66 // 67 // pauseButton 68 // 69 this.pauseButton.Location = new System.Drawing.Point(30, 459); 70 this.toolTip.SetToolTip(this.pauseButton, "Pause Experiment"); 71 // 72 // stopButton 73 // 74 this.stopButton.Location = new System.Drawing.Point(60, 459); 75 this.toolTip.SetToolTip(this.stopButton, "Stop Experiment"); 76 // 77 // resetButton 78 // 79 this.resetButton.Location = new System.Drawing.Point(90, 458); 80 this.toolTip.SetToolTip(this.resetButton, "Reset Experiment"); 81 // 59 82 // nameTextBox 60 83 // … … 72 95 this.tabControl.AllowDrop = true; 73 96 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 74 75 97 | System.Windows.Forms.AnchorStyles.Left) 98 | System.Windows.Forms.AnchorStyles.Right))); 76 99 this.tabControl.Controls.Add(this.optimizerTabPage); 77 100 this.tabControl.Controls.Add(this.runsTabPage); … … 79 102 this.tabControl.Name = "tabControl"; 80 103 this.tabControl.SelectedIndex = 0; 81 this.tabControl.Size = new System.Drawing.Size(679, 40 0);104 this.tabControl.Size = new System.Drawing.Size(679, 401); 82 105 this.tabControl.TabIndex = 5; 83 106 // … … 91 114 this.optimizerTabPage.Name = "optimizerTabPage"; 92 115 this.optimizerTabPage.Padding = new System.Windows.Forms.Padding(3); 93 this.optimizerTabPage.Size = new System.Drawing.Size(671, 37 4);116 this.optimizerTabPage.Size = new System.Drawing.Size(671, 375); 94 117 this.optimizerTabPage.TabIndex = 1; 95 118 this.optimizerTabPage.Text = "Optimizer"; … … 102 125 // 103 126 this.optimizerViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 104 105 127 | System.Windows.Forms.AnchorStyles.Left) 128 | System.Windows.Forms.AnchorStyles.Right))); 106 129 this.optimizerViewHost.Caption = "View"; 107 130 this.optimizerViewHost.Content = null; … … 110 133 this.optimizerViewHost.Name = "optimizerViewHost"; 111 134 this.optimizerViewHost.ReadOnly = false; 112 this.optimizerViewHost.Size = new System.Drawing.Size(659, 33 2);135 this.optimizerViewHost.Size = new System.Drawing.Size(659, 333); 113 136 this.optimizerViewHost.TabIndex = 3; 114 137 this.optimizerViewHost.ViewsLabelVisible = true; … … 151 174 // 152 175 this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 153 154 176 | System.Windows.Forms.AnchorStyles.Left) 177 | System.Windows.Forms.AnchorStyles.Right))); 155 178 this.runsView.Caption = "RunCollection View"; 156 179 this.runsView.Content = null; … … 161 184 this.runsView.TabIndex = 0; 162 185 // 163 // startButton164 //165 this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));166 this.startButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play;167 this.startButton.Location = new System.Drawing.Point(0, 458);168 this.startButton.Name = "startButton";169 this.startButton.Size = new System.Drawing.Size(24, 24);170 this.startButton.TabIndex = 6;171 this.toolTip.SetToolTip(this.startButton, "Start/Resume Batch Run");172 this.startButton.UseVisualStyleBackColor = true;173 this.startButton.Click += new System.EventHandler(this.startButton_Click);174 //175 // stopButton176 //177 this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));178 this.stopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Stop;179 this.stopButton.Location = new System.Drawing.Point(60, 458);180 this.stopButton.Name = "stopButton";181 this.stopButton.Size = new System.Drawing.Size(24, 24);182 this.stopButton.TabIndex = 8;183 this.toolTip.SetToolTip(this.stopButton, "Stop Batch Run");184 this.stopButton.UseVisualStyleBackColor = true;185 this.stopButton.Click += new System.EventHandler(this.stopButton_Click);186 //187 // resetButton188 //189 this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));190 this.resetButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Restart;191 this.resetButton.Location = new System.Drawing.Point(90, 458);192 this.resetButton.Name = "resetButton";193 this.resetButton.Size = new System.Drawing.Size(24, 24);194 this.resetButton.TabIndex = 9;195 this.toolTip.SetToolTip(this.resetButton, "Reset Batch Run");196 this.resetButton.UseVisualStyleBackColor = true;197 this.resetButton.Click += new System.EventHandler(this.resetButton_Click);198 //199 // executionTimeLabel200 //201 this.executionTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));202 this.executionTimeLabel.AutoSize = true;203 this.executionTimeLabel.Location = new System.Drawing.Point(453, 465);204 this.executionTimeLabel.Name = "executionTimeLabel";205 this.executionTimeLabel.Size = new System.Drawing.Size(83, 13);206 this.executionTimeLabel.TabIndex = 10;207 this.executionTimeLabel.Text = "&Execution Time:";208 //209 // executionTimeTextBox210 //211 this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));212 this.executionTimeTextBox.Location = new System.Drawing.Point(542, 462);213 this.executionTimeTextBox.Name = "executionTimeTextBox";214 this.executionTimeTextBox.ReadOnly = true;215 this.executionTimeTextBox.Size = new System.Drawing.Size(137, 20);216 this.executionTimeTextBox.TabIndex = 11;217 //218 186 // openFileDialog 219 187 // … … 235 203 // 236 204 this.repetitionsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 237 205 | System.Windows.Forms.AnchorStyles.Right))); 238 206 this.repetitionsNumericUpDown.Location = new System.Drawing.Point(72, 26); 239 207 this.repetitionsNumericUpDown.Maximum = new decimal(new int[] { … … 259 227 this.repetitionsNumericUpDown.Validated += new System.EventHandler(this.repetitionsNumericUpDown_Validated); 260 228 // 261 // pauseButton262 //263 this.pauseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));264 this.pauseButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Pause;265 this.pauseButton.Location = new System.Drawing.Point(30, 458);266 this.pauseButton.Name = "pauseButton";267 this.pauseButton.Size = new System.Drawing.Size(24, 24);268 this.pauseButton.TabIndex = 7;269 this.toolTip.SetToolTip(this.pauseButton, "Pause Batch Run");270 this.pauseButton.UseVisualStyleBackColor = true;271 this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click);272 //273 229 // BatchRunView 274 230 // 275 231 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 276 232 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 277 this.Controls.Add(this.tabControl);278 this.Controls.Add(this.startButton);279 this.Controls.Add(this.executionTimeTextBox);280 this.Controls.Add(this.executionTimeLabel);281 this.Controls.Add(this.pauseButton);282 233 this.Controls.Add(this.repetitionsNumericUpDown); 283 234 this.Controls.Add(this.repetitionsLabel); 284 this.Controls.Add(this.stopButton); 285 this.Controls.Add(this.resetButton); 235 this.Controls.Add(this.tabControl); 286 236 this.Name = "BatchRunView"; 287 237 this.Size = new System.Drawing.Size(679, 482); 288 this.Controls.SetChildIndex(this. infoLabel, 0);238 this.Controls.SetChildIndex(this.tabControl, 0); 289 239 this.Controls.SetChildIndex(this.resetButton, 0); 290 240 this.Controls.SetChildIndex(this.stopButton, 0); 241 this.Controls.SetChildIndex(this.executionTimeLabel, 0); 242 this.Controls.SetChildIndex(this.pauseButton, 0); 243 this.Controls.SetChildIndex(this.executionTimeTextBox, 0); 244 this.Controls.SetChildIndex(this.startButton, 0); 245 this.Controls.SetChildIndex(this.infoLabel, 0); 291 246 this.Controls.SetChildIndex(this.repetitionsLabel, 0); 292 247 this.Controls.SetChildIndex(this.repetitionsNumericUpDown, 0); 293 this.Controls.SetChildIndex(this.pauseButton, 0);294 this.Controls.SetChildIndex(this.executionTimeLabel, 0);295 this.Controls.SetChildIndex(this.executionTimeTextBox, 0);296 this.Controls.SetChildIndex(this.startButton, 0);297 this.Controls.SetChildIndex(this.tabControl, 0);298 248 this.Controls.SetChildIndex(this.nameLabel, 0); 299 249 this.Controls.SetChildIndex(this.nameTextBox, 0); … … 314 264 private System.Windows.Forms.Button newOptimizerButton; 315 265 private System.Windows.Forms.Button openOptimizerButton; 316 private System.Windows.Forms.Button startButton;317 private System.Windows.Forms.Button stopButton;318 private System.Windows.Forms.Button resetButton;319 private System.Windows.Forms.Label executionTimeLabel;320 private System.Windows.Forms.TextBox executionTimeTextBox;321 266 private System.Windows.Forms.OpenFileDialog openFileDialog; 322 267 private System.Windows.Forms.TabPage runsTabPage; … … 324 269 private System.Windows.Forms.NumericUpDown repetitionsNumericUpDown; 325 270 private RunCollectionView runsView; 326 private System.Windows.Forms.Button pauseButton;327 271 } 328 272 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs
r5837 r6425 35 35 [View("BatchRun View")] 36 36 [Content(typeof(BatchRun), true)] 37 public sealed partial class BatchRunView : NamedItemView {37 public sealed partial class BatchRunView : IOptimizerView { 38 38 private TypeSelectorDialog optimizerTypeSelectorDialog; 39 39 … … 60 60 protected override void DeregisterContentEvents() { 61 61 Content.OptimizerChanged -= new EventHandler(Content_OptimizerChanged); 62 Content.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred);63 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);64 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);65 Content.Prepared -= new EventHandler(Content_Prepared);66 Content.Started -= new EventHandler(Content_Started);67 Content.Paused -= new EventHandler(Content_Paused);68 Content.Stopped -= new EventHandler(Content_Stopped);69 62 Content.RepetitionsChanged -= new EventHandler(Content_RepetitionsChanged); 70 63 base.DeregisterContentEvents(); … … 73 66 base.RegisterContentEvents(); 74 67 Content.OptimizerChanged += new EventHandler(Content_OptimizerChanged); 75 Content.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred);76 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);77 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);78 Content.Prepared += new EventHandler(Content_Prepared);79 Content.Started += new EventHandler(Content_Started);80 Content.Paused += new EventHandler(Content_Paused);81 Content.Stopped += new EventHandler(Content_Stopped);82 68 Content.RepetitionsChanged += new EventHandler(Content_RepetitionsChanged); 83 69 } … … 89 75 optimizerViewHost.Content = null; 90 76 runsView.Content = null; 91 executionTimeTextBox.Text = "-";92 77 } else { 93 Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started;94 78 repetitionsNumericUpDown.Value = Content.Repetitions; 95 79 optimizerViewHost.Content = Content.Optimizer; 96 80 runsView.Content = Content.Runs; 97 executionTimeTextBox.Text = Content.ExecutionTime.ToString();98 81 } 99 82 } … … 105 88 optimizerViewHost.Enabled = Content != null; 106 89 runsView.Enabled = Content != null; 107 executionTimeTextBox.Enabled = Content != null;108 SetEnabledStateOfExecutableButtons();109 90 } 110 91 … … 122 103 123 104 #region Content Events 124 private void Content_ExecutionStateChanged(object sender, EventArgs e) {125 if (InvokeRequired)126 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e);127 else128 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;129 }130 private void Content_Prepared(object sender, EventArgs e) {131 if (InvokeRequired)132 Invoke(new EventHandler(Content_Prepared), sender, e);133 else {134 ReadOnly = Locked = false;135 SetEnabledStateOfExecutableButtons();136 }137 }138 private void Content_Started(object sender, EventArgs e) {139 if (InvokeRequired)140 Invoke(new EventHandler(Content_Started), sender, e);141 else {142 ReadOnly = Locked = true;143 SetEnabledStateOfExecutableButtons();144 }145 }146 private void Content_Paused(object sender, EventArgs e) {147 if (InvokeRequired)148 Invoke(new EventHandler(Content_Paused), sender, e);149 else {150 ReadOnly = Locked = false;151 SetEnabledStateOfExecutableButtons();152 }153 }154 private void Content_Stopped(object sender, EventArgs e) {155 if (InvokeRequired)156 Invoke(new EventHandler(Content_Stopped), sender, e);157 else {158 ReadOnly = Locked = false;159 SetEnabledStateOfExecutableButtons();160 }161 }162 private void Content_ExecutionTimeChanged(object sender, EventArgs e) {163 if (InvokeRequired)164 Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e);165 else166 executionTimeTextBox.Text = Content == null ? "-" : Content.ExecutionTime.ToString();167 }168 private void Content_ExceptionOccurred(object sender, EventArgs<Exception> e) {169 if (InvokeRequired)170 Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred), sender, e);171 else172 ErrorHandling.ShowErrorDialog(this, e.Value);173 }174 105 private void Content_OptimizerChanged(object sender, EventArgs e) { 175 106 if (InvokeRequired) … … 239 170 } 240 171 } 241 private void startButton_Click(object sender, EventArgs e) { 242 Content.Start(); 243 } 244 private void pauseButton_Click(object sender, EventArgs e) { 245 Content.Pause(); 246 } 247 private void stopButton_Click(object sender, EventArgs e) { 248 Content.Stop(); 249 } 250 private void resetButton_Click(object sender, EventArgs e) { 251 Content.Prepare(false); 252 } 172 253 173 private void optimizerTabPage_DragEnterOver(object sender, DragEventArgs e) { 254 174 e.Effect = DragDropEffects.None; … … 270 190 #endregion 271 191 272 #region Helpers273 private void SetEnabledStateOfExecutableButtons() {274 if (Content == null) {275 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;276 } else {277 startButton.Enabled = (Content.ExecutionState == ExecutionState.Prepared) || (Content.ExecutionState == ExecutionState.Paused);278 pauseButton.Enabled = Content.ExecutionState == ExecutionState.Started;279 stopButton.Enabled = (Content.ExecutionState == ExecutionState.Started) || (Content.ExecutionState == ExecutionState.Paused);280 resetButton.Enabled = Content.ExecutionState != ExecutionState.Started;281 }282 }283 #endregion284 192 } 285 193 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentView.Designer.cs
r5832 r6425 50 50 this.runsTabPage = new System.Windows.Forms.TabPage(); 51 51 this.runsViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 52 this.startButton = new System.Windows.Forms.Button();53 this.stopButton = new System.Windows.Forms.Button();54 this.resetButton = new System.Windows.Forms.Button();55 this.executionTimeLabel = new System.Windows.Forms.Label();56 this.executionTimeTextBox = new System.Windows.Forms.TextBox();57 this.pauseButton = new System.Windows.Forms.Button();58 52 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 59 53 this.tabControl.SuspendLayout(); … … 61 55 this.runsTabPage.SuspendLayout(); 62 56 this.SuspendLayout(); 57 // 58 // startButton 59 // 60 this.startButton.Location = new System.Drawing.Point(0, 458); 61 this.toolTip.SetToolTip(this.startButton, "Start/Resume Experiment"); 62 // 63 // executionTimeTextBox 64 // 65 this.executionTimeTextBox.Location = new System.Drawing.Point(542, 461); 66 // 67 // executionTimeLabel 68 // 69 this.executionTimeLabel.Location = new System.Drawing.Point(453, 464); 70 // 71 // pauseButton 72 // 73 this.pauseButton.Location = new System.Drawing.Point(30, 458); 74 this.toolTip.SetToolTip(this.pauseButton, "Pause Experiment"); 75 // 76 // stopButton 77 // 78 this.stopButton.Location = new System.Drawing.Point(60, 458); 79 this.toolTip.SetToolTip(this.stopButton, "Stop Experiment"); 80 // 81 // resetButton 82 // 83 this.resetButton.Location = new System.Drawing.Point(90, 458); 84 this.toolTip.SetToolTip(this.resetButton, "Reset Experiment"); 63 85 // 64 86 // nameTextBox … … 76 98 // 77 99 this.tabControl.AllowDrop = true; 78 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 79 | System.Windows.Forms.AnchorStyles.Left)80 100 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 101 | System.Windows.Forms.AnchorStyles.Left) 102 | System.Windows.Forms.AnchorStyles.Right))); 81 103 this.tabControl.Controls.Add(this.optimizersTabPage); 82 104 this.tabControl.Controls.Add(this.runsTabPage); … … 84 106 this.tabControl.Name = "tabControl"; 85 107 this.tabControl.SelectedIndex = 0; 86 this.tabControl.Size = new System.Drawing.Size(679, 42 6);108 this.tabControl.Size = new System.Drawing.Size(679, 427); 87 109 this.tabControl.TabIndex = 3; 88 110 // … … 93 115 this.optimizersTabPage.Name = "optimizersTabPage"; 94 116 this.optimizersTabPage.Padding = new System.Windows.Forms.Padding(3); 95 this.optimizersTabPage.Size = new System.Drawing.Size(671, 40 0);117 this.optimizersTabPage.Size = new System.Drawing.Size(671, 401); 96 118 this.optimizersTabPage.TabIndex = 1; 97 119 this.optimizersTabPage.Text = "Optimizers"; … … 100 122 // optimizerListView 101 123 // 102 this.optimizerListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 103 | System.Windows.Forms.AnchorStyles.Left)104 124 this.optimizerListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 125 | System.Windows.Forms.AnchorStyles.Left) 126 | System.Windows.Forms.AnchorStyles.Right))); 105 127 this.optimizerListView.Caption = "OptimizerList View"; 106 128 this.optimizerListView.Content = null; … … 108 130 this.optimizerListView.Name = "optimizerListView"; 109 131 this.optimizerListView.ReadOnly = false; 110 this.optimizerListView.Size = new System.Drawing.Size(659, 38 8);132 this.optimizerListView.Size = new System.Drawing.Size(659, 389); 111 133 this.optimizerListView.TabIndex = 0; 112 134 // … … 117 139 this.runsTabPage.Name = "runsTabPage"; 118 140 this.runsTabPage.Padding = new System.Windows.Forms.Padding(3); 119 this.runsTabPage.Size = new System.Drawing.Size(671, 40 0);141 this.runsTabPage.Size = new System.Drawing.Size(671, 401); 120 142 this.runsTabPage.TabIndex = 2; 121 143 this.runsTabPage.Text = "Runs"; … … 124 146 // runsViewHost 125 147 // 126 this.runsViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 127 | System.Windows.Forms.AnchorStyles.Left)128 148 this.runsViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 149 | System.Windows.Forms.AnchorStyles.Left) 150 | System.Windows.Forms.AnchorStyles.Right))); 129 151 this.runsViewHost.Caption = "View"; 130 152 this.runsViewHost.Content = null; … … 133 155 this.runsViewHost.Name = "runsViewHost"; 134 156 this.runsViewHost.ReadOnly = false; 135 this.runsViewHost.Size = new System.Drawing.Size(6 63, 388);157 this.runsViewHost.Size = new System.Drawing.Size(657, 389); 136 158 this.runsViewHost.TabIndex = 0; 137 159 this.runsViewHost.ViewsLabelVisible = true; 138 160 this.runsViewHost.ViewType = null; 139 //140 // startButton141 //142 this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));143 this.startButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play;144 this.startButton.Location = new System.Drawing.Point(0, 458);145 this.startButton.Name = "startButton";146 this.startButton.Size = new System.Drawing.Size(24, 24);147 this.startButton.TabIndex = 4;148 this.toolTip.SetToolTip(this.startButton, "Start/Resume Experiment");149 this.startButton.UseVisualStyleBackColor = true;150 this.startButton.Click += new System.EventHandler(this.startButton_Click);151 //152 // stopButton153 //154 this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));155 this.stopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Stop;156 this.stopButton.Location = new System.Drawing.Point(60, 458);157 this.stopButton.Name = "stopButton";158 this.stopButton.Size = new System.Drawing.Size(24, 24);159 this.stopButton.TabIndex = 6;160 this.toolTip.SetToolTip(this.stopButton, "Stop Experiment");161 this.stopButton.UseVisualStyleBackColor = true;162 this.stopButton.Click += new System.EventHandler(this.stopButton_Click);163 //164 // resetButton165 //166 this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));167 this.resetButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Restart;168 this.resetButton.Location = new System.Drawing.Point(90, 458);169 this.resetButton.Name = "resetButton";170 this.resetButton.Size = new System.Drawing.Size(24, 24);171 this.resetButton.TabIndex = 7;172 this.toolTip.SetToolTip(this.resetButton, "Reset Experiment");173 this.resetButton.UseVisualStyleBackColor = true;174 this.resetButton.Click += new System.EventHandler(this.resetButton_Click);175 //176 // executionTimeLabel177 //178 this.executionTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));179 this.executionTimeLabel.AutoSize = true;180 this.executionTimeLabel.Location = new System.Drawing.Point(453, 465);181 this.executionTimeLabel.Name = "executionTimeLabel";182 this.executionTimeLabel.Size = new System.Drawing.Size(83, 13);183 this.executionTimeLabel.TabIndex = 8;184 this.executionTimeLabel.Text = "&Execution Time:";185 //186 // executionTimeTextBox187 //188 this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));189 this.executionTimeTextBox.Location = new System.Drawing.Point(542, 462);190 this.executionTimeTextBox.Name = "executionTimeTextBox";191 this.executionTimeTextBox.ReadOnly = true;192 this.executionTimeTextBox.Size = new System.Drawing.Size(137, 20);193 this.executionTimeTextBox.TabIndex = 9;194 //195 // pauseButton196 //197 this.pauseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));198 this.pauseButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Pause;199 this.pauseButton.Location = new System.Drawing.Point(30, 458);200 this.pauseButton.Name = "pauseButton";201 this.pauseButton.Size = new System.Drawing.Size(24, 24);202 this.pauseButton.TabIndex = 5;203 this.toolTip.SetToolTip(this.pauseButton, "Pause Experiment");204 this.pauseButton.UseVisualStyleBackColor = true;205 this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click);206 161 // 207 162 // ExperimentView … … 210 165 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 211 166 this.Controls.Add(this.tabControl); 212 this.Controls.Add(this.startButton);213 this.Controls.Add(this.executionTimeTextBox);214 this.Controls.Add(this.executionTimeLabel);215 this.Controls.Add(this.pauseButton);216 this.Controls.Add(this.stopButton);217 this.Controls.Add(this.resetButton);218 167 this.Name = "ExperimentView"; 219 168 this.Size = new System.Drawing.Size(679, 482); 220 this.Controls.SetChildIndex(this.infoLabel, 0);221 169 this.Controls.SetChildIndex(this.resetButton, 0); 222 170 this.Controls.SetChildIndex(this.stopButton, 0); 223 171 this.Controls.SetChildIndex(this.pauseButton, 0); 172 this.Controls.SetChildIndex(this.tabControl, 0); 224 173 this.Controls.SetChildIndex(this.executionTimeLabel, 0); 225 174 this.Controls.SetChildIndex(this.executionTimeTextBox, 0); 226 175 this.Controls.SetChildIndex(this.startButton, 0); 227 this.Controls.SetChildIndex(this. tabControl, 0);176 this.Controls.SetChildIndex(this.infoLabel, 0); 228 177 this.Controls.SetChildIndex(this.nameLabel, 0); 229 178 this.Controls.SetChildIndex(this.nameTextBox, 0); … … 240 189 private HeuristicLab.MainForm.WindowsForms.DragOverTabControl tabControl; 241 190 private System.Windows.Forms.TabPage optimizersTabPage; 242 private System.Windows.Forms.Button startButton;243 private System.Windows.Forms.Button stopButton;244 private System.Windows.Forms.Button resetButton;245 private System.Windows.Forms.Label executionTimeLabel;246 private System.Windows.Forms.TextBox executionTimeTextBox;247 private System.Windows.Forms.Button pauseButton;248 191 private OptimizerListView optimizerListView; 249 192 private System.Windows.Forms.TabPage runsTabPage; -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentView.cs
r5832 r6425 20 20 #endregion 21 21 22 using System;23 22 using System.Linq; 24 23 using System.Windows.Forms; 25 using HeuristicLab.Common;26 24 using HeuristicLab.Core; 27 using HeuristicLab.Core.Views;28 25 using HeuristicLab.MainForm; 29 using HeuristicLab.PluginInfrastructure;30 26 31 27 namespace HeuristicLab.Optimization.Views { 32 /// <summary>33 /// The base class for visual representations of items.34 /// </summary>35 28 [View("Experiment View")] 36 29 [Content(typeof(Experiment), true)] 37 public sealed partial class ExperimentView : NamedItemView { 38 public new Experiment Content { 39 get { return (Experiment)base.Content; } 40 set { base.Content = value; } 41 } 42 43 /// <summary> 44 /// Initializes a new instance of <see cref="ItemBaseView"/>. 45 /// </summary> 30 public sealed partial class ExperimentView : IOptimizerView { 46 31 public ExperimentView() { 47 32 InitializeComponent(); 48 33 } 49 34 50 protected override void DeregisterContentEvents() { 51 Content.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred); 52 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged); 53 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged); 54 Content.Prepared -= new EventHandler(Content_Prepared); 55 Content.Started -= new EventHandler(Content_Started); 56 Content.Paused -= new EventHandler(Content_Paused); 57 Content.Stopped -= new EventHandler(Content_Stopped); 58 base.DeregisterContentEvents(); 59 } 60 protected override void RegisterContentEvents() { 61 base.RegisterContentEvents(); 62 Content.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred); 63 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged); 64 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged); 65 Content.Prepared += new EventHandler(Content_Prepared); 66 Content.Started += new EventHandler(Content_Started); 67 Content.Paused += new EventHandler(Content_Paused); 68 Content.Stopped += new EventHandler(Content_Stopped); 35 public new Experiment Content { 36 get { return (Experiment)base.Content; } 37 set { base.Content = value; } 69 38 } 70 39 … … 74 43 optimizerListView.Content = null; 75 44 runsViewHost.Content = null; 76 executionTimeTextBox.Text = "-";77 45 } else { 78 Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started;79 46 optimizerListView.Content = Content.Optimizers; 80 47 runsViewHost.Content = Content.Runs; 81 executionTimeTextBox.Text = Content.ExecutionTime.ToString();82 48 } 83 49 } … … 87 53 optimizerListView.Enabled = Content != null; 88 54 runsViewHost.Enabled = Content != null; 89 executionTimeTextBox.Enabled = Content != null;90 SetEnabledStateOfExecutableButtons();91 55 } 92 56 … … 102 66 base.OnClosed(e); 103 67 } 104 105 #region Content Events106 private void Content_ExecutionStateChanged(object sender, EventArgs e) {107 if (InvokeRequired)108 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e);109 else110 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;111 }112 private void Content_Prepared(object sender, EventArgs e) {113 if (InvokeRequired)114 Invoke(new EventHandler(Content_Prepared), sender, e);115 else {116 nameTextBox.Enabled = infoLabel.Enabled = true;117 ReadOnly = Locked = false;118 SetEnabledStateOfExecutableButtons();119 }120 }121 private void Content_Started(object sender, EventArgs e) {122 if (InvokeRequired)123 Invoke(new EventHandler(Content_Started), sender, e);124 else {125 nameTextBox.Enabled = infoLabel.Enabled = false;126 ReadOnly = Locked = true;127 SetEnabledStateOfExecutableButtons();128 }129 }130 private void Content_Paused(object sender, EventArgs e) {131 if (InvokeRequired)132 Invoke(new EventHandler(Content_Paused), sender, e);133 else {134 nameTextBox.Enabled = infoLabel.Enabled = true;135 ReadOnly = Locked = false;136 SetEnabledStateOfExecutableButtons();137 }138 }139 private void Content_Stopped(object sender, EventArgs e) {140 if (InvokeRequired)141 Invoke(new EventHandler(Content_Stopped), sender, e);142 else {143 nameTextBox.Enabled = infoLabel.Enabled = true;144 ReadOnly = Locked = false;145 SetEnabledStateOfExecutableButtons();146 }147 }148 private void Content_ExecutionTimeChanged(object sender, EventArgs e) {149 if (InvokeRequired)150 Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e);151 else152 executionTimeTextBox.Text = Content == null ? "-" : Content.ExecutionTime.ToString();153 }154 private void Content_ExceptionOccurred(object sender, EventArgs<Exception> e) {155 if (InvokeRequired)156 Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred), sender, e);157 else158 ErrorHandling.ShowErrorDialog(this, e.Value);159 }160 #endregion161 162 #region Control events163 private void startButton_Click(object sender, EventArgs e) {164 Content.Start();165 }166 private void pauseButton_Click(object sender, EventArgs e) {167 Content.Pause();168 }169 private void stopButton_Click(object sender, EventArgs e) {170 Content.Stop();171 }172 private void resetButton_Click(object sender, EventArgs e) {173 Content.Prepare(false);174 }175 #endregion176 177 #region Helpers178 private void SetEnabledStateOfExecutableButtons() {179 if (Content == null) {180 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;181 } else {182 startButton.Enabled = (Content.ExecutionState == ExecutionState.Prepared) || (Content.ExecutionState == ExecutionState.Paused);183 pauseButton.Enabled = Content.ExecutionState == ExecutionState.Started;184 stopButton.Enabled = (Content.ExecutionState == ExecutionState.Started) || (Content.ExecutionState == ExecutionState.Paused);185 resetButton.Enabled = Content.ExecutionState != ExecutionState.Started;186 }187 }188 #endregion189 68 } 190 69 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj
r5875 r6425 69 69 <OutputPath>bin\x86\Release\</OutputPath> 70 70 <DefineConstants>TRACE</DefineConstants> 71 <DocumentationFile>bin\x86\Release\HeuristicLab.Optimization.Views-3.3.XML</DocumentationFile> 71 <DocumentationFile> 72 </DocumentationFile> 72 73 <Optimize>true</Optimize> 73 74 <DebugType>pdbonly</DebugType> … … 127 128 <DependentUpon>BatchRunView.cs</DependentUpon> 128 129 </Compile> 130 <Compile Include="IOptimizerView.cs"> 131 <SubType>UserControl</SubType> 132 </Compile> 133 <Compile Include="IOptimizerView.Designer.cs"> 134 <DependentUpon>IOptimizerView.cs</DependentUpon> 135 </Compile> 129 136 <Compile Include="ResultValueView.cs"> 130 137 <SubType>UserControl</SubType>
Note: See TracChangeset
for help on using the changeset viewer.