Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14546


Ignore:
Timestamp:
01/05/17 15:50:40 (8 years ago)
Author:
pfleck
Message:

#2709 Added shortcuts for select input/all/none variables in datagrid and statistics.

Location:
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.Designer.cs

    r14185 r14546  
    6363      this.btnReplace = new System.Windows.Forms.Button();
    6464      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     65      this.uncheckAllButton = new System.Windows.Forms.Button();
     66      this.checkAllButton = new System.Windows.Forms.Button();
     67      this.checkInputsTargetButton = 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.groupBox1 = new System.Windows.Forms.GroupBox();
    6872      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6973      this.contextMenuCell.SuspendLayout();
     74      this.groupBox1.SuspendLayout();
    7075      this.SuspendLayout();
    7176      //
     
    8186      this.columnsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
    8287      this.columnsTextBox.Size = new System.Drawing.Size(71, 20);
    83       //
    84       // statisticsTextBox
    85       //
    86       this.statisticsTextBox.Location = new System.Drawing.Point(3, 387);
    87       this.statisticsTextBox.Size = new System.Drawing.Size(421, 13);
    8888      //
    8989      // btnApplySort
     
    104104            this.replaceValueOverSelectionToolStripMenuItem});
    105105      this.contextMenuCell.Name = "contextMenuCell";
    106       this.contextMenuCell.Size = new System.Drawing.Size(225, 48);
     106      this.contextMenuCell.Size = new System.Drawing.Size(224, 48);
    107107      //
    108108      // replaceValueOverColumnToolStripMenuItem
     
    116116            this.smoothingToolStripMenuItem_Column});
    117117      this.replaceValueOverColumnToolStripMenuItem.Name = "replaceValueOverColumnToolStripMenuItem";
    118       this.replaceValueOverColumnToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
     118      this.replaceValueOverColumnToolStripMenuItem.Size = new System.Drawing.Size(223, 22);
    119119      this.replaceValueOverColumnToolStripMenuItem.Text = "Replace Value over Column";
    120120      //
     
    169169            this.mostCommonToolStripMenuItem_Selection});
    170170      this.replaceValueOverSelectionToolStripMenuItem.Name = "replaceValueOverSelectionToolStripMenuItem";
    171       this.replaceValueOverSelectionToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
     171      this.replaceValueOverSelectionToolStripMenuItem.Size = new System.Drawing.Size(223, 22);
    172172      this.replaceValueOverSelectionToolStripMenuItem.Text = "Replace Value over Selection";
    173173      //
     
    222222      this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
    223223      //
     224      // uncheckAllButton
     225      //
     226      this.uncheckAllButton.Location = new System.Drawing.Point(105, 17);
     227      this.uncheckAllButton.Name = "uncheckAllButton";
     228      this.uncheckAllButton.Size = new System.Drawing.Size(43, 24);
     229      this.uncheckAllButton.TabIndex = 12;
     230      this.uncheckAllButton.Text = "None";
     231      this.toolTip.SetToolTip(this.uncheckAllButton, "Uncheck all variables");
     232      this.uncheckAllButton.UseVisualStyleBackColor = true;
     233      this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click);
     234      //
     235      // checkAllButton
     236      //
     237      this.checkAllButton.Location = new System.Drawing.Point(68, 17);
     238      this.checkAllButton.Name = "checkAllButton";
     239      this.checkAllButton.Size = new System.Drawing.Size(31, 24);
     240      this.checkAllButton.TabIndex = 13;
     241      this.checkAllButton.Text = "All";
     242      this.toolTip.SetToolTip(this.checkAllButton, "Check all variables");
     243      this.checkAllButton.UseVisualStyleBackColor = true;
     244      this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click);
     245      //
     246      // checkInputsTargetButton
     247      //
     248      this.checkInputsTargetButton.Location = new System.Drawing.Point(6, 17);
     249      this.checkInputsTargetButton.Name = "checkInputsTargetButton";
     250      this.checkInputsTargetButton.Size = new System.Drawing.Size(56, 24);
     251      this.checkInputsTargetButton.TabIndex = 14;
     252      this.checkInputsTargetButton.Text = "Inputs";
     253      this.toolTip.SetToolTip(this.checkInputsTargetButton, "Check only inputs and target variable");
     254      this.checkInputsTargetButton.UseVisualStyleBackColor = true;
     255      this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click);
     256      //
    224257      // addRowButton
    225258      //
     
    252285      this.renameColumnsButton.Click += new System.EventHandler(this.renameColumnsButton_Click);
    253286      //
     287      // groupBox1
     288      //
     289      this.groupBox1.Controls.Add(this.checkInputsTargetButton);
     290      this.groupBox1.Controls.Add(this.uncheckAllButton);
     291      this.groupBox1.Controls.Add(this.checkAllButton);
     292      this.groupBox1.Location = new System.Drawing.Point(426, 0);
     293      this.groupBox1.Name = "groupBox1";
     294      this.groupBox1.Size = new System.Drawing.Size(160, 49);
     295      this.groupBox1.TabIndex = 15;
     296      this.groupBox1.TabStop = false;
     297      this.groupBox1.Text = "Show Variables";
     298      //
    254299      // DataGridContentView
    255300      //
    256301      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    257302      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     303      this.Controls.Add(this.groupBox1);
    258304      this.Controls.Add(this.renameColumnsButton);
    259305      this.Controls.Add(this.addColumnButton);
     
    263309      this.Controls.Add(this.btnApplySort);
    264310      this.Name = "DataGridContentView";
    265       this.Size = new System.Drawing.Size(430, 403);
    266311      this.Controls.SetChildIndex(this.btnApplySort, 0);
    267312      this.Controls.SetChildIndex(this.btnSearch, 0);
     
    275320      this.Controls.SetChildIndex(this.rowsTextBox, 0);
    276321      this.Controls.SetChildIndex(this.columnsTextBox, 0);
     322      this.Controls.SetChildIndex(this.groupBox1, 0);
    277323      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    278324      this.contextMenuCell.ResumeLayout(false);
     325      this.groupBox1.ResumeLayout(false);
    279326      this.ResumeLayout(false);
    280327      this.PerformLayout();
     
    304351    private System.Windows.Forms.Button addColumnButton;
    305352    private System.Windows.Forms.Button renameColumnsButton;
     353    private System.Windows.Forms.Button uncheckAllButton;
     354    private System.Windows.Forms.Button checkAllButton;
     355    private System.Windows.Forms.Button checkInputsTargetButton;
     356    private System.Windows.Forms.GroupBox groupBox1;
    306357  }
    307358}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs

    r14525 r14546  
    686686      }
    687687    }
     688
     689    private void checkInputsTargetButton_Click(object sender, EventArgs e) {
     690      foreach (DataGridViewColumn column in DataGridView.Columns) {
     691        var variable = column.HeaderText;
     692        bool isInputTarget = Content.PreProcessingData.InputVariables.Contains(variable)
     693          || Content.PreProcessingData.TargetVariable == variable;
     694        column.Visible = isInputTarget;
     695      }
     696    }
     697
     698    private void checkAllButton_Click(object sender, EventArgs e) {
     699      foreach (DataGridViewColumn column in DataGridView.Columns) {
     700        column.Visible = true;
     701      }
     702    }
     703
     704    private void uncheckAllButton_Click(object sender, EventArgs e) {
     705      foreach (DataGridViewColumn column in DataGridView.Columns) {
     706        column.Visible = false;
     707      }
     708    }
    688709  }
    689710}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.Designer.cs

    r14545 r14546  
    5656      this.txtMissingValuesTotal = new System.Windows.Forms.Label();
    5757      this.stringMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
     58      this.groupBox1 = new System.Windows.Forms.GroupBox();
     59      this.checkInputsTargetButton = new System.Windows.Forms.Button();
     60      this.uncheckAllButton = new System.Windows.Forms.Button();
     61      this.checkAllButton = new System.Windows.Forms.Button();
     62      this.groupBox1.SuspendLayout();
    5863      this.SuspendLayout();
    5964      //
     
    6166      //
    6267      this.lblRows.AutoSize = true;
    63       this.lblRows.Location = new System.Drawing.Point(3, 11);
     68      this.lblRows.Location = new System.Drawing.Point(2, 6);
    6469      this.lblRows.Name = "lblRows";
    6570      this.lblRows.Size = new System.Drawing.Size(34, 13);
     
    7075      //
    7176      this.txtRows.AutoSize = true;
    72       this.txtRows.Location = new System.Drawing.Point(115, 11);
     77      this.txtRows.Location = new System.Drawing.Point(114, 6);
    7378      this.txtRows.Name = "txtRows";
    7479      this.txtRows.Size = new System.Drawing.Size(19, 13);
     
    7984      //
    8085      this.lblColumns.AutoSize = true;
    81       this.lblColumns.Location = new System.Drawing.Point(3, 31);
     86      this.lblColumns.Location = new System.Drawing.Point(2, 26);
    8287      this.lblColumns.Name = "lblColumns";
    8388      this.lblColumns.Size = new System.Drawing.Size(47, 13);
     
    8893      //
    8994      this.lblMissingValuesTotal.AutoSize = true;
    90       this.lblMissingValuesTotal.Location = new System.Drawing.Point(3, 92);
     95      this.lblMissingValuesTotal.Location = new System.Drawing.Point(2, 87);
    9196      this.lblMissingValuesTotal.Name = "lblMissingValuesTotal";
    9297      this.lblMissingValuesTotal.Size = new System.Drawing.Size(100, 13);
     
    97102      //
    98103      this.txtColumns.AutoSize = true;
    99       this.txtColumns.Location = new System.Drawing.Point(115, 31);
     104      this.txtColumns.Location = new System.Drawing.Point(114, 26);
    100105      this.txtColumns.Name = "txtColumns";
    101106      this.txtColumns.Size = new System.Drawing.Size(25, 13);
     
    106111      //
    107112      this.txtNumericColumns.AutoSize = true;
    108       this.txtNumericColumns.Location = new System.Drawing.Point(115, 51);
     113      this.txtNumericColumns.Location = new System.Drawing.Point(114, 46);
    109114      this.txtNumericColumns.Name = "txtNumericColumns";
    110115      this.txtNumericColumns.Size = new System.Drawing.Size(25, 13);
     
    115120      //
    116121      this.txtNominalColumns.AutoSize = true;
    117       this.txtNominalColumns.Location = new System.Drawing.Point(115, 72);
     122      this.txtNominalColumns.Location = new System.Drawing.Point(114, 67);
    118123      this.txtNominalColumns.Name = "txtNominalColumns";
    119124      this.txtNominalColumns.Size = new System.Drawing.Size(25, 13);
     
    124129      //
    125130      this.lblNumericColumns.AutoSize = true;
    126       this.lblNumericColumns.Location = new System.Drawing.Point(3, 51);
     131      this.lblNumericColumns.Location = new System.Drawing.Point(2, 46);
    127132      this.lblNumericColumns.Name = "lblNumericColumns";
    128133      this.lblNumericColumns.Size = new System.Drawing.Size(89, 13);
     
    133138      //
    134139      this.lblNominalColumns.AutoSize = true;
    135       this.lblNominalColumns.Location = new System.Drawing.Point(3, 72);
     140      this.lblNominalColumns.Location = new System.Drawing.Point(2, 67);
    136141      this.lblNominalColumns.Name = "lblNominalColumns";
    137142      this.lblNominalColumns.Size = new System.Drawing.Size(88, 13);
     
    142147      //
    143148      this.txtMissingValuesTotal.AutoSize = true;
    144       this.txtMissingValuesTotal.Location = new System.Drawing.Point(115, 92);
     149      this.txtMissingValuesTotal.Location = new System.Drawing.Point(114, 87);
    145150      this.txtMissingValuesTotal.Name = "txtMissingValuesTotal";
    146151      this.txtMissingValuesTotal.Size = new System.Drawing.Size(25, 13);
     
    155160      this.stringMatrixView.Caption = "StringConvertibleMatrix View";
    156161      this.stringMatrixView.Content = null;
    157       this.stringMatrixView.Location = new System.Drawing.Point(5, 117);
     162      this.stringMatrixView.Location = new System.Drawing.Point(5, 112);
    158163      this.stringMatrixView.Name = "stringMatrixView";
    159164      this.stringMatrixView.ReadOnly = true;
    160165      this.stringMatrixView.ShowRowsAndColumnsTextBox = false;
    161166      this.stringMatrixView.ShowStatisticalInformation = true;
    162       this.stringMatrixView.Size = new System.Drawing.Size(530, 278);
     167      this.stringMatrixView.Size = new System.Drawing.Size(530, 283);
    163168      this.stringMatrixView.TabIndex = 4;
     169      //
     170      // groupBox1
     171      //
     172      this.groupBox1.Controls.Add(this.checkInputsTargetButton);
     173      this.groupBox1.Controls.Add(this.uncheckAllButton);
     174      this.groupBox1.Controls.Add(this.checkAllButton);
     175      this.groupBox1.Location = new System.Drawing.Point(212, 3);
     176      this.groupBox1.Name = "groupBox1";
     177      this.groupBox1.Size = new System.Drawing.Size(160, 49);
     178      this.groupBox1.TabIndex = 16;
     179      this.groupBox1.TabStop = false;
     180      this.groupBox1.Text = "Show Variables";
     181      //
     182      // checkInputsTargetButton
     183      //
     184      this.checkInputsTargetButton.Location = new System.Drawing.Point(6, 17);
     185      this.checkInputsTargetButton.Name = "checkInputsTargetButton";
     186      this.checkInputsTargetButton.Size = new System.Drawing.Size(56, 24);
     187      this.checkInputsTargetButton.TabIndex = 14;
     188      this.checkInputsTargetButton.Text = "Inputs";
     189      this.checkInputsTargetButton.UseVisualStyleBackColor = true;
     190      this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click);
     191      //
     192      // uncheckAllButton
     193      //
     194      this.uncheckAllButton.Location = new System.Drawing.Point(105, 17);
     195      this.uncheckAllButton.Name = "uncheckAllButton";
     196      this.uncheckAllButton.Size = new System.Drawing.Size(43, 24);
     197      this.uncheckAllButton.TabIndex = 12;
     198      this.uncheckAllButton.Text = "None";
     199      this.uncheckAllButton.UseVisualStyleBackColor = true;
     200      this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click);
     201      //
     202      // checkAllButton
     203      //
     204      this.checkAllButton.Location = new System.Drawing.Point(68, 17);
     205      this.checkAllButton.Name = "checkAllButton";
     206      this.checkAllButton.Size = new System.Drawing.Size(31, 24);
     207      this.checkAllButton.TabIndex = 13;
     208      this.checkAllButton.Text = "All";
     209      this.checkAllButton.UseVisualStyleBackColor = true;
     210      this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click);
    164211      //
    165212      // StatisticsView
     
    167214      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    168215      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     216      this.Controls.Add(this.groupBox1);
    169217      this.Controls.Add(this.stringMatrixView);
    170218      this.Controls.Add(this.lblNominalColumns);
     
    180228      this.Name = "StatisticsView";
    181229      this.Size = new System.Drawing.Size(549, 408);
     230      this.groupBox1.ResumeLayout(false);
    182231      this.ResumeLayout(false);
    183232      this.PerformLayout();
     
    198247    private System.Windows.Forms.Label txtMissingValuesTotal;
    199248    private HeuristicLab.Data.Views.StringConvertibleMatrixView stringMatrixView;
     249    private System.Windows.Forms.GroupBox groupBox1;
     250    private System.Windows.Forms.Button checkInputsTargetButton;
     251    private System.Windows.Forms.Button uncheckAllButton;
     252    private System.Windows.Forms.Button checkAllButton;
    200253  }
    201254}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.cs

    r14545 r14546  
    198198    private void Content_Changed(object sender, DataPreprocessingChangedEventArgs e) {
    199199      UpdateData();
    200       //switch (e.Type) {
    201       //  case DataPreprocessingChangedEventType.DeleteColumn:
    202       //    statisticsMatrix.RemoveAt(e.Column);
    203       //    break;
    204       //  case DataPreprocessingChangedEventType.AddColumn:
    205       //    statisticsMatrix.Insert(e.Row, GetList(e.Column));
    206       //    stringMatrixView.Content.Rows++;
    207       //    break;
    208       //  case DataPreprocessingChangedEventType.ChangeItem:
    209       //    statisticsMatrix[e.Column] = GetList(e.Column);
    210       //    break;
    211       //  case DataPreprocessingChangedEventType.DeleteRow:
    212       //  case DataPreprocessingChangedEventType.AddRow:
    213       //  default:
    214       //    for (int i = 0; i < statisticsMatrix.Count; ++i) {
    215       //      statisticsMatrix[i] = GetList(e.Column);
    216       //    }
    217       //    break;
    218       //}
     200    }
     201
     202    private void checkInputsTargetButton_Click(object sender, EventArgs e) {
     203      foreach (DataGridViewColumn column in stringMatrixView.DataGridView.Columns) {
     204        var variable = column.HeaderText;
     205        bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable)
     206                             || Content.PreprocessingData.TargetVariable == variable;
     207        column.Visible = isInputTarget;
     208      }
     209    }
     210
     211    private void checkAllButton_Click(object sender, EventArgs e) {
     212      foreach (DataGridViewColumn column in stringMatrixView.DataGridView.Columns) {
     213        column.Visible = true;
     214      }
     215    }
     216
     217    private void uncheckAllButton_Click(object sender, EventArgs e) {
     218      foreach (DataGridViewColumn column in stringMatrixView.DataGridView.Columns) {
     219        column.Visible = false;
     220      }
    219221    }
    220222  }
Note: See TracChangeset for help on using the changeset viewer.