Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/18/14 12:01:13 (10 years ago)
Author:
ascheibe
Message:

merged trunk into hive statistics branch

Location:
branches/HiveStatistics/sources
Files:
4 deleted
7 edited
4 copied

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

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

    r7967 r11202  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 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/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs

    r9444 r11202  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3232
    3333namespace HeuristicLab.Optimization.Views {
    34   [View("RunCollection BoxPlots")]
     34  [View("Box Plot")]
    3535  [Content(typeof(RunCollection), false)]
    3636  public partial class RunCollectionBoxPlotView : AsynchronousContentView {
     
    122122        Invoke(new EventHandler(Content_Reset), sender, e);
    123123      else {
    124         this.categoricalMapping.Clear();
    125124        UpdateDataPoints();
    126125        UpdateAxisLabels();
     
    159158
    160159    private void UpdateCaption() {
    161       Caption = Content != null ? Content.OptimizerName + " Box Plots" : ViewAttribute.GetViewName(GetType());
     160      Caption = Content != null ? Content.OptimizerName + " Box Plot" : ViewAttribute.GetViewName(GetType());
    162161    }
    163162
     
    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
     
    234234      }
    235235      matrix.ColumnNames = columnNames;
    236       matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", "Average", "Median", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile" };
     236      matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", "Median", "Average", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile" };
    237237
    238238      for (int i = 0; i < seriesCache.Count; i++) {
     
    242242        matrix[1, i] = seriesValues.Min();
    243243        matrix[2, i] = seriesValues.Max();
    244         matrix[3, i] = seriesValues.Average();
    245         matrix[4, i] = seriesValues.Median();
     244        matrix[3, i] = seriesValues.Median();
     245        matrix[4, i] = seriesValues.Average();
    246246        matrix[5, i] = seriesValues.StandardDeviation();
    247247        matrix[6, i] = seriesValues.Variance();
     
    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
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.Designer.cs

    r9444 r11202  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 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/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs

    r9444 r11202  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3333
    3434namespace HeuristicLab.Optimization.Views {
    35   [View("RunCollection BubbleChart")]
     35  [View("Bubble Chart")]
    3636  [Content(typeof(RunCollection), false)]
    3737  public partial class RunCollectionBubbleChartView : AsynchronousContentView {
     
    5656    private bool suppressUpdates = false;
    5757
    58     private const double transperencyExponent = 2.5;
    59 
    60     private RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };
     58    private readonly RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };
    6159
    6260    public RunCollectionBubbleChartView() {
     
    155153        if (suppressUpdates) return;
    156154
    157         foreach (var run in Content) UpdateRun(run);
    158         UpdateMarkerSizes();
    159         UpdateCursorInterval();
    160         chart.ChartAreas[0].RecalculateAxesScale();
     155        UpdateDataPoints();
    161156        UpdateAxisLabels();
    162157      }
     
    192187    protected override void OnContentChanged() {
    193188      base.OnContentChanged();
    194       this.categoricalMapping.Clear();
    195189      UpdateComboBoxes();
    196190      UpdateDataPoints();
    197191      UpdateCaption();
    198       RebuildInverseIndex();
    199192    }
    200193
     
    269262        Invoke(new EventHandler(Content_Reset), sender, e);
    270263      else {
    271         this.categoricalMapping.Clear();
    272         RebuildInverseIndex();
    273264        UpdateDataPoints();
    274265        UpdateAxisLabels();
     
    280271      series.Points.Clear();
    281272      runToDataPointMapping.Clear();
     273      categoricalMapping.Clear();
    282274      selectedRuns.Clear();
     275      RebuildInverseIndex();
    283276
    284277      chart.ChartAreas[0].AxisX.IsMarginVisible = xAxisValue != AxisDimension.Index.ToString();
     
    440433      }
    441434    }
    442     private double GetCategoricalValue(int dimension, string value) {
     435    private double? GetCategoricalValue(int dimension, string value) {
    443436      if (!this.categoricalMapping.ContainsKey(dimension)) {
    444437        this.categoricalMapping[dimension] = new Dictionary<object, double>();
     
    451444        }
    452445      }
     446      if (!this.categoricalMapping[dimension].ContainsKey(value)) return null;
    453447      return this.categoricalMapping[dimension][value];
    454448    }
     
    557551          var point = chart.Series[0].Points[pointIndex];
    558552          IRun run = (IRun)point.Tag;
    559           point.Color = Color.Red;
    560           point.MarkerStyle = MarkerStyle.Cross;
    561           selectedRuns.Add(run);
     553          if (selectedRuns.Contains(run)) {
     554            point.MarkerStyle = MarkerStyle.Circle;
     555            point.Color = Color.FromArgb(255 - LogTransform(transparencyTrackBar.Value), run.Color);
     556            selectedRuns.Remove(run);
     557          } else {
     558            point.Color = Color.Red;
     559            point.MarkerStyle = MarkerStyle.Cross;
     560            selectedRuns.Add(run);
     561          }
    562562        }
    563563      } else {
     
    663663      Axis yAxis = this.chart.ChartAreas[0].AxisY;
    664664      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();
     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;
    671674    }
    672675
     
    710713    }
    711714
    712     private IRun runToHide = null;
    713715    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       }
     716      hideRunsToolStripMenuItem.Visible = selectedRuns.Any();
    725717    }
    726718
     
    730722    }
    731723    private void hideRunsToolStripMenuItem_Click(object sender, EventArgs e) {
    732       HideRuns(selectedRuns);
     724      //ToList is necessary to prevent lazy evaluation
     725      HideRuns(selectedRuns.ToList());
    733726      //could not use ClearSelectedRuns as the runs are not visible anymore
    734727      selectedRuns.Clear();
    735728    }
    736729    private void hideRunsButton_Click(object sender, EventArgs e) {
    737       HideRuns(selectedRuns);
     730      //ToList is necessary to prevent lazy evaluation
     731      HideRuns(selectedRuns.ToList());
    738732      //could not use ClearSelectedRuns as the runs are not visible anymore
    739733      selectedRuns.Clear();
     
    743737      visibilityConstraint.Active = false;
    744738      if (!Content.Constraints.Contains(visibilityConstraint)) Content.Constraints.Add(visibilityConstraint);
    745       foreach (var run in selectedRuns) {
     739      foreach (var run in runs) {
    746740        visibilityConstraint.ConstraintData.Add(run);
    747741      }
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.Designer.cs

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

    r7469 r11202  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    255255      if (e.KeyCode == Keys.Delete) {
    256256        if ((itemsListView.SelectedItems.Count > 0) && !Content.IsReadOnly && !ReadOnly) {
    257           foreach (ListViewItem item in itemsListView.SelectedItems)
    258             Content.Remove((IRun)item.Tag);
     257          if (RunCollection != null) {
     258            RunCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(i => (IRun)i.Tag));
     259          } else {
     260            foreach (ListViewItem item in itemsListView.SelectedItems)
     261              Content.Remove((IRun)item.Tag);
     262          }
    259263        }
    260264      }
     
    350354    private void removeButton_Click(object sender, EventArgs e) {
    351355      if (itemsListView.SelectedItems.Count > 0) {
    352         foreach (ListViewItem item in itemsListView.SelectedItems)
    353           Content.Remove((IRun)item.Tag);
     356        if (RunCollection != null) {
     357          RunCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(i => (IRun)i.Tag));
     358        } else {
     359          foreach (ListViewItem item in itemsListView.SelectedItems)
     360            Content.Remove((IRun)item.Tag);
     361        }
    354362        itemsListView.SelectedItems.Clear();
    355363      }
     
    377385      try {
    378386        RunCollection.Modify();
    379       } finally {
     387      }
     388      finally {
    380389        ReadOnly = false;
    381390      }
Note: See TracChangeset for help on using the changeset viewer.