Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/18/15 14:10:12 (9 years ago)
Author:
pfleck
Message:

#2486

  • Added the possibility to add rows or columns by middle-click on a row or column header.
  • Added a rename columns button which shows the new RenameColumnsDialog.
  • Fixed a bug where no input variables where checked after exporting to a DataAnalysisProblemData.
Location:
trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/FilteredPreprocessingData.cs

    r12059 r13252  
    119119        throw new InvalidOperationException("DeleteColumn not possible while data is filtered");
    120120      originalData.DeleteColumn(columnIndex);
     121    }
     122
     123    public void RenameColumn(int columnIndex, string name) {
     124      if (IsFiltered)
     125        throw new InvalidOperationException("RenameColumn not possible while data is filtered");
     126      originalData.RenameColumn(columnIndex, name);
     127    }
     128
     129    public void RenameColumns(IList<string> names) {
     130      if (IsFiltered)
     131        throw new InvalidOperationException("RenameColumns not possible while data is filtered");
     132      originalData.RenameColumns(names);
    121133    }
    122134
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingData.cs

    r12509 r13252  
    196196    public abstract void DeleteColumn(int columnIndex);
    197197
     198    public abstract void RenameColumn(int columnIndex, string name);
     199    public abstract void RenameColumns(IList<string> list);
     200
    198201    public abstract Dataset ExportToDataset();
    199202
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/TransactionalPreprocessingData.cs

    r12986 r13252  
    265265    }
    266266
     267    public override void RenameColumn(int columnIndex, string name) {
     268      SaveSnapshot(DataPreprocessingChangedEventType.ChangeColumn, columnIndex, -1);
     269      if (columnIndex < 0 || columnIndex > variableNames.Count)
     270        throw new ArgumentOutOfRangeException("columnIndex");
     271      variableNames[columnIndex] = name;
     272
     273      if (!IsInTransaction)
     274        OnChanged(DataPreprocessingChangedEventType.ChangeColumn, -1, -1);
     275    }
     276
     277    public override void RenameColumns(IList<string> names) {
     278      if (names == null) throw new ArgumentNullException("names");
     279      if (names.Count != variableNames.Count) throw new ArgumentException("number of names must match the number of columns.", "names");
     280
     281      SaveSnapshot(DataPreprocessingChangedEventType.ChangeColumn, -1, -1);
     282      for (int i = 0; i < names.Count; i++)
     283        variableNames[i] = names[i];
     284
     285      if (!IsInTransaction)
     286        OnChanged(DataPreprocessingChangedEventType.ChangeColumn, -1, -1);
     287    }
     288
    267289    public override Dataset ExportToDataset() {
    268290      IList<IList> values = new List<IList>();
Note: See TracChangeset for help on using the changeset viewer.