Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/18/13 16:23:21 (10 years ago)
Author:
sbreuer
Message:
  • added apply sorting button to datagridcontentview with click handler
  • modified sorting
Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/DataGridContent.cs

    r10246 r10253  
    1111
    1212    private readonly IDataGridLogic dataGridLogic;
    13     public DataGridContent(IDataGridLogic theDataGridLogic) {
     13    private readonly IPreprocessingDataManipulation preprocessingDataManipulation;
     14    public DataGridContent(IDataGridLogic theDataGridLogic, IPreprocessingDataManipulation thePreprocessingDataManipulation) {
    1415      dataGridLogic = theDataGridLogic;
     16      preprocessingDataManipulation = thePreprocessingDataManipulation;
    1517    }
    1618
    1719    public DataGridContent(DataGridContent dataGridContent, Cloner cloner)
    1820      : base(dataGridContent, cloner) {
     21    }
    1922
     23    public IPreprocessingDataManipulation PreprocessingDataManipulation {
     24      get { return preprocessingDataManipulation; }
    2025    }
    2126
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingDataManipulation.cs

    r10249 r10253  
    115115        }
    116116
    117         foreach (string variableName in preprocessingData.VariableNames) {
    118           if (preprocessingData.IsType<double>(variableName)) {
    119             reOrderToIndices<double>(variableName, shuffledIndices);
    120           } else if (preprocessingData.IsType<string>(variableName)) {
    121             reOrderToIndices<string>(variableName, shuffledIndices);
    122           } else if (preprocessingData.IsType<DateTime>(variableName)) {
    123             reOrderToIndices<DateTime>(variableName, shuffledIndices);
    124           }
     117        reOrdertoIndices(shuffledIndices);
     118      }
     119    }
     120
     121    public void reOrdertoIndices(IList<Tuple<int, int>> indices) {
     122      foreach (string variableName in preprocessingData.VariableNames) {
     123        if (preprocessingData.IsType<double>(variableName)) {
     124          reOrderToIndices<double>(variableName, indices);
     125        } else if (preprocessingData.IsType<string>(variableName)) {
     126          reOrderToIndices<string>(variableName, indices);
     127        } else if (preprocessingData.IsType<DateTime>(variableName)) {
     128          reOrderToIndices<DateTime>(variableName, indices);
    125129        }
    126130      }
    127131    }
    128132
    129     public void reOrderToIndices<T>(string variableName, List<Tuple<int, int>> indices) {
     133    private void reOrderToIndices<T>(string variableName, IList<Tuple<int, int>> indices) {
    130134      // process all columns equally
    131135      foreach (Tuple<int, int> index in indices) {
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IDataGridContent.cs

    r10246 r10253  
    88  public interface IDataGridContent : IStringConvertibleMatrix {
    99    IDataGridLogic DataGridLogic { get; }
     10    IPreprocessingDataManipulation PreprocessingDataManipulation { get; }
    1011  }
    1112}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingDataManipulation.cs

    r10246 r10253  
    33namespace HeuristicLab.DataPreprocessing {
    44  interface IPreprocessingDataManipulation {
    5     void reOrderToIndices<T>(string variableName, List<Tuple<int, int>> indices);
     5    void reOrderToIndices(IList<Tuple<int, int>> indices);
    66    void ReplaceIndicesByAverageValue(string variableName, IEnumerable<int> indices);
    77    void ReplaceIndicesByLinearInterpolationOfNeighbours(string variableName, IEnumerable<int> indices);
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataGridContentView.Designer.cs

    r10243 r10253  
    2424    /// </summary>
    2525    private void InitializeComponent() {
     26      this.btnApplySort = new System.Windows.Forms.Button();
    2627      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    2728      this.SuspendLayout();
     
    3233      this.errorProvider.SetIconPadding(this.rowsTextBox, 2);
    3334      this.rowsTextBox.ReadOnly = true;
     35      this.rowsTextBox.Size = new System.Drawing.Size(296, 20);
    3436      //
    3537      // columnsTextBox
    3638      //
    3739      this.columnsTextBox.ReadOnly = true;
     40      this.columnsTextBox.Size = new System.Drawing.Size(296, 20);
     41      //
     42      // statisticsTextBox
     43      //
     44      this.statisticsTextBox.Size = new System.Drawing.Size(522, 13);
     45      //
     46      // btnApplySort
     47      //
     48      this.btnApplySort.Location = new System.Drawing.Point(398, 18);
     49      this.btnApplySort.Name = "btnApplySort";
     50      this.btnApplySort.Size = new System.Drawing.Size(75, 23);
     51      this.btnApplySort.TabIndex = 7;
     52      this.btnApplySort.Text = "Apply Sort";
     53      this.btnApplySort.UseVisualStyleBackColor = true;
     54      this.btnApplySort.Click += new System.EventHandler(this.btnApplySort_Click);
    3855      //
    3956      // DataGridContentView
     
    4158      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    4259      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     60      this.Controls.Add(this.btnApplySort);
    4361      this.Name = "DataGridContentView";
     62      this.Size = new System.Drawing.Size(528, 404);
    4463      this.Controls.SetChildIndex(this.statisticsTextBox, 0);
    4564      this.Controls.SetChildIndex(this.rowsLabel, 0);
     
    4766      this.Controls.SetChildIndex(this.rowsTextBox, 0);
    4867      this.Controls.SetChildIndex(this.columnsTextBox, 0);
     68      this.Controls.SetChildIndex(this.btnApplySort, 0);
    4969      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    5070      this.ResumeLayout(false);
     
    5474
    5575    #endregion
     76
     77    private System.Windows.Forms.Button btnApplySort;
    5678  }
    5779}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataGridContentView.cs

    r10246 r10253  
    2323    protected override void OnContentChanged() {
    2424      base.OnContentChanged();
     25    }
    2526
    26     }
    2727
    2828    private void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) {
     
    3535      }
    3636    }
     37
     38    private void btnApplySort_Click(object sender, System.EventArgs e) {
     39     
     40    }
    3741  }
    3842}
Note: See TracChangeset for help on using the changeset viewer.