Changeset 9363 for branches/OaaS/HeuristicLab.Analysis.Views
- Timestamp:
- 04/16/13 13:13:41 (11 years ago)
- Location:
- branches/OaaS
- Files:
-
- 11 edited
- 8 copied
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.Analysis.Views
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/trunk/sources/HeuristicLab.Analysis.Views merged eligible /branches/Algorithms.GradientDescent/HeuristicLab.Analysis.Views 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Analysis.Views 6917-7005 /branches/CMAES/HeuristicLab.Analysis.Views 9141-9257 /branches/CloningRefactoring/HeuristicLab.Analysis.Views 4656-4721 /branches/DataAnalysis Refactoring/HeuristicLab.Analysis.Views 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Analysis.Views 5815-6180 /branches/DataAnalysis/HeuristicLab.Analysis.Views 4458-4459,4462,4464 /branches/GP.Grammar.Editor/HeuristicLab.Analysis.Views 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Analysis.Views 5060 /branches/NET40/sources/HeuristicLab.Analysis.Views 5138-5162 /branches/ParallelEngine/HeuristicLab.Analysis.Views 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Analysis.Views 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Analysis.Views 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Analysis.Views 6828 /branches/RuntimeOptimizer/HeuristicLab.Analysis.Views 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Analysis.Views 7787-8333 /branches/SlaveShutdown/HeuristicLab.Analysis.Views 8944-8956 /branches/SuccessProgressAnalysis/HeuristicLab.Analysis.Views 5370-5682 /branches/Trunk/HeuristicLab.Analysis.Views 6829-6865 /branches/UnloadJobs/HeuristicLab.Analysis.Views 9168-9215 /branches/VNS/HeuristicLab.Analysis.Views 5594-5752 /branches/histogram/HeuristicLab.Analysis.Views 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/OaaS/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r7979 r9363 20 20 #endregion 21 21 22 using HeuristicLab.Collections; 23 using HeuristicLab.Core.Views; 24 using HeuristicLab.MainForm; 22 25 using System; 23 26 using System.Collections.Generic; … … 26 29 using System.Windows.Forms; 27 30 using System.Windows.Forms.DataVisualization.Charting; 28 using HeuristicLab.Collections;29 using HeuristicLab.Core.Views;30 using HeuristicLab.MainForm;31 31 32 32 namespace HeuristicLab.Analysis.Views { … … 115 115 public void ShowConfiguration() { 116 116 if (Content != null) { 117 using ( DataTableVisualPropertiesDialogdialog = new DataTableVisualPropertiesDialog(Content)) {117 using (var dialog = new DataTableVisualPropertiesDialog(Content)) { 118 118 dialog.ShowDialog(this); 119 119 } … … 123 123 foreach (var row in rows) { 124 124 RegisterDataRowEvents(row); 125 Seriesseries = new Series(row.Name);125 var series = new Series(row.Name); 126 126 if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName; 127 127 else series.LegendText = row.Name; … … 231 231 if (!Content.VisualProperties.AxisTitleColor.IsEmpty) area.AxisY2.TitleForeColor = Content.VisualProperties.AxisTitleColor; 232 232 area.AxisY2.Title = Content.VisualProperties.SecondYAxisTitle; 233 234 area.AxisX.IsLogarithmic = Content.VisualProperties.XAxisLogScale; 235 area.AxisX2.IsLogarithmic = Content.VisualProperties.SecondXAxisLogScale; 236 area.AxisY.IsLogarithmic = Content.VisualProperties.YAxisLogScale; 237 area.AxisY2.IsLogarithmic = Content.VisualProperties.SecondYAxisLogScale; 233 238 } 234 239 … … 500 505 break; 501 506 default: { 507 bool yLogarithmic = series.YAxisType == AxisType.Primary 508 ? Content.VisualProperties.YAxisLogScale 509 : Content.VisualProperties.SecondYAxisLogScale; 510 bool xLogarithmic = series.XAxisType == AxisType.Primary 511 ? Content.VisualProperties.XAxisLogScale 512 : Content.VisualProperties.SecondXAxisLogScale; 502 513 for (int i = 0; i < row.Values.Count; i++) { 503 514 var value = row.Values[i]; 504 DataPointpoint = new DataPoint();505 point.XValue = row.VisualProperties.StartIndexZero ? i : i + 1;506 if (IsInvalidValue(value) )515 var point = new DataPoint(); 516 point.XValue = row.VisualProperties.StartIndexZero && !xLogarithmic ? i : i + 1; 517 if (IsInvalidValue(value) || (yLogarithmic && value <= 0)) 507 518 point.IsEmpty = true; 508 519 else … … 537 548 double intervalCenter = intervalWidth / 2; 538 549 539 double min = 0.0 ;550 double min = 0.0, max = 0.0; 540 551 if (!Double.IsNaN(Content.VisualProperties.XAxisMinimumFixedValue) && !Content.VisualProperties.XAxisMinimumAuto) 541 552 min = Content.VisualProperties.XAxisMinimumFixedValue; 542 553 else min = minValue; 554 if (!Double.IsNaN(Content.VisualProperties.XAxisMaximumFixedValue) && !Content.VisualProperties.XAxisMaximumAuto) 555 max = Content.VisualProperties.XAxisMaximumFixedValue; 556 else max = maxValue + intervalWidth; 543 557 544 558 double axisInterval = intervalWidth / row.VisualProperties.ScaleFactor; … … 550 564 551 565 // get the range or intervals which define the grouping of the frequency values 552 var doubleRange = DoubleRange(min, max Value + intervalWidth, intervalWidth).Skip(1).ToList();566 var doubleRange = DoubleRange(min, max, intervalWidth).Skip(1).ToList(); 553 567 554 568 // aggregate the row values by unique key and frequency value -
branches/OaaS/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesControl.Designer.cs
r8015 r9363 51 51 this.label4 = new System.Windows.Forms.Label(); 52 52 this.xAxisPrimaryGroupBox = new System.Windows.Forms.GroupBox(); 53 this.xAxisPrimaryLogScaleCheckBox = new System.Windows.Forms.CheckBox(); 53 54 this.panel2 = new System.Windows.Forms.Panel(); 54 55 this.xAxisPrimaryMaximumFixedRadioButton = new System.Windows.Forms.RadioButton(); … … 64 65 this.label11 = new System.Windows.Forms.Label(); 65 66 this.xAxisSecondaryGroupBox = new System.Windows.Forms.GroupBox(); 67 this.xAxisSecondaryLogScaleCheckBox = new System.Windows.Forms.CheckBox(); 66 68 this.panel4 = new System.Windows.Forms.Panel(); 67 69 this.xAxisSecondaryMaximumFixedRadioButton = new System.Windows.Forms.RadioButton(); … … 80 82 this.yAxisTabPage = new System.Windows.Forms.TabPage(); 81 83 this.yAxisSecondaryGroupBox = new System.Windows.Forms.GroupBox(); 84 this.yAxisSecondaryLogScaleCheckBox = new System.Windows.Forms.CheckBox(); 82 85 this.panel8 = new System.Windows.Forms.Panel(); 83 86 this.yAxisSecondaryMaximumFixedRadioButton = new System.Windows.Forms.RadioButton(); … … 91 94 this.label14 = new System.Windows.Forms.Label(); 92 95 this.yAxisPrimaryGroupBox = new System.Windows.Forms.GroupBox(); 96 this.yAxisPrimaryLogScaleCheckBox = new System.Windows.Forms.CheckBox(); 93 97 this.panel6 = new System.Windows.Forms.Panel(); 94 98 this.yAxisPrimaryMaximumFixedRadioButton = new System.Windows.Forms.RadioButton(); … … 141 145 // yAxisPrimaryTitleTextBox 142 146 // 143 this.yAxisPrimaryTitleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 144 145 this.yAxisPrimaryTitleTextBox.Location = new System.Drawing.Point( 66, 19);147 this.yAxisPrimaryTitleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 148 | System.Windows.Forms.AnchorStyles.Right))); 149 this.yAxisPrimaryTitleTextBox.Location = new System.Drawing.Point(74, 19); 146 150 this.yAxisPrimaryTitleTextBox.Name = "yAxisPrimaryTitleTextBox"; 147 this.yAxisPrimaryTitleTextBox.Size = new System.Drawing.Size(36 9, 20);151 this.yAxisPrimaryTitleTextBox.Size = new System.Drawing.Size(361, 20); 148 152 this.yAxisPrimaryTitleTextBox.TabIndex = 1; 149 153 this.yAxisPrimaryTitleTextBox.Validated += new System.EventHandler(this.yPrimaryTitleTextBox_Validated); … … 151 155 // yAxisSecondaryTitleTextBox 152 156 // 153 this.yAxisSecondaryTitleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 154 155 this.yAxisSecondaryTitleTextBox.Location = new System.Drawing.Point( 66, 19);157 this.yAxisSecondaryTitleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 158 | System.Windows.Forms.AnchorStyles.Right))); 159 this.yAxisSecondaryTitleTextBox.Location = new System.Drawing.Point(74, 19); 156 160 this.yAxisSecondaryTitleTextBox.Name = "yAxisSecondaryTitleTextBox"; 157 this.yAxisSecondaryTitleTextBox.Size = new System.Drawing.Size(36 9, 20);161 this.yAxisSecondaryTitleTextBox.Size = new System.Drawing.Size(361, 20); 158 162 this.yAxisSecondaryTitleTextBox.TabIndex = 1; 159 163 this.yAxisSecondaryTitleTextBox.Validated += new System.EventHandler(this.ySecondaryTitleTextBox_Validated); … … 170 174 // xAxisPrimaryGroupBox 171 175 // 172 this.xAxisPrimaryGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 173 | System.Windows.Forms.AnchorStyles.Right))); 176 this.xAxisPrimaryGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 177 | System.Windows.Forms.AnchorStyles.Right))); 178 this.xAxisPrimaryGroupBox.Controls.Add(this.xAxisPrimaryLogScaleCheckBox); 174 179 this.xAxisPrimaryGroupBox.Controls.Add(this.panel2); 175 180 this.xAxisPrimaryGroupBox.Controls.Add(this.panel1); … … 182 187 this.xAxisPrimaryGroupBox.Location = new System.Drawing.Point(3, 3); 183 188 this.xAxisPrimaryGroupBox.Name = "xAxisPrimaryGroupBox"; 184 this.xAxisPrimaryGroupBox.Size = new System.Drawing.Size(441, 99);189 this.xAxisPrimaryGroupBox.Size = new System.Drawing.Size(441, 126); 185 190 this.xAxisPrimaryGroupBox.TabIndex = 0; 186 191 this.xAxisPrimaryGroupBox.TabStop = false; 187 192 this.xAxisPrimaryGroupBox.Text = "Primary Axis"; 188 193 // 194 // xAxisPrimaryLogScaleCheckBox 195 // 196 this.xAxisPrimaryLogScaleCheckBox.AutoSize = true; 197 this.xAxisPrimaryLogScaleCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 198 this.xAxisPrimaryLogScaleCheckBox.Location = new System.Drawing.Point(6, 99); 199 this.xAxisPrimaryLogScaleCheckBox.Name = "xAxisPrimaryLogScaleCheckBox"; 200 this.xAxisPrimaryLogScaleCheckBox.Size = new System.Drawing.Size(83, 17); 201 this.xAxisPrimaryLogScaleCheckBox.TabIndex = 8; 202 this.xAxisPrimaryLogScaleCheckBox.Text = "Logarithmic:"; 203 this.xAxisPrimaryLogScaleCheckBox.UseVisualStyleBackColor = true; 204 this.xAxisPrimaryLogScaleCheckBox.CheckedChanged += new System.EventHandler(this.xAxisPrimaryLogScaleCheckBox_CheckedChanged); 205 // 189 206 // panel2 190 207 // 191 208 this.panel2.Controls.Add(this.xAxisPrimaryMaximumFixedRadioButton); 192 209 this.panel2.Controls.Add(this.xAxisPrimaryMaximumAutoRadioButton); 193 this.panel2.Location = new System.Drawing.Point( 66, 71);210 this.panel2.Location = new System.Drawing.Point(74, 71); 194 211 this.panel2.Name = "panel2"; 195 212 this.panel2.Size = new System.Drawing.Size(106, 20); … … 224 241 this.panel1.Controls.Add(this.xAxisPrimaryMinimumFixedRadioButton); 225 242 this.panel1.Controls.Add(this.xAxisPrimaryMinimumAutoRadioButton); 226 this.panel1.Location = new System.Drawing.Point( 66, 45);243 this.panel1.Location = new System.Drawing.Point(74, 45); 227 244 this.panel1.Name = "panel1"; 228 245 this.panel1.Size = new System.Drawing.Size(106, 20); … … 255 272 // xAxisPrimaryMinimumFixedTextBox 256 273 // 257 this.xAxisPrimaryMinimumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 258 274 this.xAxisPrimaryMinimumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 275 | System.Windows.Forms.AnchorStyles.Right))); 259 276 this.xAxisPrimaryMinimumFixedTextBox.Location = new System.Drawing.Point(191, 45); 260 277 this.xAxisPrimaryMinimumFixedTextBox.Name = "xAxisPrimaryMinimumFixedTextBox"; … … 265 282 // xAxisPrimaryMaximumFixedTextBox 266 283 // 267 this.xAxisPrimaryMaximumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 268 284 this.xAxisPrimaryMaximumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 285 | System.Windows.Forms.AnchorStyles.Right))); 269 286 this.xAxisPrimaryMaximumFixedTextBox.Location = new System.Drawing.Point(191, 71); 270 287 this.xAxisPrimaryMaximumFixedTextBox.Name = "xAxisPrimaryMaximumFixedTextBox"; … … 293 310 // xAxisPrimaryTitleTextBox 294 311 // 295 this.xAxisPrimaryTitleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 296 297 this.xAxisPrimaryTitleTextBox.Location = new System.Drawing.Point( 66, 19);312 this.xAxisPrimaryTitleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 313 | System.Windows.Forms.AnchorStyles.Right))); 314 this.xAxisPrimaryTitleTextBox.Location = new System.Drawing.Point(74, 19); 298 315 this.xAxisPrimaryTitleTextBox.Name = "xAxisPrimaryTitleTextBox"; 299 this.xAxisPrimaryTitleTextBox.Size = new System.Drawing.Size(36 9, 20);316 this.xAxisPrimaryTitleTextBox.Size = new System.Drawing.Size(361, 20); 300 317 this.xAxisPrimaryTitleTextBox.TabIndex = 1; 301 318 this.xAxisPrimaryTitleTextBox.Validated += new System.EventHandler(this.xPrimaryTitleTextBox_Validated); … … 312 329 // xAxisSecondaryGroupBox 313 330 // 314 this.xAxisSecondaryGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 315 | System.Windows.Forms.AnchorStyles.Left) 316 | System.Windows.Forms.AnchorStyles.Right))); 331 this.xAxisSecondaryGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 332 | System.Windows.Forms.AnchorStyles.Left) 333 | System.Windows.Forms.AnchorStyles.Right))); 334 this.xAxisSecondaryGroupBox.Controls.Add(this.xAxisSecondaryLogScaleCheckBox); 317 335 this.xAxisSecondaryGroupBox.Controls.Add(this.panel4); 318 336 this.xAxisSecondaryGroupBox.Controls.Add(this.panel3); … … 323 341 this.xAxisSecondaryGroupBox.Controls.Add(this.label5); 324 342 this.xAxisSecondaryGroupBox.Controls.Add(this.label6); 325 this.xAxisSecondaryGroupBox.Location = new System.Drawing.Point(3, 1 08);343 this.xAxisSecondaryGroupBox.Location = new System.Drawing.Point(3, 135); 326 344 this.xAxisSecondaryGroupBox.Name = "xAxisSecondaryGroupBox"; 327 this.xAxisSecondaryGroupBox.Size = new System.Drawing.Size(441, 99);345 this.xAxisSecondaryGroupBox.Size = new System.Drawing.Size(441, 125); 328 346 this.xAxisSecondaryGroupBox.TabIndex = 1; 329 347 this.xAxisSecondaryGroupBox.TabStop = false; 330 348 this.xAxisSecondaryGroupBox.Text = "Secondary Axis"; 331 349 // 350 // xAxisSecondaryLogScaleCheckBox 351 // 352 this.xAxisSecondaryLogScaleCheckBox.AutoSize = true; 353 this.xAxisSecondaryLogScaleCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 354 this.xAxisSecondaryLogScaleCheckBox.Location = new System.Drawing.Point(6, 99); 355 this.xAxisSecondaryLogScaleCheckBox.Name = "xAxisSecondaryLogScaleCheckBox"; 356 this.xAxisSecondaryLogScaleCheckBox.Size = new System.Drawing.Size(83, 17); 357 this.xAxisSecondaryLogScaleCheckBox.TabIndex = 8; 358 this.xAxisSecondaryLogScaleCheckBox.Text = "Logarithmic:"; 359 this.xAxisSecondaryLogScaleCheckBox.UseVisualStyleBackColor = true; 360 this.xAxisSecondaryLogScaleCheckBox.CheckedChanged += new System.EventHandler(this.xAxisSecondaryLogScaleCheckBox_CheckedChanged); 361 // 332 362 // panel4 333 363 // 334 364 this.panel4.Controls.Add(this.xAxisSecondaryMaximumFixedRadioButton); 335 365 this.panel4.Controls.Add(this.xAxisSecondaryMaximumAutoRadioButton); 336 this.panel4.Location = new System.Drawing.Point( 66, 71);366 this.panel4.Location = new System.Drawing.Point(74, 71); 337 367 this.panel4.Name = "panel4"; 338 368 this.panel4.Size = new System.Drawing.Size(106, 20); … … 367 397 this.panel3.Controls.Add(this.xAxisSecondaryMinimumFixedRadioButton); 368 398 this.panel3.Controls.Add(this.xAxisSecondaryMinimumAutoRadioButton); 369 this.panel3.Location = new System.Drawing.Point( 66, 45);399 this.panel3.Location = new System.Drawing.Point(74, 45); 370 400 this.panel3.Name = "panel3"; 371 401 this.panel3.Size = new System.Drawing.Size(106, 20); … … 398 428 // xAxisSecondaryMinimumFixedTextBox 399 429 // 400 this.xAxisSecondaryMinimumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 401 430 this.xAxisSecondaryMinimumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 431 | System.Windows.Forms.AnchorStyles.Right))); 402 432 this.xAxisSecondaryMinimumFixedTextBox.Location = new System.Drawing.Point(191, 45); 403 433 this.xAxisSecondaryMinimumFixedTextBox.Name = "xAxisSecondaryMinimumFixedTextBox"; … … 408 438 // xAxisSecondaryMaximumFixedTextBox 409 439 // 410 this.xAxisSecondaryMaximumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 411 440 this.xAxisSecondaryMaximumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 441 | System.Windows.Forms.AnchorStyles.Right))); 412 442 this.xAxisSecondaryMaximumFixedTextBox.Location = new System.Drawing.Point(191, 71); 413 443 this.xAxisSecondaryMaximumFixedTextBox.Name = "xAxisSecondaryMaximumFixedTextBox"; … … 427 457 // xAxisSecondaryTitleTextBox 428 458 // 429 this.xAxisSecondaryTitleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 430 431 this.xAxisSecondaryTitleTextBox.Location = new System.Drawing.Point( 66, 19);459 this.xAxisSecondaryTitleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 460 | System.Windows.Forms.AnchorStyles.Right))); 461 this.xAxisSecondaryTitleTextBox.Location = new System.Drawing.Point(74, 19); 432 462 this.xAxisSecondaryTitleTextBox.Name = "xAxisSecondaryTitleTextBox"; 433 this.xAxisSecondaryTitleTextBox.Size = new System.Drawing.Size(36 9, 20);463 this.xAxisSecondaryTitleTextBox.Size = new System.Drawing.Size(361, 20); 434 464 this.xAxisSecondaryTitleTextBox.TabIndex = 1; 435 465 this.xAxisSecondaryTitleTextBox.Validated += new System.EventHandler(this.xSecondaryTitleTextBox_Validated); … … 455 485 // axisTabControl 456 486 // 457 this.axisTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 458 487 this.axisTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 488 | System.Windows.Forms.AnchorStyles.Right))); 459 489 this.axisTabControl.Controls.Add(this.xAxisTabPage); 460 490 this.axisTabControl.Controls.Add(this.yAxisTabPage); … … 462 492 this.axisTabControl.Name = "axisTabControl"; 463 493 this.axisTabControl.SelectedIndex = 0; 464 this.axisTabControl.Size = new System.Drawing.Size(455, 2 36);494 this.axisTabControl.Size = new System.Drawing.Size(455, 289); 465 495 this.axisTabControl.TabIndex = 8; 466 496 // … … 472 502 this.xAxisTabPage.Name = "xAxisTabPage"; 473 503 this.xAxisTabPage.Padding = new System.Windows.Forms.Padding(3); 474 this.xAxisTabPage.Size = new System.Drawing.Size(447, 2 10);504 this.xAxisTabPage.Size = new System.Drawing.Size(447, 263); 475 505 this.xAxisTabPage.TabIndex = 0; 476 506 this.xAxisTabPage.Text = "X-Axis"; … … 484 514 this.yAxisTabPage.Name = "yAxisTabPage"; 485 515 this.yAxisTabPage.Padding = new System.Windows.Forms.Padding(3); 486 this.yAxisTabPage.Size = new System.Drawing.Size(447, 2 10);516 this.yAxisTabPage.Size = new System.Drawing.Size(447, 263); 487 517 this.yAxisTabPage.TabIndex = 1; 488 518 this.yAxisTabPage.Text = "Y-Axis"; … … 491 521 // yAxisSecondaryGroupBox 492 522 // 493 this.yAxisSecondaryGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 494 | System.Windows.Forms.AnchorStyles.Left) 495 | System.Windows.Forms.AnchorStyles.Right))); 523 this.yAxisSecondaryGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 524 | System.Windows.Forms.AnchorStyles.Left) 525 | System.Windows.Forms.AnchorStyles.Right))); 526 this.yAxisSecondaryGroupBox.Controls.Add(this.yAxisSecondaryLogScaleCheckBox); 496 527 this.yAxisSecondaryGroupBox.Controls.Add(this.panel8); 497 528 this.yAxisSecondaryGroupBox.Controls.Add(this.panel7); … … 502 533 this.yAxisSecondaryGroupBox.Controls.Add(this.label13); 503 534 this.yAxisSecondaryGroupBox.Controls.Add(this.label14); 504 this.yAxisSecondaryGroupBox.Location = new System.Drawing.Point(3, 1 08);535 this.yAxisSecondaryGroupBox.Location = new System.Drawing.Point(3, 135); 505 536 this.yAxisSecondaryGroupBox.Name = "yAxisSecondaryGroupBox"; 506 this.yAxisSecondaryGroupBox.Size = new System.Drawing.Size(441, 99);537 this.yAxisSecondaryGroupBox.Size = new System.Drawing.Size(441, 125); 507 538 this.yAxisSecondaryGroupBox.TabIndex = 1; 508 539 this.yAxisSecondaryGroupBox.TabStop = false; 509 540 this.yAxisSecondaryGroupBox.Text = "Secondary Axis"; 510 541 // 542 // yAxisSecondaryLogScaleCheckBox 543 // 544 this.yAxisSecondaryLogScaleCheckBox.AutoSize = true; 545 this.yAxisSecondaryLogScaleCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 546 this.yAxisSecondaryLogScaleCheckBox.Location = new System.Drawing.Point(6, 99); 547 this.yAxisSecondaryLogScaleCheckBox.Name = "yAxisSecondaryLogScaleCheckBox"; 548 this.yAxisSecondaryLogScaleCheckBox.Size = new System.Drawing.Size(83, 17); 549 this.yAxisSecondaryLogScaleCheckBox.TabIndex = 9; 550 this.yAxisSecondaryLogScaleCheckBox.Text = "Logarithmic:"; 551 this.yAxisSecondaryLogScaleCheckBox.UseVisualStyleBackColor = true; 552 this.yAxisSecondaryLogScaleCheckBox.CheckedChanged += new System.EventHandler(this.yAxisSecondaryLogScaleCheckBox_CheckedChanged); 553 // 511 554 // panel8 512 555 // 513 556 this.panel8.Controls.Add(this.yAxisSecondaryMaximumFixedRadioButton); 514 557 this.panel8.Controls.Add(this.yAxisSecondaryMaximumAutoRadioButton); 515 this.panel8.Location = new System.Drawing.Point( 66, 71);558 this.panel8.Location = new System.Drawing.Point(74, 71); 516 559 this.panel8.Name = "panel8"; 517 560 this.panel8.Size = new System.Drawing.Size(106, 20); … … 546 589 this.panel7.Controls.Add(this.yAxisSecondaryMinimumFixedRadioButton); 547 590 this.panel7.Controls.Add(this.yAxisSecondaryMinimumAutoRadioButton); 548 this.panel7.Location = new System.Drawing.Point( 66, 45);591 this.panel7.Location = new System.Drawing.Point(74, 45); 549 592 this.panel7.Name = "panel7"; 550 593 this.panel7.Size = new System.Drawing.Size(106, 20); … … 577 620 // yAxisSecondaryMinimumFixedTextBox 578 621 // 579 this.yAxisSecondaryMinimumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 580 622 this.yAxisSecondaryMinimumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 623 | System.Windows.Forms.AnchorStyles.Right))); 581 624 this.yAxisSecondaryMinimumFixedTextBox.Location = new System.Drawing.Point(191, 45); 582 625 this.yAxisSecondaryMinimumFixedTextBox.Name = "yAxisSecondaryMinimumFixedTextBox"; … … 587 630 // yAxisSecondaryMaximumFixedTextBox 588 631 // 589 this.yAxisSecondaryMaximumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 590 632 this.yAxisSecondaryMaximumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 633 | System.Windows.Forms.AnchorStyles.Right))); 591 634 this.yAxisSecondaryMaximumFixedTextBox.Location = new System.Drawing.Point(191, 71); 592 635 this.yAxisSecondaryMaximumFixedTextBox.Name = "yAxisSecondaryMaximumFixedTextBox"; … … 615 658 // yAxisPrimaryGroupBox 616 659 // 617 this.yAxisPrimaryGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 618 | System.Windows.Forms.AnchorStyles.Right))); 660 this.yAxisPrimaryGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 661 | System.Windows.Forms.AnchorStyles.Right))); 662 this.yAxisPrimaryGroupBox.Controls.Add(this.yAxisPrimaryLogScaleCheckBox); 619 663 this.yAxisPrimaryGroupBox.Controls.Add(this.panel6); 620 664 this.yAxisPrimaryGroupBox.Controls.Add(this.panel5); … … 627 671 this.yAxisPrimaryGroupBox.Location = new System.Drawing.Point(3, 3); 628 672 this.yAxisPrimaryGroupBox.Name = "yAxisPrimaryGroupBox"; 629 this.yAxisPrimaryGroupBox.Size = new System.Drawing.Size(441, 99);673 this.yAxisPrimaryGroupBox.Size = new System.Drawing.Size(441, 126); 630 674 this.yAxisPrimaryGroupBox.TabIndex = 0; 631 675 this.yAxisPrimaryGroupBox.TabStop = false; 632 676 this.yAxisPrimaryGroupBox.Text = "Primary Axis"; 633 677 // 678 // yAxisPrimaryLogScaleCheckBox 679 // 680 this.yAxisPrimaryLogScaleCheckBox.AutoSize = true; 681 this.yAxisPrimaryLogScaleCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 682 this.yAxisPrimaryLogScaleCheckBox.Location = new System.Drawing.Point(6, 99); 683 this.yAxisPrimaryLogScaleCheckBox.Name = "yAxisPrimaryLogScaleCheckBox"; 684 this.yAxisPrimaryLogScaleCheckBox.Size = new System.Drawing.Size(83, 17); 685 this.yAxisPrimaryLogScaleCheckBox.TabIndex = 10; 686 this.yAxisPrimaryLogScaleCheckBox.Text = "Logarithmic:"; 687 this.yAxisPrimaryLogScaleCheckBox.UseVisualStyleBackColor = true; 688 this.yAxisPrimaryLogScaleCheckBox.CheckedChanged += new System.EventHandler(this.yAxisPrimaryLogScaleCheckBox_CheckedChanged); 689 // 634 690 // panel6 635 691 // 636 692 this.panel6.Controls.Add(this.yAxisPrimaryMaximumFixedRadioButton); 637 693 this.panel6.Controls.Add(this.yAxisPrimaryMaximumAutoRadioButton); 638 this.panel6.Location = new System.Drawing.Point( 66, 71);694 this.panel6.Location = new System.Drawing.Point(74, 71); 639 695 this.panel6.Name = "panel6"; 640 696 this.panel6.Size = new System.Drawing.Size(106, 20); … … 669 725 this.panel5.Controls.Add(this.yAxisPrimaryMinimumAutoRadioButton); 670 726 this.panel5.Controls.Add(this.yAxisPrimaryMinimumFixedRadioButton); 671 this.panel5.Location = new System.Drawing.Point( 66, 45);727 this.panel5.Location = new System.Drawing.Point(74, 45); 672 728 this.panel5.Name = "panel5"; 673 729 this.panel5.Size = new System.Drawing.Size(106, 20); … … 700 756 // yAxisPrimaryMinimumFixedTextBox 701 757 // 702 this.yAxisPrimaryMinimumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 703 758 this.yAxisPrimaryMinimumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 759 | System.Windows.Forms.AnchorStyles.Right))); 704 760 this.yAxisPrimaryMinimumFixedTextBox.Location = new System.Drawing.Point(191, 45); 705 761 this.yAxisPrimaryMinimumFixedTextBox.Name = "yAxisPrimaryMinimumFixedTextBox"; … … 710 766 // yAxisPrimaryMaximumFixedTextBox 711 767 // 712 this.yAxisPrimaryMaximumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 713 768 this.yAxisPrimaryMaximumFixedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 769 | System.Windows.Forms.AnchorStyles.Right))); 714 770 this.yAxisPrimaryMaximumFixedTextBox.Location = new System.Drawing.Point(191, 71); 715 771 this.yAxisPrimaryMaximumFixedTextBox.Name = "yAxisPrimaryMaximumFixedTextBox"; … … 738 794 // titleTextBox 739 795 // 740 this.titleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 741 796 this.titleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 797 | System.Windows.Forms.AnchorStyles.Right))); 742 798 this.titleTextBox.Location = new System.Drawing.Point(66, 0); 743 799 this.titleTextBox.Name = "titleTextBox"; … … 757 813 // axisFontLabel 758 814 // 759 this.axisFontLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 760 815 this.axisFontLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 816 | System.Windows.Forms.AnchorStyles.Right))); 761 817 this.axisFontLabel.AutoSize = true; 762 818 this.axisFontLabel.Location = new System.Drawing.Point(98, 60); … … 768 824 // titleFontLabel 769 825 // 770 this.titleFontLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 771 826 this.titleFontLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 827 | System.Windows.Forms.AnchorStyles.Right))); 772 828 this.titleFontLabel.AutoSize = true; 773 829 this.titleFontLabel.Location = new System.Drawing.Point(98, 31); … … 822 878 // titleFontDialog 823 879 // 880 this.titleFontDialog.Color = System.Drawing.SystemColors.ControlText; 824 881 this.titleFontDialog.FontMustExist = true; 825 882 this.titleFontDialog.ShowColor = true; 883 // 884 // axisFontDialog 885 // 886 this.axisFontDialog.Color = System.Drawing.SystemColors.ControlText; 826 887 // 827 888 // DataTableVisualPropertiesControl … … 838 899 this.Controls.Add(this.titleFontButton); 839 900 this.Name = "DataTableVisualPropertiesControl"; 840 this.Size = new System.Drawing.Size(455, 3 22);901 this.Size = new System.Drawing.Size(455, 373); 841 902 this.xAxisPrimaryGroupBox.ResumeLayout(false); 842 903 this.xAxisPrimaryGroupBox.PerformLayout(); … … 940 1001 private System.Windows.Forms.Panel panel7; 941 1002 private System.Windows.Forms.Panel panel8; 1003 private System.Windows.Forms.CheckBox xAxisPrimaryLogScaleCheckBox; 1004 private System.Windows.Forms.CheckBox xAxisSecondaryLogScaleCheckBox; 1005 private System.Windows.Forms.CheckBox yAxisSecondaryLogScaleCheckBox; 1006 private System.Windows.Forms.CheckBox yAxisPrimaryLogScaleCheckBox; 942 1007 } 943 1008 } -
branches/OaaS/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesControl.cs
r7259 r9363 20 20 #endregion 21 21 22 using HeuristicLab.MainForm; 23 using HeuristicLab.MainForm.WindowsForms; 22 24 using System.Drawing; 23 25 using System.Windows.Forms; 24 using HeuristicLab.MainForm;25 using HeuristicLab.MainForm.WindowsForms;26 26 27 27 namespace HeuristicLab.Analysis.Views { 28 [View("Data RowVisual Properties")]28 [View("DataTable Visual Properties")] 29 29 public partial class DataTableVisualPropertiesControl : UserControl { 30 30 protected bool SuppressEvents { get; set; } … … 75 75 xAxisPrimaryMaximumFixedRadioButton.Checked = false; 76 76 xAxisPrimaryMaximumFixedTextBox.Text = string.Empty; 77 xAxisPrimaryLogScaleCheckBox.Checked = false; 77 78 xAxisSecondaryTitleTextBox.Text = string.Empty; 78 79 xAxisSecondaryMinimumAutoRadioButton.Checked = false; … … 82 83 xAxisSecondaryMaximumFixedRadioButton.Checked = false; 83 84 xAxisSecondaryMaximumFixedTextBox.Text = string.Empty; 85 xAxisSecondaryLogScaleCheckBox.Checked = false; 84 86 85 87 yAxisPrimaryTitleTextBox.Text = string.Empty; … … 90 92 yAxisPrimaryMaximumFixedRadioButton.Checked = false; 91 93 yAxisPrimaryMaximumFixedTextBox.Text = string.Empty; 94 yAxisPrimaryLogScaleCheckBox.Checked = false; 92 95 yAxisSecondaryTitleTextBox.Text = string.Empty; 93 96 yAxisSecondaryMinimumAutoRadioButton.Checked = false; … … 97 100 yAxisSecondaryMaximumFixedRadioButton.Checked = false; 98 101 yAxisSecondaryMaximumFixedTextBox.Text = string.Empty; 102 yAxisSecondaryLogScaleCheckBox.Checked = false; 99 103 } else { 100 104 titleFontLabel.Text = "( " + FormatFont(Content.TitleFont) + " )"; … … 109 113 xAxisPrimaryMaximumFixedRadioButton.Checked = !Content.XAxisMaximumAuto; 110 114 xAxisPrimaryMaximumFixedTextBox.Text = Content.XAxisMaximumFixedValue.ToString(); 115 xAxisPrimaryLogScaleCheckBox.Checked = Content.XAxisLogScale; 111 116 xAxisSecondaryTitleTextBox.Text = Content.SecondXAxisTitle; 112 117 xAxisSecondaryMinimumAutoRadioButton.Checked = Content.SecondXAxisMinimumAuto; … … 116 121 xAxisSecondaryMaximumFixedRadioButton.Checked = !Content.SecondXAxisMaximumAuto; 117 122 xAxisSecondaryMaximumFixedTextBox.Text = Content.SecondXAxisMaximumFixedValue.ToString(); 123 xAxisSecondaryLogScaleCheckBox.Checked = Content.SecondXAxisLogScale; 118 124 119 125 yAxisPrimaryTitleTextBox.Text = Content.YAxisTitle; … … 124 130 yAxisPrimaryMaximumFixedRadioButton.Checked = !Content.YAxisMaximumAuto; 125 131 yAxisPrimaryMaximumFixedTextBox.Text = Content.YAxisMaximumFixedValue.ToString(); 132 yAxisPrimaryLogScaleCheckBox.Checked = Content.YAxisLogScale; 126 133 yAxisSecondaryTitleTextBox.Text = Content.SecondYAxisTitle; 127 134 yAxisSecondaryMinimumAutoRadioButton.Checked = Content.SecondYAxisMinimumAuto; … … 131 138 yAxisSecondaryMaximumFixedRadioButton.Checked = !Content.SecondYAxisMaximumAuto; 132 139 yAxisSecondaryMaximumFixedTextBox.Text = Content.SecondYAxisMaximumFixedValue.ToString(); 133 }134 }135 finally { SuppressEvents = false; }140 yAxisSecondaryLogScaleCheckBox.Checked = Content.SecondYAxisLogScale; 141 } 142 } finally { SuppressEvents = false; } 136 143 SetEnabledStateOfControls(); 137 144 } … … 333 340 Content.XAxisMinimumAuto = xAxisPrimaryMinimumAutoRadioButton.Checked; 334 341 if (Content.XAxisMinimumAuto) xAxisPrimaryMinimumFixedTextBox.Text = double.NaN.ToString(); 335 } 336 finally { SuppressEvents = false; } 342 } finally { SuppressEvents = false; } 337 343 SetEnabledStateOfControls(); 338 344 } … … 345 351 Content.XAxisMaximumAuto = xAxisPrimaryMaximumAutoRadioButton.Checked; 346 352 if (Content.XAxisMaximumAuto) xAxisPrimaryMaximumFixedTextBox.Text = double.NaN.ToString(); 347 } 348 finally { SuppressEvents = false; } 353 } finally { SuppressEvents = false; } 349 354 SetEnabledStateOfControls(); 350 355 } … … 357 362 Content.SecondXAxisMinimumAuto = xAxisSecondaryMinimumAutoRadioButton.Checked; 358 363 if (Content.SecondXAxisMinimumAuto) xAxisSecondaryMinimumFixedTextBox.Text = double.NaN.ToString(); 359 } 360 finally { SuppressEvents = false; } 364 } finally { SuppressEvents = false; } 361 365 SetEnabledStateOfControls(); 362 366 } … … 369 373 Content.SecondXAxisMaximumAuto = xAxisSecondaryMaximumAutoRadioButton.Checked; 370 374 if (Content.SecondXAxisMaximumAuto) xAxisSecondaryMaximumFixedTextBox.Text = double.NaN.ToString(); 371 } 372 finally { SuppressEvents = false; } 375 } finally { SuppressEvents = false; } 373 376 SetEnabledStateOfControls(); 374 377 } … … 381 384 Content.YAxisMinimumAuto = yAxisPrimaryMinimumAutoRadioButton.Checked; 382 385 if (Content.YAxisMinimumAuto) yAxisPrimaryMinimumFixedTextBox.Text = double.NaN.ToString(); 383 } 384 finally { SuppressEvents = false; } 386 } finally { SuppressEvents = false; } 385 387 SetEnabledStateOfControls(); 386 388 } … … 393 395 Content.YAxisMaximumAuto = yAxisPrimaryMaximumAutoRadioButton.Checked; 394 396 if (Content.YAxisMaximumAuto) yAxisPrimaryMaximumFixedTextBox.Text = double.NaN.ToString(); 395 } 396 finally { SuppressEvents = false; } 397 } finally { SuppressEvents = false; } 397 398 SetEnabledStateOfControls(); 398 399 } … … 405 406 Content.SecondYAxisMinimumAuto = yAxisSecondaryMinimumAutoRadioButton.Checked; 406 407 if (Content.SecondYAxisMinimumAuto) yAxisSecondaryMinimumFixedTextBox.Text = double.NaN.ToString(); 407 } 408 finally { SuppressEvents = false; } 408 } finally { SuppressEvents = false; } 409 409 SetEnabledStateOfControls(); 410 410 } … … 417 417 Content.SecondYAxisMaximumAuto = yAxisSecondaryMaximumAutoRadioButton.Checked; 418 418 if (Content.SecondYAxisMaximumAuto) yAxisSecondaryMaximumFixedTextBox.Text = double.NaN.ToString(); 419 } 420 finally { SuppressEvents = false; } 421 SetEnabledStateOfControls(); 419 } finally { SuppressEvents = false; } 420 SetEnabledStateOfControls(); 421 } 422 } 423 424 private void xAxisPrimaryLogScaleCheckBox_CheckedChanged(object sender, System.EventArgs e) { 425 if (!SuppressEvents && Content != null) { 426 SuppressEvents = true; 427 try { 428 Content.XAxisLogScale = xAxisPrimaryLogScaleCheckBox.Checked; 429 } finally { SuppressEvents = false; } 430 } 431 } 432 433 private void xAxisSecondaryLogScaleCheckBox_CheckedChanged(object sender, System.EventArgs e) { 434 if (!SuppressEvents && Content != null) { 435 SuppressEvents = true; 436 try { 437 Content.SecondXAxisLogScale = xAxisSecondaryLogScaleCheckBox.Checked; 438 } finally { SuppressEvents = false; } 439 } 440 } 441 442 private void yAxisPrimaryLogScaleCheckBox_CheckedChanged(object sender, System.EventArgs e) { 443 if (!SuppressEvents && Content != null) { 444 SuppressEvents = true; 445 try { 446 Content.YAxisLogScale = yAxisPrimaryLogScaleCheckBox.Checked; 447 } finally { SuppressEvents = false; } 448 } 449 } 450 451 private void yAxisSecondaryLogScaleCheckBox_CheckedChanged(object sender, System.EventArgs e) { 452 if (!SuppressEvents && Content != null) { 453 SuppressEvents = true; 454 try { 455 Content.SecondYAxisLogScale = yAxisSecondaryLogScaleCheckBox.Checked; 456 } finally { SuppressEvents = false; } 422 457 } 423 458 } -
branches/OaaS/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.Designer.cs
r8015 r9363 69 69 this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 70 70 this.okButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 71 this.okButton.Location = new System.Drawing.Point(325, 4 00);71 this.okButton.Location = new System.Drawing.Point(325, 425); 72 72 this.okButton.Name = "okButton"; 73 73 this.okButton.Size = new System.Drawing.Size(75, 23); … … 81 81 this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 82 82 this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 83 this.cancelButton.Location = new System.Drawing.Point(406, 4 00);83 this.cancelButton.Location = new System.Drawing.Point(406, 425); 84 84 this.cancelButton.Name = "cancelButton"; 85 85 this.cancelButton.Size = new System.Drawing.Size(75, 23); … … 91 91 // tabControl 92 92 // 93 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 94 | System.Windows.Forms.AnchorStyles.Left)95 93 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 94 | System.Windows.Forms.AnchorStyles.Left) 95 | System.Windows.Forms.AnchorStyles.Right))); 96 96 this.tabControl.Controls.Add(this.seriesTabPage); 97 97 this.tabControl.Controls.Add(this.chartTabPage); … … 99 99 this.tabControl.Name = "tabControl"; 100 100 this.tabControl.SelectedIndex = 0; 101 this.tabControl.Size = new System.Drawing.Size(469, 382);101 this.tabControl.Size = new System.Drawing.Size(469, 407); 102 102 this.tabControl.TabIndex = 2; 103 103 // … … 108 108 this.seriesTabPage.Name = "seriesTabPage"; 109 109 this.seriesTabPage.Padding = new System.Windows.Forms.Padding(3); 110 this.seriesTabPage.Size = new System.Drawing.Size(461, 3 56);110 this.seriesTabPage.Size = new System.Drawing.Size(461, 381); 111 111 this.seriesTabPage.TabIndex = 0; 112 112 this.seriesTabPage.Text = "Series"; … … 115 115 // splitContainer 116 116 // 117 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 118 | System.Windows.Forms.AnchorStyles.Left)119 117 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 118 | System.Windows.Forms.AnchorStyles.Left) 119 | System.Windows.Forms.AnchorStyles.Right))); 120 120 this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; 121 121 this.splitContainer.Location = new System.Drawing.Point(0, 0); … … 133 133 this.splitContainer.Panel2.Controls.Add(this.dataRowVisualPropertiesControl); 134 134 this.splitContainer.Panel2MinSize = 50; 135 this.splitContainer.Size = new System.Drawing.Size(461, 3 56);135 this.splitContainer.Size = new System.Drawing.Size(461, 381); 136 136 this.splitContainer.SplitterDistance = 125; 137 137 this.splitContainer.TabIndex = 0; … … 161 161 // seriesListView 162 162 // 163 this.seriesListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 164 | System.Windows.Forms.AnchorStyles.Left)165 163 this.seriesListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 164 | System.Windows.Forms.AnchorStyles.Left) 165 | System.Windows.Forms.AnchorStyles.Right))); 166 166 this.seriesListView.HideSelection = false; 167 167 this.seriesListView.Location = new System.Drawing.Point(3, 32); … … 169 169 this.seriesListView.Name = "seriesListView"; 170 170 this.seriesListView.ShowGroups = false; 171 this.seriesListView.Size = new System.Drawing.Size(119, 3 21);171 this.seriesListView.Size = new System.Drawing.Size(119, 346); 172 172 this.seriesListView.TabIndex = 2; 173 173 this.seriesListView.UseCompatibleStateImageBehavior = false; … … 177 177 // dataRowVisualPropertiesControl 178 178 // 179 this.dataRowVisualPropertiesControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 180 | System.Windows.Forms.AnchorStyles.Left)181 179 this.dataRowVisualPropertiesControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 180 | System.Windows.Forms.AnchorStyles.Left) 181 | System.Windows.Forms.AnchorStyles.Right))); 182 182 this.dataRowVisualPropertiesControl.Content = null; 183 183 this.dataRowVisualPropertiesControl.Location = new System.Drawing.Point(3, 26); 184 184 this.dataRowVisualPropertiesControl.Name = "dataRowVisualPropertiesControl"; 185 this.dataRowVisualPropertiesControl.Size = new System.Drawing.Size(326, 3 27);185 this.dataRowVisualPropertiesControl.Size = new System.Drawing.Size(326, 352); 186 186 this.dataRowVisualPropertiesControl.TabIndex = 0; 187 187 // … … 192 192 this.chartTabPage.Name = "chartTabPage"; 193 193 this.chartTabPage.Padding = new System.Windows.Forms.Padding(3); 194 this.chartTabPage.Size = new System.Drawing.Size(461, 3 56);194 this.chartTabPage.Size = new System.Drawing.Size(461, 381); 195 195 this.chartTabPage.TabIndex = 1; 196 196 this.chartTabPage.Text = "Chart"; … … 199 199 // dataTableVisualPropertiesControl 200 200 // 201 this.dataTableVisualPropertiesControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 202 | System.Windows.Forms.AnchorStyles.Left)203 201 this.dataTableVisualPropertiesControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 202 | System.Windows.Forms.AnchorStyles.Left) 203 | System.Windows.Forms.AnchorStyles.Right))); 204 204 this.dataTableVisualPropertiesControl.Content = null; 205 205 this.dataTableVisualPropertiesControl.Location = new System.Drawing.Point(3, 6); 206 206 this.dataTableVisualPropertiesControl.Name = "dataTableVisualPropertiesControl"; 207 this.dataTableVisualPropertiesControl.Size = new System.Drawing.Size(455, 3 47);207 this.dataTableVisualPropertiesControl.Size = new System.Drawing.Size(455, 372); 208 208 this.dataTableVisualPropertiesControl.TabIndex = 0; 209 209 // … … 213 213 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 214 214 this.CancelButton = this.cancelButton; 215 this.ClientSize = new System.Drawing.Size(493, 4 35);215 this.ClientSize = new System.Drawing.Size(493, 460); 216 216 this.Controls.Add(this.tabControl); 217 217 this.Controls.Add(this.cancelButton); -
branches/OaaS/HeuristicLab.Analysis.Views/3.3/HeuristicLab.Analysis.Views-3.3.csproj
r7978 r9363 116 116 </ItemGroup> 117 117 <ItemGroup> 118 <Compile Include="ScatterPlotVisualPropertiesDialog.cs"> 119 <SubType>Form</SubType> 120 </Compile> 121 <Compile Include="ScatterPlotVisualPropertiesDialog.Designer.cs"> 122 <DependentUpon>ScatterPlotVisualPropertiesDialog.cs</DependentUpon> 123 </Compile> 124 <Compile Include="ScatterPlotVisualPropertiesControl.cs"> 125 <SubType>UserControl</SubType> 126 </Compile> 127 <Compile Include="ScatterPlotVisualPropertiesControl.Designer.cs"> 128 <DependentUpon>ScatterPlotVisualPropertiesControl.cs</DependentUpon> 129 </Compile> 130 <Compile Include="ScatterPlotDataRowVisualPropertiesControl.cs"> 131 <SubType>UserControl</SubType> 132 </Compile> 133 <Compile Include="ScatterPlotDataRowVisualPropertiesControl.Designer.cs"> 134 <DependentUpon>ScatterPlotDataRowVisualPropertiesControl.cs</DependentUpon> 135 </Compile> 118 136 <Compile Include="ScatterPlotView.cs"> 119 137 <SubType>UserControl</SubType> … … 121 139 <Compile Include="ScatterPlotView.Designer.cs"> 122 140 <DependentUpon>ScatterPlotView.cs</DependentUpon> 141 </Compile> 142 <Compile Include="ScatterPlotHistoryView.cs"> 143 <SubType>UserControl</SubType> 144 </Compile> 145 <Compile Include="ScatterPlotHistoryView.Designer.cs"> 146 <DependentUpon>ScatterPlotHistoryView.cs</DependentUpon> 123 147 </Compile> 124 148 <None Include="Plugin.cs.frame" /> … … 278 302 --> 279 303 <PropertyGroup> 280 <PreBuildEvent >set Path=%25Path%25;$(ProjectDir);$(SolutionDir)304 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 281 305 set ProjectDir=$(ProjectDir) 282 306 set SolutionDir=$(SolutionDir) … … 285 309 call PreBuildEvent.cmd 286 310 </PreBuildEvent> 311 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 312 export ProjectDir=$(ProjectDir) 313 export SolutionDir=$(SolutionDir) 314 315 $SolutionDir/PreBuildEvent.sh 316 </PreBuildEvent> 287 317 </PropertyGroup> 288 318 </Project> -
branches/OaaS/HeuristicLab.Analysis.Views/3.3/Plugin.cs.frame
r7259 r9363 26 26 /// Plugin class for HeuristicLab.Analysis.Views plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Analysis.Views", "3.3. 6.$WCREV$")]28 [Plugin("HeuristicLab.Analysis.Views", "3.3.7.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Analysis.Views-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/OaaS/HeuristicLab.Analysis.Views/3.3/Properties/AssemblyInfo.cs.frame
r7259 r9363 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3. 6.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.7.$WCREV$")] -
branches/OaaS/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.Designer.cs
r7829 r9363 1 #region License Information1 #region License Information 2 2 /* HeuristicLab 3 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) … … 22 22 namespace HeuristicLab.Analysis.Views { 23 23 partial class ScatterPlotView { 24 /// <summary> 24 /// <summary> 25 25 /// Required designer variable. 26 26 /// </summary> 27 27 private System.ComponentModel.IContainer components = null; 28 28 29 /// <summary> 29 /// <summary> 30 30 /// Clean up any resources being used. 31 31 /// </summary> 32 32 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> 33 33 protected override void Dispose(bool disposing) { 34 if (disposing && (components != null)) {35 components.Dispose();34 if (disposing) { 35 if (components != null) components.Dispose(); 36 36 } 37 37 base.Dispose(disposing); 38 38 } 39 39 40 #region Windows FormDesigner generated code40 #region Component Designer generated code 41 41 42 /// <summary> 43 /// Required method for Designer support - do not modify 42 /// <summary> 43 /// Required method for Designer support - do not modify 44 44 /// the contents of this method with the code editor. 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 47 System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 48 System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 48 49 System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); 49 50 System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); … … 57 58 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 58 59 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 59 this.nameTextBox.Size = new System.Drawing.Size(596, 20); 60 this.nameTextBox.Location = new System.Drawing.Point(55, 0); 61 this.nameTextBox.Size = new System.Drawing.Size(279, 20); 62 // 63 // infoLabel 64 // 65 this.infoLabel.Location = new System.Drawing.Point(340, 3); 60 66 // 61 67 // chart 62 68 // 63 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 64 | System.Windows.Forms.AnchorStyles.Left) 65 | System.Windows.Forms.AnchorStyles.Right))); 66 chartArea1.Name = "ChartArea1"; 69 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 70 | System.Windows.Forms.AnchorStyles.Left) 71 | System.Windows.Forms.AnchorStyles.Right))); 72 this.chart.BorderlineColor = System.Drawing.Color.Black; 73 this.chart.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; 74 chartArea1.AxisX.Minimum = 0D; 75 chartArea1.CursorX.IsUserEnabled = true; 76 chartArea1.CursorX.IsUserSelectionEnabled = true; 77 chartArea1.CursorY.IsUserEnabled = true; 78 chartArea1.CursorY.IsUserSelectionEnabled = true; 79 chartArea1.Name = "Default"; 67 80 this.chart.ChartAreas.Add(chartArea1); 81 legend1.Alignment = System.Drawing.StringAlignment.Center; 82 legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top; 83 legend1.Name = "Default"; 84 this.chart.Legends.Add(legend1); 68 85 this.chart.Location = new System.Drawing.Point(0, 26); 69 86 this.chart.Name = "chart"; 70 series1.ChartArea = "ChartArea1"; 71 series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastPoint; 72 series1.EmptyPointStyle.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.LeftRight; 73 series1.MarkerSize = 3; 74 series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; 75 series1.Name = "Series1"; 87 series1.ChartArea = "Default"; 88 series1.Legend = "Default"; 89 series1.Name = "Default"; 76 90 this.chart.Series.Add(series1); 77 this.chart.Size = new System.Drawing.Size(668, 378); 78 this.chart.TabIndex = 5; 79 title1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 80 title1.Name = "Title1"; 81 title1.Text = "Scatter Plot"; 91 this.chart.Size = new System.Drawing.Size(359, 248); 92 this.chart.TabIndex = 3; 93 this.chart.Text = "chart"; 94 title1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 95 title1.Name = "Default"; 96 title1.Text = "Title"; 82 97 this.chart.Titles.Add(title1); 98 this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend); 99 this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown); 100 this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove); 83 101 // 84 102 // ScatterPlotView 85 103 // 86 this.AllowDrop = true;87 104 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 105 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 88 106 this.Controls.Add(this.chart); 89 107 this.Name = "ScatterPlotView"; 90 this.Size = new System.Drawing.Size( 668, 404);108 this.Size = new System.Drawing.Size(359, 274); 91 109 this.Controls.SetChildIndex(this.infoLabel, 0); 92 110 this.Controls.SetChildIndex(this.chart, 0); … … 102 120 #endregion 103 121 104 private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart; 122 protected HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart; 123 105 124 } 106 125 } -
branches/OaaS/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.cs
r7829 r9363 1 #region License Information1 #region License Information 2 2 /* HeuristicLab 3 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) … … 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Drawing; 25 using System.Linq; 24 26 using System.Windows.Forms; 27 using System.Windows.Forms.DataVisualization.Charting; 25 28 using HeuristicLab.Collections; 29 using HeuristicLab.Common; 26 30 using HeuristicLab.Core.Views; 27 31 using HeuristicLab.MainForm; … … 30 34 [View("ScatterPlot View")] 31 35 [Content(typeof(ScatterPlot), true)] 32 public partial class ScatterPlotView : NamedItemView { 36 public partial class ScatterPlotView : NamedItemView, IConfigureableView { 37 protected List<Series> invisibleSeries; 38 protected Dictionary<IObservableList<Point2D<double>>, ScatterPlotDataRow> pointsRowsTable; 39 33 40 public new ScatterPlot Content { 34 41 get { return (ScatterPlot)base.Content; } … … 38 45 public ScatterPlotView() { 39 46 InitializeComponent(); 47 pointsRowsTable = new Dictionary<IObservableList<Point2D<double>>, ScatterPlotDataRow>(); 48 invisibleSeries = new List<Series>(); 40 49 chart.CustomizeAllChartAreas(); 41 } 42 50 chart.ChartAreas[0].CursorX.Interval = 1; 51 } 52 53 #region Event Handler Registration 43 54 protected override void DeregisterContentEvents() { 44 Content.Points.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<PointF>>(Content_Points_Changed); 45 Content.Points.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<PointF>>(Content_Points_Changed); 46 Content.Points.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<PointF>>(Content_Points_Changed); 47 Content.Points.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<PointF>>(Content_Points_Changed); 48 Content.AxisNameChanged -= new EventHandler(Content_AxisNameChanged); 55 foreach (ScatterPlotDataRow row in Content.Rows) 56 DeregisterScatterPlotDataRowEvents(row); 57 Content.VisualPropertiesChanged -= new EventHandler(Content_VisualPropertiesChanged); 58 Content.Rows.ItemsAdded -= new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsAdded); 59 Content.Rows.ItemsRemoved -= new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsRemoved); 60 Content.Rows.ItemsReplaced -= new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsReplaced); 61 Content.Rows.CollectionReset -= new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_CollectionReset); 49 62 base.DeregisterContentEvents(); 50 63 } 51 52 64 protected override void RegisterContentEvents() { 53 65 base.RegisterContentEvents(); 54 Content.Points.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<PointF>>(Content_Points_Changed); 55 Content.Points.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<PointF>>(Content_Points_Changed); 56 Content.Points.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<PointF>>(Content_Points_Changed); 57 Content.Points.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<PointF>>(Content_Points_Changed); 58 Content.AxisNameChanged += new EventHandler(Content_AxisNameChanged); 59 } 60 61 private void Content_Points_Changed(object sender, CollectionItemsChangedEventArgs<IndexedItem<PointF>> e) { 62 RedrawChart(); 63 } 66 Content.VisualPropertiesChanged += new EventHandler(Content_VisualPropertiesChanged); 67 Content.Rows.ItemsAdded += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsAdded); 68 Content.Rows.ItemsRemoved += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsRemoved); 69 Content.Rows.ItemsReplaced += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsReplaced); 70 Content.Rows.CollectionReset += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_CollectionReset); 71 } 72 73 protected virtual void RegisterScatterPlotDataRowEvents(ScatterPlotDataRow row) { 74 row.NameChanged += new EventHandler(Row_NameChanged); 75 row.VisualPropertiesChanged += new EventHandler(Row_VisualPropertiesChanged); 76 pointsRowsTable.Add(row.Points, row); 77 row.Points.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsAdded); 78 row.Points.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsRemoved); 79 row.Points.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsReplaced); 80 row.Points.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_CollectionReset); 81 } 82 protected virtual void DeregisterScatterPlotDataRowEvents(ScatterPlotDataRow row) { 83 row.Points.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsAdded); 84 row.Points.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsRemoved); 85 row.Points.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsReplaced); 86 row.Points.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_CollectionReset); 87 pointsRowsTable.Remove(row.Points); 88 row.VisualPropertiesChanged -= new EventHandler(Row_VisualPropertiesChanged); 89 row.NameChanged -= new EventHandler(Row_NameChanged); 90 } 91 #endregion 64 92 65 93 protected override void OnContentChanged() { 66 94 base.OnContentChanged(); 95 invisibleSeries.Clear(); 96 chart.Titles[0].Text = string.Empty; 97 chart.ChartAreas[0].AxisX.Title = string.Empty; 98 chart.ChartAreas[0].AxisY.Title = string.Empty; 99 chart.Series.Clear(); 67 100 if (Content != null) { 68 ConfigureChart(); 69 RedrawChart(); 101 chart.Titles[0].Text = Content.Name; 102 AddScatterPlotDataRows(Content.Rows); 103 ConfigureChartArea(chart.ChartAreas[0]); 104 RecalculateAxesScale(chart.ChartAreas[0]); 105 } 106 } 107 108 protected override void SetEnabledStateOfControls() { 109 base.SetEnabledStateOfControls(); 110 chart.Enabled = Content != null; 111 } 112 113 public void ShowConfiguration() { 114 if (Content != null) { 115 using (ScatterPlotVisualPropertiesDialog dialog = new ScatterPlotVisualPropertiesDialog(Content)) { 116 dialog.ShowDialog(this); 117 } 118 } else MessageBox.Show("Nothing to configure."); 119 } 120 121 protected virtual void AddScatterPlotDataRows(IEnumerable<ScatterPlotDataRow> rows) { 122 foreach (var row in rows) { 123 RegisterScatterPlotDataRowEvents(row); 124 Series series = new Series(row.Name); 125 if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName; 126 else series.LegendText = row.Name; 127 ConfigureSeries(series, row); 128 FillSeriesWithRowValues(series, row); 129 chart.Series.Add(series); 130 } 131 ConfigureChartArea(chart.ChartAreas[0]); 132 RecalculateAxesScale(chart.ChartAreas[0]); 133 UpdateYCursorInterval(); 134 } 135 136 protected virtual void RemoveScatterPlotDataRows(IEnumerable<ScatterPlotDataRow> rows) { 137 foreach (var row in rows) { 138 DeregisterScatterPlotDataRowEvents(row); 139 Series series = chart.Series[row.Name]; 140 chart.Series.Remove(series); 141 if (invisibleSeries.Contains(series)) 142 invisibleSeries.Remove(series); 143 } 144 RecalculateAxesScale(chart.ChartAreas[0]); 145 } 146 147 private void ConfigureSeries(Series series, ScatterPlotDataRow row) { 148 series.BorderWidth = 1; 149 series.BorderDashStyle = ChartDashStyle.Solid; 150 series.BorderColor = Color.Empty; 151 152 if (row.VisualProperties.Color != Color.Empty) 153 series.Color = row.VisualProperties.Color; 154 else series.Color = Color.Empty; 155 series.IsVisibleInLegend = row.VisualProperties.IsVisibleInLegend; 156 series.ChartType = SeriesChartType.FastPoint; 157 series.MarkerSize = row.VisualProperties.PointSize; 158 series.MarkerStyle = ConvertPointStyle(row.VisualProperties.PointStyle); 159 series.XAxisType = AxisType.Primary; 160 series.YAxisType = AxisType.Primary; 161 162 if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName; 163 else series.LegendText = row.Name; 164 165 string xAxisTitle = string.IsNullOrEmpty(Content.VisualProperties.XAxisTitle) 166 ? "X" 167 : Content.VisualProperties.XAxisTitle; 168 string yAxisTitle = string.IsNullOrEmpty(Content.VisualProperties.YAxisTitle) 169 ? "Y" 170 : Content.VisualProperties.YAxisTitle; 171 series.ToolTip = 172 series.LegendText + Environment.NewLine + 173 xAxisTitle + " = " + "#VALX," + Environment.NewLine + 174 yAxisTitle + " = " + "#VAL"; 175 } 176 177 private void ConfigureChartArea(ChartArea area) { 178 if (Content.VisualProperties.TitleFont != null) chart.Titles[0].Font = Content.VisualProperties.TitleFont; 179 if (!Content.VisualProperties.TitleColor.IsEmpty) chart.Titles[0].ForeColor = Content.VisualProperties.TitleColor; 180 chart.Titles[0].Text = Content.VisualProperties.Title; 181 182 if (Content.VisualProperties.AxisTitleFont != null) area.AxisX.TitleFont = Content.VisualProperties.AxisTitleFont; 183 if (!Content.VisualProperties.AxisTitleColor.IsEmpty) area.AxisX.TitleForeColor = Content.VisualProperties.AxisTitleColor; 184 area.AxisX.Title = Content.VisualProperties.XAxisTitle; 185 area.AxisX.MajorGrid.Enabled = Content.VisualProperties.XAxisGrid; 186 187 if (Content.VisualProperties.AxisTitleFont != null) area.AxisY.TitleFont = Content.VisualProperties.AxisTitleFont; 188 if (!Content.VisualProperties.AxisTitleColor.IsEmpty) area.AxisY.TitleForeColor = Content.VisualProperties.AxisTitleColor; 189 area.AxisY.Title = Content.VisualProperties.YAxisTitle; 190 area.AxisY.MajorGrid.Enabled = Content.VisualProperties.YAxisGrid; 191 } 192 193 private void RecalculateAxesScale(ChartArea area) { 194 // Reset the axes bounds so that RecalculateAxesScale() will assign new bounds 195 foreach (Axis a in area.Axes) { 196 a.Minimum = double.NaN; 197 a.Maximum = double.NaN; 198 } 199 area.RecalculateAxesScale(); 200 area.AxisX.IsMarginVisible = false; 201 202 if (!Content.VisualProperties.XAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.XAxisMinimumFixedValue)) area.AxisX.Minimum = Content.VisualProperties.XAxisMinimumFixedValue; 203 if (!Content.VisualProperties.XAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.XAxisMaximumFixedValue)) area.AxisX.Maximum = Content.VisualProperties.XAxisMaximumFixedValue; 204 if (!Content.VisualProperties.YAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.YAxisMinimumFixedValue)) area.AxisY.Minimum = Content.VisualProperties.YAxisMinimumFixedValue; 205 if (!Content.VisualProperties.YAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.YAxisMaximumFixedValue)) area.AxisY.Maximum = Content.VisualProperties.YAxisMaximumFixedValue; 206 if (area.AxisX.Minimum >= area.AxisX.Maximum) area.AxisX.Maximum = area.AxisX.Minimum + 1; 207 if (area.AxisY.Minimum >= area.AxisY.Maximum) area.AxisY.Maximum = area.AxisY.Minimum + 1; 208 } 209 210 protected virtual void UpdateYCursorInterval() { 211 double interestingValuesRange = ( 212 from series in chart.Series 213 where series.Enabled 214 let values = (from point in series.Points 215 where !point.IsEmpty 216 select point.YValues[0]).DefaultIfEmpty(1.0) 217 let range = values.Max() - values.Min() 218 where range > 0.0 219 select range 220 ).DefaultIfEmpty(1.0).Min(); 221 222 double digits = (int)Math.Log10(interestingValuesRange) - 3; 223 double yZoomInterval = Math.Pow(10, digits); 224 this.chart.ChartAreas[0].CursorY.Interval = yZoomInterval; 225 } 226 227 #region Event Handlers 228 #region Content Event Handlers 229 protected override void Content_NameChanged(object sender, EventArgs e) { 230 if (InvokeRequired) 231 Invoke(new EventHandler(Content_NameChanged), sender, e); 232 else { 233 chart.Titles[0].Text = Content.Name; 234 base.Content_NameChanged(sender, e); 235 } 236 } 237 private void Content_VisualPropertiesChanged(object sender, EventArgs e) { 238 if (InvokeRequired) 239 Invoke(new EventHandler(Content_VisualPropertiesChanged), sender, e); 240 else { 241 ConfigureChartArea(chart.ChartAreas[0]); 242 RecalculateAxesScale(chart.ChartAreas[0]); // axes min/max could have changed 243 } 244 } 245 #endregion 246 #region Rows Event Handlers 247 private void Rows_ItemsAdded(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) { 248 if (InvokeRequired) 249 Invoke(new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsAdded), sender, e); 250 else { 251 AddScatterPlotDataRows(e.Items); 252 } 253 } 254 private void Rows_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) { 255 if (InvokeRequired) 256 Invoke(new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsRemoved), sender, e); 257 else { 258 RemoveScatterPlotDataRows(e.Items); 259 } 260 } 261 private void Rows_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) { 262 if (InvokeRequired) 263 Invoke(new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_ItemsReplaced), sender, e); 264 else { 265 RemoveScatterPlotDataRows(e.OldItems); 266 AddScatterPlotDataRows(e.Items); 267 } 268 } 269 private void Rows_CollectionReset(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) { 270 if (InvokeRequired) 271 Invoke(new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(Rows_CollectionReset), sender, e); 272 else { 273 RemoveScatterPlotDataRows(e.OldItems); 274 AddScatterPlotDataRows(e.Items); 275 } 276 } 277 #endregion 278 #region Row Event Handlers 279 private void Row_VisualPropertiesChanged(object sender, EventArgs e) { 280 if (InvokeRequired) 281 Invoke(new EventHandler(Row_VisualPropertiesChanged), sender, e); 282 else { 283 ScatterPlotDataRow row = (ScatterPlotDataRow)sender; 284 Series series = chart.Series[row.Name]; 285 series.Points.Clear(); 286 ConfigureSeries(series, row); 287 FillSeriesWithRowValues(series, row); 288 RecalculateAxesScale(chart.ChartAreas[0]); 289 } 290 } 291 private void Row_NameChanged(object sender, EventArgs e) { 292 if (InvokeRequired) 293 Invoke(new EventHandler(Row_NameChanged), sender, e); 294 else { 295 ScatterPlotDataRow row = (ScatterPlotDataRow)sender; 296 chart.Series[row.Name].Name = row.Name; 297 } 298 } 299 #endregion 300 #region Points Event Handlers 301 private void Points_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) { 302 if (InvokeRequired) 303 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsAdded), sender, e); 304 else { 305 ScatterPlotDataRow row = null; 306 pointsRowsTable.TryGetValue((IObservableList<Point2D<double>>)sender, out row); 307 if (row != null) { 308 Series rowSeries = chart.Series[row.Name]; 309 if (!invisibleSeries.Contains(rowSeries)) { 310 rowSeries.Points.Clear(); 311 FillSeriesWithRowValues(rowSeries, row); 312 RecalculateAxesScale(chart.ChartAreas[0]); 313 UpdateYCursorInterval(); 314 } 315 } 316 } 317 } 318 private void Points_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) { 319 if (InvokeRequired) 320 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsRemoved), sender, e); 321 else { 322 ScatterPlotDataRow row = null; 323 pointsRowsTable.TryGetValue((IObservableList<Point2D<double>>)sender, out row); 324 if (row != null) { 325 Series rowSeries = chart.Series[row.Name]; 326 if (!invisibleSeries.Contains(rowSeries)) { 327 rowSeries.Points.Clear(); 328 FillSeriesWithRowValues(rowSeries, row); 329 RecalculateAxesScale(chart.ChartAreas[0]); 330 UpdateYCursorInterval(); 331 } 332 } 333 } 334 } 335 private void Points_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) { 336 if (InvokeRequired) 337 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsReplaced), sender, e); 338 else { 339 ScatterPlotDataRow row = null; 340 pointsRowsTable.TryGetValue((IObservableList<Point2D<double>>)sender, out row); 341 if (row != null) { 342 Series rowSeries = chart.Series[row.Name]; 343 if (!invisibleSeries.Contains(rowSeries)) { 344 rowSeries.Points.Clear(); 345 FillSeriesWithRowValues(rowSeries, row); 346 RecalculateAxesScale(chart.ChartAreas[0]); 347 UpdateYCursorInterval(); 348 } 349 } 350 } 351 } 352 private void Points_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) { 353 if (InvokeRequired) 354 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_CollectionReset), sender, e); 355 else { 356 ScatterPlotDataRow row = null; 357 pointsRowsTable.TryGetValue((IObservableList<Point2D<double>>)sender, out row); 358 if (row != null) { 359 Series rowSeries = chart.Series[row.Name]; 360 if (!invisibleSeries.Contains(rowSeries)) { 361 rowSeries.Points.Clear(); 362 FillSeriesWithRowValues(rowSeries, row); 363 RecalculateAxesScale(chart.ChartAreas[0]); 364 UpdateYCursorInterval(); 365 } 366 } 367 } 368 } 369 #endregion 370 #endregion 371 372 #region Chart Event Handlers 373 private void chart_MouseDown(object sender, MouseEventArgs e) { 374 HitTestResult result = chart.HitTest(e.X, e.Y); 375 if (result.ChartElementType == ChartElementType.LegendItem) { 376 ToggleSeriesVisible(result.Series); 377 } 378 } 379 private void chart_MouseMove(object sender, MouseEventArgs e) { 380 HitTestResult result = chart.HitTest(e.X, e.Y); 381 if (result.ChartElementType == ChartElementType.LegendItem) 382 this.Cursor = Cursors.Hand; 383 else 384 this.Cursor = Cursors.Default; 385 } 386 private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) { 387 foreach (LegendItem legendItem in e.LegendItems) { 388 var series = chart.Series[legendItem.SeriesName]; 389 if (series != null) { 390 bool seriesIsInvisible = invisibleSeries.Contains(series); 391 foreach (LegendCell cell in legendItem.Cells) { 392 cell.ForeColor = seriesIsInvisible ? Color.Gray : Color.Black; 393 } 394 } 395 } 396 } 397 #endregion 398 399 private void ToggleSeriesVisible(Series series) { 400 if (!invisibleSeries.Contains(series)) { 401 series.Points.Clear(); 402 invisibleSeries.Add(series); 70 403 } else { 71 ClearChart(); 72 } 73 } 74 75 private void Content_AxisNameChanged(object sender, EventArgs e) { 76 ConfigureChart(); 77 } 78 79 private void ConfigureChart() { 80 if (InvokeRequired) { 81 Invoke((Action)ConfigureChart); 82 } else { 83 chart.ChartAreas[0].AxisX.Title = Content.XAxisName; 84 chart.ChartAreas[0].AxisY.Title = Content.YAxisName; 85 chart.Titles[0].Text = Content.Name; 86 } 87 } 88 89 private void ClearChart() { 90 if (InvokeRequired) { 91 Invoke((Action)ClearChart); 92 } else { 93 chart.Series[0].Points.Clear(); 94 chart.ChartAreas[0].AxisX.Title = String.Empty; 95 chart.ChartAreas[0].AxisY.Title = String.Empty; 96 chart.Titles[0].Text = String.Empty; 97 } 98 } 99 100 private void RedrawChart() { 101 if (InvokeRequired) { 102 Invoke((Action)RedrawChart); 103 } else { 104 chart.Series[0].Points.SuspendUpdates(); 105 chart.Series[0].Points.Clear(); 106 foreach (var p in Content.Points.ToArray()) { 107 chart.Series[0].Points.AddXY(p.X, p.Y); 108 } 109 chart.Series[0].Points.ResumeUpdates(); 110 } 111 } 404 invisibleSeries.Remove(series); 405 if (Content != null) { 406 407 var row = (from r in Content.Rows 408 where r.Name == series.Name 409 select r).Single(); 410 FillSeriesWithRowValues(series, row); 411 this.chart.Legends[series.Legend].ForeColor = Color.Black; 412 RecalculateAxesScale(chart.ChartAreas[0]); 413 UpdateYCursorInterval(); 414 } 415 } 416 } 417 418 private void FillSeriesWithRowValues(Series series, ScatterPlotDataRow row) { 419 for (int i = 0; i < row.Points.Count; i++) { 420 var value = row.Points[i]; 421 DataPoint point = new DataPoint(); 422 if (IsInvalidValue(value.X) || IsInvalidValue(value.Y)) 423 point.IsEmpty = true; 424 else { 425 point.XValue = value.X; 426 point.YValues = new double[] { value.Y }; 427 } 428 series.Points.Add(point); 429 } 430 } 431 432 #region Helpers 433 public static IEnumerable<double> DoubleRange(double min, double max, double step) { 434 double i; 435 for (i = min; i <= max; i += step) 436 yield return i; 437 438 if (i != max + step) 439 yield return i; 440 } 441 442 private double HumanRoundRange(double range) { 443 double base10 = Math.Pow(10.0, Math.Floor(Math.Log10(range))); 444 double rounding = range / base10; 445 if (rounding <= 1.5) rounding = 1; 446 else if (rounding <= 2.25) rounding = 2; 447 else if (rounding <= 3.75) rounding = 2.5; 448 else if (rounding <= 7.5) rounding = 5; 449 else rounding = 10; 450 return rounding * base10; 451 } 452 453 private double HumanRoundMax(double max) { 454 double base10; 455 if (max > 0) base10 = Math.Pow(10.0, Math.Floor(Math.Log10(max))); 456 else base10 = Math.Pow(10.0, Math.Ceiling(Math.Log10(-max))); 457 double rounding = (max > 0) ? base10 : -base10; 458 while (rounding < max) rounding += base10; 459 return rounding; 460 } 461 462 private MarkerStyle ConvertPointStyle(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle pointStyle) { 463 switch (pointStyle) { 464 case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle: 465 return MarkerStyle.Circle; 466 case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Cross: 467 return MarkerStyle.Cross; 468 case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Diamond: 469 return MarkerStyle.Diamond; 470 case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Square: 471 return MarkerStyle.Square; 472 case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Star4: 473 return MarkerStyle.Star4; 474 case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Star5: 475 return MarkerStyle.Star5; 476 case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Star6: 477 return MarkerStyle.Star6; 478 case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Star10: 479 return MarkerStyle.Star10; 480 case ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Triangle: 481 return MarkerStyle.Triangle; 482 default: 483 return MarkerStyle.None; 484 } 485 } 486 487 protected static bool IsInvalidValue(double x) { 488 return double.IsNaN(x) || x < (double)decimal.MinValue || x > (double)decimal.MaxValue; 489 } 490 #endregion 112 491 } 113 492 }
Note: See TracChangeset
for help on using the changeset viewer.