Changeset 14089 for branches/HeuristicLab.RegressionSolutionGradientView
- Timestamp:
- 07/15/16 15:36:35 (8 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.Designer.cs
r13996 r14089 88 88 this.chart.Size = new System.Drawing.Size(453, 308); 89 89 this.chart.TabIndex = 0; 90 this.chart.SelectionRangeChanged += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CursorEventArgs>(this.chart_SelectionRangeChanged); 90 91 this.chart.AnnotationPositionChanging += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.AnnotationPositionChangingEventArgs>(this.chart_AnnotationPositionChanging); 91 92 this.chart.DragDrop += new System.Windows.Forms.DragEventHandler(this.chart_DragDrop); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.cs
r14021 r14089 194 194 } 195 195 196 public bool IsZoomed { 197 get { return chart.ChartAreas[0].AxisX.ScaleView.IsZoomed; } 198 } 199 196 200 private VerticalLineAnnotation VerticalLineAnnotation { 197 201 get { return (VerticalLineAnnotation)chart.Annotations.SingleOrDefault(x => x is VerticalLineAnnotation); } … … 585 589 } 586 590 591 public event EventHandler ZoomChanged; 592 public void OnZoomChanged(object sender, EventArgs args) { 593 var changed = ZoomChanged; 594 if (changed == null) return; 595 changed(sender, args); 596 } 597 587 598 private void sharedFixedVariables_ItemChanged(object o, EventArgs<int, int> e) { 588 599 if (o != sharedFixedVariables) return; … … 652 663 configurationDialog.ShowDialog(this); 653 664 } 665 666 private void chart_SelectionRangeChanged(object sender, CursorEventArgs e) { 667 OnZoomChanged(this, EventArgs.Empty); 668 } 654 669 #endregion 655 670 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.Designer.cs
r14021 r14089 31 31 this.automaticYAxisCheckBox = new System.Windows.Forms.CheckBox(); 32 32 this.densityGroupBox = new System.Windows.Forms.GroupBox(); 33 this.columnsTextBox = new System.Windows.Forms.TextBox();34 33 this.columnsLabel = new System.Windows.Forms.Label(); 35 34 this.densityComboBox = new System.Windows.Forms.ComboBox(); … … 39 38 this.scrollPanel = new System.Windows.Forms.Panel(); 40 39 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 40 this.columnsNumericUpDown = new System.Windows.Forms.NumericUpDown(); 41 41 this.yAxisConfigGroupBox.SuspendLayout(); 42 42 this.densityGroupBox.SuspendLayout(); … … 48 48 this.scrollPanel.SuspendLayout(); 49 49 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 50 ((System.ComponentModel.ISupportInitialize)(this.columnsNumericUpDown)).BeginInit(); 50 51 this.SuspendLayout(); 51 52 // … … 114 115 // densityGroupBox 115 116 // 116 this.densityGroupBox.Controls.Add(this.columns TextBox);117 this.densityGroupBox.Controls.Add(this.columnsNumericUpDown); 117 118 this.densityGroupBox.Controls.Add(this.columnsLabel); 118 119 this.densityGroupBox.Controls.Add(this.densityComboBox); … … 125 126 this.densityGroupBox.TabStop = false; 126 127 this.densityGroupBox.Text = "Settings"; 127 //128 // columnsTextBox129 //130 this.columnsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)131 | System.Windows.Forms.AnchorStyles.Right)));132 this.columnsTextBox.Location = new System.Drawing.Point(66, 46);133 this.columnsTextBox.Name = "columnsTextBox";134 this.columnsTextBox.Size = new System.Drawing.Size(94, 20);135 this.columnsTextBox.TabIndex = 1;136 this.columnsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.columnsTextBox_Validating);137 this.columnsTextBox.Validated += new System.EventHandler(this.columnsTextBox_Validated);138 128 // 139 129 // columnsLabel … … 217 207 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 218 208 this.errorProvider.ContainerControl = this; 209 // 210 // columnsNumericUpDown 211 // 212 this.columnsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 213 | System.Windows.Forms.AnchorStyles.Right))); 214 this.columnsNumericUpDown.Location = new System.Drawing.Point(66, 46); 215 this.columnsNumericUpDown.Minimum = new decimal(new int[] { 216 1, 217 0, 218 0, 219 0}); 220 this.columnsNumericUpDown.Name = "columnsNumericUpDown"; 221 this.columnsNumericUpDown.Size = new System.Drawing.Size(94, 20); 222 this.columnsNumericUpDown.TabIndex = 1; 223 this.columnsNumericUpDown.Value = new decimal(new int[] { 224 4, 225 0, 226 0, 227 0}); 228 this.columnsNumericUpDown.ValueChanged += new System.EventHandler(this.columnsNumericUpDown_ValueChanged); 219 229 // 220 230 // RegressionSolutionTargetResponseGradientView … … 237 247 this.scrollPanel.PerformLayout(); 238 248 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 249 ((System.ComponentModel.ISupportInitialize)(this.columnsNumericUpDown)).EndInit(); 239 250 this.ResumeLayout(false); 240 251 … … 253 264 private System.Windows.Forms.GroupBox variableGroupBox; 254 265 private System.Windows.Forms.Panel scrollPanel; 255 private System.Windows.Forms.TextBox columnsTextBox;256 266 private System.Windows.Forms.Label columnsLabel; 257 267 private System.Windows.Forms.ErrorProvider errorProvider; 258 268 private System.Windows.Forms.Label label1; 269 private System.Windows.Forms.NumericUpDown columnsNumericUpDown; 259 270 } 260 271 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.cs
r14021 r14089 68 68 densityComboBox.SelectedIndex = 1; // select Training 69 69 70 columnsTextBox.Text = "4";71 72 70 // Avoid additional horizontal scrollbar 73 71 var vertScrollWidth = SystemInformation.VerticalScrollBarWidth; … … 132 130 }; 133 131 densityCharts.Add(variableName, densityChart); 132 133 gradientChart.ZoomChanged += (o, e) => { 134 var gradient = (GradientChart)o; 135 var density = densityCharts[gradient.FreeVariable]; 136 density.Visible = densityComboBox.SelectedIndex != 0 && !gradient.IsZoomed; 137 if (density.Visible) 138 UpdateDensityChart(density, gradient.FreeVariable); 139 }; 134 140 135 141 var panel = new Panel() { … … 331 337 var variableName = entry.Key; 332 338 var densityChart = entry.Value; 333 if (!VisibleVariables.Contains(variableName) )339 if (!VisibleVariables.Contains(variableName) || gradientCharts[variableName].IsZoomed) 334 340 continue; 341 335 342 UpdateDensityChart(densityChart, variableName, indices); 336 337 343 } 338 344 } … … 368 374 } 369 375 370 private void columnsTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { 371 int columns; 372 if (!int.TryParse(columnsTextBox.Text, out columns)) { 373 e.Cancel = true; 374 columnsTextBox.Select(); 375 var textBox = (TextBox)sender; 376 errorProvider.SetError(columnsTextBox, "Columns number must be a positive integer."); 377 errorProvider.SetIconPadding(textBox, -20); 378 } 379 } 380 381 private void columnsTextBox_Validated(object sender, EventArgs e) { 382 errorProvider.SetError(columnsTextBox, ""); 383 MaxColumns = int.Parse(columnsTextBox.Text); 376 private void columnsNumericUpDown_ValueChanged(object sender, EventArgs e) { 377 MaxColumns = (int)columnsNumericUpDown.Value; 384 378 int columns = Math.Min(VisibleVariables.Count(), MaxColumns); 385 379 if (columns > 0) {
Note: See TracChangeset
for help on using the changeset viewer.