Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/14/17 10:29:51 (7 years ago)
Author:
pfleck
Message:

#2709 merged to stable

Location:
stable
Files:
6 deleted
36 edited
5 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.DataPreprocessing.Views

  • stable/HeuristicLab.DataPreprocessing.Views/3.4/CheckedTransformationListView.cs

    r14186 r15242  
    3232namespace HeuristicLab.DataPreprocessing.Views {
    3333  [View("CheckedTransformationList View")]
    34   //[Content(typeof(RunCollectionConstraintCollection), true)]
    3534  [Content(typeof(ICheckedItemList<ITransformation>), false)]
    3635  public partial class CheckedTransformationListView : CheckedItemListView<ITransformation> {
    37 
    3836    public CheckedTransformationListView() {
    3937      InitializeComponent();
     
    5654
    5755          return (ITransformation)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(new[] { columnNames });
    58         }
    59         catch (Exception ex) {
     56        } catch (Exception ex) {
    6057          ErrorHandling.ShowErrorDialog(this, ex);
    6158        }
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/ComparisonFilterView.cs

    r14186 r15242  
    3232  [Content(typeof(ComparisonFilter), false)]
    3333  public partial class ComparisonFilterView : ItemView {
    34     public ComparisonFilterView() {
    35       InitializeComponent();
    36     }
    37 
    3834    public new ComparisonFilter Content {
    3935      get { return (ComparisonFilter)base.Content; }
     
    4137    }
    4238
     39    public ComparisonFilterView() {
     40      InitializeComponent();
     41    }
    4342
    4443    protected override void OnContentChanged() {
    4544      base.OnContentChanged();
    46       cbAttr.Items.Clear(); //cmbConstraintColumn.Items.Clear();
    47       cbFilterOperation.Items.Clear(); //cmbConstraintOperation.Items.Clear();
     45      cbAttr.Items.Clear();
     46      cbFilterOperation.Items.Clear();
    4847      tbFilterData.Text = string.Empty;
    4948      if (Content != null) {
     
    121120    }
    122121
    123 
    124122    protected virtual void Content_ComparisonOperationChanged(object sender, EventArgs e) {
    125123      if (Content.ConstraintOperation != (ConstraintOperation)this.cbFilterOperation.SelectedItem)
     
    178176        errorProvider.Clear();
    179177    }
    180 
    181178  }
    182179}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/DataCompletenessView.Designer.cs

    r14186 r15242  
    5454      // chart
    5555      //
    56       this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    57             | System.Windows.Forms.AnchorStyles.Left)
     56      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     57            | System.Windows.Forms.AnchorStyles.Left) 
    5858            | System.Windows.Forms.AnchorStyles.Right)));
    5959      chartArea1.Name = "ChartArea1";
    6060      this.chart.ChartAreas.Add(chartArea1);
     61      legend1.Alignment = System.Drawing.StringAlignment.Center;
     62      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
    6163      legend1.Name = "Legend1";
    6264      this.chart.Legends.Add(legend1);
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/DataCompletenessView.cs

    r14186 r15242  
    2424using System.Drawing;
    2525using System.Linq;
    26 using System.Windows.Forms;
    2726using System.Windows.Forms.DataVisualization.Charting;
    2827using HeuristicLab.Core.Views;
     
    3029
    3130namespace HeuristicLab.DataPreprocessing.Views {
    32 
    3331  [View("Histogram View")]
    3432  [Content(typeof(DataCompletenessChartContent), true)]
     
    6967
    7068    private void PrepareChart() {
    71       chart.Titles.Add("DataCompletenessChart");
    7269      chart.EnableDoubleClickResetsZoom = true;
    7370      chart.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.Designer.cs

    r14186 r15242  
    6363      this.btnReplace = new System.Windows.Forms.Button();
    6464      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     65      this.checkInputsTargetButton = new System.Windows.Forms.Button();
     66      this.uncheckAllButton = new System.Windows.Forms.Button();
     67      this.checkAllButton = new System.Windows.Forms.Button();
    6568      this.addRowButton = new System.Windows.Forms.Button();
    6669      this.addColumnButton = new System.Windows.Forms.Button();
    6770      this.renameColumnsButton = new System.Windows.Forms.Button();
     71      this.showVariablesGroupBox = new System.Windows.Forms.GroupBox();
    6872      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6973      this.contextMenuCell.SuspendLayout();
     74      this.showVariablesGroupBox.SuspendLayout();
    7075      this.SuspendLayout();
     76      //
     77      // rowsLabel
     78      //
     79      this.rowsLabel.Size = new System.Drawing.Size(55, 13);
     80      this.rowsLabel.Text = "Datarows:";
    7181      //
    7282      // rowsTextBox
     
    8292      this.columnsTextBox.Size = new System.Drawing.Size(71, 20);
    8393      //
     94      // columnsLabel
     95      //
     96      this.columnsLabel.Size = new System.Drawing.Size(53, 13);
     97      this.columnsLabel.Text = "Variables:";
     98      //
    8499      // statisticsTextBox
    85100      //
    86       this.statisticsTextBox.Location = new System.Drawing.Point(3, 387);
    87101      this.statisticsTextBox.Size = new System.Drawing.Size(421, 13);
    88102      //
    89103      // btnApplySort
    90104      //
    91       this.btnApplySort.Location = new System.Drawing.Point(234, 0);
     105      this.btnApplySort.Location = new System.Drawing.Point(228, 0);
    92106      this.btnApplySort.Name = "btnApplySort";
    93107      this.btnApplySort.Size = new System.Drawing.Size(104, 23);
     
    104118            this.replaceValueOverSelectionToolStripMenuItem});
    105119      this.contextMenuCell.Name = "contextMenuCell";
    106       this.contextMenuCell.Size = new System.Drawing.Size(225, 48);
     120      this.contextMenuCell.Size = new System.Drawing.Size(224, 48);
    107121      //
    108122      // replaceValueOverColumnToolStripMenuItem
     
    116130            this.smoothingToolStripMenuItem_Column});
    117131      this.replaceValueOverColumnToolStripMenuItem.Name = "replaceValueOverColumnToolStripMenuItem";
    118       this.replaceValueOverColumnToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
    119       this.replaceValueOverColumnToolStripMenuItem.Text = "Replace Value over Column";
     132      this.replaceValueOverColumnToolStripMenuItem.Size = new System.Drawing.Size(223, 22);
     133      this.replaceValueOverColumnToolStripMenuItem.Text = "Replace Value over Variable";
    120134      //
    121135      // averageToolStripMenuItem_Column
     
    169183            this.mostCommonToolStripMenuItem_Selection});
    170184      this.replaceValueOverSelectionToolStripMenuItem.Name = "replaceValueOverSelectionToolStripMenuItem";
    171       this.replaceValueOverSelectionToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
     185      this.replaceValueOverSelectionToolStripMenuItem.Size = new System.Drawing.Size(223, 22);
    172186      this.replaceValueOverSelectionToolStripMenuItem.Text = "Replace Value over Selection";
    173187      //
     
    202216      // btnSearch
    203217      //
    204       this.btnSearch.Location = new System.Drawing.Point(173, 0);
     218      this.btnSearch.Location = new System.Drawing.Point(167, 0);
    205219      this.btnSearch.Name = "btnSearch";
    206220      this.btnSearch.Size = new System.Drawing.Size(55, 23);
     
    213227      // btnReplace
    214228      //
    215       this.btnReplace.Location = new System.Drawing.Point(173, 26);
     229      this.btnReplace.Location = new System.Drawing.Point(167, 26);
    216230      this.btnReplace.Name = "btnReplace";
    217231      this.btnReplace.Size = new System.Drawing.Size(55, 23);
     
    222236      this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
    223237      //
     238      // checkInputsTargetButton
     239      //
     240      this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs;
     241      this.checkInputsTargetButton.Location = new System.Drawing.Point(36, 19);
     242      this.checkInputsTargetButton.Name = "checkInputsTargetButton";
     243      this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24);
     244      this.checkInputsTargetButton.TabIndex = 14;
     245      this.toolTip.SetToolTip(this.checkInputsTargetButton, "Select Inputs & Target");
     246      this.checkInputsTargetButton.UseVisualStyleBackColor = true;
     247      this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click);
     248      //
     249      // uncheckAllButton
     250      //
     251      this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None;
     252      this.uncheckAllButton.Location = new System.Drawing.Point(66, 19);
     253      this.uncheckAllButton.Name = "uncheckAllButton";
     254      this.uncheckAllButton.Size = new System.Drawing.Size(24, 24);
     255      this.uncheckAllButton.TabIndex = 12;
     256      this.toolTip.SetToolTip(this.uncheckAllButton, "Select None");
     257      this.uncheckAllButton.UseVisualStyleBackColor = true;
     258      this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click);
     259      //
     260      // checkAllButton
     261      //
     262      this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All;
     263      this.checkAllButton.Location = new System.Drawing.Point(6, 19);
     264      this.checkAllButton.Name = "checkAllButton";
     265      this.checkAllButton.Size = new System.Drawing.Size(24, 24);
     266      this.checkAllButton.TabIndex = 13;
     267      this.toolTip.SetToolTip(this.checkAllButton, "Select All");
     268      this.checkAllButton.UseVisualStyleBackColor = true;
     269      this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click);
     270      //
    224271      // addRowButton
    225272      //
    226       this.addRowButton.Location = new System.Drawing.Point(344, 26);
     273      this.addRowButton.Location = new System.Drawing.Point(338, 26);
    227274      this.addRowButton.Name = "addRowButton";
    228       this.addRowButton.Size = new System.Drawing.Size(76, 23);
     275      this.addRowButton.Size = new System.Drawing.Size(83, 23);
    229276      this.addRowButton.TabIndex = 10;
    230       this.addRowButton.Text = "Add Row";
     277      this.addRowButton.Text = "Add Datarow";
    231278      this.addRowButton.UseVisualStyleBackColor = true;
    232279      this.addRowButton.Click += new System.EventHandler(this.addRowButton_Click);
     
    234281      // addColumnButton
    235282      //
    236       this.addColumnButton.Location = new System.Drawing.Point(344, 0);
     283      this.addColumnButton.Location = new System.Drawing.Point(338, 0);
    237284      this.addColumnButton.Name = "addColumnButton";
    238       this.addColumnButton.Size = new System.Drawing.Size(76, 23);
     285      this.addColumnButton.Size = new System.Drawing.Size(83, 23);
    239286      this.addColumnButton.TabIndex = 10;
    240       this.addColumnButton.Text = "Add Column";
     287      this.addColumnButton.Text = "Add Variable";
    241288      this.addColumnButton.UseVisualStyleBackColor = true;
    242289      this.addColumnButton.Click += new System.EventHandler(this.addColumnButton_Click);
     
    244291      // renameColumnsButton
    245292      //
    246       this.renameColumnsButton.Location = new System.Drawing.Point(234, 26);
     293      this.renameColumnsButton.Location = new System.Drawing.Point(228, 26);
    247294      this.renameColumnsButton.Name = "renameColumnsButton";
    248295      this.renameColumnsButton.Size = new System.Drawing.Size(104, 23);
    249296      this.renameColumnsButton.TabIndex = 11;
    250       this.renameColumnsButton.Text = "Rename Columns";
     297      this.renameColumnsButton.Text = "Rename Variables";
    251298      this.renameColumnsButton.UseVisualStyleBackColor = true;
    252299      this.renameColumnsButton.Click += new System.EventHandler(this.renameColumnsButton_Click);
    253300      //
     301      // showVariablesGroupBox
     302      //
     303      this.showVariablesGroupBox.Controls.Add(this.checkInputsTargetButton);
     304      this.showVariablesGroupBox.Controls.Add(this.uncheckAllButton);
     305      this.showVariablesGroupBox.Controls.Add(this.checkAllButton);
     306      this.showVariablesGroupBox.Location = new System.Drawing.Point(448, 0);
     307      this.showVariablesGroupBox.Name = "showVariablesGroupBox";
     308      this.showVariablesGroupBox.Size = new System.Drawing.Size(97, 49);
     309      this.showVariablesGroupBox.TabIndex = 17;
     310      this.showVariablesGroupBox.TabStop = false;
     311      this.showVariablesGroupBox.Text = "Show Variables";
     312      //
    254313      // DataGridContentView
    255314      //
    256315      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    257316      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     317      this.Controls.Add(this.showVariablesGroupBox);
    258318      this.Controls.Add(this.renameColumnsButton);
    259319      this.Controls.Add(this.addColumnButton);
     
    263323      this.Controls.Add(this.btnApplySort);
    264324      this.Name = "DataGridContentView";
    265       this.Size = new System.Drawing.Size(430, 403);
    266325      this.Controls.SetChildIndex(this.btnApplySort, 0);
    267326      this.Controls.SetChildIndex(this.btnSearch, 0);
     
    275334      this.Controls.SetChildIndex(this.rowsTextBox, 0);
    276335      this.Controls.SetChildIndex(this.columnsTextBox, 0);
     336      this.Controls.SetChildIndex(this.showVariablesGroupBox, 0);
    277337      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    278338      this.contextMenuCell.ResumeLayout(false);
     339      this.showVariablesGroupBox.ResumeLayout(false);
    279340      this.ResumeLayout(false);
    280341      this.PerformLayout();
     
    304365    private System.Windows.Forms.Button addColumnButton;
    305366    private System.Windows.Forms.Button renameColumnsButton;
     367    private System.Windows.Forms.GroupBox showVariablesGroupBox;
     368    private System.Windows.Forms.Button checkInputsTargetButton;
     369    private System.Windows.Forms.Button uncheckAllButton;
     370    private System.Windows.Forms.Button checkAllButton;
    306371  }
    307372}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs

    r14797 r15242  
    3333  [Content(typeof(DataGridContent), true)]
    3434  public partial class DataGridContentView : StringConvertibleMatrixView {
    35 
    3635    private bool isSearching = false;
    3736    private bool updateOnMouseUp = false;
     
    8180        base.Sort();
    8281      }
    83 
    8482    }
    8583
     
    141139      }
    142140    }
    143 
    144141
    145142    protected override void PasteValuesToDataGridView() {
     
    692689      }
    693690    }
     691
     692    private void checkInputsTargetButton_Click(object sender, EventArgs e) {
     693      foreach (DataGridViewColumn column in DataGridView.Columns) {
     694        var variable = column.HeaderText;
     695        bool isInputTarget = Content.PreProcessingData.InputVariables.Contains(variable)
     696          || Content.PreProcessingData.TargetVariable == variable;
     697        column.Visible = isInputTarget;
     698      }
     699    }
     700
     701    private void checkAllButton_Click(object sender, EventArgs e) {
     702      foreach (DataGridViewColumn column in DataGridView.Columns) {
     703        column.Visible = true;
     704      }
     705    }
     706
     707    private void uncheckAllButton_Click(object sender, EventArgs e) {
     708      foreach (DataGridViewColumn column in DataGridView.Columns) {
     709        column.Visible = false;
     710      }
     711    }
    694712  }
    695713}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs

    r15197 r15242  
    3636  [Content(typeof(PreprocessingContext), true)]
    3737  public partial class DataPreprocessingView : NamedItemView {
    38 
    39     public DataPreprocessingView() {
    40       InitializeComponent();
    41     }
    42 
    4338    public new PreprocessingContext Content {
    4439      get { return (PreprocessingContext)base.Content; }
    4540      set { base.Content = value; }
     41    }
     42
     43    public DataPreprocessingView() {
     44      InitializeComponent();
    4645    }
    4746
     
    5756        var viewShortcuts = new ItemList<IViewShortcut> {
    5857          new DataGridContent(data, manipulationLogic, filterLogic),
    59           new StatisticsContent(statisticsLogic),
     58          new StatisticsContent(data, statisticsLogic),
    6059
    6160          new LineChartContent(data),
    6261          new HistogramContent(data),
    63           new ScatterPlotContent(data),
     62          new SingleScatterPlotContent(data),
     63          new MultiScatterPlotContent(data),
    6464          new CorrelationMatrixContent(Content),
    6565          new DataCompletenessChartContent(searchLogic),
     
    125125    }
    126126    private void newRegressionToolStripMenuItem_Click(object sender, EventArgs e) {
    127       Content.Import(new RegressionProblemData());
     127      if (CheckNew("Regression"))
     128        Content.Import(new RegressionProblemData());
    128129    }
    129130    private void newClassificationToolStripMenuItem_Click(object sender, EventArgs e) {
    130       Content.Import(new ClassificationProblemData());
     131      if (CheckNew("Classification"))
     132        Content.Import(new ClassificationProblemData());
    131133    }
    132134    private void newTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) {
    133       Content.Import(new TimeSeriesPrognosisProblemData());
     135      if (CheckNew("Time Series Prognosis"))
     136        Content.Import(new TimeSeriesPrognosisProblemData());
     137    }
     138
     139    private bool CheckNew(string type) {
     140      return DialogResult.OK == MessageBox.Show(
     141               this,
     142               string.Format("When creating a new {0}, all previous information will be lost.", type),
     143               "Continue?",
     144               MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
    134145    }
    135146    #endregion
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessorStarter.cs

    r14186 r15242  
    2929namespace HeuristicLab.DataPreprocessing.Views {
    3030  public class DataPreprocessorStarter : IDataPreprocessorStarter {
    31 
    3231    public void Start(IDataAnalysisProblemData problemData, IContentView currentView) {
    3332      IAlgorithm algorithm;
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/FilterView.Designer.cs

    r14186 r15242  
    6262      this.label2 = new System.Windows.Forms.Label();
    6363      this.label3 = new System.Windows.Forms.Label();
     64      this.bottomPanel = new System.Windows.Forms.Panel();
    6465      this.groupBoxFilter.SuspendLayout();
    6566      this.groupBoxFilterInfo.SuspendLayout();
    6667      this.groupBox1.SuspendLayout();
     68      this.bottomPanel.SuspendLayout();
    6769      this.SuspendLayout();
    6870      //
    6971      // groupBoxFilter
    7072      //
    71       this.groupBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     73      this.groupBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    7274            | System.Windows.Forms.AnchorStyles.Right)));
    7375      this.groupBoxFilter.Controls.Add(this.checkedFilterView);
     
    9395      // groupBoxFilterInfo
    9496      //
    95       this.groupBoxFilterInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     97      this.groupBoxFilterInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    9698            | System.Windows.Forms.AnchorStyles.Right)));
    9799      this.groupBoxFilterInfo.Controls.Add(this.lblPercentage);
     
    103105      this.groupBoxFilterInfo.Location = new System.Drawing.Point(4, 337);
    104106      this.groupBoxFilterInfo.Name = "groupBoxFilterInfo";
    105       this.groupBoxFilterInfo.Size = new System.Drawing.Size(659, 102);
     107      this.groupBoxFilterInfo.Size = new System.Drawing.Size(658, 102);
    106108      this.groupBoxFilterInfo.TabIndex = 1;
    107109      this.groupBoxFilterInfo.TabStop = false;
     
    119121      // tbPercentage
    120122      //
    121       this.tbPercentage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     123      this.tbPercentage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    122124            | System.Windows.Forms.AnchorStyles.Right)));
    123125      this.tbPercentage.Enabled = false;
    124126      this.tbPercentage.Location = new System.Drawing.Point(104, 71);
    125127      this.tbPercentage.Name = "tbPercentage";
    126       this.tbPercentage.Size = new System.Drawing.Size(549, 20);
     128      this.tbPercentage.Size = new System.Drawing.Size(548, 20);
    127129      this.tbPercentage.TabIndex = 10;
    128130      //
    129       // tbFiltered
    130       //
    131       this.tbRemaining.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     131      // tbRemaining
     132      //
     133      this.tbRemaining.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    132134            | System.Windows.Forms.AnchorStyles.Right)));
    133135      this.tbRemaining.Enabled = false;
    134136      this.tbRemaining.Location = new System.Drawing.Point(104, 45);
    135137      this.tbRemaining.Name = "tbRemaining";
    136       this.tbRemaining.Size = new System.Drawing.Size(549, 20);
     138      this.tbRemaining.Size = new System.Drawing.Size(548, 20);
    137139      this.tbRemaining.TabIndex = 9;
    138140      //
    139       // lblFiltered
     141      // lblRemaining
    140142      //
    141143      this.lblRemaining.AutoSize = true;
     
    148150      // tbTotal
    149151      //
    150       this.tbTotal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     152      this.tbTotal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    151153            | System.Windows.Forms.AnchorStyles.Right)));
    152154      this.tbTotal.Enabled = false;
    153155      this.tbTotal.Location = new System.Drawing.Point(104, 19);
    154156      this.tbTotal.Name = "tbTotal";
    155       this.tbTotal.Size = new System.Drawing.Size(549, 20);
     157      this.tbTotal.Size = new System.Drawing.Size(548, 20);
    156158      this.tbTotal.TabIndex = 7;
    157159      //
     
    167169      // applyFilterButton
    168170      //
    169       this.applyFilterButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     171      this.applyFilterButton.Anchor = System.Windows.Forms.AnchorStyles.Right;
    170172      this.applyFilterButton.Cursor = System.Windows.Forms.Cursors.Default;
    171173      this.applyFilterButton.Enabled = false;
    172       this.applyFilterButton.Location = new System.Drawing.Point(554, 628);
     174      this.applyFilterButton.Location = new System.Drawing.Point(559, 3);
    173175      this.applyFilterButton.Name = "applyFilterButton";
    174176      this.applyFilterButton.Size = new System.Drawing.Size(107, 23);
     
    180182      // rBtnOr
    181183      //
    182       this.rBtnOr.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     184      this.rBtnOr.Anchor = System.Windows.Forms.AnchorStyles.Left;
    183185      this.rBtnOr.AutoSize = true;
    184186      this.rBtnOr.Cursor = System.Windows.Forms.Cursors.Default;
    185187      this.rBtnOr.Enabled = false;
    186       this.rBtnOr.Location = new System.Drawing.Point(60, 634);
     188      this.rBtnOr.Location = new System.Drawing.Point(53, 6);
    187189      this.rBtnOr.Name = "rBtnOr";
    188190      this.rBtnOr.Size = new System.Drawing.Size(36, 17);
     
    193195      // rBtnAnd
    194196      //
    195       this.rBtnAnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     197      this.rBtnAnd.Anchor = System.Windows.Forms.AnchorStyles.Left;
    196198      this.rBtnAnd.AutoSize = true;
    197199      this.rBtnAnd.Checked = true;
    198200      this.rBtnAnd.Cursor = System.Windows.Forms.Cursors.Default;
    199201      this.rBtnAnd.Enabled = false;
    200       this.rBtnAnd.Location = new System.Drawing.Point(10, 634);
     202      this.rBtnAnd.Location = new System.Drawing.Point(3, 6);
    201203      this.rBtnAnd.Name = "rBtnAnd";
    202204      this.rBtnAnd.Size = new System.Drawing.Size(44, 17);
     
    209211      // groupBox1
    210212      //
    211       this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     213      this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    212214            | System.Windows.Forms.AnchorStyles.Right)));
    213215      this.groupBox1.Controls.Add(this.label4);
     
    215217      this.groupBox1.Controls.Add(this.label2);
    216218      this.groupBox1.Controls.Add(this.label3);
    217       this.groupBox1.Location = new System.Drawing.Point(7, 445);
     219      this.groupBox1.Location = new System.Drawing.Point(4, 445);
    218220      this.groupBox1.Name = "groupBox1";
    219       this.groupBox1.Size = new System.Drawing.Size(659, 130);
     221      this.groupBox1.Size = new System.Drawing.Size(658, 130);
    220222      this.groupBox1.TabIndex = 12;
    221223      this.groupBox1.TabStop = false;
     
    261263      this.label3.Text = "A filter specifies the data rows which should remain.";
    262264      //
     265      // bottomPanel
     266      //
     267      this.bottomPanel.Controls.Add(this.applyFilterButton);
     268      this.bottomPanel.Controls.Add(this.rBtnAnd);
     269      this.bottomPanel.Controls.Add(this.rBtnOr);
     270      this.bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
     271      this.bottomPanel.Location = new System.Drawing.Point(0, 580);
     272      this.bottomPanel.Name = "bottomPanel";
     273      this.bottomPanel.Size = new System.Drawing.Size(670, 30);
     274      this.bottomPanel.TabIndex = 13;
     275      //
    263276      // FilterView
    264277      //
    265278      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    266279      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     280      this.Controls.Add(this.bottomPanel);
    267281      this.Controls.Add(this.groupBox1);
    268       this.Controls.Add(this.rBtnAnd);
    269       this.Controls.Add(this.rBtnOr);
    270       this.Controls.Add(this.applyFilterButton);
    271282      this.Controls.Add(this.groupBoxFilterInfo);
    272283      this.Controls.Add(this.groupBoxFilter);
    273284      this.Name = "FilterView";
    274       this.Size = new System.Drawing.Size(670, 660);
     285      this.Size = new System.Drawing.Size(670, 610);
    275286      this.groupBoxFilter.ResumeLayout(false);
    276287      this.groupBoxFilterInfo.ResumeLayout(false);
     
    278289      this.groupBox1.ResumeLayout(false);
    279290      this.groupBox1.PerformLayout();
     291      this.bottomPanel.ResumeLayout(false);
     292      this.bottomPanel.PerformLayout();
    280293      this.ResumeLayout(false);
    281       this.PerformLayout();
    282294
    283295    }
     
    302314    private System.Windows.Forms.Label label2;
    303315    private System.Windows.Forms.Label label3;
    304 
    305 
     316    private System.Windows.Forms.Panel bottomPanel;
    306317  }
    307318}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/FilterView.cs

    r14186 r15242  
    3232  [Content(typeof(FilterContent), true)]
    3333  public partial class FilterView : ItemView {
     34    public new FilterContent Content {
     35      get { return (FilterContent)base.Content; }
     36      set { base.Content = value; }
     37    }
    3438
    3539    public FilterView() {
     
    4549      checkedFilterView.Content.ItemsRemoved += Content_ItemsRemoved;
    4650      checkedFilterView.Content.CheckedItemsChanged += Content_CheckedItemsChanged;
    47     }
    48 
    49     public new FilterContent Content {
    50       get { return (FilterContent)base.Content; }
    51       set { base.Content = value; }
    5251    }
    5352
     
    122121      }
    123122    }
    124 
    125123  }
    126124}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj

    r15131 r15242  
    8989  <ItemGroup>
    9090    <Reference Include="System" />
    91     <Reference Include="System.Core" />
    92     <Reference Include="System.Data" />
    9391    <Reference Include="System.Drawing" />
    9492    <Reference Include="System.Windows.Forms" />
    9593    <Reference Include="System.Windows.Forms.DataVisualization" />
    96     <Reference Include="System.Xml" />
    9794  </ItemGroup>
    9895  <ItemGroup>
     
    128125      <DependentUpon>ComparisonFilterView.cs</DependentUpon>
    129126    </Compile>
     127    <Compile Include="PreprocessingIcons.Designer.cs">
     128      <AutoGen>True</AutoGen>
     129      <DesignTime>True</DesignTime>
     130      <DependentUpon>PreprocessingIcons.resx</DependentUpon>
     131    </Compile>
    130132    <Compile Include="RenameColumnsDialog.cs">
    131133      <SubType>Form</SubType>
     
    159161    </Compile>
    160162    <Compile Include="DataPreprocessorStarter.cs" />
    161     <Compile Include="PreprocessingDataTableView.cs">
    162       <SubType>UserControl</SubType>
    163     </Compile>
    164     <Compile Include="PreprocessingDataTableView.Designer.cs">
    165       <DependentUpon>PreprocessingDataTableView.cs</DependentUpon>
    166     </Compile>
    167163    <Compile Include="FilterView.cs">
    168164      <SubType>UserControl</SubType>
     
    177173      <DependentUpon>ScatterPlotMultiView.cs</DependentUpon>
    178174    </Compile>
    179     <Compile Include="PreprocessingScatterPlotView.cs">
    180       <SubType>UserControl</SubType>
    181     </Compile>
    182     <Compile Include="PreprocessingScatterPlotView.Designer.cs">
    183       <DependentUpon>PreprocessingScatterPlotView.cs</DependentUpon>
    184     </Compile>
    185175    <Compile Include="SearchAndReplaceDialog.cs">
    186176      <SubType>Form</SubType>
     
    214204      <DependentUpon>PreprocessingChartView.cs</DependentUpon>
    215205    </Compile>
    216     <Compile Include="PreprocessingCheckedItemListView.cs">
    217       <SubType>UserControl</SubType>
    218     </Compile>
    219     <Compile Include="PreprocessingCheckedItemListView.Designer.cs">
    220       <DependentUpon>PreprocessingCheckedItemListView.cs</DependentUpon>
    221     </Compile>
    222206    <Compile Include="Properties\AssemblyInfo.cs" />
    223207    <Compile Include="StatisticsView.cs">
     
    235219    <Compile Include="Utils\FindPreprocessingItemsIterator.cs" />
    236220    <Compile Include="Utils\IFindPreprocessingItemsIterator.cs" />
     221    <Compile Include="Utils\VerticalLabel.cs">
     222      <SubType>Component</SubType>
     223    </Compile>
    237224    <Compile Include="ViewShortcutListView.cs">
    238225      <SubType>UserControl</SubType>
     
    249236  <ItemGroup>
    250237    <ProjectReference Include="..\..\HeuristicLab.Analysis.Views\3.3\HeuristicLab.Analysis.Views-3.3.csproj">
    251       <Project>{76945d76-ca61-4147-9dc2-0acdcddf87f9}</Project>
     238      <Project>{76945D76-CA61-4147-9DC2-0ACDCDDF87F9}</Project>
    252239      <Name>HeuristicLab.Analysis.Views-3.3</Name>
    253240      <Private>False</Private>
    254241    </ProjectReference>
    255242    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    256       <Project>{887425b4-4348-49ed-a457-b7d2c26ddbf9}</Project>
     243      <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
    257244      <Name>HeuristicLab.Analysis-3.3</Name>
    258245      <Private>False</Private>
    259246    </ProjectReference>
    260247    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    261       <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project>
     248      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    262249      <Name>HeuristicLab.Collections-3.3</Name>
    263250      <Private>False</Private>
     
    269256    </ProjectReference>
    270257    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    271       <Project>{a9ad58b9-3ef9-4cc1-97e5-8d909039ff5c}</Project>
     258      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    272259      <Name>HeuristicLab.Common-3.3</Name>
    273260      <Private>False</Private>
    274261    </ProjectReference>
    275262    <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
    276       <Project>{e226881d-315f-423d-b419-a766fe0d8685}</Project>
     263      <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project>
    277264      <Name>HeuristicLab.Core.Views-3.3</Name>
    278265      <Private>False</Private>
    279266    </ProjectReference>
    280267    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    281       <Project>{c36bd924-a541-4a00-afa8-41701378ddc5}</Project>
     268      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    282269      <Name>HeuristicLab.Core-3.3</Name>
    283270      <Private>False</Private>
     
    289276    </ProjectReference>
    290277    <ProjectReference Include="..\..\HeuristicLab.DataPreprocessing\3.4\HeuristicLab.DataPreprocessing-3.4.csproj">
    291       <Project>{3b90f866-70f8-43ef-a541-51819d255b7b}</Project>
     278      <Project>{3B90F866-70F8-43EF-A541-51819D255B7B}</Project>
    292279      <Name>HeuristicLab.DataPreprocessing-3.4</Name>
    293280      <Private>False</Private>
    294281    </ProjectReference>
    295282    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    296       <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project>
     283      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    297284      <Name>HeuristicLab.Data-3.3</Name>
    298285      <Private>False</Private>
     
    304291    </ProjectReference>
    305292    <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj">
    306       <Project>{3bd61258-31da-4b09-89c0-4f71fef5f05a}</Project>
     293      <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
    307294      <Name>HeuristicLab.MainForm-3.3</Name>
    308295      <Private>False</Private>
    309296    </ProjectReference>
    310297    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    311       <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project>
     298      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    312299      <Name>HeuristicLab.Optimization-3.3</Name>
    313300      <Private>False</Private>
     
    319306    </ProjectReference>
    320307    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    321       <Project>{94186a6a-5176-4402-ae83-886557b53cca}</Project>
     308      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    322309      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    323310      <Private>False</Private>
    324311    </ProjectReference>
    325312    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Views\3.4\HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj">
    326       <Project>{3e9e8944-44ff-40bb-a622-3a4a7dd0f198}</Project>
     313      <Project>{3E9E8944-44FF-40BB-A622-3A4A7DD0F198}</Project>
    327314      <Name>HeuristicLab.Problems.DataAnalysis.Views-3.4</Name>
    328315      <Private>False</Private>
    329316    </ProjectReference>
    330317    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    331       <Project>{df87c13e-a889-46ff-8153-66dcaa8c5674}</Project>
     318      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    332319      <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
    333320      <Private>False</Private>
     
    353340      <Private>False</Private>
    354341    </ProjectReference>
     342  </ItemGroup>
     343  <ItemGroup>
     344    <EmbeddedResource Include="PreprocessingIcons.resx">
     345      <Generator>ResXFileCodeGenerator</Generator>
     346      <LastGenOutput>PreprocessingIcons.Designer.cs</LastGenOutput>
     347    </EmbeddedResource>
     348    <EmbeddedResource Include="ScatterPlotSingleView.resx">
     349      <DependentUpon>ScatterPlotSingleView.cs</DependentUpon>
     350    </EmbeddedResource>
     351  </ItemGroup>
     352  <ItemGroup>
     353    <Content Include="Icons\All.png" />
     354    <Content Include="Icons\Inputs.png" />
     355    <Content Include="Icons\None.png" />
    355356  </ItemGroup>
    356357  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.Designer.cs

    r14796 r15242  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      this.components = new System.ComponentModel.Container();
    4748      this.optionsBox = new System.Windows.Forms.GroupBox();
    48       this.displayDetailsCheckBox = new System.Windows.Forms.CheckBox();
    49       this.label1 = new System.Windows.Forms.Label();
    50       this.classifierComboBox = new System.Windows.Forms.ComboBox();
     49      this.groupingTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
     50      this.variableLabel = new System.Windows.Forms.Label();
     51      this.orderLabel = new System.Windows.Forms.Label();
     52      this.aggregationLabel = new System.Windows.Forms.Label();
     53      this.orderComboBox = new System.Windows.Forms.ComboBox();
     54      this.groupingComboBox = new System.Windows.Forms.ComboBox();
     55      this.aggregationComboBox = new System.Windows.Forms.ComboBox();
     56      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    5157      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    5258      this.splitContainer.Panel1.SuspendLayout();
    5359      this.splitContainer.SuspendLayout();
    5460      this.optionsBox.SuspendLayout();
     61      this.groupingTableLayoutPanel.SuspendLayout();
    5562      this.SuspendLayout();
    5663      //
     64      // sizeGroupBox
     65      //
     66      this.sizeGroupBox.Location = new System.Drawing.Point(0, 258);
     67      //
    5768      // splitContainer
    5869      //
     
    6475      // optionsBox
    6576      //
    66       this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
    67             | System.Windows.Forms.AnchorStyles.Right)));
    68       this.optionsBox.Controls.Add(this.displayDetailsCheckBox);
    69       this.optionsBox.Controls.Add(this.label1);
    70       this.optionsBox.Controls.Add(this.classifierComboBox);
    71       this.optionsBox.Location = new System.Drawing.Point(4, 262);
     77      this.optionsBox.Controls.Add(this.groupingTableLayoutPanel);
     78      this.optionsBox.Dock = System.Windows.Forms.DockStyle.Bottom;
     79      this.optionsBox.Location = new System.Drawing.Point(0, 302);
    7280      this.optionsBox.Name = "optionsBox";
    73       this.optionsBox.Size = new System.Drawing.Size(84, 138);
     81      this.optionsBox.Size = new System.Drawing.Size(180, 101);
    7482      this.optionsBox.TabIndex = 7;
    7583      this.optionsBox.TabStop = false;
    76       this.optionsBox.Text = "Options";
    77       //
    78       // displayDetailsCheckBox
    79       //
    80       this.displayDetailsCheckBox.AutoSize = true;
    81       this.displayDetailsCheckBox.Location = new System.Drawing.Point(5, 58);
    82       this.displayDetailsCheckBox.Margin = new System.Windows.Forms.Padding(2);
    83       this.displayDetailsCheckBox.Name = "displayDetailsCheckBox";
    84       this.displayDetailsCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
    85       this.displayDetailsCheckBox.Size = new System.Drawing.Size(119, 17);
    86       this.displayDetailsCheckBox.TabIndex = 3;
    87       this.displayDetailsCheckBox.Text = "Display value count";
    88       this.displayDetailsCheckBox.UseVisualStyleBackColor = true;
    89       this.displayDetailsCheckBox.CheckedChanged += new System.EventHandler(this.displayDetailsCheckBox_CheckedChanged);
    90       //
    91       // label1
    92       //
    93       this.label1.AutoSize = true;
    94       this.label1.Location = new System.Drawing.Point(3, 15);
    95       this.label1.Name = "label1";
    96       this.label1.Size = new System.Drawing.Size(81, 13);
    97       this.label1.TabIndex = 2;
    98       this.label1.Text = "Target variable:";
    99       //
    100       // classifierComboBox
    101       //
    102       this.classifierComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    103             | System.Windows.Forms.AnchorStyles.Right)));
    104       this.classifierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    105       this.classifierComboBox.FormattingEnabled = true;
    106       this.classifierComboBox.Location = new System.Drawing.Point(5, 32);
    107       this.classifierComboBox.Name = "classifierComboBox";
    108       this.classifierComboBox.Size = new System.Drawing.Size(73, 21);
    109       this.classifierComboBox.TabIndex = 1;
    110       this.classifierComboBox.SelectedIndexChanged += new System.EventHandler(this.classifierComboBox_SelectedIndexChanged);
     84      this.optionsBox.Text = "Grouping Options";
     85      //
     86      // groupingTableLayoutPanel
     87      //
     88      this.groupingTableLayoutPanel.ColumnCount = 2;
     89      this.groupingTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     90      this.groupingTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     91      this.groupingTableLayoutPanel.Controls.Add(this.variableLabel, 0, 0);
     92      this.groupingTableLayoutPanel.Controls.Add(this.orderLabel, 0, 2);
     93      this.groupingTableLayoutPanel.Controls.Add(this.aggregationLabel, 0, 1);
     94      this.groupingTableLayoutPanel.Controls.Add(this.orderComboBox, 1, 2);
     95      this.groupingTableLayoutPanel.Controls.Add(this.groupingComboBox, 1, 0);
     96      this.groupingTableLayoutPanel.Controls.Add(this.aggregationComboBox, 1, 1);
     97      this.groupingTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     98      this.groupingTableLayoutPanel.Location = new System.Drawing.Point(3, 16);
     99      this.groupingTableLayoutPanel.Name = "groupingTableLayoutPanel";
     100      this.groupingTableLayoutPanel.RowCount = 3;
     101      this.groupingTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     102      this.groupingTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     103      this.groupingTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     104      this.groupingTableLayoutPanel.Size = new System.Drawing.Size(174, 82);
     105      this.groupingTableLayoutPanel.TabIndex = 3;
     106      //
     107      // variableLabel
     108      //
     109      this.variableLabel.AutoSize = true;
     110      this.variableLabel.Dock = System.Windows.Forms.DockStyle.Fill;
     111      this.variableLabel.Location = new System.Drawing.Point(3, 0);
     112      this.variableLabel.Name = "variableLabel";
     113      this.variableLabel.Size = new System.Drawing.Size(48, 27);
     114      this.variableLabel.TabIndex = 2;
     115      this.variableLabel.Text = "Variable:";
     116      this.variableLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     117      //
     118      // orderLabel
     119      //
     120      this.orderLabel.AutoSize = true;
     121      this.orderLabel.Dock = System.Windows.Forms.DockStyle.Fill;
     122      this.orderLabel.Location = new System.Drawing.Point(3, 54);
     123      this.orderLabel.Name = "orderLabel";
     124      this.orderLabel.Size = new System.Drawing.Size(48, 28);
     125      this.orderLabel.TabIndex = 2;
     126      this.orderLabel.Text = "Order:";
     127      this.orderLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     128      this.toolTip.SetToolTip(this.orderLabel, "Order of Legend Entries");
     129      //
     130      // aggregationLabel
     131      //
     132      this.aggregationLabel.AutoSize = true;
     133      this.aggregationLabel.Dock = System.Windows.Forms.DockStyle.Fill;
     134      this.aggregationLabel.Location = new System.Drawing.Point(3, 27);
     135      this.aggregationLabel.Name = "aggregationLabel";
     136      this.aggregationLabel.Size = new System.Drawing.Size(48, 27);
     137      this.aggregationLabel.TabIndex = 2;
     138      this.aggregationLabel.Text = "Aggr.:";
     139      this.aggregationLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     140      this.toolTip.SetToolTip(this.aggregationLabel, "Aggregation");
     141      //
     142      // orderComboBox
     143      //
     144      this.orderComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
     145      this.orderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     146      this.orderComboBox.FormattingEnabled = true;
     147      this.orderComboBox.Location = new System.Drawing.Point(57, 57);
     148      this.orderComboBox.Name = "orderComboBox";
     149      this.orderComboBox.Size = new System.Drawing.Size(114, 21);
     150      this.orderComboBox.TabIndex = 1;
     151      this.orderComboBox.SelectedIndexChanged += new System.EventHandler(this.orderComboBox_SelectedIndexChanged);
     152      //
     153      // groupingComboBox
     154      //
     155      this.groupingComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
     156      this.groupingComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     157      this.groupingComboBox.FormattingEnabled = true;
     158      this.groupingComboBox.Location = new System.Drawing.Point(57, 3);
     159      this.groupingComboBox.Name = "groupingComboBox";
     160      this.groupingComboBox.Size = new System.Drawing.Size(114, 21);
     161      this.groupingComboBox.TabIndex = 1;
     162      this.groupingComboBox.SelectedIndexChanged += new System.EventHandler(this.classifierComboBox_SelectedIndexChanged);
     163      //
     164      // aggregationComboBox
     165      //
     166      this.aggregationComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
     167      this.aggregationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     168      this.aggregationComboBox.FormattingEnabled = true;
     169      this.aggregationComboBox.Location = new System.Drawing.Point(57, 30);
     170      this.aggregationComboBox.Name = "aggregationComboBox";
     171      this.aggregationComboBox.Size = new System.Drawing.Size(114, 21);
     172      this.aggregationComboBox.TabIndex = 1;
     173      this.aggregationComboBox.SelectedIndexChanged += new System.EventHandler(this.aggregationComboBox_SelectedIndexChanged);
    111174      //
    112175      // HistogramView
     
    120183      this.splitContainer.ResumeLayout(false);
    121184      this.optionsBox.ResumeLayout(false);
    122       this.optionsBox.PerformLayout();
     185      this.groupingTableLayoutPanel.ResumeLayout(false);
     186      this.groupingTableLayoutPanel.PerformLayout();
    123187      this.ResumeLayout(false);
    124188
     
    128192
    129193    private System.Windows.Forms.GroupBox optionsBox;
    130     private System.Windows.Forms.ComboBox classifierComboBox;
    131     private System.Windows.Forms.Label label1;
    132     private System.Windows.Forms.CheckBox displayDetailsCheckBox;
    133 
     194    private System.Windows.Forms.ComboBox groupingComboBox;
     195    private System.Windows.Forms.Label variableLabel;
     196    private System.Windows.Forms.Label aggregationLabel;
     197    private System.Windows.Forms.ComboBox aggregationComboBox;
     198    private System.Windows.Forms.TableLayoutPanel groupingTableLayoutPanel;
     199    private System.Windows.Forms.Label orderLabel;
     200    private System.Windows.Forms.ComboBox orderComboBox;
     201    private System.Windows.Forms.ToolTip toolTip;
    134202  }
    135203}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs

    r14186 r15242  
    2121
    2222using System;
     23using System.Drawing;
    2324using HeuristicLab.Analysis;
    2425using HeuristicLab.MainForm;
    2526
    2627namespace HeuristicLab.DataPreprocessing.Views {
    27 
    2828  [View("Histogram View")]
    2929  [Content(typeof(HistogramContent), true)]
    3030  public partial class HistogramView : PreprocessingChartView {
    31     private const string HISTOGRAM_CHART_TITLE = "Histogram";
    32 
    33     public HistogramView() {
    34       InitializeComponent();
    35       chartType = DataRowVisualProperties.DataRowChartType.Histogram;
    36       chartTitle = HISTOGRAM_CHART_TITLE;
    37     }
    38 
    39     protected override void OnContentChanged() {
    40       base.OnContentChanged();
    41       if (Content != null) {
    42         classifierComboBox.Items.Clear();
    43         classifierComboBox.Items.Add("None");
    44 
    45         foreach (string var in Content.GetVariableNamesForHistogramClassification()) {
    46           classifierComboBox.Items.Add(var);
    47         }
    48 
    49         if (classifierComboBox.SelectedItem == null && Content.ClassifierVariableIndex < classifierComboBox.Items.Count) {
    50           classifierComboBox.SelectedIndex = Content.ClassifierVariableIndex;
    51         }
    52       }
    53     }
    54 
    5531    public new HistogramContent Content {
    5632      get { return (HistogramContent)base.Content; }
     
    5834    }
    5935
    60     private void classifierComboBox_SelectedIndexChanged(object sender, EventArgs e) {
    61       if (classifierComboBox.SelectedItem == null)
    62         return;
     36    public HistogramView() {
     37      InitializeComponent();
     38      aggregationComboBox.DataSource = Enum.GetValues(typeof(DataTableVisualProperties.DataTableHistogramAggregation));
     39      aggregationComboBox.SelectedItem = DataTableVisualProperties.DataTableHistogramAggregation.Overlapping;
     40      orderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder));
     41      orderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Alphabetically;
     42    }
    6343
    64       if (classifierComboBox.SelectedIndex != 0) {
    65         int columndIndex = Content.PreprocessingData.GetColumnIndex(classifierComboBox.SelectedItem.ToString());
    66         Classification = Content.PreprocessingData.GetValues<double>(columndIndex);
    67       } else {
    68         Classification = null;
    69       }
     44    protected override void OnContentChanged() {
     45      base.OnContentChanged();
     46      groupingComboBox.Items.Clear();
     47      groupingComboBox.Items.Add(string.Empty);
    7048
    71       Content.ClassifierVariableIndex = classifierComboBox.SelectedIndex;
    72       if (Content.IsDetailedChartViewEnabled != IsDetailedChartViewEnabled) {
    73         displayDetailsCheckBox.Checked = Content.IsDetailedChartViewEnabled;
    74       } else {
    75         GenerateChart();
     49      if (Content != null) {
     50        foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData)) {
     51          groupingComboBox.Items.Add(var);
     52        }
     53
     54        groupingComboBox.SelectedItem = Content.GroupingVariableName ?? string.Empty;
    7655      }
    7756    }
    78     private void displayDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
    79       bool isChecked = displayDetailsCheckBox.Checked;
    80       if (IsDetailedChartViewEnabled != isChecked) {
    81         IsDetailedChartViewEnabled = isChecked;
    82         Content.IsDetailedChartViewEnabled = isChecked;
    83         GenerateChart();
     57
     58    protected override DataTable CreateDataTable(string variableName) {
     59      var aggregation = (DataTableVisualProperties.DataTableHistogramAggregation)aggregationComboBox.SelectedItem;
     60      var hist = HistogramContent.CreateHistogram(Content.PreprocessingData, variableName, Content.GroupingVariableName, aggregation, Content.Order);
     61      hist.VisualProperties.TitleFont = new Font(DefaultFont.FontFamily, 10, FontStyle.Bold);
     62      return hist;
     63    }
     64
     65    private void classifierComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     66      Content.GroupingVariableName = groupingComboBox.SelectedItem.ToString();
     67
     68      // rebuild datatables
     69      InitData();
     70      GenerateLayout();
     71    }
     72
     73    private void aggregationComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     74      foreach (var dt in dataTables.Values) {
     75        dt.VisualProperties.HistogramAggregation = (DataTableVisualProperties.DataTableHistogramAggregation)aggregationComboBox.SelectedItem;
    8476      }
     77    }
     78
     79    private void orderComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     80      if (Content == null) return;
     81
     82      Content.Order = (PreprocessingChartContent.LegendOrder)orderComboBox.SelectedItem;
     83
     84      // rebuild datatables
     85      InitData();
     86      GenerateLayout();
    8587    }
    8688  }
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.Designer.cs

    r14796 r15242  
    6262      // optionsBox
    6363      //
    64       this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
    65             | System.Windows.Forms.AnchorStyles.Right)));
    6664      this.optionsBox.Controls.Add(this.allInOneCheckBox);
    67       this.optionsBox.Location = new System.Drawing.Point(4, 262);
     65      this.optionsBox.Dock = System.Windows.Forms.DockStyle.Bottom;
     66      this.optionsBox.Location = new System.Drawing.Point(0, 357);
    6867      this.optionsBox.Name = "optionsBox";
    69       this.optionsBox.Size = new System.Drawing.Size(84, 138);
     68      this.optionsBox.Size = new System.Drawing.Size(180, 46);
    7069      this.optionsBox.TabIndex = 7;
    7170      this.optionsBox.TabStop = false;
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.cs

    r14186 r15242  
    2121
    2222using System;
     23using System.Collections.Generic;
     24using System.Linq;
    2325using HeuristicLab.Analysis;
     26using HeuristicLab.Analysis.Views;
     27using HeuristicLab.Collections;
     28using HeuristicLab.Data;
    2429using HeuristicLab.MainForm;
     30using HeuristicLab.Visualization.ChartControlsExtensions;
    2531
    2632namespace HeuristicLab.DataPreprocessing.Views {
    27 
    2833  [View("Line Chart View")]
    2934  [Content(typeof(LineChartContent), true)]
    3035  public partial class LineChartView : PreprocessingChartView {
    31 
    32     private const string LINE_CHART_TITLE = "Line Chart";
    33 
    34     public LineChartView() {
    35       InitializeComponent();
    36       chartType = DataRowVisualProperties.DataRowChartType.Line;
    37       chartTitle = LINE_CHART_TITLE;
    38     }
     36    protected Dictionary<string, DataRow> allInOneDataRows;
     37    protected DataTable allInOneDataTable;
     38    protected DataTableView allInOneDataTableView;
    3939
    4040    public new LineChartContent Content {
     
    4343    }
    4444
     45    public LineChartView() {
     46      InitializeComponent();
     47      sizeGroupBox.Visible = false;
     48
     49      allInOneDataRows = new Dictionary<string, DataRow>();
     50      allInOneDataTable = new DataTable();
     51    }
     52
     53    protected override void InitData() {
     54      base.InitData();
     55
     56      allInOneDataRows.Clear();
     57      foreach (var x in Content.VariableItemList.Select((v, i) => new { variable = v.Value, i })) {
     58        var row = Content.CreateDataRow(x.variable, DataRowVisualProperties.DataRowChartType.Line);
     59        row.VisualProperties.Color = Colors[x.i % Colors.Length];
     60        allInOneDataRows.Add(x.variable, row);
     61      }
     62
     63      allInOneDataTable.Rows.Clear();
     64      var rows = Content.VariableItemList.CheckedItems.Select(v => allInOneDataRows[v.Value.Value]);
     65      allInOneDataTable.Rows.AddRange(rows);
     66    }
     67
     68    protected override int GetNumberOfVisibleDataTables() {
     69      return Content.AllInOneMode ? 1 : base.GetNumberOfVisibleDataTables();
     70    }
     71    protected override IEnumerable<DataTableView> GetVisibleDataTables() {
     72      if (Content.AllInOneMode) {
     73        if (allInOneDataTableView == null)
     74          allInOneDataTableView = new DataTableView() { Content = allInOneDataTable, ShowChartOnly = true };
     75        return new[] { allInOneDataTableView };
     76      }
     77      return base.GetVisibleDataTables();
     78    }
     79    protected override DataTable CreateDataTable(string variableName) {
     80      var dt = new DataTable();
     81      var row = Content.CreateDataRow(variableName, DataRowVisualProperties.DataRowChartType.Line);
     82      dt.Rows.Add(row);
     83
     84      var validValues = row.Values.Where(x => !double.IsNaN(x) && !double.IsInfinity(x)).ToList();
     85      if (validValues.Any()) {
     86        try {
     87          double axisMin, axisMax, axisInterval;
     88          ChartUtil.CalculateOptimalAxisInterval(validValues.Min(), validValues.Max(), out axisMin, out axisMax, out axisInterval);
     89          dt.VisualProperties.YAxisMinimumAuto = false;
     90          dt.VisualProperties.YAxisMaximumAuto = false;
     91          dt.VisualProperties.YAxisMinimumFixedValue = axisMin;
     92          dt.VisualProperties.YAxisMaximumFixedValue = axisMax;
     93        } catch (ArgumentOutOfRangeException) { }
     94      }
     95      return dt;
     96    }
     97
    4598    private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) {
    4699      Content.AllInOneMode = allInOneCheckBox.Checked;
    47100
    48       GenerateChart();
     101      sizeGroupBox.Visible = !allInOneCheckBox.Checked;
     102
     103      GenerateLayout();
    49104    }
    50105
     
    55110      }
    56111    }
     112
     113    protected override void CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> checkedItems) {
     114      base.CheckedItemsChanged(sender, checkedItems);
     115
     116      foreach (IndexedItem<StringValue> item in checkedItems.Items) {
     117        string variableName = item.Value.Value;
     118
     119        if (IsVariableChecked(variableName)) {
     120          // ToDo: avoid clearing all rows, but how?
     121          allInOneDataTable.Rows.Clear();
     122          var rows = Content.VariableItemList.CheckedItems.Select(r => allInOneDataRows[r.Value.Value]);
     123          allInOneDataTable.Rows.AddRange(rows);
     124        } else {
     125          allInOneDataTable.Rows.Remove(variableName);
     126        }
     127      }
     128    }
     129
     130    #region Add/Remove/Update Variable, Reset
     131    protected override void AddVariable(string name) {
     132      base.AddVariable(name);
     133      var row = Content.CreateDataRow(name, DataRowVisualProperties.DataRowChartType.Line);
     134      allInOneDataTable.Rows.Add(row);
     135    }
     136
     137    // remove variable from data table and item list
     138    protected override void RemoveVariable(string name) {
     139      base.RemoveVariable(name);
     140      allInOneDataTable.Rows.Remove(name);
     141    }
     142
     143    protected override void UpdateVariable(string name) {
     144      base.UpdateVariable(name);
     145      allInOneDataTable.Rows.Remove(name);
     146      var newRow = Content.CreateDataRow(name, DataRowVisualProperties.DataRowChartType.Line);
     147      allInOneDataTable.Rows.Add(newRow);
     148    }
     149    #endregion
    57150  }
    58151}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/ManipulationView.cs

    r14186 r15242  
    3131
    3232namespace HeuristicLab.DataPreprocessing.Views {
    33 
    3433  [View("Manipulation Chart View")]
    3534  [Content(typeof(ManipulationContent), true)]
    3635  public partial class ManipulationView : ItemView {
    37 
    3836    private Action[] validators;
    3937    private Action[] manipulations;
     38
     39    public new ManipulationContent Content {
     40      get { return (ManipulationContent)base.Content; }
     41      set { base.Content = value; }
     42    }
    4043
    4144    public ManipulationView() {
     
    4952      tabsPreview.SizeMode = TabSizeMode.Fixed;
    5053
    51       validators = new Action[] { 
    52         ()=>validateDeleteColumnsInfo(),
    53         ()=>validateDeleteColumnsVariance(),
    54         ()=>validateDeleteRowsInfo(),
    55         ()=>validateReplaceWith(),
    56         ()=>validateShuffle()
     54      validators = new Action[] {
     55        () => ValidateDeleteColumnsInfo(),
     56        () => ValidateDeleteColumnsVariance(),
     57        () => ValidateDeleteRowsInfo(),
     58        () => ValidateReplaceWith(),
     59        () => ValidateShuffle()
    5760      };
    5861
    59       manipulations = new Action[] { 
    60         ()=>Content.ManipulationLogic.DeleteColumnsWithMissingValuesGreater(getDeleteColumnsInfo()),
    61         ()=>Content.ManipulationLogic.DeleteColumnsWithVarianceSmaller(getDeleteColumnsVariance()),
    62         ()=>Content.ManipulationLogic.DeleteRowsWithMissingValuesGreater(getRowsColumnsInfo()),
    63         ()=>replaceMissingValues(),
    64         ()=>Content.ManipulationLogic.Shuffle(shuffleSeparatelyCheckbox.Checked)
     62      manipulations = new Action[] {
     63        () => Content.ManipulationLogic.DeleteColumnsWithMissingValuesGreater(GetDeleteColumnsInfo()),
     64        () => Content.ManipulationLogic.DeleteColumnsWithVarianceSmaller(GetDeleteColumnsVariance()),
     65        () => Content.ManipulationLogic.DeleteRowsWithMissingValuesGreater(GetRowsColumnsInfo()),
     66        () => ReplaceMissingValues(),
     67        () => Content.ManipulationLogic.Shuffle(shuffleSeparatelyCheckbox.Checked)
    6568      };
    6669    }
     
    111114    }
    112115
    113     private double getDeleteColumnsInfo() {
     116    private double GetDeleteColumnsInfo() {
    114117      return double.Parse(txtDeleteColumnsInfo.Text);
    115118    }
    116119
    117     private double getDeleteColumnsVariance() {
     120    private double GetDeleteColumnsVariance() {
    118121      return double.Parse(txtDeleteColumnsVariance.Text);
    119122    }
    120123
    121     private double getRowsColumnsInfo() {
     124    private double GetRowsColumnsInfo() {
    122125      return double.Parse(txtDeleteRowsInfo.Text);
    123126    }
    124127
    125     private void replaceMissingValues() {
     128    private void ReplaceMissingValues() {
    126129      var allIndices = Content.SearchLogic.GetMissingValueIndices();
    127130      var columnIndex = cmbVariableNames.SelectedIndex;
     
    149152    }
    150153
    151     private void validateDeleteColumnsInfo() {
    152       validateDoubleTextBox(txtDeleteColumnsInfo.Text);
     154    private void ValidateDeleteColumnsInfo() {
     155      ValidateDoubleTextBox(txtDeleteColumnsInfo.Text);
    153156      if (btnApply.Enabled) {
    154         var filteredColumns = Content.ManipulationLogic.ColumnsWithMissingValuesGreater(getDeleteColumnsInfo());
     157        var filteredColumns = Content.ManipulationLogic.ColumnsWithMissingValuesGreater(GetDeleteColumnsInfo());
    155158        int count = filteredColumns.Count;
    156159        int columnCount = Content.FilterLogic.PreprocessingData.Columns;
     
    180183    }
    181184
    182     private void validateDeleteColumnsVariance() {
    183       validateDoubleTextBox(txtDeleteColumnsVariance.Text);
     185    private void ValidateDeleteColumnsVariance() {
     186      ValidateDoubleTextBox(txtDeleteColumnsVariance.Text);
    184187      if (btnApply.Enabled) {
    185         var filteredColumns = Content.ManipulationLogic.ColumnsWithVarianceSmaller(getDeleteColumnsVariance());
     188        var filteredColumns = Content.ManipulationLogic.ColumnsWithVarianceSmaller(GetDeleteColumnsVariance());
    186189        int count = filteredColumns.Count;
    187190        int columnCount = Content.FilterLogic.PreprocessingData.Columns;
     
    211214    }
    212215
    213     private void validateDeleteRowsInfo() {
    214       validateDoubleTextBox(txtDeleteRowsInfo.Text);
     216    private void ValidateDeleteRowsInfo() {
     217      ValidateDoubleTextBox(txtDeleteRowsInfo.Text);
    215218      if (btnApply.Enabled) {
    216         int count = Content.ManipulationLogic.RowsWithMissingValuesGreater(getRowsColumnsInfo()).Count;
     219        int count = Content.ManipulationLogic.RowsWithMissingValuesGreater(GetRowsColumnsInfo()).Count;
    217220        int rowCount = Content.FilterLogic.PreprocessingData.Rows;
    218221        lblPreviewRowsInfo.Text = count + " row" + (count > 1 || count == 0 ? "s" : "") + " of " + rowCount + " (" + string.Format("{0:F2}%", 100d / rowCount * count) + ") were detected with more than " + txtDeleteRowsInfo.Text + "% missing values.";
     
    227230    }
    228231
    229     private void validateReplaceWith() {
     232    private void ValidateReplaceWith() {
    230233      btnApply.Enabled = false;
    231234      string replaceWith = (string)cmbReplaceWith.SelectedItem;
     
    260263    }
    261264
    262     private void validateShuffle() {
     265    private void ValidateShuffle() {
    263266      btnApply.Enabled = true;
    264267      lblShuffleProperties.Enabled = false;
     
    268271    }
    269272
    270     public new ManipulationContent Content {
    271       get { return (ManipulationContent)base.Content; }
    272       set { base.Content = value; }
    273     }
    274 
    275273    private void lstMethods_SelectedIndexChanged(object sender, System.EventArgs e) {
    276274      int index = lstMethods.SelectedIndex;
     
    308306    }
    309307
    310     private void validateDoubleTextBox(String text) {
     308    private void ValidateDoubleTextBox(String text) {
    311309      btnApply.Enabled = false;
    312310      if (!string.IsNullOrEmpty(text)) {
     
    319317
    320318    private void txtDeleteColumnsInfo_TextChanged(object sender, EventArgs e) {
    321       validateDeleteColumnsInfo();
     319      ValidateDeleteColumnsInfo();
    322320    }
    323321
    324322    private void txtDeleteColumnsVariance_TextChanged(object sender, EventArgs e) {
    325       validateDeleteColumnsVariance();
     323      ValidateDeleteColumnsVariance();
    326324    }
    327325
    328326    private void txtDeleteRowsInfo_TextChanged(object sender, EventArgs e) {
    329       validateDeleteRowsInfo();
     327      ValidateDeleteRowsInfo();
    330328    }
    331329
     
    334332      lblValueColon.Visible = isReplaceWithValueSelected;
    335333      txtReplaceValue.Visible = isReplaceWithValueSelected;
    336       validateReplaceWith();
     334      ValidateReplaceWith();
    337335    }
    338336
    339337    private void txtReplaceValue_TextChanged(object sender, EventArgs e) {
    340       validateReplaceWith();
     338      ValidateReplaceWith();
    341339    }
    342340  }
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.Designer.cs

    r14963 r15242  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.dataTableView = new HeuristicLab.DataPreprocessing.Views.PreprocessingDataTableView();
    4847      this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
     48      this.sizeGroupBox = new System.Windows.Forms.GroupBox();
     49      this.columnsNumericUpDown = new System.Windows.Forms.NumericUpDown();
     50      this.columnsLabel = new System.Windows.Forms.Label();
     51      this.scrollPanel = new System.Windows.Forms.Panel();
    4952      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    5053      this.splitContainer.Panel1.SuspendLayout();
    5154      this.splitContainer.Panel2.SuspendLayout();
    5255      this.splitContainer.SuspendLayout();
    53       this.tableLayoutPanel.SuspendLayout();
     56      this.sizeGroupBox.SuspendLayout();
     57      ((System.ComponentModel.ISupportInitialize)(this.columnsNumericUpDown)).BeginInit();
     58      this.scrollPanel.SuspendLayout();
    5459      this.SuspendLayout();
    5560      //
     
    5762      //
    5863      //
     64      // splitContainer.Panel1
     65      //
     66      this.splitContainer.Panel1.Controls.Add(this.sizeGroupBox);
     67      //
    5968      // splitContainer.Panel2
    6069      //
    61       this.splitContainer.Panel2.Controls.Add(this.tableLayoutPanel);
    62       //
    63       // dataTableView
    64       //
    65       this.dataTableView.AutoScroll = true;
    66       this.dataTableView.Caption = "DataTable View";
    67       this.dataTableView.Classification = null;
    68       this.dataTableView.Content = null;
    69       this.dataTableView.Dock = System.Windows.Forms.DockStyle.Fill;
    70       this.dataTableView.IsDetailedChartViewEnabled = false;
    71       this.dataTableView.Location = new System.Drawing.Point(3, 3);
    72       this.dataTableView.Name = "dataTableView";
    73       this.dataTableView.ReadOnly = false;
    74       this.dataTableView.ShowLegend = true;
    75       this.dataTableView.Size = new System.Drawing.Size(553, 397);
    76       this.dataTableView.TabIndex = 0;
    77       this.dataTableView.XAxisFormat = "";
    78       this.dataTableView.YAxisFormat = "";
     70      this.splitContainer.Panel2.Controls.Add(this.scrollPanel);
     71      this.splitContainer.Panel2.Resize += new System.EventHandler(this.splitContainer_Panel2_Resize);
    7972      //
    8073      // tableLayoutPanel
    8174      //
     75      this.tableLayoutPanel.AutoSize = true;
     76      this.tableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
    8277      this.tableLayoutPanel.ColumnCount = 1;
    8378      this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
    8479      this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
    85       this.tableLayoutPanel.Controls.Add(this.dataTableView, 0, 0);
    86       this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
    8780      this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0);
    8881      this.tableLayoutPanel.Name = "tableLayoutPanel";
     
    9083      this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
    9184      this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
    92       this.tableLayoutPanel.Size = new System.Drawing.Size(559, 403);
     85      this.tableLayoutPanel.Size = new System.Drawing.Size(0, 0);
    9386      this.tableLayoutPanel.TabIndex = 0;
    9487      this.tableLayoutPanel.Layout += new System.Windows.Forms.LayoutEventHandler(this.tableLayoutPanel_Layout);
     88      //
     89      // sizeGroupBox
     90      //
     91      this.sizeGroupBox.Controls.Add(this.columnsNumericUpDown);
     92      this.sizeGroupBox.Controls.Add(this.columnsLabel);
     93      this.sizeGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom;
     94      this.sizeGroupBox.Location = new System.Drawing.Point(0, 359);
     95      this.sizeGroupBox.Name = "sizeGroupBox";
     96      this.sizeGroupBox.Size = new System.Drawing.Size(180, 44);
     97      this.sizeGroupBox.TabIndex = 8;
     98      this.sizeGroupBox.TabStop = false;
     99      this.sizeGroupBox.Text = "Chart Size";
     100      //
     101      // columnsNumericUpDown
     102      //
     103      this.columnsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     104            | System.Windows.Forms.AnchorStyles.Right)));
     105      this.columnsNumericUpDown.Location = new System.Drawing.Point(88, 14);
     106      this.columnsNumericUpDown.Minimum = new decimal(new int[] {
     107            1,
     108            0,
     109            0,
     110            0});
     111      this.columnsNumericUpDown.Name = "columnsNumericUpDown";
     112      this.columnsNumericUpDown.Size = new System.Drawing.Size(86, 20);
     113      this.columnsNumericUpDown.TabIndex = 3;
     114      this.columnsNumericUpDown.Value = new decimal(new int[] {
     115            3,
     116            0,
     117            0,
     118            0});
     119      this.columnsNumericUpDown.ValueChanged += new System.EventHandler(this.columnsNumericUpDown_ValueChanged);
     120      //
     121      // columnsLabel
     122      //
     123      this.columnsLabel.AutoSize = true;
     124      this.columnsLabel.Location = new System.Drawing.Point(6, 16);
     125      this.columnsLabel.Name = "columnsLabel";
     126      this.columnsLabel.Size = new System.Drawing.Size(76, 13);
     127      this.columnsLabel.TabIndex = 1;
     128      this.columnsLabel.Text = "Max. Columns:";
     129      //
     130      // scrollPanel
     131      //
     132      this.scrollPanel.AutoScroll = true;
     133      this.scrollPanel.Controls.Add(this.tableLayoutPanel);
     134      this.scrollPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     135      this.scrollPanel.Location = new System.Drawing.Point(0, 0);
     136      this.scrollPanel.Name = "scrollPanel";
     137      this.scrollPanel.Size = new System.Drawing.Size(470, 403);
     138      this.scrollPanel.TabIndex = 1;
    95139      //
    96140      // PreprocessingChartView
     
    103147      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    104148      this.splitContainer.ResumeLayout(false);
    105       this.tableLayoutPanel.ResumeLayout(false);
     149      this.sizeGroupBox.ResumeLayout(false);
     150      this.sizeGroupBox.PerformLayout();
     151      ((System.ComponentModel.ISupportInitialize)(this.columnsNumericUpDown)).EndInit();
     152      this.scrollPanel.ResumeLayout(false);
     153      this.scrollPanel.PerformLayout();
    106154      this.ResumeLayout(false);
    107155
     
    110158    #endregion
    111159
    112     private DataPreprocessing.Views.PreprocessingDataTableView dataTableView;
    113     private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
     160    protected System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
     161    private System.Windows.Forms.NumericUpDown columnsNumericUpDown;
     162    private System.Windows.Forms.Label columnsLabel;
     163    private System.Windows.Forms.Panel scrollPanel;
     164    protected System.Windows.Forms.GroupBox sizeGroupBox;
    114165  }
    115166}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs

    r14963 r15242  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Drawing;
    2425using System.Linq;
    2526using System.Windows.Forms;
    2627using HeuristicLab.Analysis;
     28using HeuristicLab.Analysis.Views;
    2729using HeuristicLab.Collections;
    2830using HeuristicLab.Data;
    2931using HeuristicLab.MainForm;
     32using HeuristicLab.MainForm.WindowsForms;
    3033
    3134namespace HeuristicLab.DataPreprocessing.Views {
     
    3336  [Content(typeof(PreprocessingChartContent), false)]
    3437  public partial class PreprocessingChartView : PreprocessingCheckedVariablesView {
    35 
    36     protected PreprocessingDataTable dataTable;
    37     protected List<PreprocessingDataTable> dataTablePerVariable;
    38     protected List<DataRow> dataRows;
    39     protected List<DataRow> selectedDataRows;
    40 
    41     protected DataRowVisualProperties.DataRowChartType chartType;
    42     protected string chartTitle;
    43 
    44     private const string DEFAULT_CHART_TITLE = "Chart";
    45     private const int FIXED_CHART_SIZE = 300;
    46     private const int MAX_TABLE_AUTO_SIZE_ROWS = 3;
    47 
    48 
    49     public IEnumerable<double> Classification { get; set; }
    50     public bool IsDetailedChartViewEnabled { get; set; }
     38    protected Dictionary<string, DataTable> dataTables;
     39    protected Dictionary<string, DataTableView> dataTableViews;
     40
     41    public static readonly Color[] Colors = {
     42      Color.FromArgb(59, 136, 239), Color.FromArgb(252, 177, 59), Color.FromArgb(226, 64, 10),
     43      Color.FromArgb(5, 100, 146), Color.FromArgb(191, 191, 191), Color.FromArgb(26, 59, 105),
     44      Color.FromArgb(255, 226, 126), Color.FromArgb(18, 156, 221), Color.FromArgb(202, 107, 75),
     45      Color.FromArgb(0, 92, 219), Color.FromArgb(243, 210, 136), Color.FromArgb(80, 99, 129),
     46      Color.FromArgb(241, 185, 168), Color.FromArgb(224, 131, 10), Color.FromArgb(120, 147, 190)
     47    };
    5148
    5249    public PreprocessingChartView() {
    5350      InitializeComponent();
    54       chartType = DataRowVisualProperties.DataRowChartType.Line;
    55       chartTitle = DEFAULT_CHART_TITLE;
     51      dataTables = new Dictionary<string, DataTable>();
     52      dataTableViews = new Dictionary<string, DataTableView>();
     53      scrollPanel.HorizontalScroll.Visible = false;
    5654    }
    5755
     
    6058      if (Content != null) {
    6159        InitData();
    62         GenerateChart();
    63 
    64         foreach (var row in dataRows) {
    65           string variableName = row.Name;
    66           if (!IsVariableChecked(variableName)) {
    67             dataTableView.SetRowEnabled(variableName, false);
    68             dataTable.SelectedRows.Remove(variableName);
    69             dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName)));
    70           }
    71         }
    72       }
    73     }
    74 
    75     private void InitData() {
    76       //Create data tables and data rows
    77       dataRows = Content.CreateAllDataRows(chartType);
    78       dataTable = new PreprocessingDataTable(chartTitle);
    79       dataTablePerVariable = new List<PreprocessingDataTable>();
    80 
    81       //add data rows to data tables according to checked item list
    82       foreach (var row in dataRows) {
    83         string variableName = row.Name;
    84 
    85         //add row to data table
    86         dataTable.Rows.Add(row);
    87 
    88         //add row to data table per variable
    89         PreprocessingDataTable d = new PreprocessingDataTable(variableName);
    90         d.Rows.Add(row);
    91         dataTablePerVariable.Add(d);
    92       }
    93 
    94       UpdateSelection();
     60        GenerateLayout();
     61      }
     62    }
     63
     64    protected virtual int GetNumberOfVisibleDataTables() {
     65      return Content.VariableItemList.CheckedItems.Count();
     66    }
     67
     68    protected virtual IEnumerable<DataTableView> GetVisibleDataTables() {
     69      foreach (var name in Content.VariableItemList.CheckedItems) {
     70        if (!dataTableViews.ContainsKey(name.Value.Value))
     71          dataTableViews.Add(name.Value.Value, new DataTableView() { Content = dataTables[name.Value.Value], ShowChartOnly = true });
     72        yield return dataTableViews[name.Value.Value];
     73      }
     74    }
     75
     76    protected virtual DataTable CreateDataTable(string variableName) {
     77      return null;
     78    }
     79
     80    protected virtual void InitData() {
     81      dataTables.Clear();
     82      dataTableViews.Clear();
     83      foreach (var variable in Content.VariableItemList.Select(v => v.Value)) {
     84        dataTables.Add(variable, CreateDataTable(variable));
     85      }
    9586    }
    9687
     
    9889      base.CheckedItemsChanged(sender, checkedItems);
    9990
    100       foreach (IndexedItem<StringValue> item in checkedItems.Items) {
    101         string variableName = item.Value.Value;
    102 
    103 
    104         if (!IsVariableChecked(variableName)) {
    105           // not checked -> remove
    106           dataTableView.SetRowEnabled(variableName, false);
    107           dataTable.SelectedRows.Remove(variableName);
    108           dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName)));
    109         } else {
    110           // checked -> add
    111           DataRow row = GetDataRow(variableName);
    112           DataRow selectedRow = GetSelectedDataRow(variableName);
    113           dataTableView.SetRowEnabled(variableName, true);
    114 
    115           PreprocessingDataTable pdt = new PreprocessingDataTable(variableName);
    116           pdt.Rows.Add(row);
    117           // dataTablePerVariable does not contain unchecked variables => reduce insert position by number of uncheckt variables to correct the index
    118           int uncheckedUntilVariable = checkedItemList.Content.TakeWhile(x => x.Value != variableName).Count(x => !checkedItemList.Content.ItemChecked(x));
    119           dataTablePerVariable.Insert(item.Index - uncheckedUntilVariable, pdt);
    120 
    121           //update selection
    122           if (selectedRow != null) {
    123             dataTable.SelectedRows.Add(selectedRow);
    124             pdt.SelectedRows.Add(selectedRow);
    125           }
    126         }
    127       }
    128 
    129       // update chart if not in all in one mode
    130       if (Content != null && !Content.AllInOneMode)
    131         GenerateChart();
    132     }
    133 
    134     private DataRow GetSelectedDataRow(string variableName) {
    135       foreach (DataRow row in selectedDataRows) {
    136         if (row.Name == variableName)
    137           return row;
    138       }
    139       return null;
    140     }
    141     private DataRow GetDataRow(string variableName) {
    142       foreach (DataRow row in dataRows) {
    143         if (row.Name == variableName)
    144           return row;
    145       }
    146       return null;
    147     }
     91      GenerateLayout();
     92    }
     93
    14894
    14995    #region Add/Remove/Update Variable, Reset
    15096    protected override void AddVariable(string name) {
    15197      base.AddVariable(name);
    152       DataRow row = Content.CreateDataRow(name, chartType);
    153       dataTable.Rows.Add(row);
    154       PreprocessingDataTable d = new PreprocessingDataTable(name);
    155       d.Rows.Add(row);
    156       dataTablePerVariable.Add(d);
    157 
    158       if (!Content.AllInOneMode)
    159         GenerateChart();
     98      dataTables.Add(name, CreateDataTable(name));
     99
     100      GenerateLayout();
    160101    }
    161102
     
    163104    protected override void RemoveVariable(string name) {
    164105      base.RemoveVariable(name);
    165       dataTable.Rows.Remove(name);
    166       dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == name)));
    167 
    168       if (!Content.AllInOneMode)
    169         GenerateChart();
     106      dataTables.Remove(name);
     107      dataTableViews.Remove(name);
     108
     109      GenerateLayout();
    170110    }
    171111
    172112    protected override void UpdateVariable(string name) {
    173113      base.UpdateVariable(name);
    174       DataRow newRow = Content.CreateDataRow(name, chartType);
    175       dataTable.Rows.Remove(name);
    176       dataTable.Rows.Add(newRow);
    177       DataTable dt = dataTablePerVariable.Find(x => x.Rows.Find(y => y.Name == name) != null);
    178       if (dt != null) {
    179         dt.Rows.Remove(name);
    180         dt.Rows.Add(newRow);
    181       }
     114      dataTables.Remove(name);
     115      var newDataTable = CreateDataTable(name);
     116      dataTables.Add(name, newDataTable);
     117      dataTableViews[name].Content = newDataTable;
     118      GenerateLayout();
    182119    }
    183120    protected override void ResetAllVariables() {
     
    186123    #endregion
    187124
    188     #region Generate Charts
    189     protected void GenerateChart() {
     125    protected override void CheckedChangedUpdate() {
     126      GenerateLayout();
     127    }
     128
     129    #region Generate Layout
     130    protected void GenerateLayout() {
     131      if (SuppressCheckedChangedUpdate)
     132        return;
     133
     134      scrollPanel.SuspendRepaint();
     135
    190136      ClearTableLayout();
    191       if (Content.AllInOneMode) {
    192         GenerateSingleChartLayout();
    193       } else
    194         GenerateMultiChartLayout();
    195     }
    196 
    197     private void GenerateSingleChartLayout() {
    198       tableLayoutPanel.ColumnCount = 1;
    199       tableLayoutPanel.RowCount = 1;
    200       tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
    201       tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
    202       tableLayoutPanel.Controls.Add(dataTableView, 0, 0);
    203       dataTableView.Content = dataTable;
    204     }
    205 
    206     private void GenerateMultiChartLayout() {
    207       int checkedItemsCnt = 0;
    208       foreach (var item in Content.VariableItemList.CheckedItems)
    209         checkedItemsCnt++;
    210 
    211       // set columns and rows based on number of items
    212       int columns = GetNrOfMultiChartColumns(checkedItemsCnt);
    213       int rows = GetNrOfMultiChartRows(checkedItemsCnt, columns);
    214 
    215       tableLayoutPanel.ColumnCount = columns;
    216       tableLayoutPanel.RowCount = rows;
    217 
    218       List<PreprocessingDataTable>.Enumerator enumerator = dataTablePerVariable.GetEnumerator();
    219       for (int x = 0; x < columns; x++) {
    220 
    221         if (rows <= MAX_TABLE_AUTO_SIZE_ROWS)
    222           tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100 / columns));
    223         else
    224           //scrollbar is shown if there are more than 3 rows -> remove scroll bar width from total width
    225           tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, (tableLayoutPanel.Width - System.Windows.Forms.SystemInformation.VerticalScrollBarWidth) / columns));
    226         for (int y = 0; y < rows; y++) {
    227           //Add a row only when creating the first column
    228           if (x == 0) {
    229             // fixed chart size when there are more than 3 tables
    230             if (rows > MAX_TABLE_AUTO_SIZE_ROWS)
    231               tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, FIXED_CHART_SIZE));
    232             else
    233               tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100 / rows));
     137
     138      int nrCharts = GetNumberOfVisibleDataTables();
     139
     140      // Set columns and rows based on number of items
     141      int columns = Math.Min(nrCharts, (int)columnsNumericUpDown.Value);
     142      int rows = (int)Math.Ceiling((float)nrCharts / columns);
     143
     144      tableLayoutPanel.ColumnCount = Math.Max(columns, 0);
     145      tableLayoutPanel.RowCount = Math.Max(rows, 0);
     146
     147      if (columns > 0 && rows > 0) {
     148        var width = (splitContainer.Panel2.Width - SystemInformation.VerticalScrollBarWidth) / columns;
     149        var height = width * 0.75f;
     150
     151        using (var enumerator = GetVisibleDataTables().GetEnumerator()) {
     152          for (int row = 0; row < rows; row++) {
     153            tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, height));
     154            for (int col = 0; col < columns; col++) {
     155              if (row == 0) {
     156                // Add a column-style only when creating the first row
     157                tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, width));
     158              }
     159
     160              if (enumerator.MoveNext())
     161                AddDataTableToTableLayout(enumerator.Current, row, col);
     162
     163            }
    234164          }
    235 
    236           enumerator.MoveNext();
    237           PreprocessingDataTable d = enumerator.Current;
    238           AddDataTableToTableLayout(d, x, y);
    239 
    240165        }
    241       }
    242     }
    243     private int GetNrOfMultiChartColumns(int itemCount) {
    244       int columns = 0;
    245       if (itemCount <= 2)
    246         columns = 1;
    247       else if (itemCount <= 6)
    248         columns = 2;
    249       else
    250         columns = 3;
    251       return columns;
    252     }
    253     private int GetNrOfMultiChartRows(int itemCount, int columns) {
    254       int rows = 0;
    255       if (columns == 3)
    256         rows = (itemCount + 2) / columns;
    257       else if (columns == 2)
    258         rows = (itemCount + 1) / columns;
    259       else
    260         rows = itemCount / columns;
    261       return rows;
    262     }
    263 
    264     private void AddDataTableToTableLayout(PreprocessingDataTable dataTable, int x, int y) {
    265       PreprocessingDataTableView dataView = new PreprocessingDataTableView();
    266       dataView.Classification = Classification;
    267       dataView.IsDetailedChartViewEnabled = IsDetailedChartViewEnabled;
    268 
     166        tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 0));
     167      }
     168
     169      scrollPanel.ResumeRepaint(true);
     170    }
     171
     172    private void AddDataTableToTableLayout(DataTableView dataTable, int row, int col) {
    269173      if (dataTable == null) {
    270174        // dummy panel for empty field
    271         Panel p = new Panel();
    272         p.Dock = DockStyle.Fill;
    273         tableLayoutPanel.Controls.Add(p, y, x);
     175        Panel p = new Panel { Dock = DockStyle.Fill };
     176        tableLayoutPanel.Controls.Add(p, col, row);
    274177      } else {
    275         dataView.Content = dataTable;
    276         dataView.Dock = DockStyle.Fill;
    277         tableLayoutPanel.Controls.Add(dataView, y, x);
     178        dataTable.Dock = DockStyle.Fill;
     179        tableLayoutPanel.Controls.Add(dataTable, col, row);
    278180      }
    279181    }
     
    286188      tableLayoutPanel.ColumnStyles.Clear();
    287189      tableLayoutPanel.RowStyles.Clear();
    288       tableLayoutPanel.AutoScroll = false;
    289       tableLayoutPanel.AutoScroll = true;
    290190    }
    291191    //Remove horizontal scroll bar if visible
     
    293193      if (tableLayoutPanel.HorizontalScroll.Visible) {
    294194        // Add padding on the right in order to accomodate the vertical scrollbar
    295         int vWidth = SystemInformation.VerticalScrollBarWidth;
    296         tableLayoutPanel.Padding = new Padding(0, 0, vWidth, 0);
     195        tableLayoutPanel.Padding = new Padding(0, 0, SystemInformation.VerticalScrollBarWidth, 0);
    297196      } else {
    298197        // Reset padding
     
    302201    #endregion
    303202
    304     #region Update Selection
    305     protected override void PreprocessingData_SelctionChanged(object sender, EventArgs e) {
    306       base.PreprocessingData_SelctionChanged(sender, e);
    307       UpdateSelection();
    308     }
    309 
    310     private void UpdateSelection() {
    311       //update data table selection
    312       selectedDataRows = Content.CreateAllSelectedDataRows(chartType);
    313       dataTable.SelectedRows.Clear();
    314       foreach (var selectedRow in selectedDataRows) {
    315         if (IsVariableChecked(selectedRow.Name))
    316           dataTable.SelectedRows.Add(selectedRow);
    317       }
    318 
    319       //update data table per variable selection
    320       foreach (PreprocessingDataTable d in dataTablePerVariable) {
    321         d.SelectedRows.Clear();
    322         DataRow row = selectedDataRows.Find(x => x.Name == d.Name);
    323         if (row != null)
    324           d.SelectedRows.Add(row);
    325       }
    326     }
    327     #endregion
     203    private void columnsNumericUpDown_ValueChanged(object sender, System.EventArgs e) {
     204      GenerateLayout();
     205    }
     206
     207    private void splitContainer_Panel2_Resize(object sender, EventArgs e) {
     208      if (SuppressCheckedChangedUpdate)
     209        return;
     210
     211      scrollPanel.SuspendRepaint();
     212
     213      if (tableLayoutPanel.ColumnCount > 0 && tableLayoutPanel.RowCount > 0) {
     214        var width = (splitContainer.Panel2.Width - SystemInformation.VerticalScrollBarWidth) / tableLayoutPanel.ColumnCount;
     215        var height = width * 0.75f;
     216
     217        for (int i = 0; i < tableLayoutPanel.RowStyles.Count - 1; i++) {
     218          tableLayoutPanel.RowStyles[i].Height = height;
     219        }
     220        for (int i = 0; i < tableLayoutPanel.ColumnStyles.Count; i++) {
     221          tableLayoutPanel.ColumnStyles[i].Width = width;
     222        }
     223      }
     224
     225      scrollPanel.ResumeRepaint(true);
     226    }
    328227  }
    329228}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.Designer.cs

    r14963 r15242  
    4747      this.components = new System.ComponentModel.Container();
    4848      this.splitContainer = new System.Windows.Forms.SplitContainer();
    49       this.checkedItemList = new HeuristicLab.DataPreprocessing.Views.PreprocessingCheckedItemListView();
    50       this.variablesListcontextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
    51       this.checkInputsTargetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    52       this.checkOnlyInputsTargetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    53       this.checkAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    54       this.uncheckAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     49      this.variablesGroupBox = new System.Windows.Forms.GroupBox();
     50      this.variablesListView = new System.Windows.Forms.ListView();
     51      this.columnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     52      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     53      this.uncheckAllButton = new System.Windows.Forms.Button();
     54      this.checkAllButton = new System.Windows.Forms.Button();
     55      this.checkInputsTargetButton = new System.Windows.Forms.Button();
    5556      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    5657      this.splitContainer.Panel1.SuspendLayout();
    5758      this.splitContainer.SuspendLayout();
    58       this.variablesListcontextMenuStrip.SuspendLayout();
     59      this.variablesGroupBox.SuspendLayout();
    5960      this.SuspendLayout();
    6061      //
     
    6263      //
    6364      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
     65      this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
    6466      this.splitContainer.Location = new System.Drawing.Point(0, 0);
    6567      this.splitContainer.Name = "splitContainer";
     
    6769      // splitContainer.Panel1
    6870      //
    69       this.splitContainer.Panel1.Controls.Add(this.checkedItemList);
    70       this.splitContainer.Size = new System.Drawing.Size(654, 403);
    71       this.splitContainer.SplitterDistance = 91;
     71      this.splitContainer.Panel1.Controls.Add(this.variablesGroupBox);
     72      this.splitContainer.Size = new System.Drawing.Size(940, 698);
     73      this.splitContainer.SplitterDistance = 180;
    7274      this.splitContainer.TabIndex = 7;
    7375      //
    74       // checkedItemList
     76      // variablesGroupBox
    7577      //
    76       this.checkedItemList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    77             | System.Windows.Forms.AnchorStyles.Left)
     78      this.variablesGroupBox.Controls.Add(this.uncheckAllButton);
     79      this.variablesGroupBox.Controls.Add(this.checkAllButton);
     80      this.variablesGroupBox.Controls.Add(this.checkInputsTargetButton);
     81      this.variablesGroupBox.Controls.Add(this.variablesListView);
     82      this.variablesGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
     83      this.variablesGroupBox.Location = new System.Drawing.Point(0, 0);
     84      this.variablesGroupBox.Name = "variablesGroupBox";
     85      this.variablesGroupBox.Size = new System.Drawing.Size(180, 698);
     86      this.variablesGroupBox.TabIndex = 7;
     87      this.variablesGroupBox.TabStop = false;
     88      this.variablesGroupBox.Text = "Variables";
     89      //
     90      // variablesListView
     91      //
     92      this.variablesListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     93            | System.Windows.Forms.AnchorStyles.Left)
    7894            | System.Windows.Forms.AnchorStyles.Right)));
    79       this.checkedItemList.Caption = "View";
    80       this.checkedItemList.Content = null;
    81       this.checkedItemList.ContextMenuStrip = this.variablesListcontextMenuStrip;
    82       this.checkedItemList.Location = new System.Drawing.Point(4, 4);
    83       this.checkedItemList.Name = "checkedItemList";
    84       this.checkedItemList.ReadOnly = false;
    85       this.checkedItemList.Size = new System.Drawing.Size(84, 252);
    86       this.checkedItemList.TabIndex = 4;
     95      this.variablesListView.CheckBoxes = true;
     96      this.variablesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     97            this.columnHeader});
     98      this.variablesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
     99      this.variablesListView.HideSelection = false;
     100      this.variablesListView.Location = new System.Drawing.Point(6, 49);
     101      this.variablesListView.Name = "variablesListView";
     102      this.variablesListView.Size = new System.Drawing.Size(168, 643);
     103      this.variablesListView.TabIndex = 12;
     104      this.variablesListView.UseCompatibleStateImageBehavior = false;
     105      this.variablesListView.View = System.Windows.Forms.View.Details;
    87106      //
    88       // variablesListcontextMenuStrip
     107      // columnHeader
    89108      //
    90       this.variablesListcontextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
    91             this.checkInputsTargetToolStripMenuItem,
    92             this.checkOnlyInputsTargetToolStripMenuItem,
    93             this.checkAllToolStripMenuItem,
    94             this.uncheckAllToolStripMenuItem});
    95       this.variablesListcontextMenuStrip.Name = "variablesListcontextMenuStrip";
    96       this.variablesListcontextMenuStrip.Size = new System.Drawing.Size(211, 92);
    97       this.variablesListcontextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.variablesListcontextMenuStrip_Opening);
     109      this.columnHeader.Text = "";
     110      this.columnHeader.Width = 164;
    98111      //
    99       // checkInputsTargetToolStripMenuItem
     112      // uncheckAllButton
    100113      //
    101       this.checkInputsTargetToolStripMenuItem.Name = "checkInputsTargetToolStripMenuItem";
    102       this.checkInputsTargetToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
    103       this.checkInputsTargetToolStripMenuItem.Text = "Check Inputs+Target";
    104       this.checkInputsTargetToolStripMenuItem.Click += new System.EventHandler(this.checkInputsTargetToolStripMenuItem_Click);
     114      this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None;
     115      this.uncheckAllButton.Location = new System.Drawing.Point(66, 19);
     116      this.uncheckAllButton.Name = "uncheckAllButton";
     117      this.uncheckAllButton.Size = new System.Drawing.Size(24, 24);
     118      this.uncheckAllButton.TabIndex = 9;
     119      this.toolTip.SetToolTip(this.uncheckAllButton, "Show None");
     120      this.uncheckAllButton.UseVisualStyleBackColor = true;
     121      this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click);
    105122      //
    106       // checkOnlyInputsTargetToolStripMenuItem
     123      // checkAllButton
    107124      //
    108       this.checkOnlyInputsTargetToolStripMenuItem.Name = "checkOnlyInputsTargetToolStripMenuItem";
    109       this.checkOnlyInputsTargetToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
    110       this.checkOnlyInputsTargetToolStripMenuItem.Text = "Check only Inputs+Target";
    111       this.checkOnlyInputsTargetToolStripMenuItem.Click += new System.EventHandler(this.checkOnlyInputsTargetToolStripMenuItem_Click);
     125      this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All;
     126      this.checkAllButton.Location = new System.Drawing.Point(6, 19);
     127      this.checkAllButton.Name = "checkAllButton";
     128      this.checkAllButton.Size = new System.Drawing.Size(24, 24);
     129      this.checkAllButton.TabIndex = 7;
     130      this.toolTip.SetToolTip(this.checkAllButton, "Show All");
     131      this.checkAllButton.UseVisualStyleBackColor = true;
     132      this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click);
    112133      //
    113       // checkAllToolStripMenuItem
     134      // checkInputsTargetButton
    114135      //
    115       this.checkAllToolStripMenuItem.Name = "checkAllToolStripMenuItem";
    116       this.checkAllToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
    117       this.checkAllToolStripMenuItem.Text = "Check All";
    118       this.checkAllToolStripMenuItem.Click += new System.EventHandler(this.checkAllToolStripMenuItem_Click);
    119       //
    120       // uncheckAllToolStripMenuItem
    121       //
    122       this.uncheckAllToolStripMenuItem.Name = "uncheckAllToolStripMenuItem";
    123       this.uncheckAllToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
    124       this.uncheckAllToolStripMenuItem.Text = "Uncheck All";
    125       this.uncheckAllToolStripMenuItem.Click += new System.EventHandler(this.uncheckAllToolStripMenuItem_Click);
     136      this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs;
     137      this.checkInputsTargetButton.Location = new System.Drawing.Point(36, 19);
     138      this.checkInputsTargetButton.Name = "checkInputsTargetButton";
     139      this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24);
     140      this.checkInputsTargetButton.TabIndex = 8;
     141      this.toolTip.SetToolTip(this.checkInputsTargetButton, "Show Inputs & Target");
     142      this.checkInputsTargetButton.UseVisualStyleBackColor = true;
     143      this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click);
    126144      //
    127145      // PreprocessingCheckedVariablesView
     
    131149      this.Controls.Add(this.splitContainer);
    132150      this.Name = "PreprocessingCheckedVariablesView";
    133       this.Size = new System.Drawing.Size(654, 403);
     151      this.Size = new System.Drawing.Size(940, 698);
    134152      this.splitContainer.Panel1.ResumeLayout(false);
    135153      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    136154      this.splitContainer.ResumeLayout(false);
    137       this.variablesListcontextMenuStrip.ResumeLayout(false);
     155      this.variablesGroupBox.ResumeLayout(false);
    138156      this.ResumeLayout(false);
    139157
     
    141159
    142160    #endregion
    143 
    144     protected PreprocessingCheckedItemListView checkedItemList;
    145161    protected System.Windows.Forms.SplitContainer splitContainer;
    146     private System.Windows.Forms.ContextMenuStrip variablesListcontextMenuStrip;
    147     private System.Windows.Forms.ToolStripMenuItem checkInputsTargetToolStripMenuItem;
    148     private System.Windows.Forms.ToolStripMenuItem checkAllToolStripMenuItem;
    149     private System.Windows.Forms.ToolStripMenuItem uncheckAllToolStripMenuItem;
    150     private System.Windows.Forms.ToolStripMenuItem checkOnlyInputsTargetToolStripMenuItem;
     162    private System.Windows.Forms.ToolTip toolTip;
     163    private System.Windows.Forms.ColumnHeader columnHeader;
     164    private System.Windows.Forms.ListView variablesListView;
     165    private System.Windows.Forms.GroupBox variablesGroupBox;
     166    private System.Windows.Forms.Button checkInputsTargetButton;
     167    private System.Windows.Forms.Button uncheckAllButton;
     168    private System.Windows.Forms.Button checkAllButton;
    151169  }
    152170}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.cs

    r14963 r15242  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Drawing;
     
    3433  [Content(typeof(PreprocessingChartContent), false)]
    3534  public abstract partial class PreprocessingCheckedVariablesView : ItemView {
     35    protected bool SuppressCheckedChangedUpdate = false;
    3636
    3737    public new PreprocessingChartContent Content {
     
    4848    }
    4949    protected IList<string> GetCheckedVariables() {
    50       return checkedItemList.Content.CheckedItems.Select(i => i.Value.Value).ToList();
     50      return Content.VariableItemList.CheckedItems.Select(i => i.Value.Value).ToList();
    5151    }
    5252
     
    5555      if (Content == null) return;
    5656
    57       if (Content.VariableItemList == null) {
    58         IList<string> inputs = Content.PreprocessingData.InputVariables;
    59         if (Content.PreprocessingData.TargetVariable != null)
    60           inputs = inputs.Union(new[] { Content.PreprocessingData.TargetVariable }).ToList();
    61         Content.VariableItemList = Content.CreateVariableItemList(inputs);
    62       } else {
    63         var checkedNames = Content.VariableItemList.CheckedItems.Select(x => x.Value.Value);
    64         Content.VariableItemList = Content.CreateVariableItemList(checkedNames.ToList());
     57      variablesListView.ItemChecked -= variablesListView_ItemChecked;
     58      variablesListView.Items.Clear();
     59      foreach (var variable in Content.VariableItemList) {
     60        bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable.Value)
     61          || Content.PreprocessingData.TargetVariable == variable.Value;
     62        variablesListView.Items.Add(new ListViewItem(variable.Value) {
     63          Tag = variable,
     64          Checked = IsVariableChecked(variable.Value),
     65          ForeColor = isInputTarget ? Color.Black : Color.Gray
     66        });
    6567      }
    66       Content.VariableItemList.CheckedItemsChanged += CheckedItemsChanged;
    67 
    68       checkedItemList.Content = Content.VariableItemList;
    69       var target = Content.PreprocessingData.TargetVariable;
    70       var inputAndTarget = Content.PreprocessingData.InputVariables.Union(target != null ? new[] { target } : new string[] { });
    71       foreach (var col in Content.PreprocessingData.GetDoubleVariableNames().Except(inputAndTarget)) {
    72         var listViewItem = checkedItemList.ItemsListView.FindItemWithText(col, false, 0, false);
    73         listViewItem.ForeColor = Color.LightGray;
    74       }
     68      variablesListView.ItemChecked += variablesListView_ItemChecked;
    7569    }
    7670    protected override void RegisterContentEvents() {
    7771      base.RegisterContentEvents();
    7872      Content.PreprocessingData.Changed += PreprocessingData_Changed;
    79       Content.PreprocessingData.SelectionChanged += PreprocessingData_SelctionChanged;
     73      Content.VariableItemList.CheckedItemsChanged += CheckedItemsChanged;
    8074    }
     75
    8176    protected override void DeregisterContentEvents() {
    8277      Content.PreprocessingData.Changed -= PreprocessingData_Changed;
    83       Content.PreprocessingData.SelectionChanged -= PreprocessingData_SelctionChanged;
     78      Content.VariableItemList.CheckedItemsChanged -= CheckedItemsChanged;
    8479      base.DeregisterContentEvents();
    8580    }
    8681
    8782    protected virtual void CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> checkedItems) {
     83      // sync listview
     84      foreach (var item in checkedItems.Items)
     85        variablesListView.Items[item.Index].Checked = Content.VariableItemList.ItemChecked(item.Value);
     86    }
     87    private void variablesListView_ItemChecked(object sender, ItemCheckedEventArgs e) {
     88      // sync checked item list
     89      var variable = (StringValue)e.Item.Tag;
     90      Content.VariableItemList.SetItemCheckedState(variable, e.Item.Checked);
    8891    }
    8992
     
    109112      Content.VariableItemList.Add(new StringValue(name));
    110113      if (!Content.PreprocessingData.InputVariables.Contains(name) && Content.PreprocessingData.TargetVariable != name) {
    111         var listViewItem = checkedItemList.ItemsListView.FindItemWithText(name, false, 0, false);
     114        var listViewItem = variablesListView.FindItemWithText(name, false, 0, false);
    112115        listViewItem.ForeColor = Color.LightGray;
    113116      }
     
    118121        Content.VariableItemList.Remove(stringValue);
    119122    }
    120     protected virtual void UpdateVariable(string name) {
    121     }
    122     protected virtual void ResetAllVariables() {
     123    protected virtual void UpdateVariable(string name) { }
     124    protected virtual void ResetAllVariables() { }
     125    protected virtual void CheckedChangedUpdate() { }
     126
     127    private void checkInputsTargetButton_Click(object sender, System.EventArgs e) {
     128      SuppressCheckedChangedUpdate = true;
     129      foreach (var name in Content.VariableItemList) {
     130        var isInputTarget = Content.PreprocessingData.InputVariables.Contains(name.Value) || Content.PreprocessingData.TargetVariable == name.Value;
     131        Content.VariableItemList.SetItemCheckedState(name, isInputTarget);
     132      }
     133      SuppressCheckedChangedUpdate = false;
     134      CheckedChangedUpdate();
    123135    }
    124136
    125     protected virtual void PreprocessingData_SelctionChanged(object sender, EventArgs e) {
     137    private void checkAllButton_Click(object sender, System.EventArgs e) {
     138      SuppressCheckedChangedUpdate = true;
     139      foreach (var name in Content.VariableItemList) {
     140        Content.VariableItemList.SetItemCheckedState(name, true);
     141      }
     142      SuppressCheckedChangedUpdate = false;
     143      CheckedChangedUpdate();
    126144    }
    127145
    128     #region ContextMenu Events
    129     private void variablesListcontextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) {
    130       var data = Content.PreprocessingData;
    131       checkInputsTargetToolStripMenuItem.Text = "Check Inputs" + (data.TargetVariable != null ? "+Target" : "");
    132       checkOnlyInputsTargetToolStripMenuItem.Text = "Check only Inputs" + (data.TargetVariable != null ? "+Target" : "");
     146    private void uncheckAllButton_Click(object sender, System.EventArgs e) {
     147      SuppressCheckedChangedUpdate = true;
     148      foreach (var name in Content.VariableItemList) {
     149        Content.VariableItemList.SetItemCheckedState(name, false);
     150      }
     151      SuppressCheckedChangedUpdate = false;
     152      CheckedChangedUpdate();
    133153    }
    134     private void checkInputsTargetToolStripMenuItem_Click(object sender, EventArgs e) {
    135       foreach (var name in checkedItemList.Content) {
    136         var isInputTarget = Content.PreprocessingData.InputVariables.Contains(name.Value) || Content.PreprocessingData.TargetVariable == name.Value;
    137         if (isInputTarget) {
    138           checkedItemList.Content.SetItemCheckedState(name, true);
    139         }
    140       }
    141     }
    142     private void checkOnlyInputsTargetToolStripMenuItem_Click(object sender, EventArgs e) {
    143       foreach (var name in checkedItemList.Content) {
    144         var isInputTarget = Content.PreprocessingData.InputVariables.Contains(name.Value) || Content.PreprocessingData.TargetVariable == name.Value;
    145         checkedItemList.Content.SetItemCheckedState(name, isInputTarget);
    146       }
    147     }
    148     private void checkAllToolStripMenuItem_Click(object sender, EventArgs e) {
    149       foreach (var name in checkedItemList.Content) {
    150         checkedItemList.Content.SetItemCheckedState(name, true);
    151       }
    152     }
    153     private void uncheckAllToolStripMenuItem_Click(object sender, EventArgs e) {
    154       foreach (var name in checkedItemList.Content) {
    155         checkedItemList.Content.SetItemCheckedState(name, false);
    156       }
    157     }
    158     #endregion
    159154  }
    160155}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.Designer.cs

    r14186 r15242  
    2222#endregion
    2323
    24 namespace HeuristicLab.Problems.DataAnalysis.Views {
     24namespace HeuristicLab.DataPreprocessing.Views {
    2525  partial class PreprocessingFeatureCorrelationView {
    2626    /// <summary>
     
    4848    private void InitializeComponent() {
    4949      this.components = new System.ComponentModel.Container();
     50      this.checkInputsTargetButton = new System.Windows.Forms.Button();
     51      this.uncheckAllButton = new System.Windows.Forms.Button();
     52      this.checkAllButton = new System.Windows.Forms.Button();
     53      this.correlationView = new HeuristicLab.Problems.DataAnalysis.Views.FeatureCorrelationView();
     54      this.variablesLabel = new System.Windows.Forms.Label();
     55      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     56      this.SuspendLayout();
     57      //
     58      // checkInputsTargetButton
     59      //
     60      this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs;
     61      this.checkInputsTargetButton.Location = new System.Drawing.Point(736, 5);
     62      this.checkInputsTargetButton.Name = "checkInputsTargetButton";
     63      this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24);
     64      this.checkInputsTargetButton.TabIndex = 14;
     65      this.toolTip.SetToolTip(this.checkInputsTargetButton, "Inputs & Target Variables");
     66      this.checkInputsTargetButton.UseVisualStyleBackColor = true;
     67      this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click);
     68      //
     69      // uncheckAllButton
     70      //
     71      this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None;
     72      this.uncheckAllButton.Location = new System.Drawing.Point(766, 5);
     73      this.uncheckAllButton.Name = "uncheckAllButton";
     74      this.uncheckAllButton.Size = new System.Drawing.Size(24, 24);
     75      this.uncheckAllButton.TabIndex = 12;
     76      this.toolTip.SetToolTip(this.uncheckAllButton, "None");
     77      this.uncheckAllButton.UseVisualStyleBackColor = true;
     78      this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click);
     79      //
     80      // checkAllButton
     81      //
     82      this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All;
     83      this.checkAllButton.Location = new System.Drawing.Point(706, 5);
     84      this.checkAllButton.Name = "checkAllButton";
     85      this.checkAllButton.Size = new System.Drawing.Size(24, 24);
     86      this.checkAllButton.TabIndex = 13;
     87      this.toolTip.SetToolTip(this.checkAllButton, "All");
     88      this.checkAllButton.UseVisualStyleBackColor = true;
     89      this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click);
     90      //
     91      // correlationView
     92      //
     93      this.correlationView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     94            | System.Windows.Forms.AnchorStyles.Left)
     95            | System.Windows.Forms.AnchorStyles.Right)));
     96      this.correlationView.Caption = "Feature Correlation View";
     97      this.correlationView.Content = null;
     98      this.correlationView.Location = new System.Drawing.Point(0, 0);
     99      this.correlationView.Name = "correlationView";
     100      this.correlationView.ReadOnly = false;
     101      this.correlationView.Size = new System.Drawing.Size(1013, 640);
     102      this.correlationView.TabIndex = 18;
     103      //
     104      // variablesLabel
     105      //
     106      this.variablesLabel.AutoSize = true;
     107      this.variablesLabel.Location = new System.Drawing.Point(650, 11);
     108      this.variablesLabel.Name = "variablesLabel";
     109      this.variablesLabel.Size = new System.Drawing.Size(50, 13);
     110      this.variablesLabel.TabIndex = 15;
     111      this.variablesLabel.Text = "Variables";
     112      //
     113      // PreprocessingFeatureCorrelationView
     114      //
     115      this.Controls.Add(this.variablesLabel);
     116      this.Controls.Add(this.checkInputsTargetButton);
     117      this.Controls.Add(this.uncheckAllButton);
     118      this.Controls.Add(this.checkAllButton);
     119      this.Controls.Add(this.correlationView);
     120      this.Name = "PreprocessingFeatureCorrelationView";
     121      this.Size = new System.Drawing.Size(1013, 640);
    50122      this.ResumeLayout(false);
     123      this.PerformLayout();
     124
    51125    }
    52126
    53127    #endregion
     128    private System.Windows.Forms.Button checkInputsTargetButton;
     129    private System.Windows.Forms.Button uncheckAllButton;
     130    private System.Windows.Forms.Button checkAllButton;
     131    private HeuristicLab.Problems.DataAnalysis.Views.FeatureCorrelationView correlationView;
     132    private System.Windows.Forms.ToolTip toolTip;
     133    private System.Windows.Forms.Label variablesLabel;
    54134  }
    55135}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs

    r14186 r15242  
    2020#endregion
    2121
    22 using System.Windows.Forms;
    23 using HeuristicLab.DataPreprocessing;
     22using System;
     23using System.Linq;
     24using HeuristicLab.Data.Views;
    2425using HeuristicLab.MainForm;
    2526using HeuristicLab.MainForm.WindowsForms;
    2627
    27 namespace HeuristicLab.Problems.DataAnalysis.Views {
     28namespace HeuristicLab.DataPreprocessing.Views {
    2829  [View("Preprocessing Feature Correlation View")]
    29   [Content(typeof(CorrelationMatrixContent), false)]
     30  [Content(typeof(CorrelationMatrixContent), true)]
    3031  public partial class PreprocessingFeatureCorrelationView : AsynchronousContentView {
    31 
    3232    public new CorrelationMatrixContent Content {
    3333      get { return (CorrelationMatrixContent)base.Content; }
     
    3535    }
    3636
    37     FeatureCorrelationView correlationView;
    38 
    3937    public PreprocessingFeatureCorrelationView() {
    4038      InitializeComponent();
    41       correlationView = new FeatureCorrelationView();
    42       correlationView.Dock = DockStyle.Fill;
    43       this.Controls.Add(correlationView);
    4439    }
    45 
    4640
    4741    protected override void RegisterContentEvents() {
     
    6155    protected override void OnContentChanged() {
    6256      base.OnContentChanged();
    63       if (Content == null) {
    64         correlationView.Content = null;
     57      correlationView.Content = Content != null ? Content.ProblemData : null;
     58    }
     59
     60    #region Check Variables
     61    private void checkAllButton_Click(object sender, System.EventArgs e) {
     62      SetVisibility(x => true);
     63    }
     64    private void checkInputsTargetButton_Click(object sender, System.EventArgs e) {
     65      var ppd = Content.PreprocessingData;
     66      SetVisibility(x => ppd.InputVariables.Contains(x) || ppd.TargetVariable == x);
     67    }
     68    private void uncheckAllButton_Click(object sender, System.EventArgs e) {
     69      SetVisibility(x => false);
     70    }
     71    private void SetVisibility(Func<string, bool> check) {
     72      var dataView = (EnhancedStringConvertibleMatrixView)correlationView.Controls.Find("DataView", searchAllChildren: true).Single();
     73      var ppd = Content.PreprocessingData;
     74      var visibilities = ppd.VariableNames.Where((v, i) => ppd.VariableHasType<double>(i)).Select(check).ToList();
     75      if (dataView.Content.Rows != dataView.Content.Columns || dataView.Content.Rows != visibilities.Count)
    6576        return;
    66       }
    6777
    68       correlationView.Content = Content.ProblemData;
     78      dataView.ColumnVisibility = visibilities;
     79      dataView.RowVisibility = visibilities;
     80      dataView.UpdateColumnHeaders();
     81      dataView.UpdateRowHeaders();
    6982    }
     83    #endregion
    7084  }
    7185}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingIcons.resx

    r15110 r15242  
    120120  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    121121  <data name="All" type="System.Resources.ResXFileRef, System.Windows.Forms">
    122     <value>icons\all.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     122    <value>Icons\All.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
    123123  </data>
    124124  <data name="Inputs" type="System.Resources.ResXFileRef, System.Windows.Forms">
    125     <value>icons\inputs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     125    <value>Icons\Inputs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
    126126  </data>
    127127  <data name="None" type="System.Resources.ResXFileRef, System.Windows.Forms">
    128     <value>icons\none.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     128    <value>Icons\None.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
    129129  </data>
    130130</root>
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/RenameColumnsDialog.cs

    r14186 r15242  
    2626namespace HeuristicLab.DataPreprocessing.Views {
    2727  public partial class RenameColumnsDialog : Form {
    28 
    2928    public IList<string> ColumnNames {
    3029      get {
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.Designer.cs

    r14963 r15242  
    5353      this.bodyTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
    5454      this.sizeGroupBox = new System.Windows.Forms.GroupBox();
     55      this.heightNumericUpDown = new System.Windows.Forms.NumericUpDown();
     56      this.widthNumericUpDown = new System.Windows.Forms.NumericUpDown();
    5557      this.heightLabel = new System.Windows.Forms.Label();
    5658      this.widthLabel = new System.Windows.Forms.Label();
    57       this.heightTrackBar = new System.Windows.Forms.TrackBar();
    58       this.widthTrackBar = new System.Windows.Forms.TrackBar();
     59      this.lockAspectCheckBox = new System.Windows.Forms.CheckBox();
     60      this.pointSizeNumericUpDown = new System.Windows.Forms.NumericUpDown();
     61      this.pointSizeLabel = new System.Windows.Forms.Label();
     62      this.regressionGroupBox = new System.Windows.Forms.GroupBox();
     63      this.regressionTypeComboBox = new System.Windows.Forms.ComboBox();
     64      this.polynomialRegressionOrderNumericUpDown = new System.Windows.Forms.NumericUpDown();
     65      this.orderLabel = new System.Windows.Forms.Label();
     66      this.regressionTyleLabel = new System.Windows.Forms.Label();
     67      this.groupingOptionsBox = new System.Windows.Forms.GroupBox();
     68      this.legendGroupBox = new System.Windows.Forms.GroupBox();
     69      this.legendCheckbox = new System.Windows.Forms.CheckBox();
     70      this.legendOrderComboBox = new System.Windows.Forms.ComboBox();
     71      this.legendOrderLabel = new System.Windows.Forms.Label();
     72      this.aggregationLabel = new System.Windows.Forms.Label();
     73      this.aggregationComboBox = new System.Windows.Forms.ComboBox();
     74      this.groupingComboBox = new System.Windows.Forms.ComboBox();
     75      this.opacityLabel = new System.Windows.Forms.Label();
     76      this.pointOpacityNumericUpDown = new System.Windows.Forms.NumericUpDown();
     77      this.pointsGroupBox = new System.Windows.Forms.GroupBox();
    5978      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    6079      this.splitContainer.Panel1.SuspendLayout();
     
    6685      this.bodyScrollPanel.SuspendLayout();
    6786      this.sizeGroupBox.SuspendLayout();
    68       ((System.ComponentModel.ISupportInitialize)(this.heightTrackBar)).BeginInit();
    69       ((System.ComponentModel.ISupportInitialize)(this.widthTrackBar)).BeginInit();
     87      ((System.ComponentModel.ISupportInitialize)(this.heightNumericUpDown)).BeginInit();
     88      ((System.ComponentModel.ISupportInitialize)(this.widthNumericUpDown)).BeginInit();
     89      ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).BeginInit();
     90      this.regressionGroupBox.SuspendLayout();
     91      ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).BeginInit();
     92      this.groupingOptionsBox.SuspendLayout();
     93      this.legendGroupBox.SuspendLayout();
     94      ((System.ComponentModel.ISupportInitialize)(this.pointOpacityNumericUpDown)).BeginInit();
     95      this.pointsGroupBox.SuspendLayout();
    7096      this.SuspendLayout();
    7197      //
    72       // checkedItemList
    73       //
    74       this.checkedItemList.Size = new System.Drawing.Size(113, 369);
    75       //
    7698      // splitContainer
    7799      //
     
    80102      //
    81103      this.splitContainer.Panel1.Controls.Add(this.sizeGroupBox);
     104      this.splitContainer.Panel1.Controls.Add(this.pointsGroupBox);
     105      this.splitContainer.Panel1.Controls.Add(this.groupingOptionsBox);
     106      this.splitContainer.Panel1.Controls.Add(this.regressionGroupBox);
    82107      //
    83108      // splitContainer.Panel2
    84109      //
    85110      this.splitContainer.Panel2.Controls.Add(this.frameTableLayoutPanel);
    86       this.splitContainer.Size = new System.Drawing.Size(863, 520);
    87       this.splitContainer.SplitterDistance = 120;
     111      this.splitContainer.Size = new System.Drawing.Size(589, 451);
    88112      //
    89113      // frameTableLayoutPanel
     
    101125      this.frameTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
    102126      this.frameTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
    103       this.frameTableLayoutPanel.Size = new System.Drawing.Size(739, 520);
     127      this.frameTableLayoutPanel.Size = new System.Drawing.Size(405, 451);
    104128      this.frameTableLayoutPanel.TabIndex = 0;
    105129      //
     
    111135      this.columnHeaderScrollPanel.Margin = new System.Windows.Forms.Padding(0);
    112136      this.columnHeaderScrollPanel.Name = "columnHeaderScrollPanel";
    113       this.columnHeaderScrollPanel.Size = new System.Drawing.Size(699, 40);
     137      this.columnHeaderScrollPanel.Size = new System.Drawing.Size(365, 40);
    114138      this.columnHeaderScrollPanel.TabIndex = 3;
    115139      //
     
    138162      this.rowHeaderScrollPanel.Margin = new System.Windows.Forms.Padding(0);
    139163      this.rowHeaderScrollPanel.Name = "rowHeaderScrollPanel";
    140       this.rowHeaderScrollPanel.Size = new System.Drawing.Size(40, 480);
     164      this.rowHeaderScrollPanel.Size = new System.Drawing.Size(40, 411);
    141165      this.rowHeaderScrollPanel.TabIndex = 4;
    142166      //
     
    166190      this.bodyScrollPanel.Margin = new System.Windows.Forms.Padding(0);
    167191      this.bodyScrollPanel.Name = "bodyScrollPanel";
    168       this.bodyScrollPanel.Size = new System.Drawing.Size(699, 480);
     192      this.bodyScrollPanel.Size = new System.Drawing.Size(365, 411);
    169193      this.bodyScrollPanel.TabIndex = 5;
    170194      this.bodyScrollPanel.Scroll += new System.Windows.Forms.ScrollEventHandler(this.bodyScrollPanel_Scroll);
     
    188212      // sizeGroupBox
    189213      //
    190       this.sizeGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
    191             | System.Windows.Forms.AnchorStyles.Right)));
     214      this.sizeGroupBox.Controls.Add(this.heightNumericUpDown);
     215      this.sizeGroupBox.Controls.Add(this.widthNumericUpDown);
    192216      this.sizeGroupBox.Controls.Add(this.heightLabel);
    193217      this.sizeGroupBox.Controls.Add(this.widthLabel);
    194       this.sizeGroupBox.Controls.Add(this.heightTrackBar);
    195       this.sizeGroupBox.Controls.Add(this.widthTrackBar);
    196       this.sizeGroupBox.Location = new System.Drawing.Point(4, 379);
     218      this.sizeGroupBox.Controls.Add(this.lockAspectCheckBox);
     219      this.sizeGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom;
     220      this.sizeGroupBox.Location = new System.Drawing.Point(0, 78);
    197221      this.sizeGroupBox.Name = "sizeGroupBox";
    198       this.sizeGroupBox.Size = new System.Drawing.Size(113, 124);
     222      this.sizeGroupBox.Size = new System.Drawing.Size(180, 98);
    199223      this.sizeGroupBox.TabIndex = 5;
    200224      this.sizeGroupBox.TabStop = false;
    201225      this.sizeGroupBox.Text = "Chart Size";
    202226      //
     227      // heightNumericUpDown
     228      //
     229      this.heightNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     230            | System.Windows.Forms.AnchorStyles.Right)));
     231      this.heightNumericUpDown.Increment = new decimal(new int[] {
     232            50,
     233            0,
     234            0,
     235            0});
     236      this.heightNumericUpDown.Location = new System.Drawing.Point(50, 46);
     237      this.heightNumericUpDown.Maximum = new decimal(new int[] {
     238            100000,
     239            0,
     240            0,
     241            0});
     242      this.heightNumericUpDown.Name = "heightNumericUpDown";
     243      this.heightNumericUpDown.Size = new System.Drawing.Size(124, 20);
     244      this.heightNumericUpDown.TabIndex = 4;
     245      this.heightNumericUpDown.Value = new decimal(new int[] {
     246            225,
     247            0,
     248            0,
     249            0});
     250      this.heightNumericUpDown.ValueChanged += new System.EventHandler(this.heightNumericUpDown_ValueChanged);
     251      //
     252      // widthNumericUpDown
     253      //
     254      this.widthNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     255            | System.Windows.Forms.AnchorStyles.Right)));
     256      this.widthNumericUpDown.Increment = new decimal(new int[] {
     257            50,
     258            0,
     259            0,
     260            0});
     261      this.widthNumericUpDown.Location = new System.Drawing.Point(50, 20);
     262      this.widthNumericUpDown.Maximum = new decimal(new int[] {
     263            10000,
     264            0,
     265            0,
     266            0});
     267      this.widthNumericUpDown.Name = "widthNumericUpDown";
     268      this.widthNumericUpDown.Size = new System.Drawing.Size(124, 20);
     269      this.widthNumericUpDown.TabIndex = 3;
     270      this.widthNumericUpDown.Value = new decimal(new int[] {
     271            300,
     272            0,
     273            0,
     274            0});
     275      this.widthNumericUpDown.ValueChanged += new System.EventHandler(this.widthNumericUpDown_ValueChanged);
     276      //
    203277      // heightLabel
    204278      //
    205279      this.heightLabel.AutoSize = true;
    206       this.heightLabel.Location = new System.Drawing.Point(6, 64);
     280      this.heightLabel.Location = new System.Drawing.Point(6, 48);
    207281      this.heightLabel.Name = "heightLabel";
    208282      this.heightLabel.Size = new System.Drawing.Size(41, 13);
     
    213287      //
    214288      this.widthLabel.AutoSize = true;
    215       this.widthLabel.Location = new System.Drawing.Point(6, 16);
     289      this.widthLabel.Location = new System.Drawing.Point(6, 22);
    216290      this.widthLabel.Name = "widthLabel";
    217291      this.widthLabel.Size = new System.Drawing.Size(38, 13);
     
    219293      this.widthLabel.Text = "Width:";
    220294      //
    221       // heightTrackBar
    222       //
    223       this.heightTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    224             | System.Windows.Forms.AnchorStyles.Right)));
    225       this.heightTrackBar.LargeChange = 50;
    226       this.heightTrackBar.Location = new System.Drawing.Point(6, 83);
    227       this.heightTrackBar.Maximum = 100;
    228       this.heightTrackBar.Name = "heightTrackBar";
    229       this.heightTrackBar.Size = new System.Drawing.Size(101, 45);
    230       this.heightTrackBar.SmallChange = 10;
    231       this.heightTrackBar.TabIndex = 0;
    232       this.heightTrackBar.TickFrequency = 10;
    233       this.heightTrackBar.Value = 20;
    234       this.heightTrackBar.ValueChanged += new System.EventHandler(this.heightTrackBar_ValueChanged);
    235       //
    236       // widthTrackBar
    237       //
    238       this.widthTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    239             | System.Windows.Forms.AnchorStyles.Right)));
    240       this.widthTrackBar.LargeChange = 50;
    241       this.widthTrackBar.Location = new System.Drawing.Point(6, 32);
    242       this.widthTrackBar.Maximum = 100;
    243       this.widthTrackBar.Name = "widthTrackBar";
    244       this.widthTrackBar.Size = new System.Drawing.Size(101, 45);
    245       this.widthTrackBar.SmallChange = 10;
    246       this.widthTrackBar.TabIndex = 0;
    247       this.widthTrackBar.TickFrequency = 10;
    248       this.widthTrackBar.Value = 20;
    249       this.widthTrackBar.ValueChanged += new System.EventHandler(this.widthTrackBar_ValueChanged);
     295      // lockAspectCheckBox
     296      //
     297      this.lockAspectCheckBox.AutoSize = true;
     298      this.lockAspectCheckBox.Checked = true;
     299      this.lockAspectCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     300      this.lockAspectCheckBox.Location = new System.Drawing.Point(50, 73);
     301      this.lockAspectCheckBox.Name = "lockAspectCheckBox";
     302      this.lockAspectCheckBox.Size = new System.Drawing.Size(114, 17);
     303      this.lockAspectCheckBox.TabIndex = 6;
     304      this.lockAspectCheckBox.Text = "Lock Aspect Ratio";
     305      this.lockAspectCheckBox.UseVisualStyleBackColor = true;
     306      //
     307      // pointSizeNumericUpDown
     308      //
     309      this.pointSizeNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     310            | System.Windows.Forms.AnchorStyles.Right)));
     311      this.pointSizeNumericUpDown.Location = new System.Drawing.Point(58, 15);
     312      this.pointSizeNumericUpDown.Maximum = new decimal(new int[] {
     313            50,
     314            0,
     315            0,
     316            0});
     317      this.pointSizeNumericUpDown.Minimum = new decimal(new int[] {
     318            1,
     319            0,
     320            0,
     321            0});
     322      this.pointSizeNumericUpDown.Name = "pointSizeNumericUpDown";
     323      this.pointSizeNumericUpDown.Size = new System.Drawing.Size(116, 20);
     324      this.pointSizeNumericUpDown.TabIndex = 8;
     325      this.pointSizeNumericUpDown.Value = new decimal(new int[] {
     326            3,
     327            0,
     328            0,
     329            0});
     330      this.pointSizeNumericUpDown.ValueChanged += new System.EventHandler(this.pointSizeNumericUpDown_ValueChanged);
     331      //
     332      // pointSizeLabel
     333      //
     334      this.pointSizeLabel.AutoSize = true;
     335      this.pointSizeLabel.Location = new System.Drawing.Point(6, 17);
     336      this.pointSizeLabel.Name = "pointSizeLabel";
     337      this.pointSizeLabel.Size = new System.Drawing.Size(30, 13);
     338      this.pointSizeLabel.TabIndex = 7;
     339      this.pointSizeLabel.Text = "Size:";
     340      //
     341      // regressionGroupBox
     342      //
     343      this.regressionGroupBox.Controls.Add(this.regressionTypeComboBox);
     344      this.regressionGroupBox.Controls.Add(this.polynomialRegressionOrderNumericUpDown);
     345      this.regressionGroupBox.Controls.Add(this.orderLabel);
     346      this.regressionGroupBox.Controls.Add(this.regressionTyleLabel);
     347      this.regressionGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom;
     348      this.regressionGroupBox.Location = new System.Drawing.Point(0, 376);
     349      this.regressionGroupBox.Name = "regressionGroupBox";
     350      this.regressionGroupBox.Size = new System.Drawing.Size(180, 75);
     351      this.regressionGroupBox.TabIndex = 3;
     352      this.regressionGroupBox.TabStop = false;
     353      this.regressionGroupBox.Text = "Regression";
     354      //
     355      // regressionTypeComboBox
     356      //
     357      this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     358            | System.Windows.Forms.AnchorStyles.Right)));
     359      this.regressionTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     360      this.regressionTypeComboBox.FormattingEnabled = true;
     361      this.regressionTypeComboBox.Location = new System.Drawing.Point(67, 19);
     362      this.regressionTypeComboBox.Name = "regressionTypeComboBox";
     363      this.regressionTypeComboBox.Size = new System.Drawing.Size(107, 21);
     364      this.regressionTypeComboBox.TabIndex = 14;
     365      this.regressionTypeComboBox.SelectedValueChanged += new System.EventHandler(this.regressionTypeComboBox_SelectedValueChanged);
     366      //
     367      // polynomialRegressionOrderNumericUpDown
     368      //
     369      this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     370            | System.Windows.Forms.AnchorStyles.Right)));
     371      this.polynomialRegressionOrderNumericUpDown.Location = new System.Drawing.Point(67, 45);
     372      this.polynomialRegressionOrderNumericUpDown.Margin = new System.Windows.Forms.Padding(9, 3, 3, 3);
     373      this.polynomialRegressionOrderNumericUpDown.Maximum = new decimal(new int[] {
     374            6,
     375            0,
     376            0,
     377            0});
     378      this.polynomialRegressionOrderNumericUpDown.Minimum = new decimal(new int[] {
     379            2,
     380            0,
     381            0,
     382            0});
     383      this.polynomialRegressionOrderNumericUpDown.Name = "polynomialRegressionOrderNumericUpDown";
     384      this.polynomialRegressionOrderNumericUpDown.Size = new System.Drawing.Size(107, 20);
     385      this.polynomialRegressionOrderNumericUpDown.TabIndex = 15;
     386      this.polynomialRegressionOrderNumericUpDown.Value = new decimal(new int[] {
     387            2,
     388            0,
     389            0,
     390            0});
     391      this.polynomialRegressionOrderNumericUpDown.ValueChanged += new System.EventHandler(this.polynomialRegressionOrderNumericUpDown_ValueChanged);
     392      //
     393      // orderLabel
     394      //
     395      this.orderLabel.AutoSize = true;
     396      this.orderLabel.Location = new System.Drawing.Point(6, 47);
     397      this.orderLabel.Name = "orderLabel";
     398      this.orderLabel.Size = new System.Drawing.Size(36, 13);
     399      this.orderLabel.TabIndex = 16;
     400      this.orderLabel.Text = "Order:";
     401      //
     402      // regressionTyleLabel
     403      //
     404      this.regressionTyleLabel.AutoSize = true;
     405      this.regressionTyleLabel.Location = new System.Drawing.Point(6, 22);
     406      this.regressionTyleLabel.Name = "regressionTyleLabel";
     407      this.regressionTyleLabel.Size = new System.Drawing.Size(34, 13);
     408      this.regressionTyleLabel.TabIndex = 13;
     409      this.regressionTyleLabel.Text = "Type:";
     410      //
     411      // groupingOptionsBox
     412      //
     413      this.groupingOptionsBox.Controls.Add(this.legendGroupBox);
     414      this.groupingOptionsBox.Controls.Add(this.aggregationLabel);
     415      this.groupingOptionsBox.Controls.Add(this.aggregationComboBox);
     416      this.groupingOptionsBox.Controls.Add(this.groupingComboBox);
     417      this.groupingOptionsBox.Dock = System.Windows.Forms.DockStyle.Bottom;
     418      this.groupingOptionsBox.Location = new System.Drawing.Point(0, 245);
     419      this.groupingOptionsBox.Name = "groupingOptionsBox";
     420      this.groupingOptionsBox.Size = new System.Drawing.Size(180, 131);
     421      this.groupingOptionsBox.TabIndex = 8;
     422      this.groupingOptionsBox.TabStop = false;
     423      this.groupingOptionsBox.Text = "Grouping";
     424      //
     425      // legendGroupBox
     426      //
     427      this.legendGroupBox.Controls.Add(this.legendCheckbox);
     428      this.legendGroupBox.Controls.Add(this.legendOrderComboBox);
     429      this.legendGroupBox.Controls.Add(this.legendOrderLabel);
     430      this.legendGroupBox.Enabled = false;
     431      this.legendGroupBox.Location = new System.Drawing.Point(6, 73);
     432      this.legendGroupBox.Name = "legendGroupBox";
     433      this.legendGroupBox.Size = new System.Drawing.Size(167, 50);
     434      this.legendGroupBox.TabIndex = 7;
     435      this.legendGroupBox.TabStop = false;
     436      this.legendGroupBox.Text = "Legend";
     437      //
     438      // legendCheckbox
     439      //
     440      this.legendCheckbox.AutoSize = true;
     441      this.legendCheckbox.Checked = true;
     442      this.legendCheckbox.CheckState = System.Windows.Forms.CheckState.Checked;
     443      this.legendCheckbox.Location = new System.Drawing.Point(56, -1);
     444      this.legendCheckbox.Name = "legendCheckbox";
     445      this.legendCheckbox.Size = new System.Drawing.Size(56, 17);
     446      this.legendCheckbox.TabIndex = 0;
     447      this.legendCheckbox.Text = "Visible";
     448      this.legendCheckbox.UseVisualStyleBackColor = true;
     449      this.legendCheckbox.CheckedChanged += new System.EventHandler(this.legendCheckbox_CheckedChanged);
     450      //
     451      // legendOrderComboBox
     452      //
     453      this.legendOrderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     454      this.legendOrderComboBox.FormattingEnabled = true;
     455      this.legendOrderComboBox.Location = new System.Drawing.Point(49, 19);
     456      this.legendOrderComboBox.Name = "legendOrderComboBox";
     457      this.legendOrderComboBox.Size = new System.Drawing.Size(109, 21);
     458      this.legendOrderComboBox.TabIndex = 5;
     459      this.legendOrderComboBox.SelectedIndexChanged += new System.EventHandler(this.legendOrderComboBox_SelectedIndexChanged);
     460      //
     461      // legendOrderLabel
     462      //
     463      this.legendOrderLabel.AutoSize = true;
     464      this.legendOrderLabel.Location = new System.Drawing.Point(7, 22);
     465      this.legendOrderLabel.Name = "legendOrderLabel";
     466      this.legendOrderLabel.Size = new System.Drawing.Size(36, 13);
     467      this.legendOrderLabel.TabIndex = 4;
     468      this.legendOrderLabel.Text = "Order:";
     469      this.legendOrderLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     470      //
     471      // aggregationLabel
     472      //
     473      this.aggregationLabel.AutoSize = true;
     474      this.aggregationLabel.Enabled = false;
     475      this.aggregationLabel.Location = new System.Drawing.Point(5, 49);
     476      this.aggregationLabel.Name = "aggregationLabel";
     477      this.aggregationLabel.Size = new System.Drawing.Size(67, 13);
     478      this.aggregationLabel.TabIndex = 3;
     479      this.aggregationLabel.Text = "Aggregation:";
     480      //
     481      // aggregationComboBox
     482      //
     483      this.aggregationComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     484            | System.Windows.Forms.AnchorStyles.Right)));
     485      this.aggregationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     486      this.aggregationComboBox.Enabled = false;
     487      this.aggregationComboBox.FormattingEnabled = true;
     488      this.aggregationComboBox.Location = new System.Drawing.Point(79, 46);
     489      this.aggregationComboBox.Name = "aggregationComboBox";
     490      this.aggregationComboBox.Size = new System.Drawing.Size(96, 21);
     491      this.aggregationComboBox.TabIndex = 2;
     492      this.aggregationComboBox.SelectedIndexChanged += new System.EventHandler(this.aggregationComboBox_SelectedIndexChanged);
     493      //
     494      // groupingComboBox
     495      //
     496      this.groupingComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     497            | System.Windows.Forms.AnchorStyles.Right)));
     498      this.groupingComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     499      this.groupingComboBox.FormattingEnabled = true;
     500      this.groupingComboBox.Location = new System.Drawing.Point(6, 19);
     501      this.groupingComboBox.Name = "groupingComboBox";
     502      this.groupingComboBox.Size = new System.Drawing.Size(169, 21);
     503      this.groupingComboBox.TabIndex = 1;
     504      this.groupingComboBox.SelectedIndexChanged += new System.EventHandler(this.groupingComboBox_SelectedIndexChanged);
     505      //
     506      // opacityLabel
     507      //
     508      this.opacityLabel.AutoSize = true;
     509      this.opacityLabel.Location = new System.Drawing.Point(6, 43);
     510      this.opacityLabel.Name = "opacityLabel";
     511      this.opacityLabel.Size = new System.Drawing.Size(46, 13);
     512      this.opacityLabel.TabIndex = 7;
     513      this.opacityLabel.Text = "Opacity:";
     514      //
     515      // pointOpacityNumericUpDown
     516      //
     517      this.pointOpacityNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     518            | System.Windows.Forms.AnchorStyles.Right)));
     519      this.pointOpacityNumericUpDown.DecimalPlaces = 2;
     520      this.pointOpacityNumericUpDown.Increment = new decimal(new int[] {
     521            1,
     522            0,
     523            0,
     524            65536});
     525      this.pointOpacityNumericUpDown.Location = new System.Drawing.Point(58, 41);
     526      this.pointOpacityNumericUpDown.Maximum = new decimal(new int[] {
     527            1,
     528            0,
     529            0,
     530            0});
     531      this.pointOpacityNumericUpDown.Name = "pointOpacityNumericUpDown";
     532      this.pointOpacityNumericUpDown.Size = new System.Drawing.Size(115, 20);
     533      this.pointOpacityNumericUpDown.TabIndex = 8;
     534      this.pointOpacityNumericUpDown.Value = new decimal(new int[] {
     535            1,
     536            0,
     537            0,
     538            0});
     539      this.pointOpacityNumericUpDown.ValueChanged += new System.EventHandler(this.pointOpacityNumericUpDown_ValueChanged);
     540      //
     541      // pointsGroupBox
     542      //
     543      this.pointsGroupBox.Controls.Add(this.pointOpacityNumericUpDown);
     544      this.pointsGroupBox.Controls.Add(this.pointSizeLabel);
     545      this.pointsGroupBox.Controls.Add(this.pointSizeNumericUpDown);
     546      this.pointsGroupBox.Controls.Add(this.opacityLabel);
     547      this.pointsGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom;
     548      this.pointsGroupBox.Location = new System.Drawing.Point(0, 176);
     549      this.pointsGroupBox.Name = "pointsGroupBox";
     550      this.pointsGroupBox.Size = new System.Drawing.Size(180, 69);
     551      this.pointsGroupBox.TabIndex = 4;
     552      this.pointsGroupBox.TabStop = false;
     553      this.pointsGroupBox.Text = "Points";
    250554      //
    251555      // ScatterPlotMultiView
     
    254558      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    255559      this.Name = "ScatterPlotMultiView";
    256       this.Size = new System.Drawing.Size(863, 520);
     560      this.Size = new System.Drawing.Size(589, 451);
    257561      this.splitContainer.Panel1.ResumeLayout(false);
    258562      this.splitContainer.Panel2.ResumeLayout(false);
     
    268572      this.sizeGroupBox.ResumeLayout(false);
    269573      this.sizeGroupBox.PerformLayout();
    270       ((System.ComponentModel.ISupportInitialize)(this.heightTrackBar)).EndInit();
    271       ((System.ComponentModel.ISupportInitialize)(this.widthTrackBar)).EndInit();
     574      ((System.ComponentModel.ISupportInitialize)(this.heightNumericUpDown)).EndInit();
     575      ((System.ComponentModel.ISupportInitialize)(this.widthNumericUpDown)).EndInit();
     576      ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).EndInit();
     577      this.regressionGroupBox.ResumeLayout(false);
     578      this.regressionGroupBox.PerformLayout();
     579      ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).EndInit();
     580      this.groupingOptionsBox.ResumeLayout(false);
     581      this.groupingOptionsBox.PerformLayout();
     582      this.legendGroupBox.ResumeLayout(false);
     583      this.legendGroupBox.PerformLayout();
     584      ((System.ComponentModel.ISupportInitialize)(this.pointOpacityNumericUpDown)).EndInit();
     585      this.pointsGroupBox.ResumeLayout(false);
     586      this.pointsGroupBox.PerformLayout();
    272587      this.ResumeLayout(false);
    273588
     
    284599    private System.Windows.Forms.Panel bodyScrollPanel;
    285600    private System.Windows.Forms.GroupBox sizeGroupBox;
    286     private System.Windows.Forms.TrackBar widthTrackBar;
    287     private System.Windows.Forms.TrackBar heightTrackBar;
    288601    private System.Windows.Forms.Label heightLabel;
    289602    private System.Windows.Forms.Label widthLabel;
     603    private System.Windows.Forms.GroupBox regressionGroupBox;
     604    private System.Windows.Forms.ComboBox regressionTypeComboBox;
     605    private System.Windows.Forms.NumericUpDown polynomialRegressionOrderNumericUpDown;
     606    private System.Windows.Forms.Label orderLabel;
     607    private System.Windows.Forms.Label regressionTyleLabel;
     608    private System.Windows.Forms.GroupBox groupingOptionsBox;
     609    private System.Windows.Forms.ComboBox groupingComboBox;
     610    private System.Windows.Forms.NumericUpDown widthNumericUpDown;
     611    private System.Windows.Forms.NumericUpDown heightNumericUpDown;
     612    private System.Windows.Forms.CheckBox lockAspectCheckBox;
     613    private System.Windows.Forms.NumericUpDown pointSizeNumericUpDown;
     614    private System.Windows.Forms.Label pointSizeLabel;
     615    private System.Windows.Forms.Label aggregationLabel;
     616    private System.Windows.Forms.ComboBox aggregationComboBox;
     617    private System.Windows.Forms.GroupBox pointsGroupBox;
     618    private System.Windows.Forms.NumericUpDown pointOpacityNumericUpDown;
     619    private System.Windows.Forms.Label opacityLabel;
     620    private System.Windows.Forms.Label legendOrderLabel;
     621    private System.Windows.Forms.ComboBox legendOrderComboBox;
     622    private System.Windows.Forms.GroupBox legendGroupBox;
     623    private System.Windows.Forms.CheckBox legendCheckbox;
    290624  }
    291625}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs

    r14963 r15242  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.Drawing;
     
    526using System.Windows.Forms;
    627using HeuristicLab.Analysis;
     28using HeuristicLab.Analysis.Views;
    729using HeuristicLab.Collections;
    8 using HeuristicLab.Common;
    9 using HeuristicLab.Core.Views;
    1030using HeuristicLab.Data;
    1131using HeuristicLab.MainForm;
    1232using HeuristicLab.MainForm.WindowsForms;
     33using AggregationType = HeuristicLab.Analysis.DataTableVisualProperties.DataTableHistogramAggregation;
     34using RegressionType = HeuristicLab.Analysis.ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType;
    1335
    1436namespace HeuristicLab.DataPreprocessing.Views {
    1537  [View("Scatter Plot Multi View")]
    16   [Content(typeof(ScatterPlotContent), false)]
    17   public partial class ScatterPlotMultiView : PreprocessingCheckedVariablesView {
    18     private readonly IDictionary<string, Label> columnHeaderCache;
    19     private readonly IDictionary<string, Label> rowHeaderCache;
    20     private readonly IDictionary<Tuple<string/*col*/, string/*row*/>, ItemView> bodyCache;
     38  [Content(typeof(MultiScatterPlotContent), true)]
     39  public sealed partial class ScatterPlotMultiView : PreprocessingCheckedVariablesView {
     40    private readonly IDictionary<string, Label> columnHeaderCache = new Dictionary<string, Label>();
     41    private readonly IDictionary<string, VerticalLabel> rowHeaderCache = new Dictionary<string, VerticalLabel>();
     42    private readonly IDictionary<Tuple<string/*col*/, string/*row*/>, Control> bodyCache = new Dictionary<Tuple<string, string>, Control>();
     43
     44    public new MultiScatterPlotContent Content {
     45      get { return (MultiScatterPlotContent)base.Content; }
     46      set { base.Content = value; }
     47    }
    2148
    2249    public ScatterPlotMultiView() {
    2350      InitializeComponent();
     51
     52      oldWidth = (int)widthNumericUpDown.Value;
     53      oldHeight = (int)heightNumericUpDown.Value;
     54
     55      regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType));
     56      regressionTypeComboBox.SelectedItem = RegressionType.None;
     57
     58      aggregationComboBox.DataSource = Enum.GetValues(typeof(AggregationType));
     59      aggregationComboBox.SelectedItem = AggregationType.Overlapping;
     60
     61      legendOrderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder));
     62      legendOrderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Alphabetically;
    2463
    2564      #region Initialize Scrollbars
     
    4180      #endregion
    4281
    43       columnHeaderCache = new Dictionary<string, Label>();
    44       rowHeaderCache = new Dictionary<string, Label>();
    45       bodyCache = new Dictionary<Tuple<string, string>, ItemView>();
    46 
    4782      bodyScrollPanel.MouseWheel += bodyScrollPanel_MouseWheel;
    48     }
    49 
    50     public new ScatterPlotContent Content {
    51       get { return (ScatterPlotContent)base.Content; }
    52       set { base.Content = value; }
    5383    }
    5484
     
    5686      base.OnContentChanged();
    5787      if (Content != null) {
    58         GenerateCharts();
    59       }
     88        groupingComboBox.Items.Add(string.Empty);
     89        foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData)) {
     90          groupingComboBox.Items.Add(var);
     91        }
     92        SuppressCheckedChangedUpdate = true;
     93        groupingComboBox.SelectedItem = Content.GroupingVariable ?? string.Empty;
     94        SuppressCheckedChangedUpdate = false;
     95
     96        // uncheck variables that max 20 vars are selected initially
     97        var variables = Content.VariableItemList;
     98        int numChecked = variables.CheckedItems.Count();
     99        if (numChecked > 20) {
     100          string message = string.Format("Display all {0} input variables ({1} charts)?" + Environment.NewLine +
     101                                         "Press No to reduce the number of checked variables to 20." + Environment.NewLine +
     102                                         "Press Cancel to uncheck all.",
     103            numChecked, numChecked * numChecked);
     104          var dialogResult = MessageBox.Show(this, message, "Display All Input Variables?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
     105          if (dialogResult == DialogResult.No || dialogResult == DialogResult.Cancel) {
     106            SuppressCheckedChangedUpdate = true;
     107            IEnumerable<StringValue> toUncheck = variables;
     108            if (dialogResult == DialogResult.No) // only show the first 20
     109              toUncheck = variables.CheckedItems.Reverse().Take(numChecked - 20).Select(x => x.Value);
     110            foreach (var var in toUncheck)
     111              Content.VariableItemList.SetItemCheckedState(var, false);
     112            SuppressCheckedChangedUpdate = false;
     113          }
     114        }
     115        GenerateCharts(true);
     116      }
     117    }
     118
     119    protected override void SetEnabledStateOfControls() {
     120      base.SetEnabledStateOfControls();
     121      var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue;
     122      polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial;
     123      sizeGroupBox.Enabled = Content != null;
     124      pointsGroupBox.Enabled = Content != null;
     125      groupingComboBox.Enabled = Content != null;
     126      regressionGroupBox.Enabled = Content != null;
    60127    }
    61128
    62129    protected override void CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> checkedItems) {
    63130      base.CheckedItemsChanged(sender, checkedItems);
    64       foreach (var variable in checkedItems.Items.Select(i => i.Value.Value)) {
    65         if (IsVariableChecked(variable))
    66           AddChartToTable(variable);
     131      if (SuppressCheckedChangedUpdate) return;
     132
     133      foreach (var variable in checkedItems.Items) {
     134        if (Content.VariableItemList.ItemChecked(variable.Value))
     135          ShowChartOnTable(variable.Value.Value, variable.Index);
    67136        else
    68           RemoveChartFromTable(variable);
    69       }
    70     }
    71 
    72     #region Add and remove charts
     137          HideChartFromTable(variable.Value.Value, variable.Index);
     138      }
     139    }
     140
     141    #region Show and Hide charts
     142    private void ShowChartOnTable(string variable, int idx) {
     143      frameTableLayoutPanel.SuspendLayout();
     144
     145      // show column header
     146      var colH = columnHeaderTableLayoutPanel;
     147      colH.ColumnStyles[idx].Width = GetColumnWidth();
     148      if (colH.GetControlFromPosition(idx, 0) == null)
     149        colH.Controls.Add(GetColumnHeader(variable), idx, 0);
     150      else
     151        colH.GetControlFromPosition(idx, 0).Visible = true;
     152
     153      // show row header
     154      var rowH = rowHeaderTableLayoutPanel;
     155      rowH.RowStyles[idx].Height = GetRowHeight();
     156      if (rowH.GetControlFromPosition(0, idx) == null)
     157        rowH.Controls.Add(GetRowHeader(variable), 0, idx);
     158      else
     159        rowH.GetControlFromPosition(0, idx).Visible = true;
     160
     161      // show body
     162      var body = bodyTableLayoutPanel;
     163      ShowColumnHelper(body, idx, r => GetBody(variable, Content.VariableItemList[r].Value));
     164      ShowRowHelper(body, idx, c => GetBody(Content.VariableItemList[c].Value, variable));
     165
     166      frameTableLayoutPanel.ResumeLayout(true);
     167    }
     168    private void ShowColumnHelper(TableLayoutPanel tlp, int idx, Func<int, Control> creatorFunc) {
     169      tlp.ColumnStyles[idx].Width = GetColumnWidth();
     170      for (int r = 0; r < tlp.RowCount; r++) {
     171        if (Content.VariableItemList.ItemChecked(Content.VariableItemList[r])) {
     172          var control = tlp.GetControlFromPosition(idx, r);
     173          if (control == null)
     174            tlp.Controls.Add(creatorFunc(r), idx, r);
     175          else
     176            control.Visible = true;
     177        }
     178      }
     179    }
     180    private void ShowRowHelper(TableLayoutPanel tlp, int idx, Func<int, Control> creatorFunc) {
     181      tlp.RowStyles[idx].Height = GetRowHeight();
     182      for (int c = 0; c < tlp.ColumnCount; c++) {
     183        if (Content.VariableItemList.ItemChecked(Content.VariableItemList[c])) {
     184          var control = tlp.GetControlFromPosition(c, idx);
     185          if (control == null)
     186            tlp.Controls.Add(creatorFunc(c), c, idx);
     187          else
     188            tlp.GetControlFromPosition(c, idx).Visible = true;
     189        }
     190      }
     191    }
     192
     193    private void HideChartFromTable(string variable, int idx) {
     194      frameTableLayoutPanel.SuspendLayout();
     195
     196      // hide column header
     197      var colH = columnHeaderTableLayoutPanel;
     198      HideColumnHelper(colH, idx);
     199
     200      // hide row header
     201      var rowH = rowHeaderTableLayoutPanel;
     202      HideRowHelper(rowH, idx);
     203
     204      // hide from body
     205      var body = bodyTableLayoutPanel;
     206      HideColumnHelper(body, idx);
     207      HideRowHelper(body, idx);
     208
     209      frameTableLayoutPanel.ResumeLayout(true);
     210    }
     211    private void HideColumnHelper(TableLayoutPanel tlp, int idx) {
     212      tlp.ColumnStyles[idx].Width = 0;
     213      // hide controls
     214      for (int r = 0; r < tlp.RowCount; r++) {
     215        var control = tlp.GetControlFromPosition(idx, r);
     216        if (control != null)
     217          control.Visible = false;
     218      }
     219    }
     220    private void HideRowHelper(TableLayoutPanel tlp, int idx) {
     221      tlp.RowStyles[idx].Height = 0;
     222      // hide controls
     223      for (int c = 0; c < tlp.ColumnCount; c++) {
     224        var control = tlp.GetControlFromPosition(c, idx);
     225        if (control != null)
     226          control.Visible = false;
     227      }
     228    }
     229    #endregion
     230
     231    #region Add/Remove/Update Variable
     232    protected override void AddVariable(string name) {
     233      base.AddVariable(name);
     234      if (IsVariableChecked(name))
     235        AddChartToTable(name);
     236    }
     237    protected override void RemoveVariable(string name) {
     238      base.RemoveVariable(name);
     239
     240      if (IsVariableChecked(name)) {
     241        RemoveChartFromTable(name);
     242      }
     243
     244      // clear caches
     245      columnHeaderCache[name].Dispose();
     246      columnHeaderCache.Remove(name);
     247      rowHeaderCache[name].Dispose();
     248      rowHeaderCache.Remove(name);
     249      var keys = bodyCache.Keys.Where(t => t.Item1 == name || t.Item2 == name).ToList();
     250      foreach (var key in keys) {
     251        bodyCache[key].Dispose();
     252        bodyCache.Remove(key);
     253      }
     254    }
     255    protected override void UpdateVariable(string name) {
     256      base.UpdateVariable(name);
     257      RemoveVariable(name);
     258      AddVariable(name);
     259    }
     260    protected override void ResetAllVariables() {
     261      GenerateCharts(true);
     262    }
     263
    73264    private void AddChartToTable(string variable) {
    74265      frameTableLayoutPanel.SuspendLayout();
    75266
    76267      // find index to insert
    77       var variables = checkedItemList.Content.Select(v => v.Value).ToList();
     268      var variables = Content.VariableItemList.Select(v => v.Value).ToList();
    78269      int idx = variables              // all variables
    79270        .TakeWhile(t => t != variable) // ... until the variable that was checked
     
    102293      tlp.ColumnStyles.Insert(idx, new ColumnStyle(SizeType.Absolute, GetColumnWidth()));
    103294      // shift right
    104       for (int c = tlp.ColumnCount; c >  idx - 1; c--) {
     295      for (int c = tlp.ColumnCount; c > idx - 1; c--) {
    105296        for (int r = 0; r < tlp.RowCount; r++) {
    106297          var control = tlp.GetControlFromPosition(c, r);
     
    192383    #endregion
    193384
    194     #region Add/Remove/Update Variable
    195     protected override void AddVariable(string name) {
    196       base.AddVariable(name);
    197       if (IsVariableChecked(name))
    198         AddChartToTable(name);
    199     }
    200     protected override void RemoveVariable(string name) {
    201       base.RemoveVariable(name);
    202 
    203       // clear caches
    204       columnHeaderCache.Remove(name);
    205       rowHeaderCache.Remove(name);
    206       var keys = bodyCache.Keys.Where(t => t.Item1 == name || t.Item2 == name).ToList();
    207       foreach (var key in keys)
    208         bodyCache.Remove(key);
    209 
    210       if (IsVariableChecked(name)) {
    211         RemoveChartFromTable(name);
    212       }
    213     }
    214     protected override void UpdateVariable(string name) {
    215       base.UpdateVariable(name);
    216       RemoveVariable(name);
    217       AddVariable(name);
    218     }
    219     protected override void ResetAllVariables() {
    220       GenerateCharts();
    221     }
    222     #endregion
    223 
    224     #region Creating Headers and Body
     385    #region Creating Headers and Body
    225386    private Label GetColumnHeader(string variable) {
    226387      if (!columnHeaderCache.ContainsKey(variable)) {
     
    238399    private Label GetRowHeader(string variable) {
    239400      if (!rowHeaderCache.ContainsKey(variable)) {
    240         rowHeaderCache.Add(variable, new Label() {
     401        rowHeaderCache.Add(variable, new VerticalLabel() {
    241402          Text = variable,
    242403          TextAlign = ContentAlignment.MiddleCenter,
    243404          Name = variable,
    244405          Width = rowHeaderTableLayoutPanel.Width,
     406          Height = columnHeaderScrollPanel.Width,
    245407          Dock = DockStyle.Fill,
    246408          Margin = new Padding(3)
     
    249411      return rowHeaderCache[variable];
    250412    }
    251     private ItemView GetBody(string colVariable, string rowVariable) {
     413    private Control GetBody(string colVariable, string rowVariable) {
    252414      var key = Tuple.Create(colVariable, rowVariable);
    253415      if (!bodyCache.ContainsKey(key)) {
    254416        if (rowVariable == colVariable) { // use historgram if x and y variable are equal
    255           PreprocessingDataTable dataTable = new PreprocessingDataTable();
    256           DataRow dataRow = Content.CreateDataRow(rowVariable, DataRowVisualProperties.DataRowChartType.Histogram);
    257           dataTable.Rows.Add(dataRow);
    258           PreprocessingDataTableView pcv = new PreprocessingDataTableView {
     417          var dataTable = HistogramContent.CreateHistogram(
     418            Content.PreprocessingData,
     419            rowVariable,
     420            (string)groupingComboBox.SelectedItem,
     421            (AggregationType)aggregationComboBox.SelectedItem,
     422            (PreprocessingChartContent.LegendOrder)legendOrderComboBox.SelectedItem);
     423          dataTable.VisualProperties.Title = string.Empty;
     424          foreach (var dataRow in dataTable.Rows) {
     425            dataRow.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0;
     426          }
     427          var pcv = new DataTableView {
    259428            Name = key.ToString(),
    260429            Content = dataTable,
    261430            Dock = DockStyle.Fill,
    262             ShowLegend = false,
    263             XAxisFormat = "G3"
     431            ShowChartOnly = true
    264432          };
    265           pcv.ChartDoubleClick += HistogramDoubleClick;
     433          //pcv.ChartDoubleClick += HistogramDoubleClick;  // ToDo: not working; double click is already handled by the chart
    266434          bodyCache.Add(key, pcv);
    267435        } else { //scatter plot
    268           ScatterPlot scatterPlot = Content.CreateScatterPlot(colVariable, rowVariable);
    269           PreprocessingScatterPlotView pspv = new PreprocessingScatterPlotView {
     436          var scatterPlot = ScatterPlotContent.CreateScatterPlot(Content.PreprocessingData,
     437            colVariable,
     438            rowVariable,
     439            (string)groupingComboBox.SelectedItem,
     440            (PreprocessingChartContent.LegendOrder)legendOrderComboBox.SelectedItem);
     441          var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue;
     442          int order = (int)polynomialRegressionOrderNumericUpDown.Value;
     443          int i = 0;
     444          var colors = PreprocessingChartView.Colors;
     445          foreach (var row in scatterPlot.Rows) {
     446            row.VisualProperties.PointSize = (int)pointSizeNumericUpDown.Value;
     447            row.VisualProperties.Color = Color.FromArgb((int)(pointOpacityNumericUpDown.Value * 255),
     448              row.VisualProperties.Color.IsEmpty ? colors[i++ % colors.Length] : row.VisualProperties.Color);
     449            row.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0;
     450            row.VisualProperties.IsRegressionVisibleInLegend = false;
     451            row.VisualProperties.RegressionType = regressionType;
     452            row.VisualProperties.PolynomialRegressionOrder = order;
     453          }
     454          scatterPlot.VisualProperties.Title = string.Empty;
     455          var scatterPlotView = new ScatterPlotView {
    270456            Name = key.ToString(),
    271457            Content = scatterPlot,
    272458            Dock = DockStyle.Fill,
    273             ShowLegend = false,
    274             XAxisFormat = "G3"
     459            ShowName = false
     460            //ShowLegend = false,
     461            //XAxisFormat = "G3"
    275462          };
    276           pspv.ChartDoubleClick += ScatterPlotDoubleClick;
    277           bodyCache.Add(key, pspv);
     463          //scatterPlotView.DoubleClick += ScatterPlotDoubleClick; // ToDo: not working; double click is already handled by the chart
     464          bodyCache.Add(key, scatterPlotView);
    278465        }
    279466      }
     
    282469    #endregion
    283470
     471    protected override void CheckedChangedUpdate() {
     472      GenerateCharts(false); // only checked-changes -> reuse cached values
     473    }
     474
    284475    #region Generate Charts
    285     private void GenerateCharts() {
    286       var variables = GetCheckedVariables();
     476    private void GenerateCharts(bool clearCache) {
     477      if (Content == null || SuppressCheckedChangedUpdate) return;
    287478
    288479      // Clear old layouts and cache
     
    292483        tableLayoutPanel.RowStyles.Clear();
    293484      }
    294       columnHeaderCache.Clear();
    295       rowHeaderCache.Clear();
    296       bodyCache.Clear();
     485
     486      if (clearCache) {
     487        foreach (var control in bodyCache.Values.Concat(columnHeaderCache.Values).Concat(rowHeaderCache.Values)) {
     488          control.Dispose();
     489        }
     490        columnHeaderCache.Clear();
     491        rowHeaderCache.Clear();
     492        bodyCache.Clear();
     493      }
     494
     495      var variables = Content.VariableItemList.Select(x => x.Value).ToList();
    297496
    298497      // Set row and column count
     
    304503      // Set column and row layout
    305504      for (int i = 0; i < variables.Count; i++) {
    306         columnHeaderTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, GetColumnWidth()));
    307         rowHeaderTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, GetRowHeight()));
    308         bodyTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, GetColumnWidth()));
    309         bodyTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, GetRowHeight()));
     505        bool @checked = Content.VariableItemList.ItemChecked(Content.VariableItemList[i]);
     506        columnHeaderTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, @checked ? GetColumnWidth() : 0));
     507        rowHeaderTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, @checked ? GetRowHeight() : 0));
     508        bodyTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, @checked ? GetColumnWidth() : 0));
     509        bodyTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, @checked ? GetRowHeight() : 0));
    310510      }
    311511
     
    318518
    319519    private void AddHeaderToTableLayoutPanels() {
    320       int i = 0;
    321       foreach (var variable in GetCheckedVariables()) {
    322         columnHeaderTableLayoutPanel.Controls.Add(GetColumnHeader(variable), i, 0);
    323         rowHeaderTableLayoutPanel.Controls.Add(GetRowHeader(variable), 0, i);
    324         i++;
     520      for (int i = 0; i < Content.VariableItemList.Count; i++) {
     521        var variable = Content.VariableItemList[i];
     522        if (Content.VariableItemList.ItemChecked(variable)) {
     523          columnHeaderTableLayoutPanel.Controls.Add(GetColumnHeader(variable.Value), i, 0);
     524          rowHeaderTableLayoutPanel.Controls.Add(GetRowHeader(variable.Value), 0, i);
     525        }
    325526      }
    326527    }
    327528    private void AddChartsToTableLayoutPanel() {
    328       int c = 0;
    329       foreach (var colVar in GetCheckedVariables()) {
     529      for (int c = 0; c < Content.VariableItemList.Count; c++) {
     530        var colVar = Content.VariableItemList[c].Value;
    330531        if (!IsVariableChecked(colVar)) continue;
    331         int r = 0;
    332         foreach (var rowVar in GetCheckedVariables()) {
     532        for (int r = 0; r < Content.VariableItemList.Count; r++) {
     533          var rowVar = Content.VariableItemList[r].Value;
    333534          if (!IsVariableChecked(rowVar)) continue;
    334535          bodyTableLayoutPanel.Controls.Add(GetBody(colVar, rowVar), c, r);
    335           r++;
    336         }
    337         c++;
    338       }
     536        }
     537      }
     538      UpdateRegressionLine();
    339539    }
    340540
     
    344544    //Open scatter plot in new tab with new content when double clicked
    345545    private void ScatterPlotDoubleClick(object sender, EventArgs e) {
    346       PreprocessingScatterPlotView pspv = (PreprocessingScatterPlotView)sender;
    347       ScatterPlotContent scatterContent = new ScatterPlotContent(Content, new Cloner());  // create new content
    348       ScatterPlot scatterPlot = pspv.Content;
     546      var scatterPlotView = (ScatterPlotView)sender;
     547      var scatterContent = new SingleScatterPlotContent(Content.PreprocessingData);
     548      ScatterPlot scatterPlot = scatterPlotView.Content;
    349549
    350550      //Extract variable names from scatter plot and set them in content
     
    355555      }
    356556
    357       MainFormManager.MainForm.ShowContent(scatterContent, typeof(ScatterPlotSingleView));  // open in new tab
     557      MainFormManager.MainForm.ShowContent(scatterContent, typeof(ScatterPlotSingleView)); // open in new tab
    358558    }
    359559
    360560    //open histogram in new tab with new content when double clicked
    361561    private void HistogramDoubleClick(object sender, EventArgs e) {
    362       PreprocessingDataTableView pcv = (PreprocessingDataTableView)sender;
     562      DataTableView pcv = (DataTableView)sender;
    363563      HistogramContent histoContent = new HistogramContent(Content.PreprocessingData);  // create new content     
    364       histoContent.VariableItemList = Content.CreateVariableItemList();
    365       PreprocessingDataTable dataTable = pcv.Content;
     564                                                                                        //ToDo: histoContent.VariableItemList = Content.CreateVariableItemList();
     565      var dataTable = pcv.Content;
    366566
    367567      //Set variable item list from with variable from data table
     
    374574        }
    375575      }
    376       MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView));  // open in new tab
     576      MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView)); // open in new tab
    377577    }
    378578    #endregion
     
    413613
    414614    #region Sizing of Charts
    415     private int GetColumnWidth() { return (int)(bodyScrollPanel.Width * ((float)widthTrackBar.Value / 100)); }
    416     private int GetRowHeight() { return (int)(bodyScrollPanel.Height * ((float)heightTrackBar.Value / 100)); }
    417     private void widthTrackBar_ValueChanged(object sender, EventArgs e) {
     615    private int oldWidth;
     616    private int oldHeight;
     617    private float AspectRatio {
     618      get {
     619        if (oldWidth == 0 || oldHeight == 0) return 1;
     620        return (float)oldWidth / oldHeight;
     621      }
     622    }
     623    private bool lockChange = false;
     624
     625    private int GetColumnWidth() { return (int)widthNumericUpDown.Value; }
     626    private int GetRowHeight() { return (int)heightNumericUpDown.Value; }
     627
     628    private void widthNumericUpDown_ValueChanged(object sender, EventArgs e) {
    418629      frameTableLayoutPanel.SuspendRepaint();
     630      if (lockAspectCheckBox.Checked && !lockChange) {
     631        lockChange = true;
     632        heightNumericUpDown.Value = (int)((double)widthNumericUpDown.Value / AspectRatio);
     633        lockChange = false;
     634      }
    419635      for (int i = 0; i < columnHeaderTableLayoutPanel.ColumnCount; i++) {
    420         columnHeaderTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth();
    421         bodyTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth();
    422       }
     636        if (Content.VariableItemList.ItemChecked(Content.VariableItemList[i])) {
     637          columnHeaderTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth();
     638          bodyTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth();
     639        }
     640      }
     641      oldWidth = GetColumnWidth();
     642      oldHeight = GetRowHeight();
    423643      frameTableLayoutPanel.ResumeRepaint(true);
    424644    }
    425     private void heightTrackBar_ValueChanged(object sender, EventArgs e) {
     645    private void heightNumericUpDown_ValueChanged(object sender, EventArgs e) {
    426646      frameTableLayoutPanel.SuspendRepaint();
    427 
     647      if (lockAspectCheckBox.Checked && !lockChange) {
     648        lockChange = true;
     649        widthNumericUpDown.Value = (int)((double)heightNumericUpDown.Value * AspectRatio);
     650        lockChange = false;
     651      }
    428652      for (int i = 0; i < rowHeaderTableLayoutPanel.RowCount; i++) {
    429         rowHeaderTableLayoutPanel.RowStyles[i].Height = GetRowHeight();
    430         bodyTableLayoutPanel.RowStyles[i].Height = GetRowHeight();
    431       }
     653        if (Content.VariableItemList.ItemChecked(Content.VariableItemList[i])) {
     654          rowHeaderTableLayoutPanel.RowStyles[i].Height = GetRowHeight();
     655          bodyTableLayoutPanel.RowStyles[i].Height = GetRowHeight();
     656        }
     657      }
     658      oldWidth = GetColumnWidth();
     659      oldHeight = GetRowHeight();
    432660      frameTableLayoutPanel.ResumeRepaint(true);
     661    }
     662    private void pointSizeNumericUpDown_ValueChanged(object sender, EventArgs e) {
     663      int pointSize = (int)pointSizeNumericUpDown.Value;
     664      foreach (var control in bodyCache.ToList()) {
     665        var scatterPlotView = control.Value as ScatterPlotView;
     666        if (scatterPlotView != null) {
     667          foreach (var row in scatterPlotView.Content.Rows) {
     668            row.VisualProperties.PointSize = pointSize;
     669          }
     670        }
     671      }
     672    }
     673    private void pointOpacityNumericUpDown_ValueChanged(object sender, EventArgs e) {
     674      float opacity = (float)pointOpacityNumericUpDown.Value;
     675      foreach (var control in bodyCache.ToList()) {
     676        var scatterPlotView = control.Value as ScatterPlotView;
     677        if (scatterPlotView != null) {
     678          foreach (var row in scatterPlotView.Content.Rows) {
     679            var color = row.VisualProperties.Color;
     680            if (color.IsEmpty)
     681              color = PreprocessingChartView.Colors.First();
     682            row.VisualProperties.Color = Color.FromArgb((int)(opacity * 255), color);
     683          }
     684        }
     685      }
     686    }
     687    #endregion
     688
     689    #region Regression Line
     690    private void regressionTypeComboBox_SelectedValueChanged(object sender, EventArgs e) {
     691      var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue;
     692      polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial;
     693      UpdateRegressionLine();
     694    }
     695
     696    private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) {
     697      UpdateRegressionLine();
     698    }
     699
     700    private void UpdateRegressionLine() {
     701      var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue;
     702      int order = (int)polynomialRegressionOrderNumericUpDown.Value;
     703
     704      foreach (var control in bodyCache.ToList()) {
     705        // hidden chart => reset cache
     706        if (!bodyTableLayoutPanel.Controls.Contains(control.Value)) {
     707          bodyCache.Remove(control.Key);
     708        }
     709
     710        var scatterPlotView = control.Value as ScatterPlotView;
     711        if (scatterPlotView != null) {
     712          foreach (var row in scatterPlotView.Content.Rows) {
     713            row.VisualProperties.IsRegressionVisibleInLegend = false;
     714            row.VisualProperties.RegressionType = regressionType;
     715            row.VisualProperties.PolynomialRegressionOrder = order;
     716          }
     717        }
     718      }
     719    }
     720    #endregion
     721
     722    #region Grouping
     723    private void groupingComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     724      aggregationLabel.Enabled = groupingComboBox.SelectedIndex > 0;
     725      aggregationComboBox.Enabled = groupingComboBox.SelectedIndex > 0;
     726      legendGroupBox.Enabled = groupingComboBox.SelectedIndex > 0;
     727      GenerateCharts(true); // new series within charts -> clear cache
     728    }
     729
     730    private void aggregationComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     731      var aggregation = (AggregationType)aggregationComboBox.SelectedValue;
     732      foreach (var control in bodyCache.ToList()) {
     733        // hidden chart => reset cache
     734        if (!bodyTableLayoutPanel.Controls.Contains(control.Value)) {
     735          bodyCache.Remove(control.Key);
     736        }
     737
     738        var histogramView = control.Value as DataTableView;
     739        if (histogramView != null) {
     740          histogramView.Content.VisualProperties.HistogramAggregation = aggregation;
     741        }
     742      }
     743    }
     744
     745    private void legendCheckbox_CheckedChanged(object sender, EventArgs e) {
     746      foreach (var control in bodyCache.ToList()) {
     747        var histogramControl = control.Value as DataTableView;
     748        if (histogramControl != null) {
     749          foreach (var row in histogramControl.Content.Rows) {
     750            row.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0;
     751          }
     752        }
     753        var scatterplotControl = control.Value as ScatterPlotView;
     754        if (scatterplotControl != null) {
     755          foreach (var row in scatterplotControl.Content.Rows) {
     756            row.VisualProperties.IsVisibleInLegend = legendCheckbox.Checked && groupingComboBox.SelectedIndex > 0;
     757          }
     758        }
     759      }
     760    }
     761
     762    private void legendOrderComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     763      GenerateCharts(true);
    433764    }
    434765    #endregion
    435766  }
    436767}
     768
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs

    r14186 r15242  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.scatterPlotView = new HeuristicLab.DataPreprocessing.Views.PreprocessingScatterPlotView();
    48       this.groupBox1 = new System.Windows.Forms.GroupBox();
    49       this.label2 = new System.Windows.Forms.Label();
    50       this.label1 = new System.Windows.Forms.Label();
     47      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ScatterPlotSingleView));
     48      this.scatterPlotView = new HeuristicLab.Analysis.Views.ScatterPlotView();
     49      this.variablesGroupBox = new System.Windows.Forms.GroupBox();
     50      this.orderComboBox = new System.Windows.Forms.ComboBox();
     51      this.legendOrderLabel = new System.Windows.Forms.Label();
     52      this.useGradientCheckBox = new System.Windows.Forms.CheckBox();
     53      this.groupLabel = new System.Windows.Forms.Label();
     54      this.yLabel = new System.Windows.Forms.Label();
     55      this.xLabel = new System.Windows.Forms.Label();
     56      this.comboBoxGroup = new System.Windows.Forms.ComboBox();
    5157      this.comboBoxYVariable = new System.Windows.Forms.ComboBox();
    5258      this.comboBoxXVariable = new System.Windows.Forms.ComboBox();
    53       this.label3 = new System.Windows.Forms.Label();
    54       this.comboBoxColor = new System.Windows.Forms.ComboBox();
    55       this.groupBox1.SuspendLayout();
     59      this.regressionGroupBox = new System.Windows.Forms.GroupBox();
     60      this.regressionTypeComboBox = new System.Windows.Forms.ComboBox();
     61      this.polynomialRegressionOrderNumericUpDown = new System.Windows.Forms.NumericUpDown();
     62      this.orderLabel = new System.Windows.Forms.Label();
     63      this.regressionTypeLabel = new System.Windows.Forms.Label();
     64      this.splitContainer = new System.Windows.Forms.SplitContainer();
     65      this.gradientPanel = new System.Windows.Forms.Panel();
     66      this.gradientPictureBox = new System.Windows.Forms.PictureBox();
     67      this.gradientMinimumLabel = new System.Windows.Forms.Label();
     68      this.gradientMaximumLabel = new System.Windows.Forms.Label();
     69      this.variablesGroupBox.SuspendLayout();
     70      this.regressionGroupBox.SuspendLayout();
     71      ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).BeginInit();
     72      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
     73      this.splitContainer.Panel1.SuspendLayout();
     74      this.splitContainer.Panel2.SuspendLayout();
     75      this.splitContainer.SuspendLayout();
     76      this.gradientPanel.SuspendLayout();
     77      ((System.ComponentModel.ISupportInitialize)(this.gradientPictureBox)).BeginInit();
    5678      this.SuspendLayout();
    5779      //
    5880      // scatterPlotView
    5981      //
    60       this.scatterPlotView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    61             | System.Windows.Forms.AnchorStyles.Left)
    62             | System.Windows.Forms.AnchorStyles.Right)));
    63       this.scatterPlotView.Caption = "ScatterPlot View";
     82      this.scatterPlotView.Caption = "View";
    6483      this.scatterPlotView.Content = null;
    65       this.scatterPlotView.Location = new System.Drawing.Point(169, 3);
     84      this.scatterPlotView.Dock = System.Windows.Forms.DockStyle.Fill;
     85      this.scatterPlotView.Location = new System.Drawing.Point(0, 0);
    6686      this.scatterPlotView.Name = "scatterPlotView";
    6787      this.scatterPlotView.ReadOnly = false;
    68       this.scatterPlotView.Size = new System.Drawing.Size(689, 509);
     88      this.scatterPlotView.ShowName = false;
     89      this.scatterPlotView.Size = new System.Drawing.Size(618, 517);
    6990      this.scatterPlotView.TabIndex = 0;
    7091      //
    71       // groupBox1
    72       //
    73       this.groupBox1.Controls.Add(this.label3);
    74       this.groupBox1.Controls.Add(this.label2);
    75       this.groupBox1.Controls.Add(this.label1);
    76       this.groupBox1.Controls.Add(this.comboBoxColor);
    77       this.groupBox1.Controls.Add(this.comboBoxYVariable);
    78       this.groupBox1.Controls.Add(this.comboBoxXVariable);
    79       this.groupBox1.Location = new System.Drawing.Point(3, 3);
    80       this.groupBox1.Name = "groupBox1";
    81       this.groupBox1.Size = new System.Drawing.Size(160, 215);
    82       this.groupBox1.TabIndex = 1;
    83       this.groupBox1.TabStop = false;
    84       this.groupBox1.Text = "Options";
    85       //
    86       // label2
    87       //
    88       this.label2.AutoSize = true;
    89       this.label2.Location = new System.Drawing.Point(17, 80);
    90       this.label2.Name = "label2";
    91       this.label2.Size = new System.Drawing.Size(55, 13);
    92       this.label2.TabIndex = 3;
    93       this.label2.Text = "Y Variable";
    94       //
    95       // label1
    96       //
    97       this.label1.AutoSize = true;
    98       this.label1.Location = new System.Drawing.Point(17, 25);
    99       this.label1.Name = "label1";
    100       this.label1.Size = new System.Drawing.Size(55, 13);
    101       this.label1.TabIndex = 2;
    102       this.label1.Text = "X Variable";
     92      // variablesGroupBox
     93      //
     94      this.variablesGroupBox.Controls.Add(this.orderComboBox);
     95      this.variablesGroupBox.Controls.Add(this.legendOrderLabel);
     96      this.variablesGroupBox.Controls.Add(this.useGradientCheckBox);
     97      this.variablesGroupBox.Controls.Add(this.groupLabel);
     98      this.variablesGroupBox.Controls.Add(this.yLabel);
     99      this.variablesGroupBox.Controls.Add(this.xLabel);
     100      this.variablesGroupBox.Controls.Add(this.comboBoxGroup);
     101      this.variablesGroupBox.Controls.Add(this.comboBoxYVariable);
     102      this.variablesGroupBox.Controls.Add(this.comboBoxXVariable);
     103      this.variablesGroupBox.Dock = System.Windows.Forms.DockStyle.Top;
     104      this.variablesGroupBox.Location = new System.Drawing.Point(0, 0);
     105      this.variablesGroupBox.Name = "variablesGroupBox";
     106      this.variablesGroupBox.Size = new System.Drawing.Size(172, 178);
     107      this.variablesGroupBox.TabIndex = 1;
     108      this.variablesGroupBox.TabStop = false;
     109      this.variablesGroupBox.Text = "Variables";
     110      //
     111      // orderComboBox
     112      //
     113      this.orderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     114      this.orderComboBox.FormattingEnabled = true;
     115      this.orderComboBox.Location = new System.Drawing.Point(51, 144);
     116      this.orderComboBox.Name = "orderComboBox";
     117      this.orderComboBox.Size = new System.Drawing.Size(115, 21);
     118      this.orderComboBox.TabIndex = 6;
     119      this.orderComboBox.SelectedIndexChanged += new System.EventHandler(this.orderComboBox_SelectedIndexChanged);
     120      //
     121      // legendOrderLabel
     122      //
     123      this.legendOrderLabel.AutoSize = true;
     124      this.legendOrderLabel.Location = new System.Drawing.Point(6, 149);
     125      this.legendOrderLabel.Name = "legendOrderLabel";
     126      this.legendOrderLabel.Size = new System.Drawing.Size(36, 13);
     127      this.legendOrderLabel.TabIndex = 5;
     128      this.legendOrderLabel.Text = "Order:";
     129      this.legendOrderLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     130      //
     131      // useGradientCheckBox
     132      //
     133      this.useGradientCheckBox.AutoSize = true;
     134      this.useGradientCheckBox.Location = new System.Drawing.Point(51, 121);
     135      this.useGradientCheckBox.Name = "useGradientCheckBox";
     136      this.useGradientCheckBox.Size = new System.Drawing.Size(115, 17);
     137      this.useGradientCheckBox.TabIndex = 4;
     138      this.useGradientCheckBox.Text = "Use Color Gradient";
     139      this.useGradientCheckBox.UseVisualStyleBackColor = true;
     140      this.useGradientCheckBox.CheckedChanged += new System.EventHandler(this.useGradientCheckBox_CheckedChanged);
     141      //
     142      // groupLabel
     143      //
     144      this.groupLabel.AutoSize = true;
     145      this.groupLabel.Location = new System.Drawing.Point(6, 97);
     146      this.groupLabel.Name = "groupLabel";
     147      this.groupLabel.Size = new System.Drawing.Size(39, 13);
     148      this.groupLabel.TabIndex = 3;
     149      this.groupLabel.Text = "Group:";
     150      //
     151      // yLabel
     152      //
     153      this.yLabel.AutoSize = true;
     154      this.yLabel.Location = new System.Drawing.Point(6, 63);
     155      this.yLabel.Name = "yLabel";
     156      this.yLabel.Size = new System.Drawing.Size(17, 13);
     157      this.yLabel.TabIndex = 3;
     158      this.yLabel.Text = "Y:";
     159      //
     160      // xLabel
     161      //
     162      this.xLabel.AutoSize = true;
     163      this.xLabel.Location = new System.Drawing.Point(6, 29);
     164      this.xLabel.Name = "xLabel";
     165      this.xLabel.Size = new System.Drawing.Size(17, 13);
     166      this.xLabel.TabIndex = 2;
     167      this.xLabel.Text = "X:";
     168      //
     169      // comboBoxGroup
     170      //
     171      this.comboBoxGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     172            | System.Windows.Forms.AnchorStyles.Right)));
     173      this.comboBoxGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     174      this.comboBoxGroup.FormattingEnabled = true;
     175      this.comboBoxGroup.Location = new System.Drawing.Point(51, 94);
     176      this.comboBoxGroup.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3);
     177      this.comboBoxGroup.Name = "comboBoxGroup";
     178      this.comboBoxGroup.Size = new System.Drawing.Size(115, 21);
     179      this.comboBoxGroup.TabIndex = 1;
     180      this.comboBoxGroup.SelectedIndexChanged += new System.EventHandler(this.comboBoxGroup_SelectedIndexChanged);
    103181      //
    104182      // comboBoxYVariable
    105183      //
     184      this.comboBoxYVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     185            | System.Windows.Forms.AnchorStyles.Right)));
    106186      this.comboBoxYVariable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    107187      this.comboBoxYVariable.FormattingEnabled = true;
    108       this.comboBoxYVariable.Location = new System.Drawing.Point(20, 103);
     188      this.comboBoxYVariable.Location = new System.Drawing.Point(51, 60);
    109189      this.comboBoxYVariable.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3);
    110190      this.comboBoxYVariable.Name = "comboBoxYVariable";
    111       this.comboBoxYVariable.Size = new System.Drawing.Size(121, 21);
     191      this.comboBoxYVariable.Size = new System.Drawing.Size(115, 21);
    112192      this.comboBoxYVariable.TabIndex = 1;
    113       this.comboBoxYVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
     193      this.comboBoxYVariable.SelectedIndexChanged += new System.EventHandler(this.comboBoxYVariable_SelectedIndexChanged);
    114194      //
    115195      // comboBoxXVariable
    116196      //
     197      this.comboBoxXVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     198            | System.Windows.Forms.AnchorStyles.Right)));
    117199      this.comboBoxXVariable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    118200      this.comboBoxXVariable.FormattingEnabled = true;
    119       this.comboBoxXVariable.Location = new System.Drawing.Point(20, 48);
     201      this.comboBoxXVariable.Location = new System.Drawing.Point(51, 26);
    120202      this.comboBoxXVariable.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3);
    121203      this.comboBoxXVariable.Name = "comboBoxXVariable";
    122       this.comboBoxXVariable.Size = new System.Drawing.Size(121, 21);
     204      this.comboBoxXVariable.Size = new System.Drawing.Size(115, 21);
    123205      this.comboBoxXVariable.TabIndex = 0;
    124       this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
    125       //
    126       // label3
    127       //
    128       this.label3.AutoSize = true;
    129       this.label3.Location = new System.Drawing.Point(17, 141);
    130       this.label3.Name = "label3";
    131       this.label3.Size = new System.Drawing.Size(31, 13);
    132       this.label3.TabIndex = 3;
    133       this.label3.Text = "Color";
    134       //
    135       // comboBoxColor
    136       //
    137       this.comboBoxColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    138       this.comboBoxColor.FormattingEnabled = true;
    139       this.comboBoxColor.Location = new System.Drawing.Point(20, 164);
    140       this.comboBoxColor.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3);
    141       this.comboBoxColor.Name = "comboBoxColor";
    142       this.comboBoxColor.Size = new System.Drawing.Size(121, 21);
    143       this.comboBoxColor.TabIndex = 1;
    144       this.comboBoxColor.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
     206      this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBoxXVariable_SelectedIndexChanged);
     207      //
     208      // regressionGroupBox
     209      //
     210      this.regressionGroupBox.Controls.Add(this.regressionTypeComboBox);
     211      this.regressionGroupBox.Controls.Add(this.polynomialRegressionOrderNumericUpDown);
     212      this.regressionGroupBox.Controls.Add(this.orderLabel);
     213      this.regressionGroupBox.Controls.Add(this.regressionTypeLabel);
     214      this.regressionGroupBox.Dock = System.Windows.Forms.DockStyle.Top;
     215      this.regressionGroupBox.Location = new System.Drawing.Point(0, 178);
     216      this.regressionGroupBox.Name = "regressionGroupBox";
     217      this.regressionGroupBox.Size = new System.Drawing.Size(172, 78);
     218      this.regressionGroupBox.TabIndex = 4;
     219      this.regressionGroupBox.TabStop = false;
     220      this.regressionGroupBox.Text = "Regression";
     221      //
     222      // regressionTypeComboBox
     223      //
     224      this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     225            | System.Windows.Forms.AnchorStyles.Right)));
     226      this.regressionTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     227      this.regressionTypeComboBox.FormattingEnabled = true;
     228      this.regressionTypeComboBox.Location = new System.Drawing.Point(51, 19);
     229      this.regressionTypeComboBox.Name = "regressionTypeComboBox";
     230      this.regressionTypeComboBox.Size = new System.Drawing.Size(115, 21);
     231      this.regressionTypeComboBox.TabIndex = 14;
     232      this.regressionTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.regressionTypeComboBox_SelectedIndexChanged);
     233      //
     234      // polynomialRegressionOrderNumericUpDown
     235      //
     236      this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     237            | System.Windows.Forms.AnchorStyles.Right)));
     238      this.polynomialRegressionOrderNumericUpDown.Location = new System.Drawing.Point(51, 47);
     239      this.polynomialRegressionOrderNumericUpDown.Margin = new System.Windows.Forms.Padding(9, 3, 3, 3);
     240      this.polynomialRegressionOrderNumericUpDown.Maximum = new decimal(new int[] {
     241            6,
     242            0,
     243            0,
     244            0});
     245      this.polynomialRegressionOrderNumericUpDown.Minimum = new decimal(new int[] {
     246            2,
     247            0,
     248            0,
     249            0});
     250      this.polynomialRegressionOrderNumericUpDown.Name = "polynomialRegressionOrderNumericUpDown";
     251      this.polynomialRegressionOrderNumericUpDown.Size = new System.Drawing.Size(115, 20);
     252      this.polynomialRegressionOrderNumericUpDown.TabIndex = 15;
     253      this.polynomialRegressionOrderNumericUpDown.Value = new decimal(new int[] {
     254            2,
     255            0,
     256            0,
     257            0});
     258      this.polynomialRegressionOrderNumericUpDown.ValueChanged += new System.EventHandler(this.polynomialRegressionOrderNumericUpDown_ValueChanged);
     259      //
     260      // orderLabel
     261      //
     262      this.orderLabel.AutoSize = true;
     263      this.orderLabel.Location = new System.Drawing.Point(6, 49);
     264      this.orderLabel.Name = "orderLabel";
     265      this.orderLabel.Size = new System.Drawing.Size(36, 13);
     266      this.orderLabel.TabIndex = 16;
     267      this.orderLabel.Text = "Order:";
     268      //
     269      // regressionTypeLabel
     270      //
     271      this.regressionTypeLabel.AutoSize = true;
     272      this.regressionTypeLabel.Location = new System.Drawing.Point(6, 22);
     273      this.regressionTypeLabel.Name = "regressionTypeLabel";
     274      this.regressionTypeLabel.Size = new System.Drawing.Size(34, 13);
     275      this.regressionTypeLabel.TabIndex = 13;
     276      this.regressionTypeLabel.Text = "Type:";
     277      //
     278      // splitContainer
     279      //
     280      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
     281      this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
     282      this.splitContainer.Location = new System.Drawing.Point(0, 0);
     283      this.splitContainer.Name = "splitContainer";
     284      //
     285      // splitContainer.Panel1
     286      //
     287      this.splitContainer.Panel1.Controls.Add(this.regressionGroupBox);
     288      this.splitContainer.Panel1.Controls.Add(this.variablesGroupBox);
     289      //
     290      // splitContainer.Panel2
     291      //
     292      this.splitContainer.Panel2.Controls.Add(this.scatterPlotView);
     293      this.splitContainer.Panel2.Controls.Add(this.gradientPanel);
     294      this.splitContainer.Size = new System.Drawing.Size(863, 517);
     295      this.splitContainer.SplitterDistance = 172;
     296      this.splitContainer.TabIndex = 5;
     297      //
     298      // gradientPanel
     299      //
     300      this.gradientPanel.Controls.Add(this.gradientPictureBox);
     301      this.gradientPanel.Controls.Add(this.gradientMinimumLabel);
     302      this.gradientPanel.Controls.Add(this.gradientMaximumLabel);
     303      this.gradientPanel.Dock = System.Windows.Forms.DockStyle.Right;
     304      this.gradientPanel.Location = new System.Drawing.Point(618, 0);
     305      this.gradientPanel.Name = "gradientPanel";
     306      this.gradientPanel.Size = new System.Drawing.Size(69, 517);
     307      this.gradientPanel.TabIndex = 1;
     308      this.gradientPanel.Visible = false;
     309      //
     310      // gradientPictureBox
     311      //
     312      this.gradientPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     313            | System.Windows.Forms.AnchorStyles.Left)
     314            | System.Windows.Forms.AnchorStyles.Right)));
     315      this.gradientPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     316      this.gradientPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("gradientPictureBox.Image")));
     317      this.gradientPictureBox.Location = new System.Drawing.Point(17, 29);
     318      this.gradientPictureBox.Name = "gradientPictureBox";
     319      this.gradientPictureBox.Size = new System.Drawing.Size(35, 460);
     320      this.gradientPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     321      this.gradientPictureBox.TabIndex = 19;
     322      this.gradientPictureBox.TabStop = false;
     323      //
     324      // gradientMinimumLabel
     325      //
     326      this.gradientMinimumLabel.BackColor = System.Drawing.Color.Transparent;
     327      this.gradientMinimumLabel.Dock = System.Windows.Forms.DockStyle.Bottom;
     328      this.gradientMinimumLabel.Location = new System.Drawing.Point(0, 492);
     329      this.gradientMinimumLabel.Name = "gradientMinimumLabel";
     330      this.gradientMinimumLabel.Size = new System.Drawing.Size(69, 25);
     331      this.gradientMinimumLabel.TabIndex = 18;
     332      this.gradientMinimumLabel.Text = "0.0";
     333      this.gradientMinimumLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter;
     334      //
     335      // gradientMaximumLabel
     336      //
     337      this.gradientMaximumLabel.BackColor = System.Drawing.Color.Transparent;
     338      this.gradientMaximumLabel.Dock = System.Windows.Forms.DockStyle.Top;
     339      this.gradientMaximumLabel.Location = new System.Drawing.Point(0, 0);
     340      this.gradientMaximumLabel.Name = "gradientMaximumLabel";
     341      this.gradientMaximumLabel.Size = new System.Drawing.Size(69, 25);
     342      this.gradientMaximumLabel.TabIndex = 17;
     343      this.gradientMaximumLabel.Text = "1.0";
     344      this.gradientMaximumLabel.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
    145345      //
    146346      // ScatterPlotSingleView
     
    148348      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    149349      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    150       this.Controls.Add(this.groupBox1);
    151       this.Controls.Add(this.scatterPlotView);
     350      this.Controls.Add(this.splitContainer);
    152351      this.Name = "ScatterPlotSingleView";
    153352      this.Size = new System.Drawing.Size(863, 517);
    154       this.groupBox1.ResumeLayout(false);
    155       this.groupBox1.PerformLayout();
     353      this.variablesGroupBox.ResumeLayout(false);
     354      this.variablesGroupBox.PerformLayout();
     355      this.regressionGroupBox.ResumeLayout(false);
     356      this.regressionGroupBox.PerformLayout();
     357      ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).EndInit();
     358      this.splitContainer.Panel1.ResumeLayout(false);
     359      this.splitContainer.Panel2.ResumeLayout(false);
     360      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
     361      this.splitContainer.ResumeLayout(false);
     362      this.gradientPanel.ResumeLayout(false);
     363      ((System.ComponentModel.ISupportInitialize)(this.gradientPictureBox)).EndInit();
    156364      this.ResumeLayout(false);
    157365
     
    160368    #endregion
    161369
    162     private HeuristicLab.DataPreprocessing.Views.PreprocessingScatterPlotView scatterPlotView;
    163     private System.Windows.Forms.GroupBox groupBox1;
    164     private System.Windows.Forms.Label label2;
    165     private System.Windows.Forms.Label label1;
     370    private HeuristicLab.Analysis.Views.ScatterPlotView scatterPlotView;
     371    private System.Windows.Forms.GroupBox variablesGroupBox;
     372    private System.Windows.Forms.Label yLabel;
     373    private System.Windows.Forms.Label xLabel;
    166374    private System.Windows.Forms.ComboBox comboBoxYVariable;
    167375    private System.Windows.Forms.ComboBox comboBoxXVariable;
    168     private System.Windows.Forms.ComboBox comboBoxColor;
    169     private System.Windows.Forms.Label label3;
     376    private System.Windows.Forms.ComboBox comboBoxGroup;
     377    private System.Windows.Forms.Label groupLabel;
     378    private System.Windows.Forms.GroupBox regressionGroupBox;
     379    private System.Windows.Forms.ComboBox regressionTypeComboBox;
     380    private System.Windows.Forms.NumericUpDown polynomialRegressionOrderNumericUpDown;
     381    private System.Windows.Forms.Label orderLabel;
     382    private System.Windows.Forms.Label regressionTypeLabel;
     383    private System.Windows.Forms.SplitContainer splitContainer;
     384    private System.Windows.Forms.CheckBox useGradientCheckBox;
     385    private System.Windows.Forms.Panel gradientPanel;
     386    private System.Windows.Forms.Label gradientMinimumLabel;
     387    private System.Windows.Forms.Label gradientMaximumLabel;
     388    private System.Windows.Forms.PictureBox gradientPictureBox;
     389    private System.Windows.Forms.Label legendOrderLabel;
     390    private System.Windows.Forms.ComboBox orderComboBox;
    170391  }
    171392}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs

    r14186 r15242  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Drawing;
    2425using System.Linq;
    2526using HeuristicLab.Analysis;
     27using HeuristicLab.Common;
    2628using HeuristicLab.Core.Views;
    2729using HeuristicLab.MainForm;
     30using RegressionType = HeuristicLab.Analysis.ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType;
    2831
    2932namespace HeuristicLab.DataPreprocessing.Views {
    3033
    3134  [View("Scatter Plot Single View")]
    32   [Content(typeof(ScatterPlotContent), true)]
    33   public partial class ScatterPlotSingleView : ItemView {
    34 
    35     public new ScatterPlotContent Content {
    36       get { return (ScatterPlotContent)base.Content; }
     35  [Content(typeof(SingleScatterPlotContent), true)]
     36  public sealed partial class ScatterPlotSingleView : ItemView {
     37    private readonly string NoGroupItem = "";
     38
     39    public new SingleScatterPlotContent Content {
     40      get { return (SingleScatterPlotContent)base.Content; }
    3741      set { base.Content = value; }
    3842    }
     
    4044    public ScatterPlotSingleView() {
    4145      InitializeComponent();
    42     }
    43 
    44     public void InitData() {
     46
     47      regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType));
     48      regressionTypeComboBox.SelectedItem = RegressionType.None;
     49      orderComboBox.DataSource = Enum.GetValues(typeof(PreprocessingChartContent.LegendOrder));
     50      orderComboBox.SelectedItem = PreprocessingChartContent.LegendOrder.Alphabetically;
     51    }
     52
     53    protected override void SetEnabledStateOfControls() {
     54      base.SetEnabledStateOfControls();
     55      useGradientCheckBox.Enabled = (string)comboBoxGroup.SelectedItem != NoGroupItem;
     56      gradientPanel.Visible = useGradientCheckBox.Enabled && useGradientCheckBox.Checked; ;
     57    }
     58
     59    protected override void OnContentChanged() {
     60      base.OnContentChanged();
     61      if (Content != null) {
     62        InitData();
     63      }
     64    }
     65
     66    private void InitData() {
    4567      IEnumerable<string> variables = Content.PreprocessingData.GetDoubleVariableNames();
    4668
    47       // add variables to combo boxes
    4869      comboBoxXVariable.Items.Clear();
    4970      comboBoxYVariable.Items.Clear();
    50       comboBoxColor.Items.Clear();
     71      comboBoxGroup.Items.Clear();
     72
    5173      comboBoxXVariable.Items.AddRange(variables.ToArray());
    5274      comboBoxYVariable.Items.AddRange(variables.ToArray());
    53       comboBoxColor.Items.Add("-");
    54       for (int i = 0; i < Content.PreprocessingData.Columns; ++i) {
    55         if (Content.PreprocessingData.VariableHasType<double>(i)) {
    56           double distinctValueCount = Content.PreprocessingData.GetValues<double>(i).GroupBy(x => x).Count();
    57           if (distinctValueCount <= 20)
    58             comboBoxColor.Items.Add(Content.PreprocessingData.GetVariableName(i));
    59         }
    60       }
     75      comboBoxGroup.Items.Add(NoGroupItem);
     76      foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData, 50)) {
     77        comboBoxGroup.Items.Add(var);
     78      }
     79      comboBoxGroup.SelectedItem = Content.GroupingVariable ?? NoGroupItem;
    6180
    6281      // use x and y variable from content
    63       if (Content.SelectedXVariable != null && Content.SelectedYVariable != null && Content.SelectedColorVariable != null) {
     82      if (Content.SelectedXVariable != null && Content.SelectedYVariable != null && Content.GroupingVariable != null) {
    6483        comboBoxXVariable.SelectedItem = Content.SelectedXVariable;
    6584        comboBoxYVariable.SelectedItem = Content.SelectedYVariable;
    66         comboBoxColor.SelectedItem = Content.SelectedColorVariable;
     85        comboBoxGroup.SelectedItem = Content.GroupingVariable;
    6786      } else {
    6887        if (variables.Count() >= 2) {
    6988          comboBoxXVariable.SelectedIndex = 0;
    7089          comboBoxYVariable.SelectedIndex = 1;
    71           comboBoxColor.SelectedIndex = 0;
     90          comboBoxGroup.SelectedIndex = 0;
    7291          UpdateScatterPlot();
    7392        }
     
    7594    }
    7695
    77     protected override void OnContentChanged() {
    78       base.OnContentChanged();
    79       if (Content != null) {
    80         InitData();
    81       }
    82     }
    83 
    84     private void comboBox_SelectedIndexChanged(object sender, EventArgs e) {
    85       UpdateScatterPlot();
    86     }
    87 
    8896    private void UpdateScatterPlot() {
    89       if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null && comboBoxColor.SelectedItem != null) {
    90         //get scatter plot with selected x and y variable
    91         ScatterPlot scatterPlot = Content.CreateScatterPlot(
    92           (string)comboBoxXVariable.SelectedItem,
    93           (string)comboBoxYVariable.SelectedItem,
    94           (string)comboBoxColor.SelectedItem);
     97      if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null && comboBoxGroup.SelectedItem != null) {
     98        var xVariable = (string)comboBoxXVariable.SelectedItem;
     99        var yVariable = (string)comboBoxYVariable.SelectedItem;
     100        var groupVariable = (string)comboBoxGroup.SelectedItem;
     101        var legendOrder = (PreprocessingChartContent.LegendOrder)orderComboBox.SelectedItem;
     102
     103        ScatterPlot scatterPlot = ScatterPlotContent.CreateScatterPlot(Content.PreprocessingData, xVariable, yVariable, groupVariable, legendOrder);
     104        //rows are saved and removed to avoid firing of visual property changed events
     105        var rows = scatterPlot.Rows.ToList();
     106        scatterPlot.Rows.Clear();
     107        var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue;
     108        int order = (int)polynomialRegressionOrderNumericUpDown.Value;
     109        foreach (var row in rows) {
     110          row.VisualProperties.PointSize = 6;
     111          row.VisualProperties.IsRegressionVisibleInLegend = false;
     112          row.VisualProperties.RegressionType = regressionType;
     113          row.VisualProperties.PolynomialRegressionOrder = order;
     114          row.VisualProperties.IsVisibleInLegend = !useGradientCheckBox.Checked;
     115        }
     116        scatterPlot.Rows.AddRange(rows);
     117        var vp = scatterPlot.VisualProperties;
     118        vp.Title = string.Empty;
     119        vp.XAxisTitle = xVariable;
     120        vp.YAxisTitle = yVariable;
     121
    95122        scatterPlotView.Content = scatterPlot;
    96123
     
    98125        this.Content.SelectedXVariable = (string)comboBoxXVariable.SelectedItem;
    99126        this.Content.SelectedYVariable = (string)comboBoxYVariable.SelectedItem;
    100         this.Content.SelectedColorVariable = (string)comboBoxColor.SelectedItem;
    101       }
     127        this.Content.GroupingVariable = (string)comboBoxGroup.SelectedItem;
     128      }
     129    }
     130
     131    private void comboBoxXVariable_SelectedIndexChanged(object sender, EventArgs e) {
     132      var oldPlot = scatterPlotView.Content;
     133      UpdateScatterPlot();
     134      var newPlot = scatterPlotView.Content;
     135
     136      if (oldPlot == null || newPlot == null) return;
     137      newPlot.VisualProperties.YAxisMinimumAuto = oldPlot.VisualProperties.YAxisMinimumAuto;
     138      newPlot.VisualProperties.YAxisMaximumAuto = oldPlot.VisualProperties.YAxisMaximumAuto;
     139      newPlot.VisualProperties.YAxisMinimumFixedValue = oldPlot.VisualProperties.YAxisMinimumFixedValue;
     140      newPlot.VisualProperties.YAxisMaximumFixedValue = oldPlot.VisualProperties.YAxisMaximumFixedValue;
     141
     142      foreach (var x in newPlot.Rows.Zip(oldPlot.Rows, (nr, or) => new { nr, or })) {
     143        var newVisuapProperties = (ScatterPlotDataRowVisualProperties)x.or.VisualProperties.Clone();
     144        newVisuapProperties.DisplayName = x.nr.VisualProperties.DisplayName;
     145        x.nr.VisualProperties = newVisuapProperties;
     146      }
     147    }
     148
     149    private void comboBoxYVariable_SelectedIndexChanged(object sender, EventArgs e) {
     150      SuspendRepaint();
     151      var oldPlot = scatterPlotView.Content;
     152      UpdateScatterPlot();
     153      var newPlot = scatterPlotView.Content;
     154
     155      if (oldPlot == null || newPlot == null) return;
     156      newPlot.VisualProperties.XAxisMinimumAuto = oldPlot.VisualProperties.XAxisMinimumAuto;
     157      newPlot.VisualProperties.XAxisMaximumAuto = oldPlot.VisualProperties.XAxisMaximumAuto;
     158      newPlot.VisualProperties.XAxisMinimumFixedValue = oldPlot.VisualProperties.XAxisMinimumFixedValue;
     159      newPlot.VisualProperties.XAxisMaximumFixedValue = oldPlot.VisualProperties.XAxisMaximumFixedValue;
     160
     161      foreach (var x in newPlot.Rows.Zip(oldPlot.Rows, (nr, or) => new { nr, or })) {
     162        var newVisuapProperties = (ScatterPlotDataRowVisualProperties)x.or.VisualProperties.Clone();
     163        newVisuapProperties.DisplayName = x.nr.VisualProperties.DisplayName;
     164        x.nr.VisualProperties = newVisuapProperties;
     165      }
     166      ResumeRepaint(true);
     167    }
     168
     169    private void comboBoxGroup_SelectedIndexChanged(object sender, EventArgs e) {
     170      useGradientCheckBox.Enabled = (string)comboBoxGroup.SelectedItem != NoGroupItem && Content.PreprocessingData.GetDoubleVariableNames().Contains((string)comboBoxGroup.SelectedItem);
     171      gradientPanel.Visible = useGradientCheckBox.Enabled && useGradientCheckBox.Checked;
     172      UpdateScatterPlot();
     173    }
     174
     175    #region Regression Line
     176    private void regressionTypeComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     177      var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue;
     178      polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial;
     179
     180      UpdateRegressionLine();
     181    }
     182
     183    private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) {
     184      UpdateRegressionLine();
     185    }
     186
     187    private void UpdateRegressionLine() {
     188      if (Content == null) return;
     189
     190      var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue;
     191      int order = (int)polynomialRegressionOrderNumericUpDown.Value;
     192
     193      foreach (var row in scatterPlotView.Content.Rows) {
     194        row.VisualProperties.IsRegressionVisibleInLegend = false;
     195        row.VisualProperties.RegressionType = regressionType;
     196        row.VisualProperties.PolynomialRegressionOrder = order;
     197      }
     198    }
     199    #endregion
     200
     201    private void useGradientCheckBox_CheckedChanged(object sender, EventArgs e) {
     202      gradientPanel.Visible = useGradientCheckBox.Enabled && useGradientCheckBox.Checked;
     203
     204      // remove rows and re-add them later to avoid firing visual property changd events
     205      var rows = scatterPlotView.Content.Rows.ToDictionary(r => r.Name, r => r);
     206      scatterPlotView.Content.Rows.Clear();
     207
     208      if (useGradientCheckBox.Checked) {
     209        var groupVariable = (string)comboBoxGroup.SelectedItem;
     210        if (groupVariable == NoGroupItem) return;
     211
     212        var groupValues = Content.PreprocessingData.GetValues<double>(Content.PreprocessingData.GetColumnIndex(groupVariable))
     213          .Distinct().OrderBy(x => x).ToList();
     214        double min = groupValues.FirstOrDefault(x => !double.IsNaN(x)), max = groupValues.LastOrDefault(x => !double.IsNaN(x));
     215        foreach (var group in groupValues) {
     216          ScatterPlotDataRow row;
     217          if (rows.TryGetValue(group.ToString("R"), out row)) {
     218            row.VisualProperties.Color = GetColor(group, min, max);
     219            row.VisualProperties.IsVisibleInLegend = false;
     220          }
     221        }
     222        gradientMinimumLabel.Text = min.ToString("G5");
     223        gradientMaximumLabel.Text = max.ToString("G5");
     224      } else {
     225        foreach (var row in rows.Values) {
     226          row.VisualProperties.Color = Color.Empty;
     227          row.VisualProperties.IsVisibleInLegend = true;
     228        }
     229      }
     230      scatterPlotView.Content.Rows.AddRange(rows.Values);
     231    }
     232
     233    private static Color GetColor(double value, double min, double max) {
     234      if (double.IsNaN(value)) {
     235        return Color.Black;
     236      }
     237      var colors = ColorGradient.Colors;
     238      int index = (int)((colors.Count - 1) * (value - min) / (max - min));
     239      if (index >= colors.Count) index = colors.Count - 1;
     240      if (index < 0) index = 0;
     241      return colors[index];
     242    }
     243
     244    private void orderComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     245      UpdateScatterPlot();
    102246    }
    103247  }
    104248}
     249
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/SearchAndReplaceDialog.cs

    r14186 r15242  
    4343
    4444  public partial class SearchAndReplaceDialog : Form {
    45     private string[] cmbItemsText = { "Value", "Average", "Median", "Random", "Most Common", "Interpolation" };
    46     private string[] cmbComparisonOperatorText = { "==", "<", "<=", ">", ">=", "!=" };
     45    private static readonly string[] ItemsText = { "Value", "Average", "Median", "Random", "Most Common", "Interpolation" };
     46    private static readonly string[] ComparisonOperatorText = { "==", "<", "<=", ">", ">=", "!=" };
    4747
    4848    public SearchAndReplaceDialog() {
    4949      InitializeComponent();
    50       cmbReplaceWith.Items.AddRange(cmbItemsText);
     50      cmbReplaceWith.Items.AddRange(ItemsText);
    5151      cmbReplaceWith.SelectedIndex = (int)ReplaceAction.Value;
    52       cmbComparisonOperator.Items.AddRange(cmbComparisonOperatorText);
     52      cmbComparisonOperator.Items.AddRange(ComparisonOperatorText);
    5353      cmbComparisonOperator.SelectedIndex = (int)ComparisonOperation.Equal;
    5454    }
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.Designer.cs

    r14186 r15242  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      this.components = new System.ComponentModel.Container();
    4748      this.lblRows = new System.Windows.Forms.Label();
    48       this.txtRows = new System.Windows.Forms.Label();
    4949      this.lblColumns = new System.Windows.Forms.Label();
    5050      this.lblMissingValuesTotal = new System.Windows.Forms.Label();
    51       this.txtColumns = new System.Windows.Forms.Label();
    52       this.txtNumericColumns = new System.Windows.Forms.Label();
    53       this.txtNominalColumns = new System.Windows.Forms.Label();
    5451      this.lblNumericColumns = new System.Windows.Forms.Label();
    5552      this.lblNominalColumns = new System.Windows.Forms.Label();
    56       this.txtMissingValuesTotal = new System.Windows.Forms.Label();
    57       this.dataGridView = new System.Windows.Forms.DataGridView();
    58       ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
     53      this.stringMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
     54      this.showVariablesGroupBox = new System.Windows.Forms.GroupBox();
     55      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     56      this.lblTNumValues = new System.Windows.Forms.Label();
     57      this.orientationGroupBox = new System.Windows.Forms.GroupBox();
     58      this.verticalRadioButton = new System.Windows.Forms.RadioButton();
     59      this.horizontalRadioButton = new System.Windows.Forms.RadioButton();
     60      this.rowsTextBox = new System.Windows.Forms.TextBox();
     61      this.columnsTextBox = new System.Windows.Forms.TextBox();
     62      this.totalValuesTextBox = new System.Windows.Forms.TextBox();
     63      this.overviewTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
     64      this.numericColumnsTextBox = new System.Windows.Forms.TextBox();
     65      this.nominalColumnsTextBox5 = new System.Windows.Forms.TextBox();
     66      this.missingValuesTextBox = new System.Windows.Forms.TextBox();
     67      this.overviewGroupBox = new System.Windows.Forms.GroupBox();
     68      this.checkInputsTargetButton = new System.Windows.Forms.Button();
     69      this.uncheckAllButton = new System.Windows.Forms.Button();
     70      this.checkAllButton = new System.Windows.Forms.Button();
     71      this.showVariablesGroupBox.SuspendLayout();
     72      this.orientationGroupBox.SuspendLayout();
     73      this.overviewTableLayoutPanel.SuspendLayout();
     74      this.overviewGroupBox.SuspendLayout();
    5975      this.SuspendLayout();
    6076      //
     
    6278      //
    6379      this.lblRows.AutoSize = true;
    64       this.lblRows.Location = new System.Drawing.Point(3, 11);
     80      this.lblRows.Dock = System.Windows.Forms.DockStyle.Fill;
     81      this.lblRows.Location = new System.Drawing.Point(3, 0);
    6582      this.lblRows.Name = "lblRows";
    66       this.lblRows.Size = new System.Drawing.Size(34, 13);
     83      this.lblRows.Size = new System.Drawing.Size(52, 26);
    6784      this.lblRows.TabIndex = 0;
    68       this.lblRows.Text = "Rows";
    69       //
    70       // txtRows
    71       //
    72       this.txtRows.AutoSize = true;
    73       this.txtRows.Location = new System.Drawing.Point(115, 11);
    74       this.txtRows.Name = "txtRows";
    75       this.txtRows.Size = new System.Drawing.Size(19, 13);
    76       this.txtRows.TabIndex = 1;
    77       this.txtRows.Text = "12";
     85      this.lblRows.Text = "Datarows";
     86      this.lblRows.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    7887      //
    7988      // lblColumns
    8089      //
    8190      this.lblColumns.AutoSize = true;
    82       this.lblColumns.Location = new System.Drawing.Point(3, 31);
     91      this.lblColumns.Dock = System.Windows.Forms.DockStyle.Fill;
     92      this.lblColumns.Location = new System.Drawing.Point(3, 26);
    8393      this.lblColumns.Name = "lblColumns";
    84       this.lblColumns.Size = new System.Drawing.Size(47, 13);
     94      this.lblColumns.Size = new System.Drawing.Size(52, 26);
    8595      this.lblColumns.TabIndex = 2;
    86       this.lblColumns.Text = "Columns";
     96      this.lblColumns.Text = "Variables";
     97      this.lblColumns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    8798      //
    8899      // lblMissingValuesTotal
    89100      //
    90101      this.lblMissingValuesTotal.AutoSize = true;
    91       this.lblMissingValuesTotal.Location = new System.Drawing.Point(3, 92);
     102      this.lblMissingValuesTotal.Dock = System.Windows.Forms.DockStyle.Fill;
     103      this.lblMissingValuesTotal.Location = new System.Drawing.Point(275, 26);
    92104      this.lblMissingValuesTotal.Name = "lblMissingValuesTotal";
    93       this.lblMissingValuesTotal.Size = new System.Drawing.Size(100, 13);
     105      this.lblMissingValuesTotal.Size = new System.Drawing.Size(77, 26);
    94106      this.lblMissingValuesTotal.TabIndex = 3;
    95       this.lblMissingValuesTotal.Text = "Missing Values total";
    96       //
    97       // txtColumns
    98       //
    99       this.txtColumns.AutoSize = true;
    100       this.txtColumns.Location = new System.Drawing.Point(115, 31);
    101       this.txtColumns.Name = "txtColumns";
    102       this.txtColumns.Size = new System.Drawing.Size(25, 13);
    103       this.txtColumns.TabIndex = 1;
    104       this.txtColumns.Text = "123";
    105       //
    106       // txtNumericColumns
    107       //
    108       this.txtNumericColumns.AutoSize = true;
    109       this.txtNumericColumns.Location = new System.Drawing.Point(115, 51);
    110       this.txtNumericColumns.Name = "txtNumericColumns";
    111       this.txtNumericColumns.Size = new System.Drawing.Size(25, 13);
    112       this.txtNumericColumns.TabIndex = 1;
    113       this.txtNumericColumns.Text = "456";
    114       //
    115       // txtNominalColumns
    116       //
    117       this.txtNominalColumns.AutoSize = true;
    118       this.txtNominalColumns.Location = new System.Drawing.Point(115, 72);
    119       this.txtNominalColumns.Name = "txtNominalColumns";
    120       this.txtNominalColumns.Size = new System.Drawing.Size(25, 13);
    121       this.txtNominalColumns.TabIndex = 1;
    122       this.txtNominalColumns.Text = "789";
     107      this.lblMissingValuesTotal.Text = "Missing Values";
     108      this.lblMissingValuesTotal.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    123109      //
    124110      // lblNumericColumns
    125111      //
    126112      this.lblNumericColumns.AutoSize = true;
    127       this.lblNumericColumns.Location = new System.Drawing.Point(3, 51);
     113      this.lblNumericColumns.Dock = System.Windows.Forms.DockStyle.Fill;
     114      this.lblNumericColumns.Location = new System.Drawing.Point(119, 0);
    128115      this.lblNumericColumns.Name = "lblNumericColumns";
    129       this.lblNumericColumns.Size = new System.Drawing.Size(89, 13);
     116      this.lblNumericColumns.Size = new System.Drawing.Size(92, 26);
    130117      this.lblNumericColumns.TabIndex = 3;
    131       this.lblNumericColumns.Text = "Numeric Columns";
     118      this.lblNumericColumns.Text = "Numeric Variables";
     119      this.lblNumericColumns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    132120      //
    133121      // lblNominalColumns
    134122      //
    135123      this.lblNominalColumns.AutoSize = true;
    136       this.lblNominalColumns.Location = new System.Drawing.Point(3, 72);
     124      this.lblNominalColumns.Dock = System.Windows.Forms.DockStyle.Fill;
     125      this.lblNominalColumns.Location = new System.Drawing.Point(119, 26);
    137126      this.lblNominalColumns.Name = "lblNominalColumns";
    138       this.lblNominalColumns.Size = new System.Drawing.Size(88, 13);
     127      this.lblNominalColumns.Size = new System.Drawing.Size(92, 26);
    139128      this.lblNominalColumns.TabIndex = 3;
    140       this.lblNominalColumns.Text = "Nominal Columns";
    141       //
    142       // txtMissingValuesTotal
    143       //
    144       this.txtMissingValuesTotal.AutoSize = true;
    145       this.txtMissingValuesTotal.Location = new System.Drawing.Point(115, 92);
    146       this.txtMissingValuesTotal.Name = "txtMissingValuesTotal";
    147       this.txtMissingValuesTotal.Size = new System.Drawing.Size(25, 13);
    148       this.txtMissingValuesTotal.TabIndex = 1;
    149       this.txtMissingValuesTotal.Text = "102";
    150       //
    151       // dataGridView
    152       //
    153       this.dataGridView.AllowUserToAddRows = false;
    154       this.dataGridView.AllowUserToDeleteRows = false;
    155       this.dataGridView.AllowUserToOrderColumns = true;
    156       this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    157             | System.Windows.Forms.AnchorStyles.Left)
     129      this.lblNominalColumns.Text = "Nominal Variables";
     130      this.lblNominalColumns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     131      //
     132      // stringMatrixView
     133      //
     134      this.stringMatrixView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     135            | System.Windows.Forms.AnchorStyles.Left)
    158136            | System.Windows.Forms.AnchorStyles.Right)));
    159       this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
    160       this.dataGridView.Location = new System.Drawing.Point(5, 117);
    161       this.dataGridView.Name = "dataGridView";
    162       this.dataGridView.ReadOnly = true;
    163       this.dataGridView.RowHeadersWidth = 80;
    164       this.dataGridView.Size = new System.Drawing.Size(530, 278);
    165       this.dataGridView.TabIndex = 4;
    166       this.dataGridView.VirtualMode = true;
    167       this.dataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dataGridView_CellValueNeeded);
     137      this.stringMatrixView.Caption = "StringConvertibleMatrix View";
     138      this.stringMatrixView.Content = null;
     139      this.stringMatrixView.Location = new System.Drawing.Point(3, 74);
     140      this.stringMatrixView.Name = "stringMatrixView";
     141      this.stringMatrixView.ReadOnly = true;
     142      this.stringMatrixView.ShowRowsAndColumnsTextBox = false;
     143      this.stringMatrixView.ShowStatisticalInformation = true;
     144      this.stringMatrixView.Size = new System.Drawing.Size(655, 374);
     145      this.stringMatrixView.TabIndex = 4;
     146      //
     147      // showVariablesGroupBox
     148      //
     149      this.showVariablesGroupBox.Controls.Add(this.checkInputsTargetButton);
     150      this.showVariablesGroupBox.Controls.Add(this.uncheckAllButton);
     151      this.showVariablesGroupBox.Controls.Add(this.checkAllButton);
     152      this.showVariablesGroupBox.Location = new System.Drawing.Point(458, 0);
     153      this.showVariablesGroupBox.Name = "showVariablesGroupBox";
     154      this.showVariablesGroupBox.Size = new System.Drawing.Size(97, 71);
     155      this.showVariablesGroupBox.TabIndex = 16;
     156      this.showVariablesGroupBox.TabStop = false;
     157      this.showVariablesGroupBox.Text = "Show Variables";
     158      //
     159      // lblTNumValues
     160      //
     161      this.lblTNumValues.AutoSize = true;
     162      this.lblTNumValues.Dock = System.Windows.Forms.DockStyle.Fill;
     163      this.lblTNumValues.Location = new System.Drawing.Point(275, 0);
     164      this.lblTNumValues.Name = "lblTNumValues";
     165      this.lblTNumValues.Size = new System.Drawing.Size(77, 26);
     166      this.lblTNumValues.TabIndex = 2;
     167      this.lblTNumValues.Text = "Total Values";
     168      this.lblTNumValues.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     169      this.toolTip.SetToolTip(this.lblTNumValues, "Valid Values (excl. missing Values)");
     170      //
     171      // orientationGroupBox
     172      //
     173      this.orientationGroupBox.Controls.Add(this.verticalRadioButton);
     174      this.orientationGroupBox.Controls.Add(this.horizontalRadioButton);
     175      this.orientationGroupBox.Location = new System.Drawing.Point(561, 0);
     176      this.orientationGroupBox.Name = "orientationGroupBox";
     177      this.orientationGroupBox.Size = new System.Drawing.Size(94, 71);
     178      this.orientationGroupBox.TabIndex = 17;
     179      this.orientationGroupBox.TabStop = false;
     180      this.orientationGroupBox.Text = "Orientation";
     181      //
     182      // verticalRadioButton
     183      //
     184      this.verticalRadioButton.AutoSize = true;
     185      this.verticalRadioButton.Checked = true;
     186      this.verticalRadioButton.Location = new System.Drawing.Point(6, 32);
     187      this.verticalRadioButton.Name = "verticalRadioButton";
     188      this.verticalRadioButton.Size = new System.Drawing.Size(60, 17);
     189      this.verticalRadioButton.TabIndex = 1;
     190      this.verticalRadioButton.TabStop = true;
     191      this.verticalRadioButton.Text = "Vertical";
     192      this.verticalRadioButton.UseVisualStyleBackColor = true;
     193      this.verticalRadioButton.CheckedChanged += new System.EventHandler(this.verticalRadioButton_CheckedChanged);
     194      //
     195      // horizontalRadioButton
     196      //
     197      this.horizontalRadioButton.AutoSize = true;
     198      this.horizontalRadioButton.Location = new System.Drawing.Point(6, 14);
     199      this.horizontalRadioButton.Name = "horizontalRadioButton";
     200      this.horizontalRadioButton.Size = new System.Drawing.Size(72, 17);
     201      this.horizontalRadioButton.TabIndex = 0;
     202      this.horizontalRadioButton.Text = "Horizontal";
     203      this.horizontalRadioButton.UseVisualStyleBackColor = true;
     204      this.horizontalRadioButton.CheckedChanged += new System.EventHandler(this.horizontalRadioButton_CheckedChanged);
     205      //
     206      // rowsTextBox
     207      //
     208      this.rowsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     209      this.rowsTextBox.Location = new System.Drawing.Point(61, 3);
     210      this.rowsTextBox.Name = "rowsTextBox";
     211      this.rowsTextBox.ReadOnly = true;
     212      this.rowsTextBox.Size = new System.Drawing.Size(52, 20);
     213      this.rowsTextBox.TabIndex = 18;
     214      this.rowsTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     215      //
     216      // columnsTextBox
     217      //
     218      this.columnsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     219      this.columnsTextBox.Location = new System.Drawing.Point(61, 29);
     220      this.columnsTextBox.Name = "columnsTextBox";
     221      this.columnsTextBox.ReadOnly = true;
     222      this.columnsTextBox.Size = new System.Drawing.Size(52, 20);
     223      this.columnsTextBox.TabIndex = 18;
     224      this.columnsTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     225      //
     226      // totalValuesTextBox
     227      //
     228      this.totalValuesTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     229      this.totalValuesTextBox.Location = new System.Drawing.Point(358, 3);
     230      this.totalValuesTextBox.Name = "totalValuesTextBox";
     231      this.totalValuesTextBox.ReadOnly = true;
     232      this.totalValuesTextBox.Size = new System.Drawing.Size(82, 20);
     233      this.totalValuesTextBox.TabIndex = 18;
     234      this.totalValuesTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     235      //
     236      // overviewTableLayoutPanel
     237      //
     238      this.overviewTableLayoutPanel.ColumnCount = 6;
     239      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     240      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 28.57143F));
     241      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     242      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 28.57143F));
     243      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     244      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 42.85715F));
     245      this.overviewTableLayoutPanel.Controls.Add(this.lblRows, 0, 0);
     246      this.overviewTableLayoutPanel.Controls.Add(this.lblColumns, 0, 1);
     247      this.overviewTableLayoutPanel.Controls.Add(this.columnsTextBox, 1, 1);
     248      this.overviewTableLayoutPanel.Controls.Add(this.lblNominalColumns, 2, 1);
     249      this.overviewTableLayoutPanel.Controls.Add(this.lblNumericColumns, 2, 0);
     250      this.overviewTableLayoutPanel.Controls.Add(this.rowsTextBox, 1, 0);
     251      this.overviewTableLayoutPanel.Controls.Add(this.numericColumnsTextBox, 3, 0);
     252      this.overviewTableLayoutPanel.Controls.Add(this.nominalColumnsTextBox5, 3, 1);
     253      this.overviewTableLayoutPanel.Controls.Add(this.missingValuesTextBox, 5, 1);
     254      this.overviewTableLayoutPanel.Controls.Add(this.lblTNumValues, 4, 0);
     255      this.overviewTableLayoutPanel.Controls.Add(this.totalValuesTextBox, 5, 0);
     256      this.overviewTableLayoutPanel.Controls.Add(this.lblMissingValuesTotal, 4, 1);
     257      this.overviewTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     258      this.overviewTableLayoutPanel.Location = new System.Drawing.Point(3, 16);
     259      this.overviewTableLayoutPanel.Name = "overviewTableLayoutPanel";
     260      this.overviewTableLayoutPanel.RowCount = 3;
     261      this.overviewTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     262      this.overviewTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     263      this.overviewTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
     264      this.overviewTableLayoutPanel.Size = new System.Drawing.Size(443, 52);
     265      this.overviewTableLayoutPanel.TabIndex = 19;
     266      //
     267      // numericColumnsTextBox
     268      //
     269      this.numericColumnsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     270      this.numericColumnsTextBox.Location = new System.Drawing.Point(217, 3);
     271      this.numericColumnsTextBox.Name = "numericColumnsTextBox";
     272      this.numericColumnsTextBox.ReadOnly = true;
     273      this.numericColumnsTextBox.Size = new System.Drawing.Size(52, 20);
     274      this.numericColumnsTextBox.TabIndex = 18;
     275      this.numericColumnsTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     276      //
     277      // nominalColumnsTextBox5
     278      //
     279      this.nominalColumnsTextBox5.Dock = System.Windows.Forms.DockStyle.Fill;
     280      this.nominalColumnsTextBox5.Location = new System.Drawing.Point(217, 29);
     281      this.nominalColumnsTextBox5.Name = "nominalColumnsTextBox5";
     282      this.nominalColumnsTextBox5.ReadOnly = true;
     283      this.nominalColumnsTextBox5.Size = new System.Drawing.Size(52, 20);
     284      this.nominalColumnsTextBox5.TabIndex = 18;
     285      this.nominalColumnsTextBox5.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     286      //
     287      // missingValuesTextBox
     288      //
     289      this.missingValuesTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     290      this.missingValuesTextBox.Location = new System.Drawing.Point(358, 29);
     291      this.missingValuesTextBox.Name = "missingValuesTextBox";
     292      this.missingValuesTextBox.ReadOnly = true;
     293      this.missingValuesTextBox.Size = new System.Drawing.Size(82, 20);
     294      this.missingValuesTextBox.TabIndex = 18;
     295      this.missingValuesTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
     296      //
     297      // overviewGroupBox
     298      //
     299      this.overviewGroupBox.Controls.Add(this.overviewTableLayoutPanel);
     300      this.overviewGroupBox.Location = new System.Drawing.Point(3, 0);
     301      this.overviewGroupBox.Name = "overviewGroupBox";
     302      this.overviewGroupBox.Size = new System.Drawing.Size(449, 71);
     303      this.overviewGroupBox.TabIndex = 20;
     304      this.overviewGroupBox.TabStop = false;
     305      this.overviewGroupBox.Text = "Overview";
     306      //
     307      // checkInputsTargetButton
     308      //
     309      this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs;
     310      this.checkInputsTargetButton.Location = new System.Drawing.Point(36, 19);
     311      this.checkInputsTargetButton.Name = "checkInputsTargetButton";
     312      this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24);
     313      this.checkInputsTargetButton.TabIndex = 14;
     314      this.toolTip.SetToolTip(this.checkInputsTargetButton, "Show Inputs & Target");
     315      this.checkInputsTargetButton.UseVisualStyleBackColor = true;
     316      this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click);
     317      //
     318      // uncheckAllButton
     319      //
     320      this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None;
     321      this.uncheckAllButton.Location = new System.Drawing.Point(66, 19);
     322      this.uncheckAllButton.Name = "uncheckAllButton";
     323      this.uncheckAllButton.Size = new System.Drawing.Size(24, 24);
     324      this.uncheckAllButton.TabIndex = 12;
     325      this.toolTip.SetToolTip(this.uncheckAllButton, "Show None");
     326      this.uncheckAllButton.UseVisualStyleBackColor = true;
     327      this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click);
     328      //
     329      // checkAllButton
     330      //
     331      this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All;
     332      this.checkAllButton.Location = new System.Drawing.Point(6, 19);
     333      this.checkAllButton.Name = "checkAllButton";
     334      this.checkAllButton.Size = new System.Drawing.Size(24, 24);
     335      this.checkAllButton.TabIndex = 13;
     336      this.toolTip.SetToolTip(this.checkAllButton, "Show All");
     337      this.checkAllButton.UseVisualStyleBackColor = true;
     338      this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click);
    168339      //
    169340      // StatisticsView
     
    171342      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    172343      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    173       this.Controls.Add(this.dataGridView);
    174       this.Controls.Add(this.lblNominalColumns);
    175       this.Controls.Add(this.lblNumericColumns);
    176       this.Controls.Add(this.lblMissingValuesTotal);
    177       this.Controls.Add(this.txtMissingValuesTotal);
    178       this.Controls.Add(this.txtNominalColumns);
    179       this.Controls.Add(this.lblColumns);
    180       this.Controls.Add(this.txtNumericColumns);
    181       this.Controls.Add(this.txtColumns);
    182       this.Controls.Add(this.txtRows);
    183       this.Controls.Add(this.lblRows);
     344      this.Controls.Add(this.overviewGroupBox);
     345      this.Controls.Add(this.orientationGroupBox);
     346      this.Controls.Add(this.showVariablesGroupBox);
     347      this.Controls.Add(this.stringMatrixView);
    184348      this.Name = "StatisticsView";
    185       this.Size = new System.Drawing.Size(549, 408);
    186       ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
     349      this.Size = new System.Drawing.Size(661, 451);
     350      this.showVariablesGroupBox.ResumeLayout(false);
     351      this.orientationGroupBox.ResumeLayout(false);
     352      this.orientationGroupBox.PerformLayout();
     353      this.overviewTableLayoutPanel.ResumeLayout(false);
     354      this.overviewTableLayoutPanel.PerformLayout();
     355      this.overviewGroupBox.ResumeLayout(false);
    187356      this.ResumeLayout(false);
    188       this.PerformLayout();
    189357
    190358    }
     
    193361
    194362    private System.Windows.Forms.Label lblRows;
    195     private System.Windows.Forms.Label txtRows;
    196363    private System.Windows.Forms.Label lblColumns;
    197364    private System.Windows.Forms.Label lblMissingValuesTotal;
    198     private System.Windows.Forms.Label txtColumns;
    199     private System.Windows.Forms.Label txtNumericColumns;
    200     private System.Windows.Forms.Label txtNominalColumns;
    201365    private System.Windows.Forms.Label lblNumericColumns;
    202366    private System.Windows.Forms.Label lblNominalColumns;
    203     private System.Windows.Forms.Label txtMissingValuesTotal;
    204     private System.Windows.Forms.DataGridView dataGridView;
     367    private HeuristicLab.Data.Views.StringConvertibleMatrixView stringMatrixView;
     368    private System.Windows.Forms.GroupBox showVariablesGroupBox;
     369    private System.Windows.Forms.Button checkInputsTargetButton;
     370    private System.Windows.Forms.Button uncheckAllButton;
     371    private System.Windows.Forms.Button checkAllButton;
     372    private System.Windows.Forms.ToolTip toolTip;
     373    private System.Windows.Forms.GroupBox orientationGroupBox;
     374    private System.Windows.Forms.RadioButton verticalRadioButton;
     375    private System.Windows.Forms.RadioButton horizontalRadioButton;
     376    private System.Windows.Forms.Label lblTNumValues;
     377    private System.Windows.Forms.TextBox rowsTextBox;
     378    private System.Windows.Forms.TextBox columnsTextBox;
     379    private System.Windows.Forms.TextBox totalValuesTextBox;
     380    private System.Windows.Forms.TableLayoutPanel overviewTableLayoutPanel;
     381    private System.Windows.Forms.TextBox numericColumnsTextBox;
     382    private System.Windows.Forms.TextBox nominalColumnsTextBox5;
     383    private System.Windows.Forms.TextBox missingValuesTextBox;
     384    private System.Windows.Forms.GroupBox overviewGroupBox;
    205385  }
    206386}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.cs

    r14186 r15242  
    2121
    2222using System;
     23using System.Collections;
    2324using System.Collections.Generic;
     25using System.Linq;
    2426using System.Windows.Forms;
    2527using HeuristicLab.Core.Views;
     28using HeuristicLab.Data;
    2629using HeuristicLab.MainForm;
     30using HeuristicLab.MainForm.WindowsForms;
    2731
    2832namespace HeuristicLab.DataPreprocessing.Views {
    29 
    3033  [View("Statistics View")]
    3134  [Content(typeof(StatisticsContent), true)]
    3235  public partial class StatisticsView : ItemView {
    33 
    34     private List<List<string>> columnsRowsMatrix;
    35     private readonly int COLUMNS = 12;
     36    private bool horizontal = false;
     37    private StringMatrix statisticsMatrix;
     38    private static readonly string[] StatisticsNames = new[] {
     39      "Type",
     40      "Missing Values",
     41      "Min",
     42      "Max",
     43      "Median",
     44      "Average",
     45      "Std. Deviation",
     46      "Variance",
     47      "25th Percentile",
     48      "75th Percentile",
     49      "Most Common Value",
     50      "Num. diff. Values"
     51    };
    3652
    3753    public new StatisticsContent Content {
     
    4763      base.OnContentChanged();
    4864      if (Content == null) {
    49         txtRows.Text = "";
    50         txtColumns.Text = "";
    51         txtNumericColumns.Text = "";
    52         txtNominalColumns.Text = "";
    53         txtMissingValuesTotal.Text = "";
    54         dataGridView.Columns.Clear();
     65        rowsTextBox.Text = string.Empty;
     66        columnsTextBox.Text = string.Empty;
     67        numericColumnsTextBox.Text = string.Empty;
     68        nominalColumnsTextBox5.Text = string.Empty;
     69        missingValuesTextBox.Text = string.Empty;
     70        totalValuesTextBox.Text = string.Empty;
     71        stringMatrixView.Content = null;
     72        statisticsMatrix = null;
    5573      } else {
    5674        UpdateData();
     
    5876    }
    5977
    60     /// <summary>
    61     /// Adds eventhandlers to the current instance.
    62     /// </summary>
    6378    protected override void RegisterContentEvents() {
     79      base.RegisterContentEvents();
    6480      Content.Changed += Content_Changed;
    6581    }
    6682
    67 
    68     /// <summary>
    69     /// Removes the eventhandlers from the current instance.
    70     /// </summary>
    7183    protected override void DeregisterContentEvents() {
    7284      Content.Changed -= Content_Changed;
    73     }
    74 
    75     private void UpdateData() {
    76       var logic = Content.StatisticsLogic;
    77       var rowCount = logic.GetRowCount();
    78       txtRows.Text = rowCount.ToString();
    79       txtColumns.Text = logic.GetColumnCount().ToString();
    80       txtNumericColumns.Text = logic.GetNumericColumnCount().ToString();
    81       txtNominalColumns.Text = logic.GetNominalColumnCount().ToString();
    82       txtMissingValuesTotal.Text = logic.GetMissingValueCount().ToString();
    83 
    84       columnsRowsMatrix = new List<List<string>>();
    85       DataGridViewColumn[] columns = new DataGridViewColumn[COLUMNS];
    86       for (int i = 0; i < COLUMNS; ++i) {
    87         var column = new DataGridViewTextBoxColumn();
    88         column.SortMode = DataGridViewColumnSortMode.Automatic;
    89         column.FillWeight = 1;
    90         columns[i] = column;
    91       }
    92 
    93       columns[0].HeaderCell.Value = "Type";
    94       columns[1].HeaderCell.Value = "Missing Values";
    95       columns[2].HeaderCell.Value = "Min";
    96       columns[3].HeaderCell.Value = "Max";
    97       columns[4].HeaderCell.Value = "Median";
    98       columns[5].HeaderCell.Value = "Average";
    99       columns[6].HeaderCell.Value = "std. Deviation";
    100       columns[7].HeaderCell.Value = "Variance";
    101       columns[8].HeaderCell.Value = "25th Percentile";
    102       columns[9].HeaderCell.Value = "75th Percentile";
    103       columns[10].HeaderCell.Value = "Most Common Value";
    104       columns[11].HeaderCell.Value = "Num. diff. Values";
    105 
    106       if (rowCount > 0) {
    107         for (int i = 0; i < logic.GetColumnCount(); ++i) {
    108           columnsRowsMatrix.Add(GetList(i));
    109         }
    110       }
    111 
    112       dataGridView.Columns.Clear();
    113       dataGridView.Columns.AddRange(columns);
    114       dataGridView.RowCount = columnsRowsMatrix.Count;
    115 
    116       for (int i = 0; i < columnsRowsMatrix.Count; ++i) {
    117         dataGridView.Rows[i].HeaderCell.Value = logic.GetVariableName(i);
    118       }
    119 
    120       dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
    121       dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders);
    122       dataGridView.AllowUserToResizeColumns = true;
    123     }
    124 
    125     private List<string> GetList(int i) {
     85      base.DeregisterContentEvents();
     86    }
     87
     88    private void UpdateData(Dictionary<string, bool> oldVisibility = null) {
     89      var logic = Content.StatisticsLogic;
     90      rowsTextBox.Text = logic.GetRowCount().ToString();
     91      columnsTextBox.Text = logic.GetColumnCount().ToString();
     92      numericColumnsTextBox.Text = logic.GetNumericColumnCount().ToString();
     93      nominalColumnsTextBox5.Text = logic.GetNominalColumnCount().ToString();
     94      missingValuesTextBox.Text = logic.GetMissingValueCount().ToString();
     95      totalValuesTextBox.Text = (logic.GetColumnCount() * logic.GetRowCount() - logic.GetMissingValueCount()).ToString();
     96
     97      var variableNames = Content.PreprocessingData.VariableNames.ToList();
     98      if (horizontal)
     99        statisticsMatrix = new StringMatrix(StatisticsNames.Length, Content.PreprocessingData.Columns) {
     100          RowNames = StatisticsView.StatisticsNames,
     101          ColumnNames = variableNames
     102        };
     103      else
     104        statisticsMatrix = new StringMatrix(Content.PreprocessingData.Columns, StatisticsNames.Length) {
     105          RowNames = variableNames,
     106          ColumnNames = StatisticsView.StatisticsNames
     107        };
     108
     109      for (int i = 0; i < logic.GetColumnCount(); i++) {
     110        var data = GetStatistics(i);
     111        for (int j = 0; j < data.Count; j++) {
     112          if (horizontal)
     113            statisticsMatrix[j, i] = data[j];
     114          else
     115            statisticsMatrix[i, j] = data[j];
     116        }
     117      }
     118
     119      stringMatrixView.Parent.SuspendRepaint();
     120      stringMatrixView.Content = statisticsMatrix;
     121
     122      var grid = stringMatrixView.DataGridView;
     123      int idx = 0;
     124      var list = horizontal ? grid.Columns : grid.Rows as IList;
     125      foreach (DataGridViewBand band in list) {
     126        var variable = variableNames[idx++];
     127        if (oldVisibility != null) {
     128          band.Visible = !oldVisibility.ContainsKey(variable) || oldVisibility[variable];
     129        }
     130      }
     131      if (horizontal)
     132        stringMatrixView.UpdateColumnHeaders();
     133      else
     134        stringMatrixView.UpdateRowHeaders();
     135
     136      stringMatrixView.DataGridView.AutoResizeColumns();
     137      stringMatrixView.Parent.ResumeRepaint(true);
     138    }
     139
     140    private List<string> GetStatistics(int varIdx) {
    126141      List<string> list;
    127142      var logic = Content.StatisticsLogic;
    128       if (logic.VariableHasType<double>(i)) {
    129         list = GetDoubleColumns(i);
    130       } else if (logic.VariableHasType<string>(i)) {
    131         list = GetStringColumns(i);
    132       } else if (logic.VariableHasType<DateTime>(i)) {
    133         list = GetDateTimeColumns(i);
     143      if (logic.VariableHasType<double>(varIdx)) {
     144        list = GetDoubleColumns(varIdx);
     145      } else if (logic.VariableHasType<string>(varIdx)) {
     146        list = GetStringColumns(varIdx);
     147      } else if (logic.VariableHasType<DateTime>(varIdx)) {
     148        list = GetDateTimeColumns(varIdx);
    134149      } else {
    135150        list = new List<string>();
    136         for (int j = 0; j < COLUMNS; ++j) {
     151        for (int j = 0; j < StatisticsNames.Length; ++j) {
    137152          list.Add("unknown column type");
    138153        }
     
    141156    }
    142157
    143     private List<string> GetDoubleColumns(int columnIndex) {
     158    private List<string> GetDoubleColumns(int statIdx) {
    144159      var logic = Content.StatisticsLogic;
    145160      return new List<string> {
    146         logic.GetColumnTypeAsString(columnIndex),
    147         logic.GetMissingValueCount(columnIndex).ToString(),
    148         logic.GetMin<double>(columnIndex,double.NaN).ToString(),
    149         logic.GetMax<double>(columnIndex,double.NaN).ToString(),
    150         logic.GetMedian(columnIndex).ToString(),
    151         logic.GetAverage(columnIndex).ToString(),
    152         logic.GetStandardDeviation(columnIndex).ToString(),
    153         logic.GetVariance(columnIndex).ToString(),
    154         logic.GetOneQuarterPercentile(columnIndex).ToString(),
    155         logic.GetThreeQuarterPercentile(columnIndex).ToString(),
    156         logic.GetMostCommonValue<double>(columnIndex,double.NaN).ToString(),
    157         logic.GetDifferentValuesCount<double>(columnIndex).ToString()
     161        logic.GetColumnTypeAsString(statIdx),
     162        logic.GetMissingValueCount(statIdx).ToString(),
     163        logic.GetMin<double>(statIdx, double.NaN).ToString(),
     164        logic.GetMax<double>(statIdx, double.NaN).ToString(),
     165        logic.GetMedian(statIdx).ToString(),
     166        logic.GetAverage(statIdx).ToString(),
     167        logic.GetStandardDeviation(statIdx).ToString(),
     168        logic.GetVariance(statIdx).ToString(),
     169        logic.GetOneQuarterPercentile(statIdx).ToString(),
     170        logic.GetThreeQuarterPercentile(statIdx).ToString(),
     171        logic.GetMostCommonValue<double>(statIdx, double.NaN).ToString(),
     172        logic.GetDifferentValuesCount<double>(statIdx).ToString()
    158173      };
    159174    }
    160175
    161     private List<string> GetStringColumns(int columnIndex) {
     176    private List<string> GetStringColumns(int statIdx) {
    162177      var logic = Content.StatisticsLogic;
    163178      return new List<string> {
    164         logic.GetColumnTypeAsString(columnIndex),
    165         logic.GetMissingValueCount(columnIndex).ToString(),
     179        logic.GetColumnTypeAsString(statIdx),
     180        logic.GetMissingValueCount(statIdx).ToString(),
    166181        "", //min
    167182        "", //max
     
    172187        "", //quarter percentile
    173188        "", //three quarter percentile
    174         logic.GetMostCommonValue<string>(columnIndex,string.Empty) ?? "",
    175         logic.GetDifferentValuesCount<string>(columnIndex).ToString()
     189        logic.GetMostCommonValue<string>(statIdx,string.Empty) ?? "",
     190        logic.GetDifferentValuesCount<string>(statIdx).ToString()
    176191      };
    177192    }
    178193
    179     private List<string> GetDateTimeColumns(int columnIndex) {
     194    private List<string> GetDateTimeColumns(int statIdx) {
    180195      var logic = Content.StatisticsLogic;
    181196      return new List<string> {
    182         logic.GetColumnTypeAsString(columnIndex),
    183         logic.GetMissingValueCount(columnIndex).ToString(),
    184         logic.GetMin<DateTime>(columnIndex,DateTime.MinValue).ToString(),
    185         logic.GetMax<DateTime>(columnIndex,DateTime.MinValue).ToString(),
    186         logic.GetMedianDateTime(columnIndex).ToString(),
    187         logic.GetAverageDateTime(columnIndex).ToString(),
    188         logic.GetStandardDeviation(columnIndex).ToString(),
    189         logic.GetVariance(columnIndex).ToString(), //variance
    190         logic.GetOneQuarterPercentile(columnIndex).ToString(),
    191         logic.GetThreeQuarterPercentile(columnIndex).ToString(),
    192         logic.GetMostCommonValue<DateTime>(columnIndex,DateTime.MinValue).ToString(),
    193         logic.GetDifferentValuesCount<DateTime>(columnIndex).ToString()
     197        logic.GetColumnTypeAsString(statIdx),
     198        logic.GetMissingValueCount(statIdx).ToString(),
     199        logic.GetMin<DateTime>(statIdx, DateTime.MinValue).ToString(),
     200        logic.GetMax<DateTime>(statIdx, DateTime.MinValue).ToString(),
     201        logic.GetMedianDateTime(statIdx).ToString(),
     202        logic.GetAverageDateTime(statIdx).ToString(),
     203        logic.GetStandardDeviation(statIdx).ToString(),
     204        logic.GetVariance(statIdx).ToString(),
     205        logic.GetOneQuarterPercentile(statIdx).ToString(),
     206        logic.GetThreeQuarterPercentile(statIdx).ToString(),
     207        logic.GetMostCommonValue<DateTime>(statIdx, DateTime.MinValue).ToString(),
     208        logic.GetDifferentValuesCount<DateTime>(statIdx).ToString()
    194209      };
    195210    }
    196211
    197     private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
    198       if (Content != null && e.RowIndex < columnsRowsMatrix.Count && e.ColumnIndex < columnsRowsMatrix[0].Count) {
    199         e.Value = columnsRowsMatrix[e.RowIndex][e.ColumnIndex];
    200       }
    201     }
    202 
    203212    private void Content_Changed(object sender, DataPreprocessingChangedEventArgs e) {
    204       switch (e.Type) {
    205         case DataPreprocessingChangedEventType.DeleteColumn:
    206           columnsRowsMatrix.RemoveAt(e.Column);
    207           break;
    208         case DataPreprocessingChangedEventType.AddColumn:
    209           columnsRowsMatrix.Insert(e.Row, GetList(e.Column));
    210           dataGridView.RowCount++;
    211           break;
    212         case DataPreprocessingChangedEventType.ChangeItem:
    213           columnsRowsMatrix[e.Column] = GetList(e.Column);
    214           break;
    215         case DataPreprocessingChangedEventType.DeleteRow:
    216         case DataPreprocessingChangedEventType.AddRow:
    217         default:
    218           for (int i = 0; i < columnsRowsMatrix.Count; ++i) {
    219             columnsRowsMatrix[i] = GetList(e.Column);
    220           }
    221           break;
    222       }
    223       dataGridView.Refresh();
    224     }
     213      UpdateData();
     214    }
     215
     216    #region Show/Hide Variables
     217    private void checkInputsTargetButton_Click(object sender, EventArgs e) {
     218      var grid = stringMatrixView.DataGridView;
     219      var list = horizontal ? grid.Columns : grid.Rows as IList;
     220      var variableNames = Content.PreprocessingData.VariableNames.ToList();
     221      int idx = 0;
     222      foreach (DataGridViewBand band in list) {
     223        var variable = variableNames[idx++];
     224        bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable)
     225                             || Content.PreprocessingData.TargetVariable == variable;
     226        band.Visible = isInputTarget;
     227        if (horizontal)
     228          stringMatrixView.UpdateColumnHeaders();
     229        else
     230          stringMatrixView.UpdateRowHeaders();
     231      }
     232
     233    }
     234    private void checkAllButton_Click(object sender, EventArgs e) {
     235      var grid = stringMatrixView.DataGridView;
     236      var list = horizontal ? grid.Columns : grid.Rows as IList;
     237      foreach (DataGridViewBand band in list) {
     238        band.Visible = true;
     239      }
     240      if (horizontal)
     241        stringMatrixView.UpdateColumnHeaders();
     242      else
     243        stringMatrixView.UpdateRowHeaders();
     244    }
     245    private void uncheckAllButton_Click(object sender, EventArgs e) {
     246      var grid = stringMatrixView.DataGridView;
     247      var list = horizontal ? grid.Columns : grid.Rows as IList;
     248      foreach (DataGridViewBand band in list) {
     249        band.Visible = false;
     250      }
     251    }
     252    #endregion
     253
     254    #region Orientation
     255    private void horizontalRadioButton_CheckedChanged(object sender, EventArgs e) {
     256      var grid = stringMatrixView.DataGridView;
     257      var oldVisibility = new Dictionary<string, bool>();
     258      var variableNames = Content.PreprocessingData.VariableNames.ToList();
     259      if (stringMatrixView.Content != null) {
     260        var list = horizontal ? grid.Columns : grid.Rows as IList;
     261        int idx = 0;
     262        foreach (DataGridViewBand band in list) {
     263          var variable = variableNames[idx++];
     264          oldVisibility.Add(variable, band.Visible);
     265        }
     266      }
     267      horizontal = horizontalRadioButton.Checked;
     268      UpdateData(oldVisibility);
     269    }
     270    private void verticalRadioButton_CheckedChanged(object sender, EventArgs e) {
     271      // everything is handled in horizontalRadioButton_CheckedChanged
     272    }
     273    #endregion
    225274  }
    226275}
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/TransformationView.cs

    r14186 r15242  
    2828
    2929namespace HeuristicLab.DataPreprocessing.Views {
    30 
    3130  [View("Transformation View")]
    3231  [Content(typeof(TransformationContent), true)]
    3332  public partial class TransformationView : AsynchronousContentView {
    34 
    3533    public new TransformationContent Content {
    3634      get { return (TransformationContent)base.Content; }
     
    5250    }
    5351
    54     /// <summary>
    55     /// Adds eventhandlers to the current instance.
    56     /// </summary>
    5752    protected override void RegisterContentEvents() {
    5853      Content.FilterLogic.FilterChanged += FilterLogic_FilterChanged;
    5954    }
    6055
    61     /// <summary>
    62     /// Removes the eventhandlers from the current instance.
    63     /// </summary>
    6456    protected override void DeregisterContentEvents() {
    6557      Content.FilterLogic.FilterChanged -= FilterLogic_FilterChanged;
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/Utils/FindPreprocessingItemsIterator.cs

    r14186 r15242  
    2626namespace HeuristicLab.DataPreprocessing.Views {
    2727  class FindPreprocessingItemsIterator : IFindPreprocessingItemsIterator {
    28 
    2928    private IDictionary<int, IList<int>> items;
    3029    private Tuple<int, int> currentCell;
     
    3231    public FindPreprocessingItemsIterator(IDictionary<int, IList<int>> items) {
    3332      this.items = items;
    34       Reset(); 
     33      Reset();
    3534    }
    3635
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.Designer.cs

    r14186 r15242  
    5353      this.SuspendLayout();
    5454      //
    55       // splitContainer
    56       //
    57       this.splitContainer.Size = new System.Drawing.Size(526, 364);
    58       //
    59       // itemsGroupBox
    60       //
    61       this.itemsGroupBox.Size = new System.Drawing.Size(532, 383);
    62       //
    6355      // itemsListView
    6456      //
    65       this.itemsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
    6657      this.itemsListView.Dock = System.Windows.Forms.DockStyle.Fill;
    67       this.itemsListView.Location = new System.Drawing.Point(0, 0);
    68       this.itemsListView.Size = new System.Drawing.Size(200, 364);
    69       //
    70       // detailsGroupBox
    71       //
    72       this.detailsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
    73       this.detailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    74       this.detailsGroupBox.Location = new System.Drawing.Point(0, 0);
    75       this.detailsGroupBox.Size = new System.Drawing.Size(322, 364);
    76       //
    77       // addButton
    78       //
    79       this.toolTip.SetToolTip(this.addButton, "Add");
    80       this.addButton.Visible = false;
    81       //
    82       // removeButton
    83       //
    84       this.toolTip.SetToolTip(this.removeButton, "Remove");
    85       this.removeButton.Visible = false;
    86       //
    87       // moveUpButton
    88       //
    89       this.toolTip.SetToolTip(this.moveUpButton, "Move Up");
    90       this.moveUpButton.Visible = false;
    91       //
    92       // moveDownButton
    93       //
    94       this.toolTip.SetToolTip(this.moveDownButton, "Move Down");
    95       this.moveDownButton.Visible = false;
    9658      //
    9759      // viewHost
    9860      //
    99       this.viewHost.Size = new System.Drawing.Size(310, 339);
     61      this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;
     62      this.viewHost.ViewsLabelVisible = false;
    10063      //
    10164      // showDetailsCheckBox
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.cs

    r14186 r15242  
    2121
    2222using System;
    23 using HeuristicLab.Common;
    2423using HeuristicLab.Core;
    2524using HeuristicLab.Core.Views;
     
    3029  [Content(typeof(IItemList<IViewShortcut>), true)]
    3130  public partial class ViewShortcutListView : ItemListView<IViewShortcut> {
    32 
    3331    public ViewShortcutListView() {
    3432      InitializeComponent();
    35       itemsGroupBox.Text = "View Shortcuts";
     33      Controls.Clear();
     34      Controls.Add(splitContainer);
     35      splitContainer.Panel1.Controls.Clear();
     36      splitContainer.Panel1.Controls.Add(itemsListView);
     37      splitContainer.Panel2.Controls.Clear();
     38      splitContainer.Panel2.Controls.Add(viewHost);
    3639    }
    3740
     
    4245        IViewShortcut item = itemsListView.SelectedItems[0].Tag as IViewShortcut;
    4346        if (item != null) {
    44 
    45           if (item is IViewChartShortcut)
    46             item = (IViewChartShortcut)item.Clone(new Cloner());
    47 
    48           IContentView view = MainFormManager.MainForm.ShowContent(item);
    49           if (view != null) {
    50             view.ReadOnly = ReadOnly;
    51             view.Locked = Locked;
     47          try {
     48            item = (IViewShortcut)item.Clone();
     49            var view = MainFormManager.MainForm.ShowContent(item);
     50            if (view != null) {
     51              view.ReadOnly = ReadOnly;
     52              view.Locked = Locked;
     53            }
     54          } catch (NullReferenceException) {
     55            // cloning for preprocessing not done properly yet
    5256          }
    5357        }
Note: See TracChangeset for help on using the changeset viewer.