Changeset 12118 for branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
- Timestamp:
- 03/04/15 10:18:39 (10 years ago)
- Location:
- branches/TimeLimitRunOptimizer
- Files:
-
- 4 deleted
- 8 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/TimeLimitRunOptimizer
-
Property
svn:ignore
set to
*.suo
-
Property
svn:ignore
set to
-
branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views
-
Property
svn:mergeinfo
set to
/trunk/sources/HeuristicLab.Optimization.Views merged eligible
-
Property
svn:mergeinfo
set to
-
branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.Designer.cs
r7967 r12118 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 61 61 this.tooltip = new System.Windows.Forms.ToolTip(this.components); 62 62 ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit(); 63 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 63 64 this.splitContainer.Panel1.SuspendLayout(); 64 65 this.splitContainer.Panel2.SuspendLayout(); … … 71 72 this.xAxisLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 72 73 this.xAxisLabel.AutoSize = true; 73 this.xAxisLabel.Location = new System.Drawing.Point( 298, 256);74 this.xAxisLabel.Location = new System.Drawing.Point(363, 345); 74 75 this.xAxisLabel.Name = "xAxisLabel"; 75 76 this.xAxisLabel.Size = new System.Drawing.Size(15, 13); … … 83 84 this.xAxisComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 84 85 this.xAxisComboBox.FormattingEnabled = true; 85 this.xAxisComboBox.Location = new System.Drawing.Point(3 19, 253);86 this.xAxisComboBox.Location = new System.Drawing.Point(384, 342); 86 87 this.xAxisComboBox.Name = "xAxisComboBox"; 87 this.xAxisComboBox.Size = new System.Drawing.Size( 221, 21);88 this.xAxisComboBox.Size = new System.Drawing.Size(600, 21); 88 89 this.xAxisComboBox.TabIndex = 11; 89 90 this.xAxisComboBox.SelectedIndexChanged += new System.EventHandler(this.AxisComboBox_SelectedIndexChanged); … … 105 106 this.yAxisComboBox.Location = new System.Drawing.Point(24, 3); 106 107 this.yAxisComboBox.Name = "yAxisComboBox"; 107 this.yAxisComboBox.Size = new System.Drawing.Size( 221, 21);108 this.yAxisComboBox.Size = new System.Drawing.Size(600, 21); 108 109 this.yAxisComboBox.TabIndex = 9; 109 110 this.yAxisComboBox.SelectedIndexChanged += new System.EventHandler(this.AxisComboBox_SelectedIndexChanged); … … 111 112 // chart 112 113 // 113 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 114 | System.Windows.Forms.AnchorStyles.Left)115 114 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 115 | System.Windows.Forms.AnchorStyles.Left) 116 | System.Windows.Forms.AnchorStyles.Right))); 116 117 chartArea1.Name = "ChartArea1"; 117 118 this.chart.ChartAreas.Add(chartArea1); 118 this.chart.Location = new System.Drawing.Point( 6, 30);119 this.chart.Location = new System.Drawing.Point(-1, 30); 119 120 this.chart.Name = "chart"; 120 121 series1.ChartArea = "ChartArea1"; … … 125 126 series1.YValuesPerPoint = 6; 126 127 this.chart.Series.Add(series1); 127 this.chart.Size = new System.Drawing.Size( 534, 217);128 this.chart.Size = new System.Drawing.Size(989, 306); 128 129 this.chart.TabIndex = 17; 129 130 this.chart.Text = "chart"; … … 135 136 this.noRunsLabel.Anchor = System.Windows.Forms.AnchorStyles.None; 136 137 this.noRunsLabel.AutoSize = true; 137 this.noRunsLabel.Location = new System.Drawing.Point( 212, 122);138 this.noRunsLabel.Location = new System.Drawing.Point(434, 167); 138 139 this.noRunsLabel.Name = "noRunsLabel"; 139 140 this.noRunsLabel.Size = new System.Drawing.Size(138, 13); … … 161 162 // 162 163 this.splitContainer.Panel2.Controls.Add(this.statisticsGroupBox); 163 this.splitContainer.Size = new System.Drawing.Size( 543, 416);164 this.splitContainer.SplitterDistance = 277;164 this.splitContainer.Size = new System.Drawing.Size(987, 550); 165 this.splitContainer.SplitterDistance = 366; 165 166 this.splitContainer.TabIndex = 23; 166 167 // … … 172 173 this.showStatisticsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 173 174 this.showStatisticsCheckBox.Image = HeuristicLab.Common.Resources.VSImageLibrary.Properties; 174 this.showStatisticsCheckBox.Location = new System.Drawing.Point( 6, 245);175 this.showStatisticsCheckBox.Location = new System.Drawing.Point(3, 339); 175 176 this.showStatisticsCheckBox.Name = "showStatisticsCheckBox"; 176 177 this.showStatisticsCheckBox.Size = new System.Drawing.Size(24, 24); … … 182 183 // statisticsGroupBox 183 184 // 184 this.statisticsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 185 | System.Windows.Forms.AnchorStyles.Left)186 185 this.statisticsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 186 | System.Windows.Forms.AnchorStyles.Left) 187 | System.Windows.Forms.AnchorStyles.Right))); 187 188 this.statisticsGroupBox.Controls.Add(this.statisticsMatrixView); 188 189 this.statisticsGroupBox.Location = new System.Drawing.Point(3, 3); 189 190 this.statisticsGroupBox.Name = "statisticsGroupBox"; 190 this.statisticsGroupBox.Size = new System.Drawing.Size( 534, 129);191 this.statisticsGroupBox.Size = new System.Drawing.Size(981, 174); 191 192 this.statisticsGroupBox.TabIndex = 1; 192 193 this.statisticsGroupBox.TabStop = false; … … 203 204 this.statisticsMatrixView.ShowRowsAndColumnsTextBox = false; 204 205 this.statisticsMatrixView.ShowStatisticalInformation = false; 205 this.statisticsMatrixView.Size = new System.Drawing.Size( 528, 110);206 this.statisticsMatrixView.Size = new System.Drawing.Size(975, 155); 206 207 this.statisticsMatrixView.TabIndex = 0; 207 208 // 208 209 // RunCollectionBoxPlotView 209 210 // 210 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);211 211 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 212 212 this.BackColor = System.Drawing.SystemColors.Window; … … 214 214 this.Controls.Add(this.splitContainer); 215 215 this.Name = "RunCollectionBoxPlotView"; 216 this.Size = new System.Drawing.Size( 543, 416);216 this.Size = new System.Drawing.Size(987, 550); 217 217 ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit(); 218 218 this.splitContainer.Panel1.ResumeLayout(false); 219 219 this.splitContainer.Panel1.PerformLayout(); 220 220 this.splitContainer.Panel2.ResumeLayout(false); 221 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 221 222 this.splitContainer.ResumeLayout(false); 222 223 this.statisticsGroupBox.ResumeLayout(false); -
branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
r9435 r12118 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 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.Linq; 25 26 using System.Windows.Forms; … … 32 33 33 34 namespace HeuristicLab.Optimization.Views { 34 [View(" RunCollection BoxPlots")]35 [View("Box Plot")] 35 36 [Content(typeof(RunCollection), false)] 36 37 public partial class RunCollectionBoxPlotView : AsynchronousContentView { … … 92 93 protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) { 93 94 foreach (IRun run in runs) 94 run. Changed += new EventHandler(run_Changed);95 run.PropertyChanged += run_PropertyChanged; 95 96 } 96 97 protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) { 97 98 foreach (IRun run in runs) 98 run. Changed -= new EventHandler(run_Changed);99 run.PropertyChanged -= run_PropertyChanged; 99 100 } 100 101 … … 121 122 if (InvokeRequired) 122 123 Invoke(new EventHandler(Content_Reset), sender, e); 123 else { 124 this.categoricalMapping.Clear(); 124 else if (!suppressUpdates) { 125 125 UpdateDataPoints(); 126 126 UpdateAxisLabels(); … … 134 134 } 135 135 } 136 private void run_ Changed(object sender,EventArgs e) {136 private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) { 137 137 if (InvokeRequired) 138 this.Invoke( new EventHandler(run_Changed), sender, e);138 this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e); 139 139 else if (!suppressUpdates) { 140 UpdateDataPoints(); 140 if (e.PropertyName == "Visible") 141 UpdateDataPoints(); 141 142 } 142 143 } … … 159 160 160 161 private void UpdateCaption() { 161 Caption = Content != null ? Content.OptimizerName + " Box Plot s" : ViewAttribute.GetViewName(GetType());162 Caption = Content != null ? Content.OptimizerName + " Box Plot" : ViewAttribute.GetViewName(GetType()); 162 163 } 163 164 … … 189 190 190 191 private void UpdateDataPoints() { 192 this.categoricalMapping.Clear(); 191 193 this.chart.Series.Clear(); 192 194 this.seriesCache.Clear(); … … 216 218 if (datapoint != null) { 217 219 IRun run = (IRun)datapoint.Tag; 218 string selectedAxis = (string)xAxisComboBox.SelectedItem;220 string selectedAxis = xAxisValue; 219 221 IItem value = null; 220 222 … … 234 236 } 235 237 matrix.ColumnNames = columnNames; 236 matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", " Average", "Median", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile" };238 matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", "Median", "Average", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile" }; 237 239 238 240 for (int i = 0; i < seriesCache.Count; i++) { … … 242 244 matrix[1, i] = seriesValues.Min(); 243 245 matrix[2, i] = seriesValues.Max(); 244 matrix[3, i] = seriesValues. Average();245 matrix[4, i] = seriesValues. Median();246 matrix[3, i] = seriesValues.Median(); 247 matrix[4, i] = seriesValues.Average(); 246 248 matrix[5, i] = seriesValues.StandardDeviation(); 247 249 matrix[6, i] = seriesValues.Variance(); … … 325 327 } 326 328 } 327 private double GetCategoricalValue(int dimension, string value) {329 private double? GetCategoricalValue(int dimension, string value) { 328 330 if (!this.categoricalMapping.ContainsKey(dimension)) { 329 331 this.categoricalMapping[dimension] = new Dictionary<object, double>(); … … 336 338 } 337 339 } 340 if (!this.categoricalMapping[dimension].ContainsKey(value)) return null; 338 341 return this.categoricalMapping[dimension][value]; 339 342 } 340 private double GetValue(IRun run, AxisDimension axisDimension) {341 double value = double.NaN;343 private double? GetValue(IRun run, AxisDimension axisDimension) { 344 double? value = double.NaN; 342 345 switch (axisDimension) { 343 346 case AxisDimension.Color: { … … 373 376 Axis yAxis = this.chart.ChartAreas[BoxPlotChartAreaName].AxisY; 374 377 int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count(); 375 SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount); 376 SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount); 377 if (xAxisComboBox.SelectedItem != null) 378 xAxis.Title = xAxisComboBox.SelectedItem.ToString(); 379 if (yAxisComboBox.SelectedItem != null) 380 yAxis.Title = yAxisComboBox.SelectedItem.ToString(); 378 //mkommend: combobox.SelectedIndex could not be used as this changes during hovering over possible values 379 var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue); 380 var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue); 381 SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount); 382 SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount); 383 if (xAxisValue != null) 384 xAxis.Title = xAxisValue; 385 if (yAxisValue != null) 386 yAxis.Title = yAxisValue; 381 387 } 382 388 … … 447 453 } 448 454 455 public void SetXAxis(string axisName) { 456 xAxisComboBox.SelectedItem = axisName; 457 } 458 459 public void SetYAxis(string axisName) { 460 yAxisComboBox.SelectedItem = axisName; 461 } 449 462 } 450 463 } -
branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.Designer.cs
r9435 r12118 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 48 48 System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 49 49 System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); 50 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RunCollectionBubbleChartView)); 50 51 this.yJitterLabel = new System.Windows.Forms.Label(); 51 52 this.xJitterlabel = new System.Windows.Forms.Label(); … … 71 72 this.transparencyTrackBar = new System.Windows.Forms.TrackBar(); 72 73 this.hideRunsButton = new System.Windows.Forms.Button(); 74 this.colorDialogButton = new System.Windows.Forms.Button(); 73 75 this.noRunsLabel = new System.Windows.Forms.Label(); 74 76 this.sizeTrackBar = new System.Windows.Forms.TrackBar(); … … 77 79 this.unhideAllRunToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 78 80 this.colorResetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 79 this.colorDialogButton = new System.Windows.Forms.Button();80 81 ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).BeginInit(); 81 82 ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).BeginInit(); … … 89 90 // 90 91 this.yJitterLabel.AutoSize = true; 91 this.yJitterLabel.Location = new System.Drawing.Point( 278, 6);92 this.yJitterLabel.Location = new System.Drawing.Point(457, 6); 92 93 this.yJitterLabel.Name = "yJitterLabel"; 93 94 this.yJitterLabel.Size = new System.Drawing.Size(32, 13); … … 99 100 this.xJitterlabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 100 101 this.xJitterlabel.AutoSize = true; 101 this.xJitterlabel.Location = new System.Drawing.Point( 749, 472);102 this.xJitterlabel.Location = new System.Drawing.Point(893, 719); 102 103 this.xJitterlabel.Name = "xJitterlabel"; 103 104 this.xJitterlabel.Size = new System.Drawing.Size(32, 13); … … 109 110 this.xTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 110 111 this.xTrackBar.Enabled = false; 111 this.xTrackBar.Location = new System.Drawing.Point( 787, 469);112 this.xTrackBar.Location = new System.Drawing.Point(919, 715); 112 113 this.xTrackBar.Maximum = 100; 113 114 this.xTrackBar.Name = "xTrackBar"; … … 121 122 this.xAxisLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 122 123 this.xAxisLabel.AutoSize = true; 123 this.xAxisLabel.Location = new System.Drawing.Point(4 71, 472);124 this.xAxisLabel.Location = new System.Drawing.Point(439, 719); 124 125 this.xAxisLabel.Name = "xAxisLabel"; 125 126 this.xAxisLabel.Size = new System.Drawing.Size(15, 13); … … 132 133 this.xAxisComboBox.BackColor = System.Drawing.SystemColors.ControlLightLight; 133 134 this.xAxisComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 135 this.xAxisComboBox.DropDownWidth = 500; 134 136 this.xAxisComboBox.FormattingEnabled = true; 135 this.xAxisComboBox.Location = new System.Drawing.Point(4 92, 469);137 this.xAxisComboBox.Location = new System.Drawing.Point(460, 715); 136 138 this.xAxisComboBox.Name = "xAxisComboBox"; 137 this.xAxisComboBox.Size = new System.Drawing.Size( 221, 21);139 this.xAxisComboBox.Size = new System.Drawing.Size(400, 21); 138 140 this.xAxisComboBox.TabIndex = 7; 139 141 this.xAxisComboBox.SelectedValueChanged += new System.EventHandler(this.AxisComboBox_SelectedValueChanged); … … 152 154 this.yAxisComboBox.BackColor = System.Drawing.SystemColors.ControlLightLight; 153 155 this.yAxisComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 156 this.yAxisComboBox.DropDownWidth = 800; 154 157 this.yAxisComboBox.FormattingEnabled = true; 155 158 this.yAxisComboBox.Location = new System.Drawing.Point(24, 3); 156 159 this.yAxisComboBox.Name = "yAxisComboBox"; 157 this.yAxisComboBox.Size = new System.Drawing.Size( 221, 21);160 this.yAxisComboBox.Size = new System.Drawing.Size(400, 21); 158 161 this.yAxisComboBox.TabIndex = 5; 159 162 this.yAxisComboBox.SelectedValueChanged += new System.EventHandler(this.AxisComboBox_SelectedValueChanged); … … 162 165 // 163 166 this.yTrackBar.Enabled = false; 164 this.yTrackBar.Location = new System.Drawing.Point( 312, 3);167 this.yTrackBar.Location = new System.Drawing.Point(483, 3); 165 168 this.yTrackBar.Maximum = 100; 166 169 this.yTrackBar.Name = "yTrackBar"; … … 175 178 this.sizeComboBox.BackColor = System.Drawing.SystemColors.ControlLightLight; 176 179 this.sizeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 180 this.sizeComboBox.DropDownWidth = 400; 177 181 this.sizeComboBox.FormattingEnabled = true; 178 this.sizeComboBox.Location = new System.Drawing.Point( 560, 4);182 this.sizeComboBox.Location = new System.Drawing.Point(613, 3); 179 183 this.sizeComboBox.Name = "sizeComboBox"; 180 this.sizeComboBox.Size = new System.Drawing.Size( 221, 21);184 this.sizeComboBox.Size = new System.Drawing.Size(300, 21); 181 185 this.sizeComboBox.TabIndex = 14; 182 186 this.sizeComboBox.SelectedValueChanged += new System.EventHandler(this.AxisComboBox_SelectedValueChanged); … … 186 190 this.sizeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 187 191 this.sizeLabel.AutoSize = true; 188 this.sizeLabel.Location = new System.Drawing.Point( 489, 7);192 this.sizeLabel.Location = new System.Drawing.Point(541, 6); 189 193 this.sizeLabel.Name = "sizeLabel"; 190 194 this.sizeLabel.Size = new System.Drawing.Size(66, 13); … … 194 198 // chart 195 199 // 196 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 197 | System.Windows.Forms.AnchorStyles.Left) 200 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 201 | System.Windows.Forms.AnchorStyles.Left) 198 202 | System.Windows.Forms.AnchorStyles.Right))); 199 203 chartArea1.Name = "ChartArea1"; 200 204 this.chart.ChartAreas.Add(chartArea1); 201 this.chart.Location = new System.Drawing.Point( 6, 30);205 this.chart.Location = new System.Drawing.Point(-1, 30); 202 206 this.chart.Name = "chart"; 203 207 series1.ChartArea = "ChartArea1"; … … 208 212 series1.YValuesPerPoint = 2; 209 213 this.chart.Series.Add(series1); 210 this.chart.Size = new System.Drawing.Size( 843, 425);214 this.chart.Size = new System.Drawing.Size(988, 681); 211 215 this.chart.TabIndex = 16; 212 216 this.chart.Text = "chart"; … … 235 239 this.zoomButton.AutoSize = true; 236 240 this.zoomButton.Checked = true; 237 this.zoomButton.Location = new System.Drawing.Point(6, 1 0);241 this.zoomButton.Location = new System.Drawing.Point(6, 11); 238 242 this.zoomButton.Name = "zoomButton"; 239 243 this.zoomButton.Size = new System.Drawing.Size(52, 17); … … 248 252 this.selectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 249 253 this.selectButton.AutoSize = true; 250 this.selectButton.Location = new System.Drawing.Point(6 4, 9);254 this.selectButton.Location = new System.Drawing.Point(61, 11); 251 255 this.selectButton.Name = "selectButton"; 252 256 this.selectButton.Size = new System.Drawing.Size(55, 17); … … 260 264 this.radioButtonGroup.Controls.Add(this.zoomButton); 261 265 this.radioButtonGroup.Controls.Add(this.selectButton); 262 this.radioButtonGroup.Location = new System.Drawing.Point( 2, 461);266 this.radioButtonGroup.Location = new System.Drawing.Point(3, 704); 263 267 this.radioButtonGroup.Name = "radioButtonGroup"; 264 268 this.radioButtonGroup.Size = new System.Drawing.Size(122, 32); … … 271 275 this.colorRunsButton.Enabled = false; 272 276 this.colorRunsButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 273 this.colorRunsButton.Location = new System.Drawing.Point(13 0, 469);277 this.colorRunsButton.Location = new System.Drawing.Point(131, 713); 274 278 this.colorRunsButton.Name = "colorRunsButton"; 275 279 this.colorRunsButton.Size = new System.Drawing.Size(21, 21); … … 289 293 this.colorXAxisButton.Enabled = false; 290 294 this.colorXAxisButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.DisplayInColorVertical; 291 this.colorXAxisButton.Location = new System.Drawing.Point( 719, 469);295 this.colorXAxisButton.Location = new System.Drawing.Point(866, 715); 292 296 this.colorXAxisButton.Name = "colorXAxisButton"; 293 297 this.colorXAxisButton.Size = new System.Drawing.Size(21, 21); … … 301 305 this.colorYAxisButton.Enabled = false; 302 306 this.colorYAxisButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.DisplayInColor; 303 this.colorYAxisButton.Location = new System.Drawing.Point( 251, 3);307 this.colorYAxisButton.Location = new System.Drawing.Point(430, 3); 304 308 this.colorYAxisButton.Name = "colorYAxisButton"; 305 309 this.colorYAxisButton.Size = new System.Drawing.Size(21, 21); … … 313 317 this.transparencyTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 314 318 this.transparencyTrackBar.LargeChange = 16; 315 this.transparencyTrackBar.Location = new System.Drawing.Point(3 59, 470);319 this.transparencyTrackBar.Location = new System.Drawing.Point(302, 715); 316 320 this.transparencyTrackBar.Maximum = 254; 317 321 this.transparencyTrackBar.Name = "transparencyTrackBar"; … … 327 331 this.hideRunsButton.Enabled = false; 328 332 this.hideRunsButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 329 this.hideRunsButton.Location = new System.Drawing.Point(17 7, 469);333 this.hideRunsButton.Location = new System.Drawing.Point(172, 713); 330 334 this.hideRunsButton.Name = "hideRunsButton"; 331 335 this.hideRunsButton.Size = new System.Drawing.Size(43, 21); … … 336 340 this.hideRunsButton.Click += new System.EventHandler(this.hideRunsButton_Click); 337 341 // 342 // colorDialogButton 343 // 344 this.colorDialogButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 345 this.colorDialogButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 346 this.colorDialogButton.Enabled = false; 347 this.colorDialogButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 348 this.colorDialogButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 349 this.colorDialogButton.Location = new System.Drawing.Point(152, 713); 350 this.colorDialogButton.Name = "colorDialogButton"; 351 this.colorDialogButton.Size = new System.Drawing.Size(14, 21); 352 this.colorDialogButton.TabIndex = 25; 353 this.colorDialogButton.Text = "v"; 354 this.tooltip.SetToolTip(this.colorDialogButton, "Choose color"); 355 this.colorDialogButton.UseVisualStyleBackColor = true; 356 this.colorDialogButton.Click += new System.EventHandler(this.colorDialogButton_Click); 357 // 338 358 // noRunsLabel 339 359 // 340 360 this.noRunsLabel.Anchor = System.Windows.Forms.AnchorStyles.None; 341 361 this.noRunsLabel.AutoSize = true; 342 this.noRunsLabel.Location = new System.Drawing.Point( 366, 228);362 this.noRunsLabel.Location = new System.Drawing.Point(432, 350); 343 363 this.noRunsLabel.Name = "noRunsLabel"; 344 364 this.noRunsLabel.Size = new System.Drawing.Size(138, 13); … … 349 369 // 350 370 this.sizeTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 351 this.sizeTrackBar.Location = new System.Drawing.Point( 787, 3);371 this.sizeTrackBar.Location = new System.Drawing.Point(919, 3); 352 372 this.sizeTrackBar.Maximum = 20; 353 373 this.sizeTrackBar.Minimum = -20; … … 370 390 this.transparencyLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 371 391 this.transparencyLabel.AutoSize = true; 372 this.transparencyLabel.Location = new System.Drawing.Point(2 78, 475);392 this.transparencyLabel.Location = new System.Drawing.Point(233, 717); 373 393 this.transparencyLabel.Name = "transparencyLabel"; 374 394 this.transparencyLabel.Size = new System.Drawing.Size(75, 13); … … 390 410 this.colorResetToolStripMenuItem.Click += new System.EventHandler(this.colorResetToolStripMenuItem_Click); 391 411 // 392 // colorDialogButton393 //394 this.colorDialogButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));395 this.colorDialogButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;396 this.colorDialogButton.Enabled = false;397 this.colorDialogButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));398 this.colorDialogButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;399 this.colorDialogButton.Location = new System.Drawing.Point(150, 469);400 this.colorDialogButton.Name = "colorDialogButton";401 this.colorDialogButton.Size = new System.Drawing.Size(14, 21);402 this.colorDialogButton.TabIndex = 25;403 this.colorDialogButton.Text = "v";404 this.tooltip.SetToolTip(this.colorDialogButton, "Choose color");405 this.colorDialogButton.UseVisualStyleBackColor = true;406 this.colorDialogButton.Click += new System.EventHandler(this.colorDialogButton_Click);407 //408 412 // RunCollectionBubbleChartView 409 413 // … … 412 416 this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 413 417 this.Controls.Add(this.hideRunsButton); 414 this.Controls.Add(this.transparencyTrackBar);415 418 this.Controls.Add(this.sizeTrackBar); 416 419 this.Controls.Add(this.colorYAxisButton); … … 419 422 this.Controls.Add(this.colorRunsButton); 420 423 this.Controls.Add(this.radioButtonGroup); 421 this.Controls.Add(this.sizeLabel);422 this.Controls.Add(this.sizeComboBox);423 424 this.Controls.Add(this.yJitterLabel); 424 425 this.Controls.Add(this.transparencyLabel); … … 432 433 this.Controls.Add(this.colorDialogButton); 433 434 this.Controls.Add(this.chart); 435 this.Controls.Add(this.transparencyTrackBar); 436 this.Controls.Add(this.sizeLabel); 437 this.Controls.Add(this.sizeComboBox); 434 438 this.Name = "RunCollectionBubbleChartView"; 435 this.Size = new System.Drawing.Size( 854, 496);439 this.Size = new System.Drawing.Size(986, 741); 436 440 ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).EndInit(); 437 441 ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).EndInit(); -
branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r9435 r12118 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 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; … … 33 34 34 35 namespace HeuristicLab.Optimization.Views { 35 [View(" RunCollection BubbleChart")]36 [View("Bubble Chart")] 36 37 [Content(typeof(RunCollection), false)] 37 38 public partial class RunCollectionBubbleChartView : AsynchronousContentView { … … 56 57 private bool suppressUpdates = false; 57 58 58 private const double transperencyExponent = 2.5; 59 60 private RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true }; 59 private readonly RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true }; 61 60 62 61 public RunCollectionBubbleChartView() { … … 118 117 protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) { 119 118 foreach (IRun run in runs) 120 run. Changed += new EventHandler(run_Changed);119 run.PropertyChanged += run_PropertyChanged; 121 120 } 122 121 protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) { 123 122 foreach (IRun run in runs) 124 run. Changed -= new EventHandler(run_Changed);123 run.PropertyChanged -= run_PropertyChanged; 125 124 } 126 125 … … 135 134 RegisterRunEvents(e.Items); 136 135 } 137 private void run_ Changed(object sender,EventArgs e) {136 private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) { 138 137 if (suppressUpdates) return; 139 138 if (InvokeRequired) 140 this.Invoke( new EventHandler(run_Changed), sender, e);139 this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e); 141 140 else { 142 IRun run = (IRun)sender; 143 UpdateRun(run); 144 UpdateCursorInterval(); 145 chart.ChartAreas[0].RecalculateAxesScale(); 146 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 } 147 148 } 148 149 } … … 155 156 if (suppressUpdates) return; 156 157 157 foreach (var run in Content) UpdateRun(run); 158 UpdateMarkerSizes(); 159 UpdateCursorInterval(); 160 chart.ChartAreas[0].RecalculateAxesScale(); 158 UpdateDataPoints(); 161 159 UpdateAxisLabels(); 162 160 } … … 192 190 protected override void OnContentChanged() { 193 191 base.OnContentChanged(); 194 this.categoricalMapping.Clear();195 192 UpdateComboBoxes(); 196 193 UpdateDataPoints(); 197 194 UpdateCaption(); 198 RebuildInverseIndex();199 195 } 200 196 … … 266 262 267 263 private void Content_Reset(object sender, EventArgs e) { 264 if (suppressUpdates) return; 268 265 if (InvokeRequired) 269 266 Invoke(new EventHandler(Content_Reset), sender, e); 270 267 else { 271 this.categoricalMapping.Clear();272 RebuildInverseIndex();273 268 UpdateDataPoints(); 274 269 UpdateAxisLabels(); … … 280 275 series.Points.Clear(); 281 276 runToDataPointMapping.Clear(); 277 categoricalMapping.Clear(); 282 278 selectedRuns.Clear(); 279 RebuildInverseIndex(); 283 280 284 281 chart.ChartAreas[0].AxisX.IsMarginVisible = xAxisValue != AxisDimension.Index.ToString(); … … 440 437 } 441 438 } 442 private double GetCategoricalValue(int dimension, string value) {439 private double? GetCategoricalValue(int dimension, string value) { 443 440 if (!this.categoricalMapping.ContainsKey(dimension)) { 444 441 this.categoricalMapping[dimension] = new Dictionary<object, double>(); … … 451 448 } 452 449 } 450 if (!this.categoricalMapping[dimension].ContainsKey(value)) return null; 453 451 return this.categoricalMapping[dimension][value]; 454 452 } … … 557 555 var point = chart.Series[0].Points[pointIndex]; 558 556 IRun run = (IRun)point.Tag; 559 point.Color = Color.Red; 560 point.MarkerStyle = MarkerStyle.Cross; 561 selectedRuns.Add(run); 557 if (selectedRuns.Contains(run)) { 558 point.MarkerStyle = MarkerStyle.Circle; 559 point.Color = Color.FromArgb(255 - LogTransform(transparencyTrackBar.Value), run.Color); 560 selectedRuns.Remove(run); 561 } else { 562 point.Color = Color.Red; 563 point.MarkerStyle = MarkerStyle.Cross; 564 selectedRuns.Add(run); 565 } 562 566 } 563 567 } else { … … 663 667 Axis yAxis = this.chart.ChartAreas[0].AxisY; 664 668 int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count(); 665 SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount); 666 SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount); 667 if (xAxisComboBox.SelectedItem != null) 668 xAxis.Title = xAxisComboBox.SelectedItem.ToString(); 669 if (yAxisComboBox.SelectedItem != null) 670 yAxis.Title = yAxisComboBox.SelectedItem.ToString(); 669 //mkommend: combobox.SelectedIndex could not be used as this changes during hovering over possible values 670 var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue); 671 var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue); 672 SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount); 673 SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount); 674 if (xAxisValue != null) 675 xAxis.Title = xAxisValue; 676 if (yAxisValue != null) 677 yAxis.Title = yAxisValue; 671 678 } 672 679 … … 710 717 } 711 718 712 private IRun runToHide = null;713 719 private void ContextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) { 714 var pos = Control.MousePosition; 715 var chartPos = chart.PointToClient(pos); 716 717 HitTestResult h = this.chart.HitTest(chartPos.X, chartPos.Y, ChartElementType.DataPoint); 718 if (h.ChartElementType == ChartElementType.DataPoint) { 719 runToHide = (IRun)((DataPoint)h.Object).Tag; 720 hideRunsToolStripMenuItem.Visible = true; 721 } else { 722 runToHide = null; 723 hideRunsToolStripMenuItem.Visible = false; 724 } 720 hideRunsToolStripMenuItem.Visible = selectedRuns.Any(); 725 721 } 726 722 … … 730 726 } 731 727 private void hideRunsToolStripMenuItem_Click(object sender, EventArgs e) { 732 HideRuns(selectedRuns); 728 //ToList is necessary to prevent lazy evaluation 729 HideRuns(selectedRuns.ToList()); 733 730 //could not use ClearSelectedRuns as the runs are not visible anymore 734 731 selectedRuns.Clear(); 735 732 } 736 733 private void hideRunsButton_Click(object sender, EventArgs e) { 737 HideRuns(selectedRuns); 734 //ToList is necessary to prevent lazy evaluation 735 HideRuns(selectedRuns.ToList()); 738 736 //could not use ClearSelectedRuns as the runs are not visible anymore 739 737 selectedRuns.Clear(); … … 743 741 visibilityConstraint.Active = false; 744 742 if (!Content.Constraints.Contains(visibilityConstraint)) Content.Constraints.Add(visibilityConstraint); 745 foreach (var run in selectedRuns) {743 foreach (var run in runs) { 746 744 visibilityConstraint.ConstraintData.Add(run); 747 745 } … … 764 762 double max = transparencyTrackBar.Maximum; 765 763 double r = (x - min) / (max - min); // r \in [0..1] 766 double l = Math. Log(r + 1) / Math.Log(2.0); // l \in [0..1]764 double l = Math.Max(Math.Min((1.0 - Math.Pow(0.05, r)) / 0.95, 1), 0); // l \in [0..1] 767 765 return (int)Math.Round(255.0 * l); 768 766 } -
branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.Designer.cs
r7469 r12118 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r7469 r12118 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections; 24 24 using System.Collections.Generic; 25 using System.ComponentModel; 25 26 using System.Drawing; 26 27 using System.Linq; … … 79 80 item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged); 80 81 item.ToStringChanged -= new EventHandler(Item_ToStringChanged); 81 item. Changed -= new EventHandler(Item_Changed);82 item.PropertyChanged -= Item_PropertyChanged; 82 83 } 83 84 private void RegisterItemEvents(IRun item) { 84 85 item.ItemImageChanged += new EventHandler(Item_ItemImageChanged); 85 86 item.ToStringChanged += new EventHandler(Item_ToStringChanged); 86 item. Changed += new EventHandler(Item_Changed);87 item.PropertyChanged += Item_PropertyChanged; 87 88 } 88 89 … … 255 256 if (e.KeyCode == Keys.Delete) { 256 257 if ((itemsListView.SelectedItems.Count > 0) && !Content.IsReadOnly && !ReadOnly) { 257 foreach (ListViewItem item in itemsListView.SelectedItems) 258 Content.Remove((IRun)item.Tag); 258 if (RunCollection != null) { 259 RunCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(i => (IRun)i.Tag)); 260 } else { 261 foreach (ListViewItem item in itemsListView.SelectedItems) 262 Content.Remove((IRun)item.Tag); 263 } 259 264 } 260 265 } … … 350 355 private void removeButton_Click(object sender, EventArgs e) { 351 356 if (itemsListView.SelectedItems.Count > 0) { 352 foreach (ListViewItem item in itemsListView.SelectedItems) 353 Content.Remove((IRun)item.Tag); 357 if (RunCollection != null) { 358 RunCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(i => (IRun)i.Tag)); 359 } else { 360 foreach (ListViewItem item in itemsListView.SelectedItems) 361 Content.Remove((IRun)item.Tag); 362 } 354 363 itemsListView.SelectedItems.Clear(); 355 364 } … … 453 462 } 454 463 } 455 private void Item_ Changed(object sender,EventArgs e) {464 private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e) { 456 465 if (InvokeRequired) 457 this.Invoke( new EventHandler(Item_Changed), sender, e);466 this.Invoke((Action<object, PropertyChangedEventArgs>)Item_PropertyChanged, sender, e); 458 467 else { 459 468 IRun run = (IRun)sender; 460 UpdateRun(run); 469 if (e.PropertyName == "Color" || e.PropertyName == "Visible") 470 UpdateRun(run); 461 471 } 462 472 }
Note: See TracChangeset
for help on using the changeset viewer.