Changeset 14582 for trunk/sources/HeuristicLab.Analysis.Views/3.3
- Timestamp:
- 01/18/17 13:17:00 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Analysis.Views/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataRowVisualPropertiesControl.Designer.cs
r14437 r14582 54 54 this.label3 = new System.Windows.Forms.Label(); 55 55 this.commonGroupBox = new System.Windows.Forms.GroupBox(); 56 this.clearColorButton = new System.Windows.Forms.Button(); 56 57 this.isVisibleInLegendCheckBox = new System.Windows.Forms.CheckBox(); 57 58 this.label10 = new System.Windows.Forms.Label(); … … 70 71 this.binsExactRadioButton = new System.Windows.Forms.RadioButton(); 71 72 this.binsApproximatelyRadioButton = new System.Windows.Forms.RadioButton(); 73 this.label11 = new System.Windows.Forms.Label(); 74 this.aggregationComboBox = new System.Windows.Forms.ComboBox(); 72 75 this.lineChartGroupBox = new System.Windows.Forms.GroupBox(); 73 76 this.lineWidthNumericUpDown = new System.Windows.Forms.NumericUpDown(); … … 88 91 // chartTypeComboBox 89 92 // 90 this.chartTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 93 this.chartTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 91 94 | System.Windows.Forms.AnchorStyles.Right))); 92 95 this.chartTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; … … 125 128 // binsNumericUpDown 126 129 // 127 this.binsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 128 | System.Windows.Forms.AnchorStyles.Right))); 129 this.binsNumericUpDown.Location = new System.Drawing.Point( 57, 19);130 this.binsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 131 | System.Windows.Forms.AnchorStyles.Right))); 132 this.binsNumericUpDown.Location = new System.Drawing.Point(82, 19); 130 133 this.binsNumericUpDown.Minimum = new decimal(new int[] { 131 134 1, … … 134 137 0}); 135 138 this.binsNumericUpDown.Name = "binsNumericUpDown"; 136 this.binsNumericUpDown.Size = new System.Drawing.Size( 97, 20);139 this.binsNumericUpDown.Size = new System.Drawing.Size(72, 20); 137 140 this.binsNumericUpDown.TabIndex = 1; 138 141 this.binsNumericUpDown.Value = new decimal(new int[] { … … 172 175 // commonGroupBox 173 176 // 174 this.commonGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 175 | System.Windows.Forms.AnchorStyles.Right))); 177 this.commonGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 178 | System.Windows.Forms.AnchorStyles.Right))); 179 this.commonGroupBox.Controls.Add(this.clearColorButton); 176 180 this.commonGroupBox.Controls.Add(this.isVisibleInLegendCheckBox); 177 181 this.commonGroupBox.Controls.Add(this.label10); … … 190 194 this.commonGroupBox.Text = "Common"; 191 195 // 196 // clearColorButton 197 // 198 this.clearColorButton.BackColor = System.Drawing.SystemColors.ActiveCaption; 199 this.clearColorButton.Cursor = System.Windows.Forms.Cursors.Default; 200 this.clearColorButton.FlatAppearance.BorderSize = 0; 201 this.clearColorButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 202 this.clearColorButton.ForeColor = System.Drawing.Color.Transparent; 203 this.clearColorButton.Location = new System.Drawing.Point(128, 76); 204 this.clearColorButton.Margin = new System.Windows.Forms.Padding(0); 205 this.clearColorButton.Name = "clearColorButton"; 206 this.clearColorButton.Size = new System.Drawing.Size(15, 16); 207 this.clearColorButton.TabIndex = 10; 208 this.clearColorButton.TabStop = false; 209 this.clearColorButton.UseVisualStyleBackColor = false; 210 this.clearColorButton.Click += new System.EventHandler(this.clearColorButton_Click); 211 // 192 212 // isVisibleInLegendCheckBox 193 213 // … … 212 232 // displayNameTextBox 213 233 // 214 this.displayNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 234 this.displayNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 215 235 | System.Windows.Forms.AnchorStyles.Right))); 216 236 this.displayNameTextBox.Location = new System.Drawing.Point(102, 19); … … 222 242 // axisGroupBox 223 243 // 224 this.axisGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 225 | System.Windows.Forms.AnchorStyles.Left) 244 this.axisGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 245 | System.Windows.Forms.AnchorStyles.Left) 226 246 | System.Windows.Forms.AnchorStyles.Right))); 227 247 this.axisGroupBox.Controls.Add(this.panel2); … … 238 258 // panel2 239 259 // 240 this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 260 this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 241 261 | System.Windows.Forms.AnchorStyles.Right))); 242 262 this.panel2.Controls.Add(this.yAxisSecondaryRadioButton); … … 273 293 // panel1 274 294 // 275 this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 295 this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 276 296 | System.Windows.Forms.AnchorStyles.Right))); 277 297 this.panel1.Controls.Add(this.xAxisPrimaryRadioButton); … … 335 355 // histoGramGroupBox 336 356 // 337 this.histoGramGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 357 this.histoGramGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 338 358 | System.Windows.Forms.AnchorStyles.Right))); 339 359 this.histoGramGroupBox.Controls.Add(this.binsExactRadioButton); 340 360 this.histoGramGroupBox.Controls.Add(this.binsApproximatelyRadioButton); 341 361 this.histoGramGroupBox.Controls.Add(this.binsNumericUpDown); 362 this.histoGramGroupBox.Controls.Add(this.label11); 342 363 this.histoGramGroupBox.Controls.Add(this.label3); 364 this.histoGramGroupBox.Controls.Add(this.aggregationComboBox); 343 365 this.histoGramGroupBox.Location = new System.Drawing.Point(0, 305); 344 366 this.histoGramGroupBox.Name = "histoGramGroupBox"; 345 this.histoGramGroupBox.Size = new System.Drawing.Size(327, 47);367 this.histoGramGroupBox.Size = new System.Drawing.Size(327, 75); 346 368 this.histoGramGroupBox.TabIndex = 2; 347 369 this.histoGramGroupBox.TabStop = false; … … 374 396 this.binsApproximatelyRadioButton.CheckedChanged += new System.EventHandler(this.binNumberRadioButton_CheckedChanged); 375 397 // 398 // label11 399 // 400 this.label11.AutoSize = true; 401 this.label11.Location = new System.Drawing.Point(6, 49); 402 this.label11.Name = "label11"; 403 this.label11.Size = new System.Drawing.Size(67, 13); 404 this.label11.TabIndex = 0; 405 this.label11.Text = "Aggregation:"; 406 // 407 // aggregationComboBox 408 // 409 this.aggregationComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 410 | System.Windows.Forms.AnchorStyles.Right))); 411 this.aggregationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 412 this.aggregationComboBox.FormattingEnabled = true; 413 this.aggregationComboBox.Location = new System.Drawing.Point(82, 45); 414 this.aggregationComboBox.Name = "aggregationComboBox"; 415 this.aggregationComboBox.Size = new System.Drawing.Size(239, 21); 416 this.aggregationComboBox.TabIndex = 3; 417 this.aggregationComboBox.SelectedValueChanged += new System.EventHandler(this.aggregationComboBox_SelectedValueChanged); 418 // 376 419 // lineChartGroupBox 377 420 // 378 this.lineChartGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 421 this.lineChartGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 379 422 | System.Windows.Forms.AnchorStyles.Right))); 380 423 this.lineChartGroupBox.Controls.Add(this.lineWidthNumericUpDown); … … 393 436 // lineWidthNumericUpDown 394 437 // 395 this.lineWidthNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 438 this.lineWidthNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 396 439 | System.Windows.Forms.AnchorStyles.Right))); 397 440 this.lineWidthNumericUpDown.Location = new System.Drawing.Point(82, 66); … … 431 474 // lineStyleComboBox 432 475 // 433 this.lineStyleComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 476 this.lineStyleComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 434 477 | System.Windows.Forms.AnchorStyles.Right))); 435 478 this.lineStyleComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; … … 457 500 this.Controls.Add(this.commonGroupBox); 458 501 this.Name = "DataRowVisualPropertiesControl"; 459 this.Size = new System.Drawing.Size(327, 3 56);502 this.Size = new System.Drawing.Size(327, 382); 460 503 ((System.ComponentModel.ISupportInitialize)(this.binsNumericUpDown)).EndInit(); 461 504 this.commonGroupBox.ResumeLayout(false); … … 509 552 private System.Windows.Forms.Label label10; 510 553 private System.Windows.Forms.CheckBox isVisibleInLegendCheckBox; 554 private System.Windows.Forms.Label label11; 555 private System.Windows.Forms.ComboBox aggregationComboBox; 556 private System.Windows.Forms.Button clearColorButton; 511 557 } 512 558 } -
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataRowVisualPropertiesControl.cs
r14437 r14582 23 23 using System.Drawing; 24 24 using System.Windows.Forms; 25 using HeuristicLab.Common.Resources; 25 26 using HeuristicLab.MainForm; 26 27 using HeuristicLab.MainForm.WindowsForms; … … 45 46 chartTypeComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowChartType)); 46 47 lineStyleComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowLineStyle)); 48 aggregationComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowHistogramAggregation)); 49 clearColorButton.BackColor = Color.Transparent; 50 clearColorButton.BackgroundImage = VSImageLibrary.Delete; 47 51 SetEnabledStateOfControls(); 48 52 } … … 65 69 binsApproximatelyRadioButton.Checked = false; 66 70 binsExactRadioButton.Checked = false; 71 aggregationComboBox.SelectedIndex = -1; 67 72 displayNameTextBox.Text = String.Empty; 68 73 } else { … … 93 98 binsApproximatelyRadioButton.Checked = !Content.ExactBins; 94 99 binsExactRadioButton.Checked = Content.ExactBins; 100 aggregationComboBox.SelectedItem = Content.Aggregation; 95 101 displayNameTextBox.Text = Content.DisplayName; 96 102 isVisibleInLegendCheckBox.Checked = Content.IsVisibleInLegend; … … 102 108 protected virtual void SetEnabledStateOfControls() { 103 109 commonGroupBox.Enabled = Content != null; 110 clearColorButton.Visible = Content != null && !Content.Color.IsEmpty; 104 111 lineChartGroupBox.Enabled = Content != null && Content.ChartType == DataRowVisualProperties.DataRowChartType.Line; 105 112 histoGramGroupBox.Enabled = Content != null && Content.ChartType == DataRowVisualProperties.DataRowChartType.Histogram; … … 128 135 colorButton.BackColor = Content.Color; 129 136 colorButton.Text = String.Empty; 137 clearColorButton.Visible = true; 138 } 139 } 140 141 private void clearColorButton_Click(object sender, EventArgs e) { 142 if (!SuppressEvents && Content != null) { 143 SuppressEvents = true; 144 try { 145 Content.Color = Color.Empty; 146 colorButton.BackColor = SystemColors.Control; 147 colorButton.Text = "?"; 148 clearColorButton.Visible = false; 149 } finally { SuppressEvents = false; } 130 150 } 131 151 } … … 178 198 try { 179 199 Content.ExactBins = binsExactRadioButton.Checked; 200 } finally { SuppressEvents = false; } 201 } 202 } 203 204 private void aggregationComboBox_SelectedValueChanged(object sender, EventArgs e) { 205 if (!SuppressEvents && Content != null) { 206 SuppressEvents = true; 207 try { 208 Content.Aggregation = (DataRowVisualProperties.DataRowHistogramAggregation)aggregationComboBox.SelectedValue; 180 209 } finally { SuppressEvents = false; } 181 210 } -
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableControl.Designer.cs
r14439 r14582 71 71 legend1.Alignment = System.Drawing.StringAlignment.Center; 72 72 legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top; 73 legend1.LegendItemOrder = System.Windows.Forms.DataVisualization.Charting.LegendItemOrder.ReversedSeriesOrder; 73 74 legend1.Name = "Default"; 74 75 this.chart.Legends.Add(legend1); -
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableControl.cs
r14519 r14582 118 118 foreach (var row in rows) { 119 119 RegisterDataRowEvents(row); 120 var series = new Series(row.Name); 120 var series = new Series(row.Name) { 121 Tag = row 122 }; 121 123 if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName; 122 124 else series.LegendText = row.Name; … … 128 130 RecalculateAxesScale(chart.ChartAreas[0]); 129 131 UpdateYCursorInterval(); 132 UpdateHistogramTransparency(); 130 133 } 131 134 … … 174 177 break; 175 178 case DataRowVisualProperties.DataRowChartType.Histogram: 176 series.ChartType = SeriesChartType.StackedColumn; 179 bool stacked = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Stacked; 180 series.ChartType = stacked ? SeriesChartType.StackedColumn : SeriesChartType.Column; 181 bool sideBySide = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.SideBySide; 182 series.SetCustomProperty("DrawSideBySide", sideBySide ? "True" : "False"); 177 183 series.SetCustomProperty("PointWidth", "1"); 178 184 if (!series.Color.IsEmpty && series.Color.GetBrightness() < 0.25) … … 275 281 } 276 282 283 protected void UpdateHistogramTransparency() { 284 if (Content.Rows.Any(r => RequiresTransparency(r) && r.VisualProperties.Color.IsEmpty)) { 285 foreach (var series in chart.Series) // sync colors before applying palette colors 286 series.Color = ((DataRow)series.Tag).VisualProperties.Color; 287 chart.ApplyPaletteColors(); 288 } 289 290 var numTransparent = Content.Rows.Count(RequiresTransparency); 291 if (numTransparent <= 1) return; 292 foreach (var series in chart.Series) { 293 var row = (DataRow)series.Tag; 294 if (!RequiresTransparency(row)) 295 continue; 296 var baseColor = row.VisualProperties.Color; 297 if (baseColor.IsEmpty) baseColor = series.Color; 298 series.Color = Color.FromArgb(180, baseColor); 299 } 300 } 301 private bool RequiresTransparency(DataRow row) { 302 return row.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram 303 && row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Overlapping; 304 } 305 277 306 #region Event Handlers 278 307 #region Content Event Handlers … … 327 356 series.Points.Clear(); 328 357 ConfigureSeries(series, row); 329 FillSeriesWithRowValues(series, row); 330 RecalculateAxesScale(chart.ChartAreas[0]); 358 if (!invisibleSeries.Contains(series)) { 359 FillSeriesWithRowValues(series, row); 360 RecalculateAxesScale(chart.ChartAreas[0]); 361 UpdateHistogramTransparency(); 362 } 331 363 } 332 364 } -
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.Designer.cs
r14185 r14582 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 25);71 this.okButton.Location = new System.Drawing.Point(325, 454); 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 25);83 this.cancelButton.Location = new System.Drawing.Point(406, 454); 84 84 this.cancelButton.Name = "cancelButton"; 85 85 this.cancelButton.Size = new System.Drawing.Size(75, 23); … … 99 99 this.tabControl.Name = "tabControl"; 100 100 this.tabControl.SelectedIndex = 0; 101 this.tabControl.Size = new System.Drawing.Size(469, 4 07);101 this.tabControl.Size = new System.Drawing.Size(469, 436); 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, 381);110 this.seriesTabPage.Size = new System.Drawing.Size(461, 410); 111 111 this.seriesTabPage.TabIndex = 0; 112 112 this.seriesTabPage.Text = "Series"; … … 133 133 this.splitContainer.Panel2.Controls.Add(this.dataRowVisualPropertiesControl); 134 134 this.splitContainer.Panel2MinSize = 50; 135 this.splitContainer.Size = new System.Drawing.Size(461, 381);135 this.splitContainer.Size = new System.Drawing.Size(461, 410); 136 136 this.splitContainer.SplitterDistance = 125; 137 137 this.splitContainer.TabIndex = 0; … … 169 169 this.seriesListView.Name = "seriesListView"; 170 170 this.seriesListView.ShowGroups = false; 171 this.seriesListView.Size = new System.Drawing.Size(119, 3 46);171 this.seriesListView.Size = new System.Drawing.Size(119, 375); 172 172 this.seriesListView.TabIndex = 2; 173 173 this.seriesListView.UseCompatibleStateImageBehavior = false; … … 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 52);185 this.dataRowVisualPropertiesControl.Size = new System.Drawing.Size(326, 381); 186 186 this.dataRowVisualPropertiesControl.TabIndex = 0; 187 187 // … … 213 213 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 214 214 this.CancelButton = this.cancelButton; 215 this.ClientSize = new System.Drawing.Size(493, 4 60);215 this.ClientSize = new System.Drawing.Size(493, 489); 216 216 this.Controls.Add(this.tabControl); 217 217 this.Controls.Add(this.cancelButton);
Note: See TracChangeset
for help on using the changeset viewer.