Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10934


Ignore:
Timestamp:
06/04/14 12:30:08 (10 years ago)
Author:
mleitner
Message:

Update correlationmatrix on preprocessing data change - improve performance on datagrid selection.

Location:
branches/DataPreprocessing
Files:
4 edited

Legend:

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

    r10930 r10934  
    3636    private bool notOwnEvent = true;
    3737    private bool isSearching = false;
     38    private bool updateOnMouseUp = false;
    3839    private SearchAndReplaceDialog findAndReplaceDialog;
    3940    private IFindPreprocessingItemsIterator searchIterator;
     
    7071      dataGridView.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(dataGridView_CellPainting);
    7172      dataGridView.KeyDown += dataGridView_KeyDown;
     73      dataGridView.MouseUp += dataGridView_MouseUp;
    7274      contextMenuCell.Items.Add(ShowHideColumns);
    7375      _highlightedRowIndices = new List<int>();
     
    7981      if (Content != null) {
    8082        if (!isSearching) {
     83
     84          if (Control.MouseButtons == MouseButtons.Left) {
     85            updateOnMouseUp = true;
     86            return;
     87          }
     88           
    8189          base.dataGridView_SelectionChanged(sender, e);
     90       
    8291          Content.DataGridLogic.SetSelection(GetSelectedCells());
    8392        }
    8493      }
    8594    }
     95
     96    private void dataGridView_MouseUp(object sender, MouseEventArgs e) {
     97      if (!updateOnMouseUp)
     98        return;
     99
     100      updateOnMouseUp = false;
     101      dataGridView_SelectionChanged(sender, e);
     102    }                                     
    86103
    87104    protected override void OnContentChanged() {
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs

    r10922 r10934  
    5454        //var correlationMatrixLogic = new ChartLogic(data);
    5555        var filterLogic = new FilterLogic(data);
    56         var creator = new ProblemDataCreator(Content);
    57         var problemData = (DataAnalysisProblemData)creator.CreateProblemData();
     56       
    5857        //var dataCompletenessLogic = new ChartLogic(data);
    5958
     
    6564          new HistogramContent(chartLogic),
    6665          new ScatterPlotContent(chartLogic),
    67           new CorrelationMatrixContent(problemData),
     66          new CorrelationMatrixContent(Content),
    6867          new DataCompletenessChartContent(dataGridLogic, searchLogic),
    6968         
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs

    r10908 r10934  
    6666    }
    6767
     68
    6869    protected override void RegisterContentEvents() {
    6970      base.RegisterContentEvents();
     71      Content.PreprocessingData.Changed += Data_Changed;
    7072      fcc.ProgressCalculation += new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);
    7173      fcc.CorrelationCalculationFinished += new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);
     
    7375
    7476    protected override void DeregisterContentEvents() {
     77      Content.PreprocessingData.Changed -= Data_Changed;
    7578      fcc.CorrelationCalculationFinished -= new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);
    7679      fcc.ProgressCalculation -= new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);
    7780      base.DeregisterContentEvents();
     81    }
     82
     83    private void Data_Changed(object sender, DataPreprocessingChangedEventArgs e) {
     84      OnContentChanged();
    7885    }
    7986
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/CorrelationMatrixContent.cs

    r10914 r10934  
    2929  [Item("Feature Correlation Matrix", "Represents the feature correlation matrix.")]
    3030  public class CorrelationMatrixContent : Item, IViewShortcut {
    31     public DataAnalysisProblemData ProblemData { get; set; }
    3231
    33     public CorrelationMatrixContent(DataAnalysisProblemData data) {
    34       ProblemData = data;
     32    public DataAnalysisProblemData ProblemData {
     33      get {
     34        var creator = new ProblemDataCreator(Context);
     35        return (DataAnalysisProblemData)creator.CreateProblemData();
     36      }
     37    }
     38
     39    public ITransactionalPreprocessingData PreprocessingData {
     40      get {
     41        return Context.Data;
     42      }
     43    }
     44
     45    private IPreprocessingContext Context { get; set; }
     46    public CorrelationMatrixContent(IPreprocessingContext context) {
     47      Context = context;
     48
     49
    3550    }
    3651
     
    4762      return new CorrelationMatrixContent(this, cloner);
    4863    }
     64
     65    public event DataPreprocessingChangedEventHandler Changed {
     66      add { PreprocessingData.Changed += value; }
     67      remove { PreprocessingData.Changed -= value; }
     68    }
    4969  }
    5070}
Note: See TracChangeset for help on using the changeset viewer.