Changeset 4888
- Timestamp:
- 11/22/10 01:26:55 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBoxPlotView.cs
r4883 r4888 71 71 Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 72 72 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 73 Content.UpdateOfRunsInProgress += new EventHandler<EventArgs<bool>>(Content_UpdateOfRunsInProgress);73 Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged); 74 74 RegisterRunEvents(Content); 75 75 } … … 81 81 Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 82 82 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 83 Content.UpdateOfRunsInProgress -= new EventHandler<EventArgs<bool>>(Content_UpdateOfRunsInProgress);83 Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged); 84 84 DeregisterRunEvents(Content); 85 85 } … … 104 104 RegisterRunEvents(e.Items); 105 105 } 106 private void Content_UpdateOfRunsInProgress (object sender, EventArgs<bool>e) {106 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { 107 107 if (InvokeRequired) 108 Invoke(new EventHandler <EventArgs<bool>>(Content_UpdateOfRunsInProgress), sender, e);108 Invoke(new EventHandler(Content_UpdateOfRunsInProgressChanged), sender, e); 109 109 else { 110 suppressUpdates = e.Value;110 suppressUpdates = Content.UpdateOfRunsInProgress; 111 111 if (!suppressUpdates) UpdateDataPoints(); 112 112 } … … 339 339 if (this.chart.Series.Count > 0) { 340 340 noRunsLabel.Visible = false; 341 showStatisticsCheckBox.Enabled = true; 341 342 splitContainer.Panel2Collapsed = !showStatisticsCheckBox.Checked; 342 343 } else { 343 344 noRunsLabel.Visible = true; 345 showStatisticsCheckBox.Enabled = false; 344 346 splitContainer.Panel2Collapsed = true; 345 347 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
r4883 r4888 89 89 Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 90 90 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 91 Content.UpdateOfRunsInProgress += new EventHandler<EventArgs<bool>>(Content_UpdateOfRunsInProgress);91 Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged); 92 92 RegisterRunEvents(Content); 93 93 } … … 99 99 Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 100 100 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 101 Content.UpdateOfRunsInProgress -= new EventHandler<EventArgs<bool>>(Content_UpdateOfRunsInProgress);101 Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged); 102 102 DeregisterRunEvents(Content); 103 103 } … … 205 205 206 206 207 private void Content_UpdateOfRunsInProgress (object sender, EventArgs<bool>e) {207 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { 208 208 if (InvokeRequired) 209 Invoke(new EventHandler <EventArgs<bool>>(Content_UpdateOfRunsInProgress), sender, e);209 Invoke(new EventHandler(Content_UpdateOfRunsInProgressChanged), sender, e); 210 210 else { 211 suppressUpdates = e.Value;211 suppressUpdates = Content.UpdateOfRunsInProgress; 212 212 if (!suppressUpdates) UpdateDataPoints(); 213 213 } … … 377 377 } 378 378 379 #region drag anddrop and tooltip379 #region Drag & drop and tooltip 380 380 private IRun draggedRun; 381 381 private void chart_MouseDown(object sender, MouseEventArgs e) { … … 398 398 private void chart_MouseUp(object sender, MouseEventArgs e) { 399 399 if (isSelecting) { 400 Content.UpdateOfRunsInProgress = true; 400 401 System.Windows.Forms.DataVisualization.Charting.Cursor xCursor = chart.ChartAreas[0].CursorX; 401 402 System.Windows.Forms.DataVisualization.Charting.Cursor yCursor = chart.ChartAreas[0].CursorY; … … 429 430 this.chart.ChartAreas[0].CursorX.SelectionStart = this.chart.ChartAreas[0].CursorX.SelectionEnd; 430 431 this.chart.ChartAreas[0].CursorY.SelectionStart = this.chart.ChartAreas[0].CursorY.SelectionEnd; 432 Content.UpdateOfRunsInProgress = false; 431 433 } 432 434 } … … 602 604 #endregion 603 605 604 #region automatic coloring606 #region Automatic coloring 605 607 private void colorXAxisButton_Click(object sender, EventArgs e) { 606 608 ColorRuns(xAxisValue); … … 612 614 613 615 private void ColorRuns(string axisValue) { 614 Content. OnUpdateOfRunsInProgress(true);616 Content.UpdateOfRunsInProgress = true; 615 617 var runs = Content.Select(r => new { Run = r, Value = GetValue(r, axisValue) }).Where(r => r.Value.HasValue); 616 618 double minValue = runs.Min(r => r.Value.Value); … … 623 625 r.Run.Color = ColorGradient.Colors[colorIndex]; 624 626 } 625 Content. OnUpdateOfRunsInProgress(false);627 Content.UpdateOfRunsInProgress = false; 626 628 } 627 629 #endregion -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTabularView.cs
r4883 r4888 24 24 using System.Linq; 25 25 using System.Windows.Forms; 26 using HeuristicLab.Co mmon;26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data.Views; 28 28 using HeuristicLab.MainForm; 29 using HeuristicLab.Core;30 29 31 30 namespace HeuristicLab.Optimization.Views { … … 64 63 Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 65 64 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 66 Content.UpdateOfRunsInProgress += new EventHandler<EventArgs<bool>>(Content_UpdateOfRunsInProgress);65 Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged); 67 66 RegisterRunEvents(Content); 68 67 } … … 76 75 Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 77 76 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 78 Content.UpdateOfRunsInProgress -= new EventHandler<EventArgs<bool>>(Content_UpdateOfRunsInProgress);77 Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged); 79 78 DeregisterRunEvents(Content); 80 79 } … … 126 125 127 126 128 private void Content_UpdateOfRunsInProgress (object sender, Common.EventArgs<bool>e) {127 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { 129 128 if (InvokeRequired) 130 Invoke(new EventHandler <EventArgs<bool>>(Content_UpdateOfRunsInProgress), sender, e);129 Invoke(new EventHandler(Content_UpdateOfRunsInProgressChanged), sender, e); 131 130 else { 132 suppressUpdates = e.Value;131 suppressUpdates = Content.UpdateOfRunsInProgress; 133 132 if (!suppressUpdates) UpdateRowAttributes(); 134 133 } -
trunk/sources/HeuristicLab.Optimization/3.3/RunCollection.cs
r4883 r4888 37 37 38 38 [StorableConstructor] 39 protected RunCollection(bool deserializing) : base(deserializing) { } 40 39 protected RunCollection(bool deserializing) 40 : base(deserializing) { 41 updateOfRunsInProgress = false; 42 } 41 43 protected RunCollection(RunCollection original, Cloner cloner) 42 44 : base(original, cloner) { 45 updateOfRunsInProgress = false; 43 46 resultNames = new List<string>(original.resultNames); 44 47 parameterNames = new List<string>(original.parameterNames); … … 55 58 UpdateFiltering(true); 56 59 } 57 public override IDeepCloneable Clone(Cloner cloner) {58 return new RunCollection(this, cloner);59 }60 60 public RunCollection() : base() { Initialize(); } 61 61 public RunCollection(int capacity) : base(capacity) { Initialize(); } 62 62 public RunCollection(IEnumerable<IRun> collection) : base(collection) { Initialize(); this.OnItemsAdded(collection); } 63 63 private void Initialize() { 64 updateOfRunsInProgress = false; 64 65 parameterNames = new List<string>(); 65 66 resultNames = new List<string>(); … … 81 82 public RunCollectionConstraintCollection Constraints { 82 83 get { return constraints; } 84 } 85 86 private bool updateOfRunsInProgress; 87 public bool UpdateOfRunsInProgress { 88 get { return updateOfRunsInProgress; } 89 set { 90 if (updateOfRunsInProgress != value) { 91 updateOfRunsInProgress = value; 92 OnUpdateOfRunsInProgressChanged(); 93 } 94 } 95 } 96 97 [StorableHook(HookType.AfterDeserialization)] 98 private void AfterDeserialization() { 99 if (constraints == null) constraints = new RunCollectionConstraintCollection(); 100 RegisterConstraintsEvents(); 101 RegisterConstraintEvents(constraints); 102 UpdateFiltering(true); 103 } 104 105 public override IDeepCloneable Clone(Cloner cloner) { 106 return new RunCollection(this, cloner); 107 } 108 109 public event EventHandler UpdateOfRunsInProgressChanged; 110 protected virtual void OnUpdateOfRunsInProgressChanged() { 111 var handler = UpdateOfRunsInProgressChanged; 112 if (handler != null) handler(this, EventArgs.Empty); 83 113 } 84 114 … … 188 218 value = run.Results[columnName]; 189 219 return value; 190 }191 192 [StorableHook(HookType.AfterDeserialization)]193 private void AfterDeserialization() {194 if (constraints == null) constraints = new RunCollectionConstraintCollection();195 RegisterConstraintsEvents();196 RegisterConstraintEvents(constraints);197 UpdateFiltering(true);198 220 } 199 221 … … 285 307 #endregion 286 308 287 #region 288 public event EventHandler<EventArgs<bool>> UpdateOfRunsInProgress; 289 public void OnUpdateOfRunsInProgress(bool inProgress) { 290 var handler = UpdateOfRunsInProgress; 291 if (handler != null) handler(this, new EventArgs<bool>(inProgress)); 292 } 293 #endregion 294 295 #region filtering 309 #region Filtering 296 310 private void UpdateFiltering(bool reset) { 297 OnUpdateOfRunsInProgress(true);311 UpdateOfRunsInProgress = true; 298 312 if (reset) 299 313 list.ForEach(r => r.Visible = true); 300 314 foreach (IRunCollectionConstraint constraint in this.constraints) 301 315 constraint.Check(); 302 OnUpdateOfRunsInProgress(false);316 UpdateOfRunsInProgress = false; 303 317 } 304 318
Note: See TracChangeset
for help on using the changeset viewer.