Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/04/15 10:18:39 (10 years ago)
Author:
abeham
Message:

#1985:

  • Restored compilable state of TimeLimitRunOptimizer branch
  • Updated changes from trunk
Location:
branches/TimeLimitRunOptimizer
Files:
4 deleted
8 edited
4 copied

Legend:

Unmodified
Added
Removed
  • branches/TimeLimitRunOptimizer

    • Property svn:ignore set to
      *.suo
  • branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views

  • branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.Designer.cs

    r7967 r12118  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    6161      this.tooltip = new System.Windows.Forms.ToolTip(this.components);
    6262      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
     63      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    6364      this.splitContainer.Panel1.SuspendLayout();
    6465      this.splitContainer.Panel2.SuspendLayout();
     
    7172      this.xAxisLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    7273      this.xAxisLabel.AutoSize = true;
    73       this.xAxisLabel.Location = new System.Drawing.Point(298, 256);
     74      this.xAxisLabel.Location = new System.Drawing.Point(363, 345);
    7475      this.xAxisLabel.Name = "xAxisLabel";
    7576      this.xAxisLabel.Size = new System.Drawing.Size(15, 13);
     
    8384      this.xAxisComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    8485      this.xAxisComboBox.FormattingEnabled = true;
    85       this.xAxisComboBox.Location = new System.Drawing.Point(319, 253);
     86      this.xAxisComboBox.Location = new System.Drawing.Point(384, 342);
    8687      this.xAxisComboBox.Name = "xAxisComboBox";
    87       this.xAxisComboBox.Size = new System.Drawing.Size(221, 21);
     88      this.xAxisComboBox.Size = new System.Drawing.Size(600, 21);
    8889      this.xAxisComboBox.TabIndex = 11;
    8990      this.xAxisComboBox.SelectedIndexChanged += new System.EventHandler(this.AxisComboBox_SelectedIndexChanged);
     
    105106      this.yAxisComboBox.Location = new System.Drawing.Point(24, 3);
    106107      this.yAxisComboBox.Name = "yAxisComboBox";
    107       this.yAxisComboBox.Size = new System.Drawing.Size(221, 21);
     108      this.yAxisComboBox.Size = new System.Drawing.Size(600, 21);
    108109      this.yAxisComboBox.TabIndex = 9;
    109110      this.yAxisComboBox.SelectedIndexChanged += new System.EventHandler(this.AxisComboBox_SelectedIndexChanged);
     
    111112      // chart
    112113      //
    113       this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    114                   | System.Windows.Forms.AnchorStyles.Left)
    115                   | System.Windows.Forms.AnchorStyles.Right)));
     114      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     115            | System.Windows.Forms.AnchorStyles.Left)
     116            | System.Windows.Forms.AnchorStyles.Right)));
    116117      chartArea1.Name = "ChartArea1";
    117118      this.chart.ChartAreas.Add(chartArea1);
    118       this.chart.Location = new System.Drawing.Point(6, 30);
     119      this.chart.Location = new System.Drawing.Point(-1, 30);
    119120      this.chart.Name = "chart";
    120121      series1.ChartArea = "ChartArea1";
     
    125126      series1.YValuesPerPoint = 6;
    126127      this.chart.Series.Add(series1);
    127       this.chart.Size = new System.Drawing.Size(534, 217);
     128      this.chart.Size = new System.Drawing.Size(989, 306);
    128129      this.chart.TabIndex = 17;
    129130      this.chart.Text = "chart";
     
    135136      this.noRunsLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    136137      this.noRunsLabel.AutoSize = true;
    137       this.noRunsLabel.Location = new System.Drawing.Point(212, 122);
     138      this.noRunsLabel.Location = new System.Drawing.Point(434, 167);
    138139      this.noRunsLabel.Name = "noRunsLabel";
    139140      this.noRunsLabel.Size = new System.Drawing.Size(138, 13);
     
    161162      //
    162163      this.splitContainer.Panel2.Controls.Add(this.statisticsGroupBox);
    163       this.splitContainer.Size = new System.Drawing.Size(543, 416);
    164       this.splitContainer.SplitterDistance = 277;
     164      this.splitContainer.Size = new System.Drawing.Size(987, 550);
     165      this.splitContainer.SplitterDistance = 366;
    165166      this.splitContainer.TabIndex = 23;
    166167      //
     
    172173      this.showStatisticsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
    173174      this.showStatisticsCheckBox.Image = HeuristicLab.Common.Resources.VSImageLibrary.Properties;
    174       this.showStatisticsCheckBox.Location = new System.Drawing.Point(6, 245);
     175      this.showStatisticsCheckBox.Location = new System.Drawing.Point(3, 339);
    175176      this.showStatisticsCheckBox.Name = "showStatisticsCheckBox";
    176177      this.showStatisticsCheckBox.Size = new System.Drawing.Size(24, 24);
     
    182183      // statisticsGroupBox
    183184      //
    184       this.statisticsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    185                   | System.Windows.Forms.AnchorStyles.Left)
    186                   | System.Windows.Forms.AnchorStyles.Right)));
     185      this.statisticsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     186            | System.Windows.Forms.AnchorStyles.Left)
     187            | System.Windows.Forms.AnchorStyles.Right)));
    187188      this.statisticsGroupBox.Controls.Add(this.statisticsMatrixView);
    188189      this.statisticsGroupBox.Location = new System.Drawing.Point(3, 3);
    189190      this.statisticsGroupBox.Name = "statisticsGroupBox";
    190       this.statisticsGroupBox.Size = new System.Drawing.Size(534, 129);
     191      this.statisticsGroupBox.Size = new System.Drawing.Size(981, 174);
    191192      this.statisticsGroupBox.TabIndex = 1;
    192193      this.statisticsGroupBox.TabStop = false;
     
    203204      this.statisticsMatrixView.ShowRowsAndColumnsTextBox = false;
    204205      this.statisticsMatrixView.ShowStatisticalInformation = false;
    205       this.statisticsMatrixView.Size = new System.Drawing.Size(528, 110);
     206      this.statisticsMatrixView.Size = new System.Drawing.Size(975, 155);
    206207      this.statisticsMatrixView.TabIndex = 0;
    207208      //
    208209      // RunCollectionBoxPlotView
    209210      //
    210       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    211211      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    212212      this.BackColor = System.Drawing.SystemColors.Window;
     
    214214      this.Controls.Add(this.splitContainer);
    215215      this.Name = "RunCollectionBoxPlotView";
    216       this.Size = new System.Drawing.Size(543, 416);
     216      this.Size = new System.Drawing.Size(987, 550);
    217217      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
    218218      this.splitContainer.Panel1.ResumeLayout(false);
    219219      this.splitContainer.Panel1.PerformLayout();
    220220      this.splitContainer.Panel2.ResumeLayout(false);
     221      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    221222      this.splitContainer.ResumeLayout(false);
    222223      this.statisticsGroupBox.ResumeLayout(false);
  • branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs

    r9435 r12118  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.Collections.Generic;
     24using System.ComponentModel;
    2425using System.Linq;
    2526using System.Windows.Forms;
     
    3233
    3334namespace HeuristicLab.Optimization.Views {
    34   [View("RunCollection BoxPlots")]
     35  [View("Box Plot")]
    3536  [Content(typeof(RunCollection), false)]
    3637  public partial class RunCollectionBoxPlotView : AsynchronousContentView {
     
    9293    protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) {
    9394      foreach (IRun run in runs)
    94         run.Changed += new EventHandler(run_Changed);
     95        run.PropertyChanged += run_PropertyChanged;
    9596    }
    9697    protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) {
    9798      foreach (IRun run in runs)
    98         run.Changed -= new EventHandler(run_Changed);
     99        run.PropertyChanged -= run_PropertyChanged;
    99100    }
    100101
     
    121122      if (InvokeRequired)
    122123        Invoke(new EventHandler(Content_Reset), sender, e);
    123       else {
    124         this.categoricalMapping.Clear();
     124      else if (!suppressUpdates) {
    125125        UpdateDataPoints();
    126126        UpdateAxisLabels();
     
    134134      }
    135135    }
    136     private void run_Changed(object sender, EventArgs e) {
     136    private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    137137      if (InvokeRequired)
    138         this.Invoke(new EventHandler(run_Changed), sender, e);
     138        this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e);
    139139      else if (!suppressUpdates) {
    140         UpdateDataPoints();
     140        if (e.PropertyName == "Visible")
     141          UpdateDataPoints();
    141142      }
    142143    }
     
    159160
    160161    private void UpdateCaption() {
    161       Caption = Content != null ? Content.OptimizerName + " Box Plots" : ViewAttribute.GetViewName(GetType());
     162      Caption = Content != null ? Content.OptimizerName + " Box Plot" : ViewAttribute.GetViewName(GetType());
    162163    }
    163164
     
    189190
    190191    private void UpdateDataPoints() {
     192      this.categoricalMapping.Clear();
    191193      this.chart.Series.Clear();
    192194      this.seriesCache.Clear();
     
    216218        if (datapoint != null) {
    217219          IRun run = (IRun)datapoint.Tag;
    218           string selectedAxis = (string)xAxisComboBox.SelectedItem;
     220          string selectedAxis = xAxisValue;
    219221          IItem value = null;
    220222
     
    234236      }
    235237      matrix.ColumnNames = columnNames;
    236       matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", "Average", "Median", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile" };
     238      matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", "Median", "Average", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile" };
    237239
    238240      for (int i = 0; i < seriesCache.Count; i++) {
     
    242244        matrix[1, i] = seriesValues.Min();
    243245        matrix[2, i] = seriesValues.Max();
    244         matrix[3, i] = seriesValues.Average();
    245         matrix[4, i] = seriesValues.Median();
     246        matrix[3, i] = seriesValues.Median();
     247        matrix[4, i] = seriesValues.Average();
    246248        matrix[5, i] = seriesValues.StandardDeviation();
    247249        matrix[6, i] = seriesValues.Variance();
     
    325327      }
    326328    }
    327     private double GetCategoricalValue(int dimension, string value) {
     329    private double? GetCategoricalValue(int dimension, string value) {
    328330      if (!this.categoricalMapping.ContainsKey(dimension)) {
    329331        this.categoricalMapping[dimension] = new Dictionary<object, double>();
     
    336338        }
    337339      }
     340      if (!this.categoricalMapping[dimension].ContainsKey(value)) return null;
    338341      return this.categoricalMapping[dimension][value];
    339342    }
    340     private double GetValue(IRun run, AxisDimension axisDimension) {
    341       double value = double.NaN;
     343    private double? GetValue(IRun run, AxisDimension axisDimension) {
     344      double? value = double.NaN;
    342345      switch (axisDimension) {
    343346        case AxisDimension.Color: {
     
    373376      Axis yAxis = this.chart.ChartAreas[BoxPlotChartAreaName].AxisY;
    374377      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();
     378      //mkommend: combobox.SelectedIndex could not be used as this changes during hovering over possible values
     379      var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue);
     380      var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue);
     381      SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount);
     382      SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount);
     383      if (xAxisValue != null)
     384        xAxis.Title = xAxisValue;
     385      if (yAxisValue != null)
     386        yAxis.Title = yAxisValue;
    381387    }
    382388
     
    447453    }
    448454
     455    public void SetXAxis(string axisName) {
     456      xAxisComboBox.SelectedItem = axisName;
     457    }
     458
     459    public void SetYAxis(string axisName) {
     460      yAxisComboBox.SelectedItem = axisName;
     461    }
    449462  }
    450463}
  • branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.Designer.cs

    r9435 r12118  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    4848      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
    4949      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
     50      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RunCollectionBubbleChartView));
    5051      this.yJitterLabel = new System.Windows.Forms.Label();
    5152      this.xJitterlabel = new System.Windows.Forms.Label();
     
    7172      this.transparencyTrackBar = new System.Windows.Forms.TrackBar();
    7273      this.hideRunsButton = new System.Windows.Forms.Button();
     74      this.colorDialogButton = new System.Windows.Forms.Button();
    7375      this.noRunsLabel = new System.Windows.Forms.Label();
    7476      this.sizeTrackBar = new System.Windows.Forms.TrackBar();
     
    7779      this.unhideAllRunToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    7880      this.colorResetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    79       this.colorDialogButton = new System.Windows.Forms.Button();
    8081      ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).BeginInit();
    8182      ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).BeginInit();
     
    8990      //
    9091      this.yJitterLabel.AutoSize = true;
    91       this.yJitterLabel.Location = new System.Drawing.Point(278, 6);
     92      this.yJitterLabel.Location = new System.Drawing.Point(457, 6);
    9293      this.yJitterLabel.Name = "yJitterLabel";
    9394      this.yJitterLabel.Size = new System.Drawing.Size(32, 13);
     
    99100      this.xJitterlabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    100101      this.xJitterlabel.AutoSize = true;
    101       this.xJitterlabel.Location = new System.Drawing.Point(749, 472);
     102      this.xJitterlabel.Location = new System.Drawing.Point(893, 719);
    102103      this.xJitterlabel.Name = "xJitterlabel";
    103104      this.xJitterlabel.Size = new System.Drawing.Size(32, 13);
     
    109110      this.xTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    110111      this.xTrackBar.Enabled = false;
    111       this.xTrackBar.Location = new System.Drawing.Point(787, 469);
     112      this.xTrackBar.Location = new System.Drawing.Point(919, 715);
    112113      this.xTrackBar.Maximum = 100;
    113114      this.xTrackBar.Name = "xTrackBar";
     
    121122      this.xAxisLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    122123      this.xAxisLabel.AutoSize = true;
    123       this.xAxisLabel.Location = new System.Drawing.Point(471, 472);
     124      this.xAxisLabel.Location = new System.Drawing.Point(439, 719);
    124125      this.xAxisLabel.Name = "xAxisLabel";
    125126      this.xAxisLabel.Size = new System.Drawing.Size(15, 13);
     
    132133      this.xAxisComboBox.BackColor = System.Drawing.SystemColors.ControlLightLight;
    133134      this.xAxisComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     135      this.xAxisComboBox.DropDownWidth = 500;
    134136      this.xAxisComboBox.FormattingEnabled = true;
    135       this.xAxisComboBox.Location = new System.Drawing.Point(492, 469);
     137      this.xAxisComboBox.Location = new System.Drawing.Point(460, 715);
    136138      this.xAxisComboBox.Name = "xAxisComboBox";
    137       this.xAxisComboBox.Size = new System.Drawing.Size(221, 21);
     139      this.xAxisComboBox.Size = new System.Drawing.Size(400, 21);
    138140      this.xAxisComboBox.TabIndex = 7;
    139141      this.xAxisComboBox.SelectedValueChanged += new System.EventHandler(this.AxisComboBox_SelectedValueChanged);
     
    152154      this.yAxisComboBox.BackColor = System.Drawing.SystemColors.ControlLightLight;
    153155      this.yAxisComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     156      this.yAxisComboBox.DropDownWidth = 800;
    154157      this.yAxisComboBox.FormattingEnabled = true;
    155158      this.yAxisComboBox.Location = new System.Drawing.Point(24, 3);
    156159      this.yAxisComboBox.Name = "yAxisComboBox";
    157       this.yAxisComboBox.Size = new System.Drawing.Size(221, 21);
     160      this.yAxisComboBox.Size = new System.Drawing.Size(400, 21);
    158161      this.yAxisComboBox.TabIndex = 5;
    159162      this.yAxisComboBox.SelectedValueChanged += new System.EventHandler(this.AxisComboBox_SelectedValueChanged);
     
    162165      //
    163166      this.yTrackBar.Enabled = false;
    164       this.yTrackBar.Location = new System.Drawing.Point(312, 3);
     167      this.yTrackBar.Location = new System.Drawing.Point(483, 3);
    165168      this.yTrackBar.Maximum = 100;
    166169      this.yTrackBar.Name = "yTrackBar";
     
    175178      this.sizeComboBox.BackColor = System.Drawing.SystemColors.ControlLightLight;
    176179      this.sizeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     180      this.sizeComboBox.DropDownWidth = 400;
    177181      this.sizeComboBox.FormattingEnabled = true;
    178       this.sizeComboBox.Location = new System.Drawing.Point(560, 4);
     182      this.sizeComboBox.Location = new System.Drawing.Point(613, 3);
    179183      this.sizeComboBox.Name = "sizeComboBox";
    180       this.sizeComboBox.Size = new System.Drawing.Size(221, 21);
     184      this.sizeComboBox.Size = new System.Drawing.Size(300, 21);
    181185      this.sizeComboBox.TabIndex = 14;
    182186      this.sizeComboBox.SelectedValueChanged += new System.EventHandler(this.AxisComboBox_SelectedValueChanged);
     
    186190      this.sizeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    187191      this.sizeLabel.AutoSize = true;
    188       this.sizeLabel.Location = new System.Drawing.Point(489, 7);
     192      this.sizeLabel.Location = new System.Drawing.Point(541, 6);
    189193      this.sizeLabel.Name = "sizeLabel";
    190194      this.sizeLabel.Size = new System.Drawing.Size(66, 13);
     
    194198      // chart
    195199      //
    196       this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    197             | System.Windows.Forms.AnchorStyles.Left)
     200      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     201            | System.Windows.Forms.AnchorStyles.Left) 
    198202            | System.Windows.Forms.AnchorStyles.Right)));
    199203      chartArea1.Name = "ChartArea1";
    200204      this.chart.ChartAreas.Add(chartArea1);
    201       this.chart.Location = new System.Drawing.Point(6, 30);
     205      this.chart.Location = new System.Drawing.Point(-1, 30);
    202206      this.chart.Name = "chart";
    203207      series1.ChartArea = "ChartArea1";
     
    208212      series1.YValuesPerPoint = 2;
    209213      this.chart.Series.Add(series1);
    210       this.chart.Size = new System.Drawing.Size(843, 425);
     214      this.chart.Size = new System.Drawing.Size(988, 681);
    211215      this.chart.TabIndex = 16;
    212216      this.chart.Text = "chart";
     
    235239      this.zoomButton.AutoSize = true;
    236240      this.zoomButton.Checked = true;
    237       this.zoomButton.Location = new System.Drawing.Point(6, 10);
     241      this.zoomButton.Location = new System.Drawing.Point(6, 11);
    238242      this.zoomButton.Name = "zoomButton";
    239243      this.zoomButton.Size = new System.Drawing.Size(52, 17);
     
    248252      this.selectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    249253      this.selectButton.AutoSize = true;
    250       this.selectButton.Location = new System.Drawing.Point(64, 9);
     254      this.selectButton.Location = new System.Drawing.Point(61, 11);
    251255      this.selectButton.Name = "selectButton";
    252256      this.selectButton.Size = new System.Drawing.Size(55, 17);
     
    260264      this.radioButtonGroup.Controls.Add(this.zoomButton);
    261265      this.radioButtonGroup.Controls.Add(this.selectButton);
    262       this.radioButtonGroup.Location = new System.Drawing.Point(2, 461);
     266      this.radioButtonGroup.Location = new System.Drawing.Point(3, 704);
    263267      this.radioButtonGroup.Name = "radioButtonGroup";
    264268      this.radioButtonGroup.Size = new System.Drawing.Size(122, 32);
     
    271275      this.colorRunsButton.Enabled = false;
    272276      this.colorRunsButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    273       this.colorRunsButton.Location = new System.Drawing.Point(130, 469);
     277      this.colorRunsButton.Location = new System.Drawing.Point(131, 713);
    274278      this.colorRunsButton.Name = "colorRunsButton";
    275279      this.colorRunsButton.Size = new System.Drawing.Size(21, 21);
     
    289293      this.colorXAxisButton.Enabled = false;
    290294      this.colorXAxisButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.DisplayInColorVertical;
    291       this.colorXAxisButton.Location = new System.Drawing.Point(719, 469);
     295      this.colorXAxisButton.Location = new System.Drawing.Point(866, 715);
    292296      this.colorXAxisButton.Name = "colorXAxisButton";
    293297      this.colorXAxisButton.Size = new System.Drawing.Size(21, 21);
     
    301305      this.colorYAxisButton.Enabled = false;
    302306      this.colorYAxisButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.DisplayInColor;
    303       this.colorYAxisButton.Location = new System.Drawing.Point(251, 3);
     307      this.colorYAxisButton.Location = new System.Drawing.Point(430, 3);
    304308      this.colorYAxisButton.Name = "colorYAxisButton";
    305309      this.colorYAxisButton.Size = new System.Drawing.Size(21, 21);
     
    313317      this.transparencyTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    314318      this.transparencyTrackBar.LargeChange = 16;
    315       this.transparencyTrackBar.Location = new System.Drawing.Point(359, 470);
     319      this.transparencyTrackBar.Location = new System.Drawing.Point(302, 715);
    316320      this.transparencyTrackBar.Maximum = 254;
    317321      this.transparencyTrackBar.Name = "transparencyTrackBar";
     
    327331      this.hideRunsButton.Enabled = false;
    328332      this.hideRunsButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    329       this.hideRunsButton.Location = new System.Drawing.Point(177, 469);
     333      this.hideRunsButton.Location = new System.Drawing.Point(172, 713);
    330334      this.hideRunsButton.Name = "hideRunsButton";
    331335      this.hideRunsButton.Size = new System.Drawing.Size(43, 21);
     
    336340      this.hideRunsButton.Click += new System.EventHandler(this.hideRunsButton_Click);
    337341      //
     342      // colorDialogButton
     343      //
     344      this.colorDialogButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     345      this.colorDialogButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     346      this.colorDialogButton.Enabled = false;
     347      this.colorDialogButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     348      this.colorDialogButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     349      this.colorDialogButton.Location = new System.Drawing.Point(152, 713);
     350      this.colorDialogButton.Name = "colorDialogButton";
     351      this.colorDialogButton.Size = new System.Drawing.Size(14, 21);
     352      this.colorDialogButton.TabIndex = 25;
     353      this.colorDialogButton.Text = "v";
     354      this.tooltip.SetToolTip(this.colorDialogButton, "Choose color");
     355      this.colorDialogButton.UseVisualStyleBackColor = true;
     356      this.colorDialogButton.Click += new System.EventHandler(this.colorDialogButton_Click);
     357      //
    338358      // noRunsLabel
    339359      //
    340360      this.noRunsLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    341361      this.noRunsLabel.AutoSize = true;
    342       this.noRunsLabel.Location = new System.Drawing.Point(366, 228);
     362      this.noRunsLabel.Location = new System.Drawing.Point(432, 350);
    343363      this.noRunsLabel.Name = "noRunsLabel";
    344364      this.noRunsLabel.Size = new System.Drawing.Size(138, 13);
     
    349369      //
    350370      this.sizeTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    351       this.sizeTrackBar.Location = new System.Drawing.Point(787, 3);
     371      this.sizeTrackBar.Location = new System.Drawing.Point(919, 3);
    352372      this.sizeTrackBar.Maximum = 20;
    353373      this.sizeTrackBar.Minimum = -20;
     
    370390      this.transparencyLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    371391      this.transparencyLabel.AutoSize = true;
    372       this.transparencyLabel.Location = new System.Drawing.Point(278, 475);
     392      this.transparencyLabel.Location = new System.Drawing.Point(233, 717);
    373393      this.transparencyLabel.Name = "transparencyLabel";
    374394      this.transparencyLabel.Size = new System.Drawing.Size(75, 13);
     
    390410      this.colorResetToolStripMenuItem.Click += new System.EventHandler(this.colorResetToolStripMenuItem_Click);
    391411      //
    392       // colorDialogButton
    393       //
    394       this.colorDialogButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    395       this.colorDialogButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
    396       this.colorDialogButton.Enabled = false;
    397       this.colorDialogButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    398       this.colorDialogButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    399       this.colorDialogButton.Location = new System.Drawing.Point(150, 469);
    400       this.colorDialogButton.Name = "colorDialogButton";
    401       this.colorDialogButton.Size = new System.Drawing.Size(14, 21);
    402       this.colorDialogButton.TabIndex = 25;
    403       this.colorDialogButton.Text = "v";
    404       this.tooltip.SetToolTip(this.colorDialogButton, "Choose color");
    405       this.colorDialogButton.UseVisualStyleBackColor = true;
    406       this.colorDialogButton.Click += new System.EventHandler(this.colorDialogButton_Click);
    407       //
    408412      // RunCollectionBubbleChartView
    409413      //
     
    412416      this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
    413417      this.Controls.Add(this.hideRunsButton);
    414       this.Controls.Add(this.transparencyTrackBar);
    415418      this.Controls.Add(this.sizeTrackBar);
    416419      this.Controls.Add(this.colorYAxisButton);
     
    419422      this.Controls.Add(this.colorRunsButton);
    420423      this.Controls.Add(this.radioButtonGroup);
    421       this.Controls.Add(this.sizeLabel);
    422       this.Controls.Add(this.sizeComboBox);
    423424      this.Controls.Add(this.yJitterLabel);
    424425      this.Controls.Add(this.transparencyLabel);
     
    432433      this.Controls.Add(this.colorDialogButton);
    433434      this.Controls.Add(this.chart);
     435      this.Controls.Add(this.transparencyTrackBar);
     436      this.Controls.Add(this.sizeLabel);
     437      this.Controls.Add(this.sizeComboBox);
    434438      this.Name = "RunCollectionBubbleChartView";
    435       this.Size = new System.Drawing.Size(854, 496);
     439      this.Size = new System.Drawing.Size(986, 741);
    436440      ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).EndInit();
    437441      ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).EndInit();
  • branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs

    r9435 r12118  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.Collections.Generic;
     24using System.ComponentModel;
    2425using System.Drawing;
    2526using System.Linq;
     
    3334
    3435namespace HeuristicLab.Optimization.Views {
    35   [View("RunCollection BubbleChart")]
     36  [View("Bubble Chart")]
    3637  [Content(typeof(RunCollection), false)]
    3738  public partial class RunCollectionBubbleChartView : AsynchronousContentView {
     
    5657    private bool suppressUpdates = false;
    5758
    58     private const double transperencyExponent = 2.5;
    59 
    60     private RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };
     59    private readonly RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };
    6160
    6261    public RunCollectionBubbleChartView() {
     
    118117    protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) {
    119118      foreach (IRun run in runs)
    120         run.Changed += new EventHandler(run_Changed);
     119        run.PropertyChanged += run_PropertyChanged;
    121120    }
    122121    protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) {
    123122      foreach (IRun run in runs)
    124         run.Changed -= new EventHandler(run_Changed);
     123        run.PropertyChanged -= run_PropertyChanged;
    125124    }
    126125
     
    135134      RegisterRunEvents(e.Items);
    136135    }
    137     private void run_Changed(object sender, EventArgs e) {
     136    private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    138137      if (suppressUpdates) return;
    139138      if (InvokeRequired)
    140         this.Invoke(new EventHandler(run_Changed), sender, e);
     139        this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e);
    141140      else {
    142         IRun run = (IRun)sender;
    143         UpdateRun(run);
    144         UpdateCursorInterval();
    145         chart.ChartAreas[0].RecalculateAxesScale();
    146         UpdateAxisLabels();
     141        if (e.PropertyName == "Color" || e.PropertyName == "Visible") {
     142          IRun run = (IRun)sender;
     143          UpdateRun(run);
     144          UpdateCursorInterval();
     145          chart.ChartAreas[0].RecalculateAxesScale();
     146          UpdateAxisLabels();
     147        }
    147148      }
    148149    }
     
    155156        if (suppressUpdates) return;
    156157
    157         foreach (var run in Content) UpdateRun(run);
    158         UpdateMarkerSizes();
    159         UpdateCursorInterval();
    160         chart.ChartAreas[0].RecalculateAxesScale();
     158        UpdateDataPoints();
    161159        UpdateAxisLabels();
    162160      }
     
    192190    protected override void OnContentChanged() {
    193191      base.OnContentChanged();
    194       this.categoricalMapping.Clear();
    195192      UpdateComboBoxes();
    196193      UpdateDataPoints();
    197194      UpdateCaption();
    198       RebuildInverseIndex();
    199195    }
    200196
     
    266262
    267263    private void Content_Reset(object sender, EventArgs e) {
     264      if (suppressUpdates) return;
    268265      if (InvokeRequired)
    269266        Invoke(new EventHandler(Content_Reset), sender, e);
    270267      else {
    271         this.categoricalMapping.Clear();
    272         RebuildInverseIndex();
    273268        UpdateDataPoints();
    274269        UpdateAxisLabels();
     
    280275      series.Points.Clear();
    281276      runToDataPointMapping.Clear();
     277      categoricalMapping.Clear();
    282278      selectedRuns.Clear();
     279      RebuildInverseIndex();
    283280
    284281      chart.ChartAreas[0].AxisX.IsMarginVisible = xAxisValue != AxisDimension.Index.ToString();
     
    440437      }
    441438    }
    442     private double GetCategoricalValue(int dimension, string value) {
     439    private double? GetCategoricalValue(int dimension, string value) {
    443440      if (!this.categoricalMapping.ContainsKey(dimension)) {
    444441        this.categoricalMapping[dimension] = new Dictionary<object, double>();
     
    451448        }
    452449      }
     450      if (!this.categoricalMapping[dimension].ContainsKey(value)) return null;
    453451      return this.categoricalMapping[dimension][value];
    454452    }
     
    557555          var point = chart.Series[0].Points[pointIndex];
    558556          IRun run = (IRun)point.Tag;
    559           point.Color = Color.Red;
    560           point.MarkerStyle = MarkerStyle.Cross;
    561           selectedRuns.Add(run);
     557          if (selectedRuns.Contains(run)) {
     558            point.MarkerStyle = MarkerStyle.Circle;
     559            point.Color = Color.FromArgb(255 - LogTransform(transparencyTrackBar.Value), run.Color);
     560            selectedRuns.Remove(run);
     561          } else {
     562            point.Color = Color.Red;
     563            point.MarkerStyle = MarkerStyle.Cross;
     564            selectedRuns.Add(run);
     565          }
    562566        }
    563567      } else {
     
    663667      Axis yAxis = this.chart.ChartAreas[0].AxisY;
    664668      int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count();
    665       SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount);
    666       SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount);
    667       if (xAxisComboBox.SelectedItem != null)
    668         xAxis.Title = xAxisComboBox.SelectedItem.ToString();
    669       if (yAxisComboBox.SelectedItem != null)
    670         yAxis.Title = yAxisComboBox.SelectedItem.ToString();
     669      //mkommend: combobox.SelectedIndex could not be used as this changes during hovering over possible values
     670      var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue);
     671      var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue);
     672      SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount);
     673      SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount);
     674      if (xAxisValue != null)
     675        xAxis.Title = xAxisValue;
     676      if (yAxisValue != null)
     677        yAxis.Title = yAxisValue;
    671678    }
    672679
     
    710717    }
    711718
    712     private IRun runToHide = null;
    713719    private void ContextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) {
    714       var pos = Control.MousePosition;
    715       var chartPos = chart.PointToClient(pos);
    716 
    717       HitTestResult h = this.chart.HitTest(chartPos.X, chartPos.Y, ChartElementType.DataPoint);
    718       if (h.ChartElementType == ChartElementType.DataPoint) {
    719         runToHide = (IRun)((DataPoint)h.Object).Tag;
    720         hideRunsToolStripMenuItem.Visible = true;
    721       } else {
    722         runToHide = null;
    723         hideRunsToolStripMenuItem.Visible = false;
    724       }
     720      hideRunsToolStripMenuItem.Visible = selectedRuns.Any();
    725721    }
    726722
     
    730726    }
    731727    private void hideRunsToolStripMenuItem_Click(object sender, EventArgs e) {
    732       HideRuns(selectedRuns);
     728      //ToList is necessary to prevent lazy evaluation
     729      HideRuns(selectedRuns.ToList());
    733730      //could not use ClearSelectedRuns as the runs are not visible anymore
    734731      selectedRuns.Clear();
    735732    }
    736733    private void hideRunsButton_Click(object sender, EventArgs e) {
    737       HideRuns(selectedRuns);
     734      //ToList is necessary to prevent lazy evaluation
     735      HideRuns(selectedRuns.ToList());
    738736      //could not use ClearSelectedRuns as the runs are not visible anymore
    739737      selectedRuns.Clear();
     
    743741      visibilityConstraint.Active = false;
    744742      if (!Content.Constraints.Contains(visibilityConstraint)) Content.Constraints.Add(visibilityConstraint);
    745       foreach (var run in selectedRuns) {
     743      foreach (var run in runs) {
    746744        visibilityConstraint.ConstraintData.Add(run);
    747745      }
     
    764762      double max = transparencyTrackBar.Maximum;
    765763      double r = (x - min) / (max - min);  // r \in [0..1]
    766       double l = Math.Log(r + 1) / Math.Log(2.0); // l \in [0..1]
     764      double l = Math.Max(Math.Min((1.0 - Math.Pow(0.05, r)) / 0.95, 1), 0); // l \in [0..1]
    767765      return (int)Math.Round(255.0 * l);
    768766    }
  • branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.Designer.cs

    r7469 r12118  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/TimeLimitRunOptimizer/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs

    r7469 r12118  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323using System.Collections;
    2424using System.Collections.Generic;
     25using System.ComponentModel;
    2526using System.Drawing;
    2627using System.Linq;
     
    7980      item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
    8081      item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
    81       item.Changed -= new EventHandler(Item_Changed);
     82      item.PropertyChanged -= Item_PropertyChanged;
    8283    }
    8384    private void RegisterItemEvents(IRun item) {
    8485      item.ItemImageChanged += new EventHandler(Item_ItemImageChanged);
    8586      item.ToStringChanged += new EventHandler(Item_ToStringChanged);
    86       item.Changed += new EventHandler(Item_Changed);
     87      item.PropertyChanged += Item_PropertyChanged;
    8788    }
    8889
     
    255256      if (e.KeyCode == Keys.Delete) {
    256257        if ((itemsListView.SelectedItems.Count > 0) && !Content.IsReadOnly && !ReadOnly) {
    257           foreach (ListViewItem item in itemsListView.SelectedItems)
    258             Content.Remove((IRun)item.Tag);
     258          if (RunCollection != null) {
     259            RunCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(i => (IRun)i.Tag));
     260          } else {
     261            foreach (ListViewItem item in itemsListView.SelectedItems)
     262              Content.Remove((IRun)item.Tag);
     263          }
    259264        }
    260265      }
     
    350355    private void removeButton_Click(object sender, EventArgs e) {
    351356      if (itemsListView.SelectedItems.Count > 0) {
    352         foreach (ListViewItem item in itemsListView.SelectedItems)
    353           Content.Remove((IRun)item.Tag);
     357        if (RunCollection != null) {
     358          RunCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(i => (IRun)i.Tag));
     359        } else {
     360          foreach (ListViewItem item in itemsListView.SelectedItems)
     361            Content.Remove((IRun)item.Tag);
     362        }
    354363        itemsListView.SelectedItems.Clear();
    355364      }
     
    453462      }
    454463    }
    455     private void Item_Changed(object sender, EventArgs e) {
     464    private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    456465      if (InvokeRequired)
    457         this.Invoke(new EventHandler(Item_Changed), sender, e);
     466        this.Invoke((Action<object, PropertyChangedEventArgs>)Item_PropertyChanged, sender, e);
    458467      else {
    459468        IRun run = (IRun)sender;
    460         UpdateRun(run);
     469        if (e.PropertyName == "Color" || e.PropertyName == "Visible")
     470          UpdateRun(run);
    461471      }
    462472    }
Note: See TracChangeset for help on using the changeset viewer.