- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 7 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]; -
branches/OaaS/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.Designer.cs
r7967 r9363 46 46 private void InitializeComponent() { 47 47 this.components = new System.ComponentModel.Container(); 48 System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea 2= new System.Windows.Forms.DataVisualization.Charting.ChartArea();49 System.Windows.Forms.DataVisualization.Charting.Series series 2= new System.Windows.Forms.DataVisualization.Charting.Series();48 System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 49 System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); 50 50 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RunCollectionBubbleChartView)); 51 51 this.yJitterLabel = new System.Windows.Forms.Label(); … … 65 65 this.selectButton = new System.Windows.Forms.RadioButton(); 66 66 this.radioButtonGroup = new System.Windows.Forms.GroupBox(); 67 this.color Button = new System.Windows.Forms.Button();67 this.colorDialogButton = new System.Windows.Forms.Button(); 68 68 this.colorDialog = new System.Windows.Forms.ColorDialog(); 69 69 this.tooltip = new System.Windows.Forms.ToolTip(this.components); … … 72 72 this.noRunsLabel = new System.Windows.Forms.Label(); 73 73 this.sizeTrackBar = new System.Windows.Forms.TrackBar(); 74 this.getDataAsMatrixToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 75 this.transparencyTrackBar = new System.Windows.Forms.TrackBar(); 76 this.transparencyLabel = new System.Windows.Forms.Label(); 77 this.colorRunsButton = new System.Windows.Forms.Button(); 78 this.hideRunsButton = new System.Windows.Forms.Button(); 74 79 ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).BeginInit(); 75 80 ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).BeginInit(); … … 77 82 this.radioButtonGroup.SuspendLayout(); 78 83 ((System.ComponentModel.ISupportInitialize)(this.sizeTrackBar)).BeginInit(); 84 ((System.ComponentModel.ISupportInitialize)(this.transparencyTrackBar)).BeginInit(); 79 85 this.SuspendLayout(); 80 86 // … … 188 194 // 189 195 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 190 191 192 chartArea 2.Name = "ChartArea1";193 this.chart.ChartAreas.Add(chartArea 2);196 | System.Windows.Forms.AnchorStyles.Left) 197 | System.Windows.Forms.AnchorStyles.Right))); 198 chartArea1.Name = "ChartArea1"; 199 this.chart.ChartAreas.Add(chartArea1); 194 200 this.chart.Location = new System.Drawing.Point(6, 30); 195 201 this.chart.Name = "chart"; 196 series 2.ChartArea = "ChartArea1";197 series 2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;198 series 2.IsVisibleInLegend = false;199 series 2.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;200 series 2.Name = "Bubbles";201 series 2.YValuesPerPoint = 2;202 this.chart.Series.Add(series 2);202 series1.ChartArea = "ChartArea1"; 203 series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; 204 series1.IsVisibleInLegend = false; 205 series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; 206 series1.Name = "Bubbles"; 207 series1.YValuesPerPoint = 2; 208 this.chart.Series.Add(series1); 203 209 this.chart.Size = new System.Drawing.Size(843, 425); 204 210 this.chart.TabIndex = 16; … … 215 221 this.openBoxPlotViewToolStripMenuItem.Text = "Open BoxPlot View"; 216 222 this.openBoxPlotViewToolStripMenuItem.Click += new System.EventHandler(this.openBoxPlotViewToolStripMenuItem_Click); 217 // 223 // 218 224 // hideRunToolStripMenuItem 219 // 225 // 220 226 this.hideRunToolStripMenuItem.Name = "hideRunToolStripMenuItem"; 221 227 this.hideRunToolStripMenuItem.Size = new System.Drawing.Size(256, 22); 222 228 this.hideRunToolStripMenuItem.Text = "Hide Run"; 223 this.hideRunToolStripMenuItem.Click += new System.EventHandler( hideRunToolStripMenuItem_Click);229 this.hideRunToolStripMenuItem.Click += new System.EventHandler(this.hideRunToolStripMenuItem_Click); 224 230 // 225 231 // zoomButton … … 253 259 this.radioButtonGroup.Controls.Add(this.zoomButton); 254 260 this.radioButtonGroup.Controls.Add(this.selectButton); 255 this.radioButtonGroup.Location = new System.Drawing.Point( 3, 461);261 this.radioButtonGroup.Location = new System.Drawing.Point(2, 461); 256 262 this.radioButtonGroup.Name = "radioButtonGroup"; 257 this.radioButtonGroup.Size = new System.Drawing.Size(1 35, 32);263 this.radioButtonGroup.Size = new System.Drawing.Size(122, 32); 258 264 this.radioButtonGroup.TabIndex = 19; 259 265 this.radioButtonGroup.TabStop = false; 260 266 // 261 // color Button262 // 263 this.color Button.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));264 this.color Button.Enabled = false;265 this.color Button.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;266 this.color Button.Location = new System.Drawing.Point(144, 469);267 this.color Button.Name = "colorButton";268 this.color Button.Size = new System.Drawing.Size(64, 21);269 this.color Button.TabIndex = 20;270 this.color Button.Text = "Color";271 this. colorButton.TextAlign = System.Drawing.ContentAlignment.MiddleRight;272 this.color Button.UseVisualStyleBackColor = true;273 this.color Button.Click += new System.EventHandler(this.colorButton_Click);267 // colorDialogButton 268 // 269 this.colorDialogButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 270 this.colorDialogButton.Enabled = false; 271 this.colorDialogButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 272 this.colorDialogButton.Location = new System.Drawing.Point(130, 469); 273 this.colorDialogButton.Name = "colorDialogButton"; 274 this.colorDialogButton.Size = new System.Drawing.Size(21, 21); 275 this.colorDialogButton.TabIndex = 20; 276 this.colorDialogButton.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 277 this.tooltip.SetToolTip(this.colorDialogButton, "Choose color"); 278 this.colorDialogButton.UseVisualStyleBackColor = true; 279 this.colorDialogButton.Click += new System.EventHandler(this.colorDialogButton_Click); 274 280 // 275 281 // colorDialog … … 317 323 this.sizeTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 318 324 this.sizeTrackBar.Location = new System.Drawing.Point(787, 3); 319 this.sizeTrackBar.Maximum = 50;320 this.sizeTrackBar.Minimum = 5;325 this.sizeTrackBar.Maximum = 20; 326 this.sizeTrackBar.Minimum = -20; 321 327 this.sizeTrackBar.Name = "sizeTrackBar"; 322 328 this.sizeTrackBar.Size = new System.Drawing.Size(64, 45); 323 329 this.sizeTrackBar.TabIndex = 24; 324 this.sizeTrackBar.Tick Style = System.Windows.Forms.TickStyle.None;325 this.sizeTrackBar. Value = 10;330 this.sizeTrackBar.TickFrequency = 20; 331 this.sizeTrackBar.TickStyle = System.Windows.Forms.TickStyle.TopLeft; 326 332 this.sizeTrackBar.ValueChanged += new System.EventHandler(this.sizeTrackBar_ValueChanged); 327 333 // 334 // getDataAsMatrixToolStripMenuItem 335 // 336 this.getDataAsMatrixToolStripMenuItem.Name = "getDataAsMatrixToolStripMenuItem"; 337 this.getDataAsMatrixToolStripMenuItem.Size = new System.Drawing.Size(256, 22); 338 this.getDataAsMatrixToolStripMenuItem.Text = "Get Data as Matrix"; 339 this.getDataAsMatrixToolStripMenuItem.Click += new System.EventHandler(this.getDataAsMatrixToolStripMenuItem_Click); 340 // 341 // transparencyTrackBar 342 // 343 this.transparencyTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 344 this.transparencyTrackBar.LargeChange = 16; 345 this.transparencyTrackBar.Location = new System.Drawing.Point(359, 470); 346 this.transparencyTrackBar.Maximum = 254; 347 this.transparencyTrackBar.Name = "transparencyTrackBar"; 348 this.transparencyTrackBar.Size = new System.Drawing.Size(64, 45); 349 this.transparencyTrackBar.TabIndex = 24; 350 this.transparencyTrackBar.TickStyle = System.Windows.Forms.TickStyle.None; 351 this.tooltip.SetToolTip(this.transparencyTrackBar, "Sets the transparency of the colors"); 352 this.transparencyTrackBar.ValueChanged += new System.EventHandler(this.transparencyTrackBar_ValueChanged); 353 // 354 // transparencyLabel 355 // 356 this.transparencyLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 357 this.transparencyLabel.AutoSize = true; 358 this.transparencyLabel.Location = new System.Drawing.Point(278, 475); 359 this.transparencyLabel.Name = "transparencyLabel"; 360 this.transparencyLabel.Size = new System.Drawing.Size(75, 13); 361 this.transparencyLabel.TabIndex = 12; 362 this.transparencyLabel.Text = "Transparency:"; 363 // 364 // colorRunsButton 365 // 366 this.colorRunsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 367 this.colorRunsButton.Enabled = false; 368 this.colorRunsButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 369 this.colorRunsButton.Location = new System.Drawing.Point(151, 469); 370 this.colorRunsButton.Name = "colorRunsButton"; 371 this.colorRunsButton.Size = new System.Drawing.Size(43, 21); 372 this.colorRunsButton.TabIndex = 25; 373 this.colorRunsButton.Text = "Color"; 374 this.colorRunsButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 375 this.tooltip.SetToolTip(this.colorRunsButton, "Color all selected runs"); 376 this.colorRunsButton.UseVisualStyleBackColor = true; 377 this.colorRunsButton.Click += new System.EventHandler(this.colorRunsButton_Click); 378 // 379 // hideRunsButton 380 // 381 this.hideRunsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 382 this.hideRunsButton.Enabled = false; 383 this.hideRunsButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 384 this.hideRunsButton.Location = new System.Drawing.Point(194, 469); 385 this.hideRunsButton.Name = "hideRunsButton"; 386 this.hideRunsButton.Size = new System.Drawing.Size(43, 21); 387 this.hideRunsButton.TabIndex = 26; 388 this.hideRunsButton.Text = "Hide"; 389 this.hideRunsButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 390 this.tooltip.SetToolTip(this.hideRunsButton, "Hides all selected runs"); 391 this.hideRunsButton.UseVisualStyleBackColor = true; 392 this.hideRunsButton.Click += new System.EventHandler(this.hideRunsButton_Click); 393 // 328 394 // RunCollectionBubbleChartView 329 395 // 330 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);331 396 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 332 397 this.BackColor = System.Drawing.SystemColors.Window; 333 398 this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 399 this.Controls.Add(this.hideRunsButton); 400 this.Controls.Add(this.colorRunsButton); 401 this.Controls.Add(this.transparencyTrackBar); 334 402 this.Controls.Add(this.sizeTrackBar); 335 403 this.Controls.Add(this.colorYAxisButton); 336 404 this.Controls.Add(this.colorXAxisButton); 337 405 this.Controls.Add(this.noRunsLabel); 338 this.Controls.Add(this.color Button);406 this.Controls.Add(this.colorDialogButton); 339 407 this.Controls.Add(this.radioButtonGroup); 340 408 this.Controls.Add(this.chart); … … 342 410 this.Controls.Add(this.sizeComboBox); 343 411 this.Controls.Add(this.yJitterLabel); 412 this.Controls.Add(this.transparencyLabel); 344 413 this.Controls.Add(this.xJitterlabel); 345 414 this.Controls.Add(this.xTrackBar); … … 357 426 this.radioButtonGroup.PerformLayout(); 358 427 ((System.ComponentModel.ISupportInitialize)(this.sizeTrackBar)).EndInit(); 428 ((System.ComponentModel.ISupportInitialize)(this.transparencyTrackBar)).EndInit(); 359 429 this.ResumeLayout(false); 360 430 this.PerformLayout(); … … 377 447 private System.Windows.Forms.RadioButton selectButton; 378 448 private System.Windows.Forms.GroupBox radioButtonGroup; 379 private System.Windows.Forms.Button color Button;449 private System.Windows.Forms.Button colorDialogButton; 380 450 private System.Windows.Forms.ColorDialog colorDialog; 381 451 private System.Windows.Forms.ToolTip tooltip; … … 386 456 private System.Windows.Forms.Button colorYAxisButton; 387 457 private System.Windows.Forms.TrackBar sizeTrackBar; 458 private System.Windows.Forms.ToolStripMenuItem getDataAsMatrixToolStripMenuItem; 459 private System.Windows.Forms.TrackBar transparencyTrackBar; 460 private System.Windows.Forms.Label transparencyLabel; 461 private System.Windows.Forms.Button colorRunsButton; 462 private System.Windows.Forms.Button hideRunsButton; 388 463 } 389 464 } -
branches/OaaS/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r7469 r9363 43 43 private string sizeAxisValue; 44 44 45 private Dictionary<IRun, List<DataPoint>> runToDataPointMapping; 46 private Dictionary<int, Dictionary<object, double>> categoricalMapping; 47 private Dictionary<IRun, double> xJitter; 48 private Dictionary<IRun, double> yJitter; 45 private readonly Dictionary<IRun, List<DataPoint>> runToDataPointMapping = new Dictionary<IRun, List<DataPoint>>(); 46 private readonly Dictionary<IRun, int> runToIndexMapping = new Dictionary<IRun, int>(); 47 private readonly Dictionary<int, Dictionary<object, double>> categoricalMapping = new Dictionary<int, Dictionary<object, double>>(); 48 private readonly Dictionary<IRun, double> xJitter = new Dictionary<IRun, double>(); 49 private readonly Dictionary<IRun, double> yJitter = new Dictionary<IRun, double>(); 50 51 private readonly HashSet<IRun> selectedRuns = new HashSet<IRun>(); 52 private readonly Random random = new Random(); 49 53 private double xJitterFactor = 0.0; 50 54 private double yJitterFactor = 0.0; 51 private Random random;52 55 private bool isSelecting = false; 53 56 private bool suppressUpdates = false; 54 57 58 55 59 public RunCollectionBubbleChartView() { 56 60 InitializeComponent(); … … 58 62 chart.ContextMenuStrip.Items.Insert(0, hideRunToolStripMenuItem); 59 63 chart.ContextMenuStrip.Items.Insert(1, openBoxPlotViewToolStripMenuItem); 64 chart.ContextMenuStrip.Items.Add(getDataAsMatrixToolStripMenuItem); 60 65 chart.ContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(ContextMenuStrip_Opening); 61 66 62 runToDataPointMapping = new Dictionary<IRun, List<DataPoint>>();63 categoricalMapping = new Dictionary<int, Dictionary<object, double>>();64 xJitter = new Dictionary<IRun, double>();65 yJitter = new Dictionary<IRun, double>();66 random = new Random();67 68 67 colorDialog.Color = Color.Black; 69 color Button.Image = this.GenerateImage(16, 16, this.colorDialog.Color);68 colorDialogButton.Image = this.GenerateImage(16, 16, this.colorDialog.Color); 70 69 isSelecting = false; 71 70 … … 83 82 public IStringConvertibleMatrix Matrix { 84 83 get { return this.Content; } 84 } 85 public IEnumerable<IRun> SelectedRuns { 86 get { return selectedRuns; } 85 87 } 86 88 … … 92 94 Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 93 95 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 96 Content.OptimizerNameChanged += new EventHandler(Content_AlgorithmNameChanged); 94 97 Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged); 95 98 RegisterRunEvents(Content); … … 102 105 Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 103 106 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 107 Content.OptimizerNameChanged -= new EventHandler(Content_AlgorithmNameChanged); 104 108 Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged); 105 109 DeregisterRunEvents(Content); … … 125 129 } 126 130 private void run_Changed(object sender, EventArgs e) { 131 if (suppressUpdates) return; 127 132 if (InvokeRequired) 128 133 this.Invoke(new EventHandler(run_Changed), sender, e); … … 130 135 IRun run = (IRun)sender; 131 136 UpdateRun(run); 137 UpdateCursorInterval(); 138 chart.ChartAreas[0].RecalculateAxesScale(); 139 UpdateAxisLabels(); 140 } 141 } 142 143 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { 144 if (InvokeRequired) 145 this.Invoke(new EventHandler(Content_UpdateOfRunsInProgressChanged), sender, e); 146 else { 147 suppressUpdates = Content.UpdateOfRunsInProgress; 148 if (suppressUpdates) return; 149 150 foreach (var run in Content) UpdateRun(run); 151 UpdateMarkerSizes(); 152 UpdateCursorInterval(); 153 chart.ChartAreas[0].RecalculateAxesScale(); 154 UpdateAxisLabels(); 132 155 } 133 156 } 134 157 135 158 private void UpdateRun(IRun run) { 136 if (!suppressUpdates) { 137 if (runToDataPointMapping.ContainsKey(run)) { 138 foreach (DataPoint point in runToDataPointMapping[run]) { 139 point.Color = run.Color; 140 if (!run.Visible) { 141 this.chart.Series[0].Points.Remove(point); 142 UpdateCursorInterval(); 143 chart.ChartAreas[0].RecalculateAxesScale(); 144 } 159 if (runToDataPointMapping.ContainsKey(run)) { 160 foreach (DataPoint point in runToDataPointMapping[run]) { 161 if (!run.Visible) { 162 this.chart.Series[0].Points.Remove(point); 163 continue; 145 164 } 146 if (!run.Visible) runToDataPointMapping.Remove(run); 147 } else { 148 AddDataPoint(run); 149 UpdateCursorInterval(); 150 chart.ChartAreas[0].RecalculateAxesScale(); 151 } 152 153 if (this.chart.Series[0].Points.Count == 0) 154 noRunsLabel.Visible = true; 155 else 156 noRunsLabel.Visible = false; 157 } 165 if (selectedRuns.Contains(run)) { 166 point.Color = Color.Red; 167 point.MarkerStyle = MarkerStyle.Cross; 168 } else { 169 point.Color = Color.FromArgb(255 - transparencyTrackBar.Value, ((IRun)point.Tag).Color); 170 point.MarkerStyle = MarkerStyle.Circle; 171 } 172 173 } 174 if (!run.Visible) runToDataPointMapping.Remove(run); 175 } else { 176 AddDataPoint(run); 177 } 178 179 if (this.chart.Series[0].Points.Count == 0) 180 noRunsLabel.Visible = true; 181 else 182 noRunsLabel.Visible = false; 158 183 } 159 184 … … 163 188 UpdateComboBoxes(); 164 189 UpdateDataPoints(); 165 } 190 UpdateCaption(); 191 RebuildInverseIndex(); 192 } 193 194 private void RebuildInverseIndex() { 195 if (Content != null) { 196 runToIndexMapping.Clear(); 197 int i = 0; 198 foreach (var run in Content) { 199 runToIndexMapping.Add(run, i); 200 i++; 201 } 202 } 203 } 204 166 205 private void Content_ColumnNamesChanged(object sender, EventArgs e) { 167 206 if (InvokeRequired) … … 169 208 else 170 209 UpdateComboBoxes(); 210 } 211 212 private void UpdateCaption() { 213 Caption = Content != null ? Content.OptimizerName + " Bubble Chart" : ViewAttribute.GetViewName(GetType()); 171 214 } 172 215 … … 202 245 changed = true; 203 246 } 204 if (changed) 247 if (changed) { 205 248 UpdateDataPoints(); 206 } 207 } 208 209 210 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { 249 UpdateAxisLabels(); 250 } 251 } 252 } 253 254 private void Content_AlgorithmNameChanged(object sender, EventArgs e) { 211 255 if (InvokeRequired) 212 Invoke(new EventHandler(Content_UpdateOfRunsInProgressChanged), sender, e); 213 else { 214 suppressUpdates = Content.UpdateOfRunsInProgress; 215 if (!suppressUpdates) UpdateDataPoints(); 216 } 256 Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e); 257 else UpdateCaption(); 217 258 } 218 259 … … 222 263 else { 223 264 this.categoricalMapping.Clear(); 265 RebuildInverseIndex(); 224 266 UpdateDataPoints(); 267 UpdateAxisLabels(); 225 268 } 226 269 } … … 230 273 series.Points.Clear(); 231 274 runToDataPointMapping.Clear(); 275 selectedRuns.Clear(); 232 276 233 277 chart.ChartAreas[0].AxisX.IsMarginVisible = xAxisValue != AxisDimension.Index.ToString(); … … 246 290 } 247 291 } 292 xTrackBar.Value = 0; 293 yTrackBar.Value = 0; 294 295 //needed to set axis back to automatic and refresh them, otherwise their values may remain NaN 248 296 var xAxis = chart.ChartAreas[0].AxisX; 249 297 var yAxis = chart.ChartAreas[0].AxisY; 250 xTrackBar.Value = 0;251 yTrackBar.Value = 0;252 298 SetAutomaticUpdateOfAxis(xAxis, true); 253 299 SetAutomaticUpdateOfAxis(yAxis, true); 300 chart.Refresh(); 254 301 } 255 302 256 303 private void UpdateMarkerSizes() { 257 double[] sizeValues = this.chart.Series[0].Points.Select(p => p.YValues[1]).ToArray(); 304 var series = chart.Series[0]; 305 if (series.Points.Count <= 0) return; 306 307 var sizeValues = series.Points.Select(p => p.YValues[1]); 258 308 double minSizeValue = sizeValues.Min(); 259 309 double maxSizeValue = sizeValues.Max(); 260 261 for (int i = 0; i < sizeValues.Length; i++) { 262 DataPoint point = this.chart.Series[0].Points[i]; 263 double sizeRange = maxSizeValue - minSizeValue; 310 double sizeRange = maxSizeValue - minSizeValue; 311 312 const int smallestBubbleSize = 5; 313 314 foreach (DataPoint point in series.Points) { 315 //calculates the relative size of the data point 0 <= relativeSize <= 1 264 316 double relativeSize = (point.YValues[1] - minSizeValue); 265 266 if (sizeRange > double.Epsilon) relativeSize /= sizeRange; 267 else relativeSize = 1; 268 269 point.MarkerSize = (int)Math.Round((sizeTrackBar.Value - sizeTrackBar.Minimum) * relativeSize + sizeTrackBar.Minimum); 317 if (sizeRange > double.Epsilon) { 318 relativeSize /= sizeRange; 319 320 //invert bubble sizes if the value of the trackbar is negative 321 if (sizeTrackBar.Value < 0) relativeSize = Math.Abs(relativeSize - 1); 322 } else relativeSize = 1; 323 324 double sizeChange = Math.Abs(sizeTrackBar.Value) * relativeSize; 325 point.MarkerSize = (int)Math.Round(sizeChange + smallestBubbleSize); 270 326 } 271 327 } … … 274 330 var xAxis = this.chart.ChartAreas[0].AxisX; 275 331 var yAxis = this.chart.ChartAreas[0].AxisY; 332 276 333 SetAutomaticUpdateOfAxis(xAxis, false); 277 334 SetAutomaticUpdateOfAxis(yAxis, false); 335 336 double xAxisRange = xAxis.Maximum - xAxis.Minimum; 337 double yAxisRange = yAxis.Maximum - yAxis.Minimum; 278 338 279 339 foreach (DataPoint point in chart.Series[0].Points) { … … 283 343 284 344 if (!xJitterFactor.IsAlmost(0.0)) 285 xValue += 0.1 * GetXJitter(run) * xJitterFactor * (xAxis .Maximum - xAxis.Minimum);345 xValue += 0.1 * GetXJitter(run) * xJitterFactor * (xAxisRange); 286 346 if (!yJitterFactor.IsAlmost(0.0)) 287 yValue += 0.1 * GetYJitter(run) * yJitterFactor * (yAxis .Maximum - yAxis.Minimum);347 yValue += 0.1 * GetYJitter(run) * yJitterFactor * (yAxisRange); 288 348 289 349 point.XValue = xValue; 290 350 point.YValues[0] = yValue; 291 351 } 292 } 293 352 353 } 354 355 // sets an axis to automatic or restrains it to its current values 356 // this is used that none of the set values is changed when jitter is applied, so that the chart stays the same 294 357 private void SetAutomaticUpdateOfAxis(Axis axis, bool enabled) { 295 358 if (enabled) { … … 306 369 axis.LabelStyle.Interval = axis.LabelStyle.Interval; 307 370 } 308 309 371 } 310 372 … … 321 383 if (xValue.HasValue && yValue.HasValue && sizeValue.HasValue) { 322 384 xValue = xValue.Value; 323 324 385 yValue = yValue.Value; 325 386 … … 327 388 DataPoint point = new DataPoint(xValue.Value, new double[] { yValue.Value, sizeValue.Value }); 328 389 point.Tag = run; 329 point.Color = run.Color;330 390 series.Points.Add(point); 331 391 if (!runToDataPointMapping.ContainsKey(run)) runToDataPointMapping.Add(run, new List<DataPoint>()); 332 392 runToDataPointMapping[run].Add(point); 393 UpdateRun(run); 333 394 } 334 395 } … … 368 429 } 369 430 private double GetCategoricalValue(int dimension, string value) { 370 if (!this.categoricalMapping.ContainsKey(dimension)) 431 if (!this.categoricalMapping.ContainsKey(dimension)) { 371 432 this.categoricalMapping[dimension] = new Dictionary<object, double>(); 372 if (!this.categoricalMapping[dimension].ContainsKey(value)) { 373 if (this.categoricalMapping[dimension].Values.Count == 0) 374 this.categoricalMapping[dimension][value] = 1.0; 375 else 376 this.categoricalMapping[dimension][value] = this.categoricalMapping[dimension].Values.Max() + 1.0; 433 var orderedCategories = Content.Where(r => r.Visible).Select(r => Content.GetValue(r, dimension).ToString()) 434 .Distinct() 435 .OrderBy(x => x, new NaturalStringComparer()); 436 int count = 1; 437 foreach (var category in orderedCategories) { 438 this.categoricalMapping[dimension].Add(category, count); 439 count++; 440 } 377 441 } 378 442 return this.categoricalMapping[dimension][value]; 379 443 } 444 380 445 private double GetValue(IRun run, AxisDimension axisDimension) { 381 446 double value = double.NaN; 382 447 switch (axisDimension) { 383 448 case AxisDimension.Index: { 384 value = Content.ToList().IndexOf(run);449 value = runToIndexMapping[run]; 385 450 break; 386 451 } … … 405 470 } 406 471 private void UpdateCursorInterval() { 407 Series series = chart.Series[0]; 408 double[] xValues = (from point in series.Points 409 where !point.IsEmpty 410 select point.XValue) 411 .DefaultIfEmpty(1.0) 412 .ToArray(); 413 double[] yValues = (from point in series.Points 414 where !point.IsEmpty 415 select point.YValues[0]) 416 .DefaultIfEmpty(1.0) 417 .ToArray(); 418 419 double xRange = xValues.Max() - xValues.Min(); 420 double yRange = yValues.Max() - yValues.Min(); 472 double xMin = double.MaxValue; 473 double xMax = double.MinValue; 474 double yMin = double.MaxValue; 475 double yMax = double.MinValue; 476 477 foreach (var point in chart.Series[0].Points) { 478 if (point.IsEmpty) continue; 479 if (point.XValue < xMin) xMin = point.XValue; 480 if (point.XValue > xMax) xMax = point.XValue; 481 if (point.YValues[0] < yMin) yMin = point.YValues[0]; 482 if (point.YValues[0] > yMax) yMax = point.YValues[0]; 483 } 484 485 double xRange = 0.0; 486 double yRange = 0.0; 487 if (xMin != double.MaxValue && xMax != double.MinValue) xRange = xMax - xMin; 488 if (yMin != double.MaxValue && yMax != double.MinValue) yRange = yMax - yMin; 489 421 490 if (xRange.IsAlmost(0.0)) xRange = 1.0; 422 491 if (yRange.IsAlmost(0.0)) yRange = 1.0; … … 456 525 457 526 private void chart_MouseUp(object sender, MouseEventArgs e) { 458 if (isSelecting) { 459 System.Windows.Forms.DataVisualization.Charting.Cursor xCursor = chart.ChartAreas[0].CursorX; 460 System.Windows.Forms.DataVisualization.Charting.Cursor yCursor = chart.ChartAreas[0].CursorY; 461 462 double minX = Math.Min(xCursor.SelectionStart, xCursor.SelectionEnd); 463 double maxX = Math.Max(xCursor.SelectionStart, xCursor.SelectionEnd); 464 double minY = Math.Min(yCursor.SelectionStart, yCursor.SelectionEnd); 465 double maxY = Math.Max(yCursor.SelectionStart, yCursor.SelectionEnd); 466 467 //check for click to select model 468 if (minX == maxX && minY == maxY) { 469 HitTestResult hitTest = chart.HitTest(e.X, e.Y); 470 if (hitTest.ChartElementType == ChartElementType.DataPoint) { 471 int pointIndex = hitTest.PointIndex; 472 IRun run = (IRun)this.chart.Series[0].Points[pointIndex].Tag; 473 run.Color = colorDialog.Color; 474 } 475 } else { 476 List<DataPoint> selectedPoints = new List<DataPoint>(); 477 foreach (DataPoint p in this.chart.Series[0].Points) { 478 if (p.XValue >= minX && p.XValue < maxX && 479 p.YValues[0] >= minY && p.YValues[0] < maxY) { 480 selectedPoints.Add(p); 481 } 482 } 483 foreach (DataPoint p in selectedPoints) { 484 IRun run = (IRun)p.Tag; 485 run.Color = colorDialog.Color; 486 } 487 } 488 this.chart.ChartAreas[0].CursorX.SelectionStart = this.chart.ChartAreas[0].CursorX.SelectionEnd; 489 this.chart.ChartAreas[0].CursorY.SelectionStart = this.chart.ChartAreas[0].CursorY.SelectionEnd; 490 } 527 if (!isSelecting) return; 528 529 System.Windows.Forms.DataVisualization.Charting.Cursor xCursor = chart.ChartAreas[0].CursorX; 530 System.Windows.Forms.DataVisualization.Charting.Cursor yCursor = chart.ChartAreas[0].CursorY; 531 532 double minX = Math.Min(xCursor.SelectionStart, xCursor.SelectionEnd); 533 double maxX = Math.Max(xCursor.SelectionStart, xCursor.SelectionEnd); 534 double minY = Math.Min(yCursor.SelectionStart, yCursor.SelectionEnd); 535 double maxY = Math.Max(yCursor.SelectionStart, yCursor.SelectionEnd); 536 537 //check for click to select a single model 538 if (minX == maxX && minY == maxY) { 539 HitTestResult hitTest = chart.HitTest(e.X, e.Y, ChartElementType.DataPoint); 540 if (hitTest.ChartElementType == ChartElementType.DataPoint) { 541 int pointIndex = hitTest.PointIndex; 542 var point = chart.Series[0].Points[pointIndex]; 543 IRun run = (IRun)point.Tag; 544 point.Color = Color.Red; 545 point.MarkerStyle = MarkerStyle.Cross; 546 selectedRuns.Add(run); 547 548 } else ClearSelectedRuns(); 549 } else { 550 foreach (DataPoint point in this.chart.Series[0].Points) { 551 if (point.XValue < minX || point.XValue >= maxX) continue; 552 if (point.YValues[0] < minY || point.YValues[0] >= maxY) continue; 553 point.MarkerStyle = MarkerStyle.Cross; 554 point.Color = Color.Red; 555 IRun run = (IRun)point.Tag; 556 selectedRuns.Add(run); 557 } 558 } 559 560 this.chart.ChartAreas[0].CursorX.SelectionStart = this.chart.ChartAreas[0].CursorX.SelectionEnd; 561 this.chart.ChartAreas[0].CursorY.SelectionStart = this.chart.ChartAreas[0].CursorY.SelectionEnd; 562 this.OnChanged(); 491 563 } 492 564 493 565 private void chart_MouseMove(object sender, MouseEventArgs e) { 566 if (Control.MouseButtons != MouseButtons.None) return; 494 567 HitTestResult h = this.chart.HitTest(e.X, e.Y); 495 568 string newTooltipText = string.Empty; … … 615 688 private void zoomButton_CheckedChanged(object sender, EventArgs e) { 616 689 this.isSelecting = selectButton.Checked; 617 this.colorButton.Enabled = this.isSelecting; 690 this.colorDialogButton.Enabled = this.isSelecting; 691 this.colorRunsButton.Enabled = this.isSelecting; 692 this.hideRunsButton.Enabled = this.isSelecting; 618 693 this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = !isSelecting; 619 694 this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = !isSelecting; 620 } 621 private void colorButton_Click(object sender, EventArgs e) { 622 if (colorDialog.ShowDialog(this) == DialogResult.OK) { 623 this.colorButton.Image = this.GenerateImage(16, 16, this.colorDialog.Color); 624 } 625 } 626 private Image GenerateImage(int width, int height, Color fillColor) { 627 Image colorImage = new Bitmap(width, height); 628 using (Graphics gfx = Graphics.FromImage(colorImage)) { 629 using (SolidBrush brush = new SolidBrush(fillColor)) { 630 gfx.FillRectangle(brush, 0, 0, width, height); 631 } 632 } 633 return colorImage; 695 ClearSelectedRuns(); 634 696 } 635 697 … … 650 712 } 651 713 private void hideRunToolStripMenuItem_Click(object sender, EventArgs e) { 652 var constraint = Content.Constraints.OfType<RunCollectionContentConstraint>(). Where(c => c.Active).FirstOrDefault();714 var constraint = Content.Constraints.OfType<RunCollectionContentConstraint>().FirstOrDefault(c => c.Active); 653 715 if (constraint == null) { 654 716 constraint = new RunCollectionContentConstraint(); … … 657 719 } 658 720 constraint.ConstraintData.Add(runToHide); 721 } 722 private void hideRunsButton_Click(object sender, EventArgs e) { 723 if (!selectedRuns.Any()) return; 724 var constraint = new RunCollectionContentConstraint(); 725 constraint.ConstraintData = new ItemSet<IRun>(selectedRuns); 726 Content.Constraints.Add(constraint); 727 ClearSelectedRuns(); 728 constraint.Active = true; 729 } 730 731 private void ClearSelectedRuns() { 732 foreach (var run in selectedRuns) { 733 foreach (var point in runToDataPointMapping[run]) { 734 point.MarkerStyle = MarkerStyle.Circle; 735 point.Color = Color.FromArgb(255 - transparencyTrackBar.Value, run.Color); 736 } 737 } 738 selectedRuns.Clear(); 659 739 } 660 740 … … 666 746 boxplotView.Show(); 667 747 } 748 749 private void getDataAsMatrixToolStripMenuItem_Click(object sender, EventArgs e) { 750 int xCol = Matrix.ColumnNames.ToList().IndexOf(xAxisValue); 751 int yCol = Matrix.ColumnNames.ToList().IndexOf(yAxisValue); 752 753 var grouped = new Dictionary<string, List<string>>(); 754 Dictionary<double, string> reverseMapping = null; 755 if (categoricalMapping.ContainsKey(xCol)) 756 reverseMapping = categoricalMapping[xCol].ToDictionary(x => x.Value, y => y.Key.ToString()); 757 foreach (var run in Content.Where(r => r.Visible)) { 758 var x = GetValue(run, xAxisValue); 759 object y; 760 if (categoricalMapping.ContainsKey(yCol)) 761 y = Content.GetValue(run, yAxisValue); 762 else y = GetValue(run, yAxisValue); 763 if (!(x.HasValue && y != null)) continue; 764 765 var category = reverseMapping == null ? x.Value.ToString() : reverseMapping[x.Value]; 766 if (!grouped.ContainsKey(category)) grouped[category] = new List<string>(); 767 grouped[category].Add(y.ToString()); 768 } 769 770 if (!grouped.Any()) return; 771 var matrix = new StringMatrix(grouped.Values.Max(x => x.Count), grouped.Count) { 772 ColumnNames = grouped.Keys.ToArray() 773 }; 774 int i = 0; 775 foreach (var col in matrix.ColumnNames) { 776 int j = 0; 777 foreach (var y in grouped[col]) 778 matrix[j++, i] = y; 779 i++; 780 } 781 matrix.SortableView = false; 782 var view = MainFormManager.MainForm.ShowContent(matrix); 783 view.ReadOnly = true; 784 } 785 786 private void transparencyTrackBar_ValueChanged(object sender, EventArgs e) { 787 foreach (var run in Content) 788 UpdateRun(run); 789 } 668 790 #endregion 669 791 670 #region Automatic coloring 792 #region coloring 793 private void colorDialogButton_Click(object sender, EventArgs e) { 794 if (colorDialog.ShowDialog(this) == DialogResult.OK) { 795 this.colorDialogButton.Image = this.GenerateImage(16, 16, this.colorDialog.Color); 796 } 797 } 798 private Image GenerateImage(int width, int height, Color fillColor) { 799 Image colorImage = new Bitmap(width, height); 800 using (Graphics gfx = Graphics.FromImage(colorImage)) { 801 using (SolidBrush brush = new SolidBrush(fillColor)) { 802 gfx.FillRectangle(brush, 0, 0, width, height); 803 } 804 } 805 return colorImage; 806 } 807 808 private void colorRunsButton_Click(object sender, EventArgs e) { 809 if (!selectedRuns.Any()) return; 810 Content.UpdateOfRunsInProgress = true; 811 foreach (var run in selectedRuns) 812 run.Color = colorDialog.Color; 813 814 ClearSelectedRuns(); 815 Content.UpdateOfRunsInProgress = false; 816 } 817 671 818 private void colorXAxisButton_Click(object sender, EventArgs e) { 672 819 ColorRuns(xAxisValue); 673 820 } 674 675 821 private void colorYAxisButton_Click(object sender, EventArgs e) { 676 822 ColorRuns(yAxisValue); 677 823 } 678 679 824 private void ColorRuns(string axisValue) { 680 var runs = Content.Where(r => r.Visible).Select(r => new { Run = r, Value = GetValue(r, axisValue) }).Where(r => r.Value.HasValue) ;825 var runs = Content.Where(r => r.Visible).Select(r => new { Run = r, Value = GetValue(r, axisValue) }).Where(r => r.Value.HasValue).ToList(); 681 826 double minValue = runs.Min(r => r.Value.Value); 682 827 double maxValue = runs.Max(r => r.Value.Value); 683 828 double range = maxValue - minValue; 684 685 foreach (var r in runs) { 686 int colorIndex = 0; 687 if (!range.IsAlmost(0)) colorIndex = (int)((ColorGradient.Colors.Count - 1) * (r.Value.Value - minValue) / (range)); 688 r.Run.Color = ColorGradient.Colors[colorIndex]; 689 } 829 // UpdateOfRunsInProgress has to be set to true, otherwise run_Changed is called all the time (also in other views) 830 Content.UpdateOfRunsInProgress = true; 831 if (range.IsAlmost(0)) { 832 Color c = ColorGradient.Colors[0]; 833 runs.ForEach(r => r.Run.Color = c); 834 } else { 835 int maxColorIndex = ColorGradient.Colors.Count - 1; 836 foreach (var r in runs) { 837 int colorIndex = (int)(maxColorIndex * (r.Value - minValue) / (range)); 838 r.Run.Color = ColorGradient.Colors[colorIndex]; 839 } 840 } 841 Content.UpdateOfRunsInProgress = false; 690 842 } 691 843 #endregion -
branches/OaaS/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionDataTableView.cs
r8108 r9363 63 63 Content.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 64 64 Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged); 65 Content.OptimizerNameChanged += new EventHandler(Content_AlgorithmNameChanged); 65 66 } 66 67 protected override void DeregisterContentEvents() { … … 69 70 Content.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 70 71 Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged); 72 Content.OptimizerNameChanged -= new EventHandler(Content_AlgorithmNameChanged); 71 73 base.DeregisterContentEvents(); 72 74 } … … 93 95 RemoveRuns(e.OldItems); 94 96 AddRuns(e.Items); 97 } 98 private void Content_AlgorithmNameChanged(object sender, EventArgs e) { 99 if (InvokeRequired) 100 Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e); 101 else UpdateCaption(); 95 102 } 96 103 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { … … 123 130 runMapping.Clear(); 124 131 132 UpdateCaption(); 125 133 if (Content != null) { 126 134 UpdateDataTableComboBox(); … … 195 203 } 196 204 205 private void UpdateCaption() { 206 Caption = Content != null ? Content.OptimizerName + " Data Table" : ViewAttribute.GetViewName(GetType()); 207 } 208 197 209 private void UpdateDataRowComboBox() { 198 210 dataRowComboBox.Items.Clear(); -
branches/OaaS/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTabularView.cs
r8139 r9363 55 55 UpdateRowAttributes(); 56 56 } 57 UpdateCaption(); 57 58 } 58 59 … … 64 65 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 65 66 Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged); 67 Content.OptimizerNameChanged += new EventHandler(Content_AlgorithmNameChanged); 66 68 RegisterRunEvents(Content); 67 69 } … … 76 78 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 77 79 Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged); 80 Content.OptimizerNameChanged -= new EventHandler(Content_AlgorithmNameChanged); 78 81 DeregisterRunEvents(Content); 79 82 } … … 91 94 private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 92 95 RegisterRunEvents(e.Items); 96 } 97 private void Content_AlgorithmNameChanged(object sender, EventArgs e) { 98 if (InvokeRequired) 99 Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e); 100 else UpdateCaption(); 93 101 } 94 102 private void run_Changed(object sender, EventArgs e) { … … 101 109 } 102 110 #endregion 111 112 private void UpdateCaption() { 113 Caption = Content != null ? Content.OptimizerName + " Tabular View" : ViewAttribute.GetViewName(GetType()); 114 } 103 115 104 116 protected override void UpdateColumnHeaders() {
Note: See TracChangeset
for help on using the changeset viewer.