Changeset 14089


Ignore:
Timestamp:
07/15/16 15:36:35 (9 months ago)
Author:
pfleck
Message:

#2597

  • Hide density chart when zoom is active.
  • Changed columns textbox to numberic up/down control (thus removed validation).
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  
    8888      this.chart.Size = new System.Drawing.Size(453, 308);
    8989      this.chart.TabIndex = 0;
     90      this.chart.SelectionRangeChanged += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CursorEventArgs>(this.chart_SelectionRangeChanged);
    9091      this.chart.AnnotationPositionChanging += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.AnnotationPositionChangingEventArgs>(this.chart_AnnotationPositionChanging);
    9192      this.chart.DragDrop += new System.Windows.Forms.DragEventHandler(this.chart_DragDrop);
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.cs

    r14021 r14089  
    194194    }
    195195
     196    public bool IsZoomed {
     197      get { return chart.ChartAreas[0].AxisX.ScaleView.IsZoomed; }
     198    }
     199
    196200    private VerticalLineAnnotation VerticalLineAnnotation {
    197201      get { return (VerticalLineAnnotation)chart.Annotations.SingleOrDefault(x => x is VerticalLineAnnotation); }
     
    585589    }
    586590
     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
    587598    private void sharedFixedVariables_ItemChanged(object o, EventArgs<int, int> e) {
    588599      if (o != sharedFixedVariables) return;
     
    652663      configurationDialog.ShowDialog(this);
    653664    }
     665
     666    private void chart_SelectionRangeChanged(object sender, CursorEventArgs e) {
     667      OnZoomChanged(this, EventArgs.Empty);
     668    }
    654669    #endregion
    655670  }
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.Designer.cs

    r14021 r14089  
    3131      this.automaticYAxisCheckBox = new System.Windows.Forms.CheckBox();
    3232      this.densityGroupBox = new System.Windows.Forms.GroupBox();
    33       this.columnsTextBox = new System.Windows.Forms.TextBox();
    3433      this.columnsLabel = new System.Windows.Forms.Label();
    3534      this.densityComboBox = new System.Windows.Forms.ComboBox();
     
    3938      this.scrollPanel = new System.Windows.Forms.Panel();
    4039      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
     40      this.columnsNumericUpDown = new System.Windows.Forms.NumericUpDown();
    4141      this.yAxisConfigGroupBox.SuspendLayout();
    4242      this.densityGroupBox.SuspendLayout();
     
    4848      this.scrollPanel.SuspendLayout();
    4949      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
     50      ((System.ComponentModel.ISupportInitialize)(this.columnsNumericUpDown)).BeginInit();
    5051      this.SuspendLayout();
    5152      //
     
    114115      // densityGroupBox
    115116      //
    116       this.densityGroupBox.Controls.Add(this.columnsTextBox);
     117      this.densityGroupBox.Controls.Add(this.columnsNumericUpDown);
    117118      this.densityGroupBox.Controls.Add(this.columnsLabel);
    118119      this.densityGroupBox.Controls.Add(this.densityComboBox);
     
    125126      this.densityGroupBox.TabStop = false;
    126127      this.densityGroupBox.Text = "Settings";
    127       //
    128       // columnsTextBox
    129       //
    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);
    138128      //
    139129      // columnsLabel
     
    217207      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
    218208      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);
    219229      //
    220230      // RegressionSolutionTargetResponseGradientView
     
    237247      this.scrollPanel.PerformLayout();
    238248      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
     249      ((System.ComponentModel.ISupportInitialize)(this.columnsNumericUpDown)).EndInit();
    239250      this.ResumeLayout(false);
    240251
     
    253264    private System.Windows.Forms.GroupBox variableGroupBox;
    254265    private System.Windows.Forms.Panel scrollPanel;
    255     private System.Windows.Forms.TextBox columnsTextBox;
    256266    private System.Windows.Forms.Label columnsLabel;
    257267    private System.Windows.Forms.ErrorProvider errorProvider;
    258268    private System.Windows.Forms.Label label1;
     269    private System.Windows.Forms.NumericUpDown columnsNumericUpDown;
    259270  }
    260271}
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.cs

    r14021 r14089  
    6868      densityComboBox.SelectedIndex = 1; // select Training
    6969
    70       columnsTextBox.Text = "4";
    71 
    7270      // Avoid additional horizontal scrollbar
    7371      var vertScrollWidth = SystemInformation.VerticalScrollBarWidth;
     
    132130        };
    133131        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        };
    134140
    135141        var panel = new Panel() {
     
    331337          var variableName = entry.Key;
    332338          var densityChart = entry.Value;
    333           if (!VisibleVariables.Contains(variableName))
     339          if (!VisibleVariables.Contains(variableName) || gradientCharts[variableName].IsZoomed)
    334340            continue;
     341
    335342          UpdateDensityChart(densityChart, variableName, indices);
    336 
    337343        }
    338344      }
     
    368374    }
    369375
    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;
    384378      int columns = Math.Min(VisibleVariables.Count(), MaxColumns);
    385379      if (columns > 0) {
Note: See TracChangeset for help on using the changeset viewer.