Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/17 14:33:09 (8 years ago)
Author:
pfleck
Message:

#2709

  • Added Check All/Inputs&Target/None Icons.
  • Improved location and formatting of the "Show Variables" groupbox in datagrid and statistics view.
  • Added an "Orientation" option for the statistics view.
Location:
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4
Files:
6 added
4 edited

Legend:

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

    r14546 r14915  
    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();
    6566      this.uncheckAllButton = new System.Windows.Forms.Button();
    6667      this.checkAllButton = new System.Windows.Forms.Button();
    67       this.checkInputsTargetButton = new System.Windows.Forms.Button();
    6868      this.addRowButton = new System.Windows.Forms.Button();
    6969      this.addColumnButton = new System.Windows.Forms.Button();
    7070      this.renameColumnsButton = new System.Windows.Forms.Button();
    71       this.groupBox1 = new System.Windows.Forms.GroupBox();
     71      this.showVariablesGroupBox = new System.Windows.Forms.GroupBox();
    7272      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    7373      this.contextMenuCell.SuspendLayout();
    74       this.groupBox1.SuspendLayout();
     74      this.showVariablesGroupBox.SuspendLayout();
    7575      this.SuspendLayout();
    7676      //
     
    8686      this.columnsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
    8787      this.columnsTextBox.Size = new System.Drawing.Size(71, 20);
     88      //
     89      // statisticsTextBox
     90      //
     91      this.statisticsTextBox.Size = new System.Drawing.Size(1133, 13);
    8892      //
    8993      // btnApplySort
     
    222226      this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
    223227      //
     228      // checkInputsTargetButton
     229      //
     230      this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs;
     231      this.checkInputsTargetButton.Location = new System.Drawing.Point(36, 19);
     232      this.checkInputsTargetButton.Name = "checkInputsTargetButton";
     233      this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24);
     234      this.checkInputsTargetButton.TabIndex = 14;
     235      this.toolTip.SetToolTip(this.checkInputsTargetButton, "Inputs & Target");
     236      this.checkInputsTargetButton.UseVisualStyleBackColor = true;
     237      this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click);
     238      //
    224239      // uncheckAllButton
    225240      //
    226       this.uncheckAllButton.Location = new System.Drawing.Point(105, 17);
     241      this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None;
     242      this.uncheckAllButton.Location = new System.Drawing.Point(66, 19);
    227243      this.uncheckAllButton.Name = "uncheckAllButton";
    228       this.uncheckAllButton.Size = new System.Drawing.Size(43, 24);
     244      this.uncheckAllButton.Size = new System.Drawing.Size(24, 24);
    229245      this.uncheckAllButton.TabIndex = 12;
    230       this.uncheckAllButton.Text = "None";
    231       this.toolTip.SetToolTip(this.uncheckAllButton, "Uncheck all variables");
     246      this.toolTip.SetToolTip(this.uncheckAllButton, "None");
    232247      this.uncheckAllButton.UseVisualStyleBackColor = true;
    233248      this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click);
     
    235250      // checkAllButton
    236251      //
    237       this.checkAllButton.Location = new System.Drawing.Point(68, 17);
     252      this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All;
     253      this.checkAllButton.Location = new System.Drawing.Point(6, 19);
    238254      this.checkAllButton.Name = "checkAllButton";
    239       this.checkAllButton.Size = new System.Drawing.Size(31, 24);
     255      this.checkAllButton.Size = new System.Drawing.Size(24, 24);
    240256      this.checkAllButton.TabIndex = 13;
    241       this.checkAllButton.Text = "All";
    242       this.toolTip.SetToolTip(this.checkAllButton, "Check all variables");
     257      this.toolTip.SetToolTip(this.checkAllButton, "All");
    243258      this.checkAllButton.UseVisualStyleBackColor = true;
    244259      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);
    256260      //
    257261      // addRowButton
     
    285289      this.renameColumnsButton.Click += new System.EventHandler(this.renameColumnsButton_Click);
    286290      //
    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";
     291      // showVariablesGroupBox
     292      //
     293      this.showVariablesGroupBox.Controls.Add(this.checkInputsTargetButton);
     294      this.showVariablesGroupBox.Controls.Add(this.uncheckAllButton);
     295      this.showVariablesGroupBox.Controls.Add(this.checkAllButton);
     296      this.showVariablesGroupBox.Location = new System.Drawing.Point(448, 0);
     297      this.showVariablesGroupBox.Name = "showVariablesGroupBox";
     298      this.showVariablesGroupBox.Size = new System.Drawing.Size(97, 49);
     299      this.showVariablesGroupBox.TabIndex = 17;
     300      this.showVariablesGroupBox.TabStop = false;
     301      this.showVariablesGroupBox.Text = "Show Variables";
    298302      //
    299303      // DataGridContentView
     
    301305      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    302306      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    303       this.Controls.Add(this.groupBox1);
     307      this.Controls.Add(this.showVariablesGroupBox);
    304308      this.Controls.Add(this.renameColumnsButton);
    305309      this.Controls.Add(this.addColumnButton);
     
    320324      this.Controls.SetChildIndex(this.rowsTextBox, 0);
    321325      this.Controls.SetChildIndex(this.columnsTextBox, 0);
    322       this.Controls.SetChildIndex(this.groupBox1, 0);
     326      this.Controls.SetChildIndex(this.showVariablesGroupBox, 0);
    323327      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    324328      this.contextMenuCell.ResumeLayout(false);
    325       this.groupBox1.ResumeLayout(false);
     329      this.showVariablesGroupBox.ResumeLayout(false);
    326330      this.ResumeLayout(false);
    327331      this.PerformLayout();
     
    351355    private System.Windows.Forms.Button addColumnButton;
    352356    private System.Windows.Forms.Button renameColumnsButton;
     357    private System.Windows.Forms.GroupBox showVariablesGroupBox;
     358    private System.Windows.Forms.Button checkInputsTargetButton;
    353359    private System.Windows.Forms.Button uncheckAllButton;
    354360    private System.Windows.Forms.Button checkAllButton;
    355     private System.Windows.Forms.Button checkInputsTargetButton;
    356     private System.Windows.Forms.GroupBox groupBox1;
    357361  }
    358362}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj

    r14521 r14915  
    208208      <DependentUpon>ComparisonFilterView.cs</DependentUpon>
    209209    </Compile>
     210    <Compile Include="PreprocessingIcons.Designer.cs">
     211      <AutoGen>True</AutoGen>
     212      <DesignTime>True</DesignTime>
     213      <DependentUpon>PreprocessingIcons.resx</DependentUpon>
     214    </Compile>
    210215    <Compile Include="RenameColumnsDialog.cs">
    211216      <SubType>Form</SubType>
     
    319324  </ItemGroup>
    320325  <ItemGroup>
     326    <EmbeddedResource Include="PreprocessingIcons.resx">
     327      <Generator>ResXFileCodeGenerator</Generator>
     328      <LastGenOutput>PreprocessingIcons.Designer.cs</LastGenOutput>
     329    </EmbeddedResource>
    321330    <EmbeddedResource Include="ScatterPlotSingleView.resx">
    322331      <DependentUpon>ScatterPlotSingleView.cs</DependentUpon>
    323332    </EmbeddedResource>
     333  </ItemGroup>
     334  <ItemGroup>
     335    <Content Include="Icons\All.png" />
     336    <Content Include="Icons\Inputs.png" />
     337    <Content Include="Icons\None.png" />
    324338  </ItemGroup>
    325339  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.Designer.cs

    r14546 r14915  
    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();
    5753      this.stringMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
    58       this.groupBox1 = new System.Windows.Forms.GroupBox();
     54      this.showVariablesGroupBox = new System.Windows.Forms.GroupBox();
    5955      this.checkInputsTargetButton = new System.Windows.Forms.Button();
    6056      this.uncheckAllButton = new System.Windows.Forms.Button();
    6157      this.checkAllButton = new System.Windows.Forms.Button();
    62       this.groupBox1.SuspendLayout();
     58      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     59      this.lblTNumValues = new System.Windows.Forms.Label();
     60      this.orientationGroupBox = new System.Windows.Forms.GroupBox();
     61      this.verticalRadioButton = new System.Windows.Forms.RadioButton();
     62      this.horizontalRadioButton = new System.Windows.Forms.RadioButton();
     63      this.rowsTextBox = new System.Windows.Forms.TextBox();
     64      this.columnsTextBox = new System.Windows.Forms.TextBox();
     65      this.totalValuesTextBox = new System.Windows.Forms.TextBox();
     66      this.overviewTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
     67      this.numericColumnsTextBox = new System.Windows.Forms.TextBox();
     68      this.nominalColumnsTextBox5 = new System.Windows.Forms.TextBox();
     69      this.missingValuesTextBox = new System.Windows.Forms.TextBox();
     70      this.overviewGroupBox = new System.Windows.Forms.GroupBox();
     71      this.showVariablesGroupBox.SuspendLayout();
     72      this.orientationGroupBox.SuspendLayout();
     73      this.overviewTableLayoutPanel.SuspendLayout();
     74      this.overviewGroupBox.SuspendLayout();
    6375      this.SuspendLayout();
    6476      //
     
    6678      //
    6779      this.lblRows.AutoSize = true;
    68       this.lblRows.Location = new System.Drawing.Point(2, 6);
     80      this.lblRows.Dock = System.Windows.Forms.DockStyle.Fill;
     81      this.lblRows.Location = new System.Drawing.Point(3, 0);
    6982      this.lblRows.Name = "lblRows";
    70       this.lblRows.Size = new System.Drawing.Size(34, 13);
     83      this.lblRows.Size = new System.Drawing.Size(47, 26);
    7184      this.lblRows.TabIndex = 0;
    7285      this.lblRows.Text = "Rows";
    73       //
    74       // txtRows
    75       //
    76       this.txtRows.AutoSize = true;
    77       this.txtRows.Location = new System.Drawing.Point(114, 6);
    78       this.txtRows.Name = "txtRows";
    79       this.txtRows.Size = new System.Drawing.Size(19, 13);
    80       this.txtRows.TabIndex = 1;
    81       this.txtRows.Text = "12";
     86      this.lblRows.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    8287      //
    8388      // lblColumns
    8489      //
    8590      this.lblColumns.AutoSize = true;
    86       this.lblColumns.Location = new System.Drawing.Point(2, 26);
     91      this.lblColumns.Dock = System.Windows.Forms.DockStyle.Fill;
     92      this.lblColumns.Location = new System.Drawing.Point(3, 26);
    8793      this.lblColumns.Name = "lblColumns";
    88       this.lblColumns.Size = new System.Drawing.Size(47, 13);
     94      this.lblColumns.Size = new System.Drawing.Size(47, 26);
    8995      this.lblColumns.TabIndex = 2;
    9096      this.lblColumns.Text = "Columns";
     97      this.lblColumns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    9198      //
    9299      // lblMissingValuesTotal
    93100      //
    94101      this.lblMissingValuesTotal.AutoSize = true;
    95       this.lblMissingValuesTotal.Location = new System.Drawing.Point(2, 87);
     102      this.lblMissingValuesTotal.Dock = System.Windows.Forms.DockStyle.Fill;
     103      this.lblMissingValuesTotal.Location = new System.Drawing.Point(233, 26);
    96104      this.lblMissingValuesTotal.Name = "lblMissingValuesTotal";
    97       this.lblMissingValuesTotal.Size = new System.Drawing.Size(100, 13);
     105      this.lblMissingValuesTotal.Size = new System.Drawing.Size(77, 26);
    98106      this.lblMissingValuesTotal.TabIndex = 3;
    99       this.lblMissingValuesTotal.Text = "Missing Values total";
    100       //
    101       // txtColumns
    102       //
    103       this.txtColumns.AutoSize = true;
    104       this.txtColumns.Location = new System.Drawing.Point(114, 26);
    105       this.txtColumns.Name = "txtColumns";
    106       this.txtColumns.Size = new System.Drawing.Size(25, 13);
    107       this.txtColumns.TabIndex = 1;
    108       this.txtColumns.Text = "123";
    109       //
    110       // txtNumericColumns
    111       //
    112       this.txtNumericColumns.AutoSize = true;
    113       this.txtNumericColumns.Location = new System.Drawing.Point(114, 46);
    114       this.txtNumericColumns.Name = "txtNumericColumns";
    115       this.txtNumericColumns.Size = new System.Drawing.Size(25, 13);
    116       this.txtNumericColumns.TabIndex = 1;
    117       this.txtNumericColumns.Text = "456";
    118       //
    119       // txtNominalColumns
    120       //
    121       this.txtNominalColumns.AutoSize = true;
    122       this.txtNominalColumns.Location = new System.Drawing.Point(114, 67);
    123       this.txtNominalColumns.Name = "txtNominalColumns";
    124       this.txtNominalColumns.Size = new System.Drawing.Size(25, 13);
    125       this.txtNominalColumns.TabIndex = 1;
    126       this.txtNominalColumns.Text = "789";
     107      this.lblMissingValuesTotal.Text = "Missing Values";
     108      this.lblMissingValuesTotal.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    127109      //
    128110      // lblNumericColumns
    129111      //
    130112      this.lblNumericColumns.AutoSize = true;
    131       this.lblNumericColumns.Location = new System.Drawing.Point(2, 46);
     113      this.lblNumericColumns.Dock = System.Windows.Forms.DockStyle.Fill;
     114      this.lblNumericColumns.Location = new System.Drawing.Point(97, 0);
    132115      this.lblNumericColumns.Name = "lblNumericColumns";
    133       this.lblNumericColumns.Size = new System.Drawing.Size(89, 13);
     116      this.lblNumericColumns.Size = new System.Drawing.Size(89, 26);
    134117      this.lblNumericColumns.TabIndex = 3;
    135118      this.lblNumericColumns.Text = "Numeric Columns";
     119      this.lblNumericColumns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    136120      //
    137121      // lblNominalColumns
    138122      //
    139123      this.lblNominalColumns.AutoSize = true;
    140       this.lblNominalColumns.Location = new System.Drawing.Point(2, 67);
     124      this.lblNominalColumns.Dock = System.Windows.Forms.DockStyle.Fill;
     125      this.lblNominalColumns.Location = new System.Drawing.Point(97, 26);
    141126      this.lblNominalColumns.Name = "lblNominalColumns";
    142       this.lblNominalColumns.Size = new System.Drawing.Size(88, 13);
     127      this.lblNominalColumns.Size = new System.Drawing.Size(89, 26);
    143128      this.lblNominalColumns.TabIndex = 3;
    144129      this.lblNominalColumns.Text = "Nominal Columns";
    145       //
    146       // txtMissingValuesTotal
    147       //
    148       this.txtMissingValuesTotal.AutoSize = true;
    149       this.txtMissingValuesTotal.Location = new System.Drawing.Point(114, 87);
    150       this.txtMissingValuesTotal.Name = "txtMissingValuesTotal";
    151       this.txtMissingValuesTotal.Size = new System.Drawing.Size(25, 13);
    152       this.txtMissingValuesTotal.TabIndex = 1;
    153       this.txtMissingValuesTotal.Text = "102";
     130      this.lblNominalColumns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    154131      //
    155132      // stringMatrixView
     
    160137      this.stringMatrixView.Caption = "StringConvertibleMatrix View";
    161138      this.stringMatrixView.Content = null;
    162       this.stringMatrixView.Location = new System.Drawing.Point(5, 112);
     139      this.stringMatrixView.Location = new System.Drawing.Point(3, 74);
    163140      this.stringMatrixView.Name = "stringMatrixView";
    164141      this.stringMatrixView.ReadOnly = true;
    165142      this.stringMatrixView.ShowRowsAndColumnsTextBox = false;
    166143      this.stringMatrixView.ShowStatisticalInformation = true;
    167       this.stringMatrixView.Size = new System.Drawing.Size(530, 283);
     144      this.stringMatrixView.Size = new System.Drawing.Size(592, 331);
    168145      this.stringMatrixView.TabIndex = 4;
    169146      //
    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";
     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(393, 0);
     153      this.showVariablesGroupBox.Name = "showVariablesGroupBox";
     154      this.showVariablesGroupBox.Size = new System.Drawing.Size(97, 55);
     155      this.showVariablesGroupBox.TabIndex = 16;
     156      this.showVariablesGroupBox.TabStop = false;
     157      this.showVariablesGroupBox.Text = "Show Variables";
    181158      //
    182159      // checkInputsTargetButton
    183160      //
    184       this.checkInputsTargetButton.Location = new System.Drawing.Point(6, 17);
     161      this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs;
     162      this.checkInputsTargetButton.Location = new System.Drawing.Point(36, 19);
    185163      this.checkInputsTargetButton.Name = "checkInputsTargetButton";
    186       this.checkInputsTargetButton.Size = new System.Drawing.Size(56, 24);
     164      this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24);
    187165      this.checkInputsTargetButton.TabIndex = 14;
    188       this.checkInputsTargetButton.Text = "Inputs";
     166      this.toolTip.SetToolTip(this.checkInputsTargetButton, "Inputs & Target");
    189167      this.checkInputsTargetButton.UseVisualStyleBackColor = true;
    190168      this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click);
     
    192170      // uncheckAllButton
    193171      //
    194       this.uncheckAllButton.Location = new System.Drawing.Point(105, 17);
     172      this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None;
     173      this.uncheckAllButton.Location = new System.Drawing.Point(66, 19);
    195174      this.uncheckAllButton.Name = "uncheckAllButton";
    196       this.uncheckAllButton.Size = new System.Drawing.Size(43, 24);
     175      this.uncheckAllButton.Size = new System.Drawing.Size(24, 24);
    197176      this.uncheckAllButton.TabIndex = 12;
    198       this.uncheckAllButton.Text = "None";
     177      this.toolTip.SetToolTip(this.uncheckAllButton, "None");
    199178      this.uncheckAllButton.UseVisualStyleBackColor = true;
    200179      this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click);
     
    202181      // checkAllButton
    203182      //
    204       this.checkAllButton.Location = new System.Drawing.Point(68, 17);
     183      this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All;
     184      this.checkAllButton.Location = new System.Drawing.Point(6, 19);
    205185      this.checkAllButton.Name = "checkAllButton";
    206       this.checkAllButton.Size = new System.Drawing.Size(31, 24);
     186      this.checkAllButton.Size = new System.Drawing.Size(24, 24);
    207187      this.checkAllButton.TabIndex = 13;
    208       this.checkAllButton.Text = "All";
     188      this.toolTip.SetToolTip(this.checkAllButton, "All");
    209189      this.checkAllButton.UseVisualStyleBackColor = true;
    210190      this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click);
    211191      //
     192      // lblTNumValues
     193      //
     194      this.lblTNumValues.AutoSize = true;
     195      this.lblTNumValues.Dock = System.Windows.Forms.DockStyle.Fill;
     196      this.lblTNumValues.Location = new System.Drawing.Point(233, 0);
     197      this.lblTNumValues.Name = "lblTNumValues";
     198      this.lblTNumValues.Size = new System.Drawing.Size(77, 26);
     199      this.lblTNumValues.TabIndex = 2;
     200      this.lblTNumValues.Text = "Total Values";
     201      this.lblTNumValues.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     202      this.toolTip.SetToolTip(this.lblTNumValues, "Valid Values (excl. missing Values)");
     203      //
     204      // orientationGroupBox
     205      //
     206      this.orientationGroupBox.Controls.Add(this.verticalRadioButton);
     207      this.orientationGroupBox.Controls.Add(this.horizontalRadioButton);
     208      this.orientationGroupBox.Location = new System.Drawing.Point(496, 0);
     209      this.orientationGroupBox.Name = "orientationGroupBox";
     210      this.orientationGroupBox.Size = new System.Drawing.Size(94, 55);
     211      this.orientationGroupBox.TabIndex = 17;
     212      this.orientationGroupBox.TabStop = false;
     213      this.orientationGroupBox.Text = "Orientation";
     214      //
     215      // verticalRadioButton
     216      //
     217      this.verticalRadioButton.AutoSize = true;
     218      this.verticalRadioButton.Location = new System.Drawing.Point(6, 32);
     219      this.verticalRadioButton.Name = "verticalRadioButton";
     220      this.verticalRadioButton.Size = new System.Drawing.Size(60, 17);
     221      this.verticalRadioButton.TabIndex = 1;
     222      this.verticalRadioButton.TabStop = true;
     223      this.verticalRadioButton.Text = "Vertical";
     224      this.verticalRadioButton.UseVisualStyleBackColor = true;
     225      this.verticalRadioButton.CheckedChanged += new System.EventHandler(this.verticalRadioButton_CheckedChanged);
     226      //
     227      // horizontalRadioButton
     228      //
     229      this.horizontalRadioButton.AutoSize = true;
     230      this.horizontalRadioButton.Checked = true;
     231      this.horizontalRadioButton.Location = new System.Drawing.Point(6, 14);
     232      this.horizontalRadioButton.Name = "horizontalRadioButton";
     233      this.horizontalRadioButton.Size = new System.Drawing.Size(72, 17);
     234      this.horizontalRadioButton.TabIndex = 0;
     235      this.horizontalRadioButton.TabStop = true;
     236      this.horizontalRadioButton.Text = "Horizontal";
     237      this.horizontalRadioButton.UseVisualStyleBackColor = true;
     238      this.horizontalRadioButton.CheckedChanged += new System.EventHandler(this.horizontalRadioButton_CheckedChanged);
     239      //
     240      // rowsTextBox
     241      //
     242      this.rowsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     243      this.rowsTextBox.Location = new System.Drawing.Point(56, 3);
     244      this.rowsTextBox.Name = "rowsTextBox";
     245      this.rowsTextBox.ReadOnly = true;
     246      this.rowsTextBox.Size = new System.Drawing.Size(35, 20);
     247      this.rowsTextBox.TabIndex = 18;
     248      //
     249      // columnsTextBox
     250      //
     251      this.columnsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     252      this.columnsTextBox.Location = new System.Drawing.Point(56, 29);
     253      this.columnsTextBox.Name = "columnsTextBox";
     254      this.columnsTextBox.ReadOnly = true;
     255      this.columnsTextBox.Size = new System.Drawing.Size(35, 20);
     256      this.columnsTextBox.TabIndex = 18;
     257      //
     258      // totalValuesTextBox
     259      //
     260      this.totalValuesTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     261      this.totalValuesTextBox.Location = new System.Drawing.Point(316, 3);
     262      this.totalValuesTextBox.Name = "totalValuesTextBox";
     263      this.totalValuesTextBox.ReadOnly = true;
     264      this.totalValuesTextBox.Size = new System.Drawing.Size(59, 20);
     265      this.totalValuesTextBox.TabIndex = 18;
     266      //
     267      // overviewTableLayoutPanel
     268      //
     269      this.overviewTableLayoutPanel.ColumnCount = 6;
     270      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     271      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 28.57143F));
     272      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     273      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 28.57143F));
     274      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     275      this.overviewTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 42.85715F));
     276      this.overviewTableLayoutPanel.Controls.Add(this.lblRows, 0, 0);
     277      this.overviewTableLayoutPanel.Controls.Add(this.lblColumns, 0, 1);
     278      this.overviewTableLayoutPanel.Controls.Add(this.columnsTextBox, 1, 1);
     279      this.overviewTableLayoutPanel.Controls.Add(this.lblNominalColumns, 2, 1);
     280      this.overviewTableLayoutPanel.Controls.Add(this.lblNumericColumns, 2, 0);
     281      this.overviewTableLayoutPanel.Controls.Add(this.rowsTextBox, 1, 0);
     282      this.overviewTableLayoutPanel.Controls.Add(this.numericColumnsTextBox, 3, 0);
     283      this.overviewTableLayoutPanel.Controls.Add(this.nominalColumnsTextBox5, 3, 1);
     284      this.overviewTableLayoutPanel.Controls.Add(this.missingValuesTextBox, 5, 1);
     285      this.overviewTableLayoutPanel.Controls.Add(this.lblTNumValues, 4, 0);
     286      this.overviewTableLayoutPanel.Controls.Add(this.totalValuesTextBox, 5, 0);
     287      this.overviewTableLayoutPanel.Controls.Add(this.lblMissingValuesTotal, 4, 1);
     288      this.overviewTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     289      this.overviewTableLayoutPanel.Location = new System.Drawing.Point(3, 16);
     290      this.overviewTableLayoutPanel.Name = "overviewTableLayoutPanel";
     291      this.overviewTableLayoutPanel.RowCount = 3;
     292      this.overviewTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     293      this.overviewTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
     294      this.overviewTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
     295      this.overviewTableLayoutPanel.Size = new System.Drawing.Size(378, 52);
     296      this.overviewTableLayoutPanel.TabIndex = 19;
     297      //
     298      // numericColumnsTextBox
     299      //
     300      this.numericColumnsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     301      this.numericColumnsTextBox.Location = new System.Drawing.Point(192, 3);
     302      this.numericColumnsTextBox.Name = "numericColumnsTextBox";
     303      this.numericColumnsTextBox.ReadOnly = true;
     304      this.numericColumnsTextBox.Size = new System.Drawing.Size(35, 20);
     305      this.numericColumnsTextBox.TabIndex = 18;
     306      //
     307      // nominalColumnsTextBox5
     308      //
     309      this.nominalColumnsTextBox5.Dock = System.Windows.Forms.DockStyle.Fill;
     310      this.nominalColumnsTextBox5.Location = new System.Drawing.Point(192, 29);
     311      this.nominalColumnsTextBox5.Name = "nominalColumnsTextBox5";
     312      this.nominalColumnsTextBox5.ReadOnly = true;
     313      this.nominalColumnsTextBox5.Size = new System.Drawing.Size(35, 20);
     314      this.nominalColumnsTextBox5.TabIndex = 18;
     315      //
     316      // missingValuesTextBox
     317      //
     318      this.missingValuesTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     319      this.missingValuesTextBox.Location = new System.Drawing.Point(316, 29);
     320      this.missingValuesTextBox.Name = "missingValuesTextBox";
     321      this.missingValuesTextBox.ReadOnly = true;
     322      this.missingValuesTextBox.Size = new System.Drawing.Size(59, 20);
     323      this.missingValuesTextBox.TabIndex = 18;
     324      //
     325      // overviewGroupBox
     326      //
     327      this.overviewGroupBox.Controls.Add(this.overviewTableLayoutPanel);
     328      this.overviewGroupBox.Location = new System.Drawing.Point(3, 0);
     329      this.overviewGroupBox.Name = "overviewGroupBox";
     330      this.overviewGroupBox.Size = new System.Drawing.Size(384, 71);
     331      this.overviewGroupBox.TabIndex = 20;
     332      this.overviewGroupBox.TabStop = false;
     333      this.overviewGroupBox.Text = "Overview";
     334      //
    212335      // StatisticsView
    213336      //
    214337      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    215338      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    216       this.Controls.Add(this.groupBox1);
     339      this.Controls.Add(this.overviewGroupBox);
     340      this.Controls.Add(this.orientationGroupBox);
     341      this.Controls.Add(this.showVariablesGroupBox);
    217342      this.Controls.Add(this.stringMatrixView);
    218       this.Controls.Add(this.lblNominalColumns);
    219       this.Controls.Add(this.lblNumericColumns);
    220       this.Controls.Add(this.lblMissingValuesTotal);
    221       this.Controls.Add(this.txtMissingValuesTotal);
    222       this.Controls.Add(this.txtNominalColumns);
    223       this.Controls.Add(this.lblColumns);
    224       this.Controls.Add(this.txtNumericColumns);
    225       this.Controls.Add(this.txtColumns);
    226       this.Controls.Add(this.txtRows);
    227       this.Controls.Add(this.lblRows);
    228343      this.Name = "StatisticsView";
    229       this.Size = new System.Drawing.Size(549, 408);
    230       this.groupBox1.ResumeLayout(false);
     344      this.Size = new System.Drawing.Size(598, 408);
     345      this.showVariablesGroupBox.ResumeLayout(false);
     346      this.orientationGroupBox.ResumeLayout(false);
     347      this.orientationGroupBox.PerformLayout();
     348      this.overviewTableLayoutPanel.ResumeLayout(false);
     349      this.overviewTableLayoutPanel.PerformLayout();
     350      this.overviewGroupBox.ResumeLayout(false);
    231351      this.ResumeLayout(false);
    232       this.PerformLayout();
    233352
    234353    }
     
    237356
    238357    private System.Windows.Forms.Label lblRows;
    239     private System.Windows.Forms.Label txtRows;
    240358    private System.Windows.Forms.Label lblColumns;
    241359    private System.Windows.Forms.Label lblMissingValuesTotal;
    242     private System.Windows.Forms.Label txtColumns;
    243     private System.Windows.Forms.Label txtNumericColumns;
    244     private System.Windows.Forms.Label txtNominalColumns;
    245360    private System.Windows.Forms.Label lblNumericColumns;
    246361    private System.Windows.Forms.Label lblNominalColumns;
    247     private System.Windows.Forms.Label txtMissingValuesTotal;
    248362    private HeuristicLab.Data.Views.StringConvertibleMatrixView stringMatrixView;
    249     private System.Windows.Forms.GroupBox groupBox1;
     363    private System.Windows.Forms.GroupBox showVariablesGroupBox;
    250364    private System.Windows.Forms.Button checkInputsTargetButton;
    251365    private System.Windows.Forms.Button uncheckAllButton;
    252366    private System.Windows.Forms.Button checkAllButton;
     367    private System.Windows.Forms.ToolTip toolTip;
     368    private System.Windows.Forms.GroupBox orientationGroupBox;
     369    private System.Windows.Forms.RadioButton verticalRadioButton;
     370    private System.Windows.Forms.RadioButton horizontalRadioButton;
     371    private System.Windows.Forms.Label lblTNumValues;
     372    private System.Windows.Forms.TextBox rowsTextBox;
     373    private System.Windows.Forms.TextBox columnsTextBox;
     374    private System.Windows.Forms.TextBox totalValuesTextBox;
     375    private System.Windows.Forms.TableLayoutPanel overviewTableLayoutPanel;
     376    private System.Windows.Forms.TextBox numericColumnsTextBox;
     377    private System.Windows.Forms.TextBox nominalColumnsTextBox5;
     378    private System.Windows.Forms.TextBox missingValuesTextBox;
     379    private System.Windows.Forms.GroupBox overviewGroupBox;
    253380  }
    254381}
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.cs

    r14546 r14915  
    2121
    2222using System;
     23using System.Collections;
    2324using System.Collections.Generic;
     25using System.Linq;
    2426using System.Windows.Forms;
    2527using HeuristicLab.Core.Views;
    2628using HeuristicLab.Data;
    2729using HeuristicLab.MainForm;
     30using HeuristicLab.MainForm.WindowsForms;
    2831
    2932namespace HeuristicLab.DataPreprocessing.Views {
     
    3336  public partial class StatisticsView : ItemView {
    3437
     38    private bool horizontal = true;
     39
    3540    private StringMatrix statisticsMatrix;
    3641
    37     private static readonly string[] RowNames = new[] {
     42    private static readonly string[] StatisticsNames = new[] {
    3843      "Type",
    3944      "Missing Values",
     
    4247      "Median",
    4348      "Average",
    44       "std. Deviation",
     49      "Std. Deviation",
    4550      "Variance",
    4651      "25th Percentile",
     
    6267      base.OnContentChanged();
    6368      if (Content == null) {
    64         txtRows.Text = "";
    65         txtColumns.Text = "";
    66         txtNumericColumns.Text = "";
    67         txtNominalColumns.Text = "";
    68         txtMissingValuesTotal.Text = "";
     69        rowsTextBox.Text = string.Empty;
     70        columnsTextBox.Text = string.Empty;
     71        numericColumnsTextBox.Text = string.Empty;
     72        nominalColumnsTextBox5.Text = string.Empty;
     73        missingValuesTextBox.Text = string.Empty;
     74        totalValuesTextBox.Text = string.Empty;
    6975        stringMatrixView.Content = null;
    7076        statisticsMatrix = null;
     
    8490    }
    8591
    86     private void UpdateData() {
    87       var logic = Content.StatisticsLogic;
    88       var rowCount = logic.GetRowCount();
    89       txtRows.Text = logic.GetColumnCount().ToString();
    90       txtColumns.Text = rowCount.ToString();
    91       txtNumericColumns.Text = logic.GetNumericColumnCount().ToString();
    92       txtNominalColumns.Text = logic.GetNominalColumnCount().ToString();
    93       txtMissingValuesTotal.Text = logic.GetMissingValueCount().ToString();
    94 
    95       statisticsMatrix = new StringMatrix(RowNames.Length, Content.PreprocessingData.Columns) {
    96         RowNames = StatisticsView.RowNames,
    97         ColumnNames = Content.PreprocessingData.VariableNames
    98       };
    99 
    100       if (rowCount > 0) {
    101         for (int i = 0; i < logic.GetColumnCount(); ++i) {
    102           var data = GetList(i);
    103           for (int j = 0; j < data.Count; j++) {
     92    private void UpdateData(Dictionary<string, bool> oldVisibility = null) {
     93      var logic = Content.StatisticsLogic;
     94      rowsTextBox.Text = logic.GetColumnCount().ToString();
     95      columnsTextBox.Text = logic.GetRowCount().ToString();
     96      numericColumnsTextBox.Text = logic.GetNumericColumnCount().ToString();
     97      nominalColumnsTextBox5.Text = logic.GetNominalColumnCount().ToString();
     98      missingValuesTextBox.Text = logic.GetMissingValueCount().ToString();
     99      totalValuesTextBox.Text = (logic.GetColumnCount() * logic.GetRowCount() - logic.GetMissingValueCount()).ToString();
     100
     101      var variableNames = Content.PreprocessingData.VariableNames.ToList();
     102      if (horizontal)
     103        statisticsMatrix = new StringMatrix(StatisticsNames.Length, Content.PreprocessingData.Columns) {
     104          RowNames = StatisticsView.StatisticsNames,
     105          ColumnNames = variableNames
     106        };
     107      else
     108        statisticsMatrix = new StringMatrix(Content.PreprocessingData.Columns, StatisticsNames.Length) {
     109          RowNames = variableNames,
     110          ColumnNames = StatisticsView.StatisticsNames
     111        };
     112
     113      for (int i = 0; i < logic.GetColumnCount(); i++) {
     114        var data = GetStatistics(i);
     115        for (int j = 0; j < data.Count; j++) {
     116          if (horizontal)
    104117            statisticsMatrix[j, i] = data[j];
    105           }
    106         }
    107       }
     118          else
     119            statisticsMatrix[i, j] = data[j];
     120        }
     121      }
     122
     123      stringMatrixView.Parent.SuspendRepaint();
    108124      stringMatrixView.Content = statisticsMatrix;
    109125
    110       foreach (DataGridViewColumn column in stringMatrixView.DataGridView.Columns) {
    111         var variable = column.HeaderText;
    112         bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable)
    113                              || Content.PreprocessingData.TargetVariable == variable;
    114         column.Visible = isInputTarget;
    115       }
     126      var grid = stringMatrixView.DataGridView;
     127      int idx = 0;
     128      var list = horizontal ? grid.Columns : grid.Rows as IList;
     129      foreach (DataGridViewBand band in list) {
     130        var variable = variableNames[idx++];
     131        if (oldVisibility != null) {
     132          band.Visible = !oldVisibility.ContainsKey(variable) || oldVisibility[variable];
     133        }
     134      }
     135      if (horizontal)
     136        stringMatrixView.UpdateColumnHeaders();
     137      else
     138        stringMatrixView.UpdateRowHeaders();
     139
    116140      stringMatrixView.DataGridView.AutoResizeColumns();
    117 
    118       //foreach (DataGridViewRow row in stringMatrixView.DataGridView.Rows) {
    119       //  var variable = (string)row.HeaderCell.Value;
    120       //  bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable)
    121       //                       || Content.PreprocessingData.TargetVariable == variable;
    122       //  row.Visible = isInputTarget;
    123       //}
    124     }
    125 
    126     private List<string> GetList(int i) {
     141      stringMatrixView.Parent.ResumeRepaint(true);
     142    }
     143
     144    private List<string> GetStatistics(int varIdx) {
    127145      List<string> list;
    128146      var logic = Content.StatisticsLogic;
    129       if (logic.VariableHasType<double>(i)) {
    130         list = GetDoubleColumns(i);
    131       } else if (logic.VariableHasType<string>(i)) {
    132         list = GetStringColumns(i);
    133       } else if (logic.VariableHasType<DateTime>(i)) {
    134         list = GetDateTimeColumns(i);
     147      if (logic.VariableHasType<double>(varIdx)) {
     148        list = GetDoubleColumns(varIdx);
     149      } else if (logic.VariableHasType<string>(varIdx)) {
     150        list = GetStringColumns(varIdx);
     151      } else if (logic.VariableHasType<DateTime>(varIdx)) {
     152        list = GetDateTimeColumns(varIdx);
    135153      } else {
    136154        list = new List<string>();
    137         for (int j = 0; j < RowNames.Length; ++j) {
     155        for (int j = 0; j < StatisticsNames.Length; ++j) {
    138156          list.Add("unknown column type");
    139157        }
     
    142160    }
    143161
    144     private List<string> GetDoubleColumns(int columnIndex) {
     162    private List<string> GetDoubleColumns(int statIdx) {
    145163      var logic = Content.StatisticsLogic;
    146164      return new List<string> {
    147         logic.GetColumnTypeAsString(columnIndex),
    148         logic.GetMissingValueCount(columnIndex).ToString(),
    149         logic.GetMin<double>(columnIndex,double.NaN).ToString(),
    150         logic.GetMax<double>(columnIndex,double.NaN).ToString(),
    151         logic.GetMedian(columnIndex).ToString(),
    152         logic.GetAverage(columnIndex).ToString(),
    153         logic.GetStandardDeviation(columnIndex).ToString(),
    154         logic.GetVariance(columnIndex).ToString(),
    155         logic.GetOneQuarterPercentile(columnIndex).ToString(),
    156         logic.GetThreeQuarterPercentile(columnIndex).ToString(),
    157         logic.GetMostCommonValue<double>(columnIndex,double.NaN).ToString(),
    158         logic.GetDifferentValuesCount<double>(columnIndex).ToString()
     165        logic.GetColumnTypeAsString(statIdx),
     166        logic.GetMissingValueCount(statIdx).ToString(),
     167        logic.GetMin<double>(statIdx, double.NaN).ToString(),
     168        logic.GetMax<double>(statIdx, double.NaN).ToString(),
     169        logic.GetMedian(statIdx).ToString(),
     170        logic.GetAverage(statIdx).ToString(),
     171        logic.GetStandardDeviation(statIdx).ToString(),
     172        logic.GetVariance(statIdx).ToString(),
     173        logic.GetOneQuarterPercentile(statIdx).ToString(),
     174        logic.GetThreeQuarterPercentile(statIdx).ToString(),
     175        logic.GetMostCommonValue<double>(statIdx, double.NaN).ToString(),
     176        logic.GetDifferentValuesCount<double>(statIdx).ToString()
    159177      };
    160178    }
    161179
    162     private List<string> GetStringColumns(int columnIndex) {
     180    private List<string> GetStringColumns(int statIdx) {
    163181      var logic = Content.StatisticsLogic;
    164182      return new List<string> {
    165         logic.GetColumnTypeAsString(columnIndex),
    166         logic.GetMissingValueCount(columnIndex).ToString(),
     183        logic.GetColumnTypeAsString(statIdx),
     184        logic.GetMissingValueCount(statIdx).ToString(),
    167185        "", //min
    168186        "", //max
     
    173191        "", //quarter percentile
    174192        "", //three quarter percentile
    175         logic.GetMostCommonValue<string>(columnIndex,string.Empty) ?? "",
    176         logic.GetDifferentValuesCount<string>(columnIndex).ToString()
     193        logic.GetMostCommonValue<string>(statIdx,string.Empty) ?? "",
     194        logic.GetDifferentValuesCount<string>(statIdx).ToString()
    177195      };
    178196    }
    179197
    180     private List<string> GetDateTimeColumns(int columnIndex) {
     198    private List<string> GetDateTimeColumns(int statIdx) {
    181199      var logic = Content.StatisticsLogic;
    182200      return new List<string> {
    183         logic.GetColumnTypeAsString(columnIndex),
    184         logic.GetMissingValueCount(columnIndex).ToString(),
    185         logic.GetMin<DateTime>(columnIndex,DateTime.MinValue).ToString(),
    186         logic.GetMax<DateTime>(columnIndex,DateTime.MinValue).ToString(),
    187         logic.GetMedianDateTime(columnIndex).ToString(),
    188         logic.GetAverageDateTime(columnIndex).ToString(),
    189         logic.GetStandardDeviation(columnIndex).ToString(),
    190         logic.GetVariance(columnIndex).ToString(), //variance
    191         logic.GetOneQuarterPercentile(columnIndex).ToString(),
    192         logic.GetThreeQuarterPercentile(columnIndex).ToString(),
    193         logic.GetMostCommonValue<DateTime>(columnIndex,DateTime.MinValue).ToString(),
    194         logic.GetDifferentValuesCount<DateTime>(columnIndex).ToString()
     201        logic.GetColumnTypeAsString(statIdx),
     202        logic.GetMissingValueCount(statIdx).ToString(),
     203        logic.GetMin<DateTime>(statIdx, DateTime.MinValue).ToString(),
     204        logic.GetMax<DateTime>(statIdx, DateTime.MinValue).ToString(),
     205        logic.GetMedianDateTime(statIdx).ToString(),
     206        logic.GetAverageDateTime(statIdx).ToString(),
     207        logic.GetStandardDeviation(statIdx).ToString(),
     208        logic.GetVariance(statIdx).ToString(),
     209        logic.GetOneQuarterPercentile(statIdx).ToString(),
     210        logic.GetThreeQuarterPercentile(statIdx).ToString(),
     211        logic.GetMostCommonValue<DateTime>(statIdx, DateTime.MinValue).ToString(),
     212        logic.GetDifferentValuesCount<DateTime>(statIdx).ToString()
    195213      };
    196214    }
     
    200218    }
    201219
     220    #region Show/Hide Variables
    202221    private void checkInputsTargetButton_Click(object sender, EventArgs e) {
    203       foreach (DataGridViewColumn column in stringMatrixView.DataGridView.Columns) {
    204         var variable = column.HeaderText;
     222      var grid = stringMatrixView.DataGridView;
     223      var list = horizontal ? grid.Columns : grid.Rows as IList;
     224      var variableNames = Content.PreprocessingData.VariableNames.ToList();
     225      int idx = 0;
     226      foreach (DataGridViewBand band in list) {
     227        var variable = variableNames[idx++];
    205228        bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable)
    206229                             || Content.PreprocessingData.TargetVariable == variable;
    207         column.Visible = isInputTarget;
    208       }
    209     }
    210 
     230        band.Visible = isInputTarget;
     231        if (horizontal)
     232          stringMatrixView.UpdateColumnHeaders();
     233        else
     234          stringMatrixView.UpdateRowHeaders();
     235      }
     236
     237    }
    211238    private void checkAllButton_Click(object sender, EventArgs e) {
    212       foreach (DataGridViewColumn column in stringMatrixView.DataGridView.Columns) {
    213         column.Visible = true;
    214       }
    215     }
    216 
     239      var grid = stringMatrixView.DataGridView;
     240      var list = horizontal ? grid.Columns : grid.Rows as IList;
     241      foreach (DataGridViewBand band in list) {
     242        band.Visible = true;
     243      }
     244      if (horizontal)
     245        stringMatrixView.UpdateColumnHeaders();
     246      else
     247        stringMatrixView.UpdateRowHeaders();
     248    }
    217249    private void uncheckAllButton_Click(object sender, EventArgs e) {
    218       foreach (DataGridViewColumn column in stringMatrixView.DataGridView.Columns) {
    219         column.Visible = false;
    220       }
    221     }
     250      var grid = stringMatrixView.DataGridView;
     251      var list = horizontal ? grid.Columns : grid.Rows as IList;
     252      foreach (DataGridViewBand band in list) {
     253        band.Visible = false;
     254      }
     255    }
     256    #endregion
     257
     258    #region Orientation
     259    private void horizontalRadioButton_CheckedChanged(object sender, EventArgs e) {
     260      var grid = stringMatrixView.DataGridView;
     261      var oldVisibility = new Dictionary<string, bool>();
     262      var variableNames = Content.PreprocessingData.VariableNames.ToList();
     263      if (stringMatrixView.Content != null) {
     264        var list = horizontal ? grid.Columns : grid.Rows as IList;
     265        int idx = 0;
     266        foreach (DataGridViewBand band in list) {
     267          var variable = variableNames[idx++];
     268          oldVisibility.Add(variable, band.Visible);
     269        }
     270      }
     271      horizontal = horizontalRadioButton.Checked;
     272      UpdateData(oldVisibility);
     273    }
     274    private void verticalRadioButton_CheckedChanged(object sender, EventArgs e) {
     275      // everything is handled in horizontalRadioButton_CheckedChanged
     276    }
     277    #endregion
    222278  }
    223279}
Note: See TracChangeset for help on using the changeset viewer.