Changeset 14589 for branches/symbreg-factors-2650
- Timestamp:
- 01/20/17 09:55:38 (8 years ago)
- Location:
- branches/symbreg-factors-2650
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/symbreg-factors-2650
- Property svn:mergeinfo changed
/trunk/sources merged: 14548,14553,14561,14582
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Analysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Analysis merged: 14582
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Analysis.Views merged: 14582
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/DataRowVisualPropertiesControl.Designer.cs
r14449 r14589 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 } -
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/DataRowVisualPropertiesControl.cs
r14449 r14589 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 } -
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/DataTableControl.Designer.cs
r14449 r14589 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); -
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/DataTableControl.cs
r14542 r14589 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 } -
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.Designer.cs
r14185 r14589 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); -
branches/symbreg-factors-2650/HeuristicLab.Analysis/3.3/DataVisualization/DataRowVisualProperties.cs
r14185 r14589 52 52 } 53 53 #endregion 54 #region Histogram Aggregation 55 public enum DataRowHistogramAggregation { 56 Overlapping, 57 SideBySide, 58 Stacked 59 } 60 #endregion 54 61 55 62 private DataRowChartType chartType; … … 140 147 exactBins = value; 141 148 OnPropertyChanged("ExactBins"); 149 } 150 } 151 } 152 private DataRowHistogramAggregation aggregation; 153 public DataRowHistogramAggregation Aggregation { 154 get { return aggregation; } 155 set { 156 if (aggregation != value) { 157 aggregation = value; 158 OnPropertyChanged("Aggregation"); 142 159 } 143 160 } … … 224 241 get { return exactBins; } 225 242 set { exactBins = value; } 243 } 244 [Storable(Name = "Aggregation", DefaultValue = DataRowHistogramAggregation.Overlapping)] 245 private DataRowHistogramAggregation StorableAggregation { 246 get { return aggregation; } 247 set { aggregation = value; } 226 248 } 227 249 [Storable(Name = "ScaleFactor")] … … 255 277 this.bins = original.bins; 256 278 this.exactBins = original.exactBins; 279 this.aggregation = original.aggregation; 257 280 this.scaleFactor = original.scaleFactor; 258 281 this.displayName = original.displayName; … … 269 292 bins = 10; 270 293 exactBins = false; 294 aggregation = DataRowHistogramAggregation.Overlapping; 271 295 scaleFactor = 1.0; 272 296 displayName = String.Empty; -
branches/symbreg-factors-2650/HeuristicLab.Data.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Data.Views merged: 14561
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Data.Views/3.3
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Data.Views/3.3 merged: 14561
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Data.Views/3.3/StringConvertibleArrayView.cs
r14330 r14589 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.ComponentModel; 24 25 using System.Drawing; … … 200 201 } 201 202 203 var elementNames = Content.ElementNames.ToList(); 202 204 for (int i = minRowIndex; i <= maxRowIndex; i++) { 203 205 DataGridViewColumn column = dataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible); 204 206 DataGridViewCell cell = dataGridView[column.Index, i]; 205 207 if (cell.Selected) { 206 s.Append(Content.ElementNames.ElementAt(i)); 207 s.Append("\t"); 208 if (i < elementNames.Count) { 209 s.Append(elementNames[i]); 210 s.Append("\t"); 211 } else if (elementNames.Count > 0) { 212 s.Append("Index " + i); 213 s.Append("\t"); 214 } 208 215 s.Append(Content.GetValue(i)); 209 216 s.Append(Environment.NewLine); … … 213 220 } 214 221 private void PasteValuesToDataGridView() { 215 string[] values = SplitClipboardString(Clipboard.GetText()); 222 Tuple<string, string>[] values = null; 223 try { 224 values = SplitClipboardString(Clipboard.GetText()).ToArray(); 225 } catch (ArgumentException ex) { 226 MessageBox.Show(this, ex.Message, "Error while parsing clipboard text.", MessageBoxButtons.OK, MessageBoxIcon.Error); 227 return; 228 } 216 229 int rowIndex = 0; 217 230 if (dataGridView.CurrentCell != null) … … 219 232 220 233 if (Content.Length < rowIndex + values.Length) Content.Length = rowIndex + values.Length; 221 for (int row = 0; row < values.Length; row++) 222 Content.SetValue(values[row], row + rowIndex); 223 } 224 private string[] SplitClipboardString(string clipboardText) { 234 for (int row = 0; row < values.Length; row++) { 235 Content.SetValue(values[row].Item2, row + rowIndex); 236 } 237 if (values.Any(x => !string.IsNullOrEmpty(x.Item1))) { 238 var elementNames = Content.ElementNames.ToList(); 239 for (int row = 0; row < values.Length; row++) { 240 if (row + rowIndex < elementNames.Count) 241 elementNames[row + rowIndex] = values[row].Item1; 242 else elementNames.Add(values[row].Item1); 243 } 244 Content.ElementNames = elementNames; 245 } 246 } 247 private IEnumerable<Tuple<string, string>> SplitClipboardString(string clipboardText) { 225 248 if (clipboardText.EndsWith(Environment.NewLine)) 226 249 clipboardText = clipboardText.Remove(clipboardText.Length - Environment.NewLine.Length); //remove last newline constant 227 return clipboardText.Split(new string[] { Environment.NewLine, "\t" }, StringSplitOptions.None); 250 251 var lines = clipboardText.Split(new [] { Environment.NewLine }, StringSplitOptions.None); 252 var tabSep = new[] { '\t' }; 253 if (lines.Length > 2) { 254 // Case 1: Each line contains either "elementName \t value" or just "value" (one or two vertical vectors) 255 foreach (var l in lines) { 256 var row = l.Split(tabSep, StringSplitOptions.RemoveEmptyEntries); 257 if (row.Length > 2) throw new ArgumentException("Clipboard may have either at most two rows or at most two columns."); 258 if (row.Length == 2) yield return Tuple.Create(row[0], row[1]); 259 else if (row.Length == 1) yield return Tuple.Create(string.Empty, row[0]); 260 else yield return Tuple.Create(string.Empty, string.Empty); 261 } 262 } else if (lines.Length == 2) { 263 var firstLine = lines[0].Split(tabSep, StringSplitOptions.None); 264 var secondLine = lines[1].Split(tabSep, StringSplitOptions.None); 265 if (firstLine.Length <= 2 && secondLine.Length <= 2) { 266 // Case 2a: The two lines contain either "elementName \t value" or just "value" (one or two vertical vectors) 267 yield return firstLine.Length >= 2 ? Tuple.Create(firstLine[0], firstLine[1]) : Tuple.Create(string.Empty, firstLine[0]); 268 yield return secondLine.Length >= 2 ? Tuple.Create(secondLine[0], secondLine[1]) : Tuple.Create(string.Empty, secondLine[0]); 269 } else { 270 // Case 2b: The first line contains the elementNames, the second line contains the values (two horizontal vectors) 271 var max = Math.Max(firstLine.Length, secondLine.Length); 272 for (var i = 0; i < max; i++) { 273 var elemName = i < firstLine.Length ? firstLine[i] : string.Empty; 274 var value = i < secondLine.Length ? secondLine[i] : string.Empty; 275 yield return Tuple.Create(elemName, value); 276 } 277 } 278 } else if (lines.Length == 1) { 279 // Case 3: The line contains the values (one horizontal vector) 280 var entries = lines[0].Split(tabSep, StringSplitOptions.None); 281 foreach (var e in entries) { 282 yield return Tuple.Create(string.Empty, e); 283 } 284 } 228 285 } 229 286 #endregion -
branches/symbreg-factors-2650/HeuristicLab.DataPreprocessing.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.DataPreprocessing.Views merged: 14548
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs
r14449 r14589 554 554 if (e.KeyCode == Keys.Delete) { 555 555 //Delete column 556 if (dataGridView.SelectedColumns.Count == 1) { 557 Content.DeleteColumn(dataGridView.SelectedColumns[0].Index); 556 if (dataGridView.SelectedColumns.Count > 0) { 557 var columnsToDelete = dataGridView.SelectedColumns.Cast<DataGridViewColumn>().OrderByDescending(col => col.Index).ToList(); 558 foreach (var col in columnsToDelete) 559 Content.DeleteColumn(col.Index); 558 560 } 559 561 //Delete row -
branches/symbreg-factors-2650/HeuristicLab.MainForm.WindowsForms/3.3/Views/View.cs
r14542 r14589 34 34 this.closeReason = CloseReason.None; 35 35 this.readOnly = false; 36 37 36 if (ViewAttribute.HasViewAttribute(this.GetType())) 38 37 this.Caption = ViewAttribute.GetViewName(this.GetType()); … … 46 45 set { 47 46 if (InvokeRequired) { 48 Action<string> action = delegate 47 Action<string> action = delegate(string s) { this.Caption = s; }; 49 48 Invoke(action, value); 50 49 } else { … … 62 61 set { 63 62 if (InvokeRequired) { 64 Action<bool> action = delegate 63 Action<bool> action = delegate(bool b) { this.ReadOnly = b; }; 65 64 Invoke(action, value); 66 65 } else { … … 95 94 96 95 protected override void OnEnabledChanged(EventArgs e) { 97 SuspendRepaint();98 96 base.OnEnabledChanged(e); 99 97 if (Enabled) SetEnabledStateOfControls(); 100 ResumeRepaint(true);101 98 } 102 99
Note: See TracChangeset
for help on using the changeset viewer.