Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11139


Ignore:
Timestamp:
07/08/14 18:52:05 (10 years ago)
Author:
mkommend
Message:

#2121: Merged r11007, 11024, r11095 into stable.

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs

    r9929 r11139  
    122122        Invoke(new EventHandler(Content_Reset), sender, e);
    123123      else {
    124         this.categoricalMapping.Clear();
    125124        UpdateDataPoints();
    126125        UpdateAxisLabels();
     
    189188
    190189    private void UpdateDataPoints() {
     190      this.categoricalMapping.Clear();
    191191      this.chart.Series.Clear();
    192192      this.seriesCache.Clear();
     
    216216        if (datapoint != null) {
    217217          IRun run = (IRun)datapoint.Tag;
    218           string selectedAxis = (string)xAxisComboBox.SelectedItem;
     218          string selectedAxis = xAxisValue;
    219219          IItem value = null;
    220220
     
    325325      }
    326326    }
    327     private double GetCategoricalValue(int dimension, string value) {
     327    private double? GetCategoricalValue(int dimension, string value) {
    328328      if (!this.categoricalMapping.ContainsKey(dimension)) {
    329329        this.categoricalMapping[dimension] = new Dictionary<object, double>();
     
    336336        }
    337337      }
     338      if (!this.categoricalMapping[dimension].ContainsKey(value)) return null;
    338339      return this.categoricalMapping[dimension][value];
    339340    }
    340     private double GetValue(IRun run, AxisDimension axisDimension) {
    341       double value = double.NaN;
     341    private double? GetValue(IRun run, AxisDimension axisDimension) {
     342      double? value = double.NaN;
    342343      switch (axisDimension) {
    343344        case AxisDimension.Color: {
     
    373374      Axis yAxis = this.chart.ChartAreas[BoxPlotChartAreaName].AxisY;
    374375      int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count();
    375       SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount);
    376       SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount);
    377       if (xAxisComboBox.SelectedItem != null)
    378         xAxis.Title = xAxisComboBox.SelectedItem.ToString();
    379       if (yAxisComboBox.SelectedItem != null)
    380         yAxis.Title = yAxisComboBox.SelectedItem.ToString();
     376      //mkommend: combobox.SelectedIndex could not be used as this changes during hoovering over possible values
     377      var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue);
     378      var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue);
     379      SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount);
     380      SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount);
     381      if (xAxisValue != null)
     382        xAxis.Title = xAxisValue;
     383      if (yAxisValue != null)
     384        yAxis.Title = yAxisValue;
    381385    }
    382386
  • stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs

    r9929 r11139  
    5656    private bool suppressUpdates = false;
    5757
    58     private RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };
     58    private readonly RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };
    5959
    6060    public RunCollectionBubbleChartView() {
     
    153153        if (suppressUpdates) return;
    154154
    155         foreach (var run in Content) UpdateRun(run);
    156         UpdateMarkerSizes();
    157         UpdateCursorInterval();
    158         chart.ChartAreas[0].RecalculateAxesScale();
     155        UpdateDataPoints();
    159156        UpdateAxisLabels();
    160157      }
     
    190187    protected override void OnContentChanged() {
    191188      base.OnContentChanged();
    192       this.categoricalMapping.Clear();
    193189      UpdateComboBoxes();
    194190      UpdateDataPoints();
    195191      UpdateCaption();
    196       RebuildInverseIndex();
    197192    }
    198193
     
    267262        Invoke(new EventHandler(Content_Reset), sender, e);
    268263      else {
    269         this.categoricalMapping.Clear();
    270         RebuildInverseIndex();
    271264        UpdateDataPoints();
    272265        UpdateAxisLabels();
     
    278271      series.Points.Clear();
    279272      runToDataPointMapping.Clear();
     273      categoricalMapping.Clear();
    280274      selectedRuns.Clear();
     275      RebuildInverseIndex();
    281276
    282277      chart.ChartAreas[0].AxisX.IsMarginVisible = xAxisValue != AxisDimension.Index.ToString();
     
    438433      }
    439434    }
    440     private double GetCategoricalValue(int dimension, string value) {
     435    private double? GetCategoricalValue(int dimension, string value) {
    441436      if (!this.categoricalMapping.ContainsKey(dimension)) {
    442437        this.categoricalMapping[dimension] = new Dictionary<object, double>();
     
    449444        }
    450445      }
     446      if (!this.categoricalMapping[dimension].ContainsKey(value)) return null;
    451447      return this.categoricalMapping[dimension][value];
    452448    }
     
    667663      Axis yAxis = this.chart.ChartAreas[0].AxisY;
    668664      int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count();
    669       SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount);
    670       SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount);
    671       if (xAxisComboBox.SelectedItem != null)
    672         xAxis.Title = xAxisComboBox.SelectedItem.ToString();
    673       if (yAxisComboBox.SelectedItem != null)
    674         yAxis.Title = yAxisComboBox.SelectedItem.ToString();
     665      //mkommend: combobox.SelectedIndex could not be used as this changes during hovering over possible values
     666      var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue);
     667      var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue);
     668      SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount);
     669      SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount);
     670      if (xAxisValue != null)
     671        xAxis.Title = xAxisValue;
     672      if(yAxisValue != null)
     673      yAxis.Title = yAxisValue;
    675674    }
    676675
     
    723722    }
    724723    private void hideRunsToolStripMenuItem_Click(object sender, EventArgs e) {
    725       HideRuns(selectedRuns);
     724      //ToList is necessary to prevent lazy evaluation
     725      HideRuns(selectedRuns.ToList());
    726726      //could not use ClearSelectedRuns as the runs are not visible anymore
    727727      selectedRuns.Clear();
    728728    }
    729729    private void hideRunsButton_Click(object sender, EventArgs e) {
    730       HideRuns(selectedRuns);
     730      //ToList is necessary to prevent lazy evaluation
     731      HideRuns(selectedRuns.ToList());
    731732      //could not use ClearSelectedRuns as the runs are not visible anymore
    732733      selectedRuns.Clear();
Note: See TracChangeset for help on using the changeset viewer.