Changeset 11594 for branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
- Timestamp:
- 11/27/14 11:23:37 (9 years ago)
- Location:
- branches/Breadcrumbs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r9910 r11594 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Drawing; 25 26 using System.Linq; … … 56 57 private bool suppressUpdates = false; 57 58 58 private RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };59 private readonly RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true }; 59 60 60 61 public RunCollectionBubbleChartView() { … … 116 117 protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) { 117 118 foreach (IRun run in runs) 118 run. Changed += new EventHandler(run_Changed);119 run.PropertyChanged += run_PropertyChanged; 119 120 } 120 121 protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) { 121 122 foreach (IRun run in runs) 122 run. Changed -= new EventHandler(run_Changed);123 run.PropertyChanged -= run_PropertyChanged; 123 124 } 124 125 … … 133 134 RegisterRunEvents(e.Items); 134 135 } 135 private void run_ Changed(object sender,EventArgs e) {136 private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) { 136 137 if (suppressUpdates) return; 137 138 if (InvokeRequired) 138 this.Invoke( new EventHandler(run_Changed), sender, e);139 this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e); 139 140 else { 140 IRun run = (IRun)sender; 141 UpdateRun(run); 142 UpdateCursorInterval(); 143 chart.ChartAreas[0].RecalculateAxesScale(); 144 UpdateAxisLabels(); 141 if (e.PropertyName == "Color" || e.PropertyName == "Visible") { 142 IRun run = (IRun)sender; 143 UpdateRun(run); 144 UpdateCursorInterval(); 145 chart.ChartAreas[0].RecalculateAxesScale(); 146 UpdateAxisLabels(); 147 } 145 148 } 146 149 } … … 153 156 if (suppressUpdates) return; 154 157 155 foreach (var run in Content) UpdateRun(run); 156 UpdateMarkerSizes(); 157 UpdateCursorInterval(); 158 chart.ChartAreas[0].RecalculateAxesScale(); 158 UpdateDataPoints(); 159 159 UpdateAxisLabels(); 160 160 } … … 190 190 protected override void OnContentChanged() { 191 191 base.OnContentChanged(); 192 this.categoricalMapping.Clear();193 192 UpdateComboBoxes(); 194 193 UpdateDataPoints(); 195 194 UpdateCaption(); 196 RebuildInverseIndex();197 195 } 198 196 … … 267 265 Invoke(new EventHandler(Content_Reset), sender, e); 268 266 else { 269 this.categoricalMapping.Clear();270 RebuildInverseIndex();271 267 UpdateDataPoints(); 272 268 UpdateAxisLabels(); … … 278 274 series.Points.Clear(); 279 275 runToDataPointMapping.Clear(); 276 categoricalMapping.Clear(); 280 277 selectedRuns.Clear(); 278 RebuildInverseIndex(); 281 279 282 280 chart.ChartAreas[0].AxisX.IsMarginVisible = xAxisValue != AxisDimension.Index.ToString(); … … 438 436 } 439 437 } 440 private double GetCategoricalValue(int dimension, string value) {438 private double? GetCategoricalValue(int dimension, string value) { 441 439 if (!this.categoricalMapping.ContainsKey(dimension)) { 442 440 this.categoricalMapping[dimension] = new Dictionary<object, double>(); … … 449 447 } 450 448 } 449 if (!this.categoricalMapping[dimension].ContainsKey(value)) return null; 451 450 return this.categoricalMapping[dimension][value]; 452 451 } … … 667 666 Axis yAxis = this.chart.ChartAreas[0].AxisY; 668 667 int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count(); 669 SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount); 670 SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount); 671 if (xAxisComboBox.SelectedItem != null) 672 xAxis.Title = xAxisComboBox.SelectedItem.ToString(); 673 if (yAxisComboBox.SelectedItem != null) 674 yAxis.Title = yAxisComboBox.SelectedItem.ToString(); 668 //mkommend: combobox.SelectedIndex could not be used as this changes during hovering over possible values 669 var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue); 670 var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue); 671 SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount); 672 SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount); 673 if (xAxisValue != null) 674 xAxis.Title = xAxisValue; 675 if (yAxisValue != null) 676 yAxis.Title = yAxisValue; 675 677 } 676 678 … … 723 725 } 724 726 private void hideRunsToolStripMenuItem_Click(object sender, EventArgs e) { 725 HideRuns(selectedRuns); 727 //ToList is necessary to prevent lazy evaluation 728 HideRuns(selectedRuns.ToList()); 726 729 //could not use ClearSelectedRuns as the runs are not visible anymore 727 730 selectedRuns.Clear(); 728 731 } 729 732 private void hideRunsButton_Click(object sender, EventArgs e) { 730 HideRuns(selectedRuns); 733 //ToList is necessary to prevent lazy evaluation 734 HideRuns(selectedRuns.ToList()); 731 735 //could not use ClearSelectedRuns as the runs are not visible anymore 732 736 selectedRuns.Clear();
Note: See TracChangeset
for help on using the changeset viewer.