Changeset 9363 for branches/OaaS/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
- Timestamp:
- 04/16/13 13:13:41 (11 years ago)
- Location:
- branches/OaaS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Optimization.Views
- Property svn:mergeinfo deleted
-
branches/OaaS/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
r7469 r9363 75 75 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 76 76 Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged); 77 Content.OptimizerNameChanged += new EventHandler(Content_AlgorithmNameChanged); 77 78 RegisterRunEvents(Content); 78 79 } … … 85 86 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 86 87 Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged); 88 Content.OptimizerNameChanged -= new EventHandler(Content_AlgorithmNameChanged); 87 89 DeregisterRunEvents(Content); 88 90 } … … 122 124 this.categoricalMapping.Clear(); 123 125 UpdateDataPoints(); 126 UpdateAxisLabels(); 124 127 } 125 128 } … … 135 138 this.Invoke(new EventHandler(run_Changed), sender, e); 136 139 else if (!suppressUpdates) { 137 IRun run = (IRun)sender;138 140 UpdateDataPoints(); 139 141 } 142 } 143 144 private void Content_AlgorithmNameChanged(object sender, EventArgs e) { 145 if (InvokeRequired) 146 Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e); 147 else UpdateCaption(); 140 148 } 141 149 #endregion … … 147 155 UpdateComboBoxes(); 148 156 UpdateDataPoints(); 157 UpdateCaption(); 158 } 159 160 private void UpdateCaption() { 161 Caption = Content != null ? Content.OptimizerName + " Box Plots" : ViewAttribute.GetViewName(GetType()); 149 162 } 150 163 … … 313 326 } 314 327 private double GetCategoricalValue(int dimension, string value) { 315 if (!this.categoricalMapping.ContainsKey(dimension)) 328 if (!this.categoricalMapping.ContainsKey(dimension)) { 316 329 this.categoricalMapping[dimension] = new Dictionary<object, double>(); 317 if (!this.categoricalMapping[dimension].ContainsKey(value)) { 318 if (this.categoricalMapping[dimension].Values.Count == 0) 319 this.categoricalMapping[dimension][value] = 1.0; 320 else 321 this.categoricalMapping[dimension][value] = this.categoricalMapping[dimension].Values.Max() + 1.0; 330 var orderedCategories = Content.Where(r=> r.Visible).Select(r => Content.GetValue(r, dimension).ToString()) 331 .Distinct() 332 .OrderBy(x => x, new NaturalStringComparer()); 333 int count = 1; 334 foreach (var category in orderedCategories) { 335 this.categoricalMapping[dimension].Add(category, count); 336 count++; 337 } 322 338 } 323 339 return this.categoricalMapping[dimension][value];
Note: See TracChangeset
for help on using the changeset viewer.