Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/04/12 15:42:21 (12 years ago)
Author:
mkommend
Message:

#1673: Added new property AlgorithmName to the RunCollection and synced the property with the name of the surrounding IOptimizer. The AlgorithmName is used by the RunCollectionViews as prefix for its caption if it was set.

Location:
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs

    r7469 r8738  
    7575      Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    7676      Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged);
     77      Content.AlgorithmNameChanged += new EventHandler(Content_AlgorithmNameChanged);
    7778      RegisterRunEvents(Content);
    7879    }
     
    8586      Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    8687      Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged);
     88      Content.AlgorithmNameChanged -= new EventHandler(Content_AlgorithmNameChanged);
    8789      DeregisterRunEvents(Content);
    8890    }
     
    139141      }
    140142    }
     143
     144    private void Content_AlgorithmNameChanged(object sender, EventArgs e) {
     145      if (InvokeRequired)
     146        Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e);
     147      else UpdateCaption();
     148    }
    141149    #endregion
    142150
     
    147155      UpdateComboBoxes();
    148156      UpdateDataPoints();
     157      UpdateCaption();
     158    }
     159
     160    private void UpdateCaption() {
     161      Caption = Content != null ? Content.AlgorithmName + "Box Plots" : ViewAttribute.GetViewName(GetType());
    149162    }
    150163
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs

    r7469 r8738  
    9393      Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    9494      Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged);
     95      Content.AlgorithmNameChanged += new EventHandler(Content_AlgorithmNameChanged);
    9596      RegisterRunEvents(Content);
    9697    }
     
    103104      Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    104105      Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged);
     106      Content.AlgorithmNameChanged -= new EventHandler(Content_AlgorithmNameChanged);
    105107      DeregisterRunEvents(Content);
    106108    }
     
    163165      UpdateComboBoxes();
    164166      UpdateDataPoints();
     167      UpdateCaption();
    165168    }
    166169    private void Content_ColumnNamesChanged(object sender, EventArgs e) {
     
    169172      else
    170173        UpdateComboBoxes();
     174    }
     175
     176    private void UpdateCaption() {
     177      Caption = Content != null ? Content.AlgorithmName + "Bubble Chart" : ViewAttribute.GetViewName(GetType());
    171178    }
    172179
     
    215222        if (!suppressUpdates) UpdateDataPoints();
    216223      }
     224    }
     225
     226    private void Content_AlgorithmNameChanged(object sender, EventArgs e) {
     227      if (InvokeRequired)
     228        Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e);
     229      else UpdateCaption();
    217230    }
    218231
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionDataTableView.cs

    r8108 r8738  
    6363      Content.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    6464      Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged);
     65      Content.AlgorithmNameChanged += new EventHandler(Content_AlgorithmNameChanged);
    6566    }
    6667    protected override void DeregisterContentEvents() {
     
    6970      Content.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    7071      Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged);
     72      Content.AlgorithmNameChanged -= new EventHandler(Content_AlgorithmNameChanged);
    7173      base.DeregisterContentEvents();
    7274    }
     
    9395      RemoveRuns(e.OldItems);
    9496      AddRuns(e.Items);
     97    }
     98    private void Content_AlgorithmNameChanged(object sender, EventArgs e) {
     99      if (InvokeRequired)
     100        Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e);
     101      else UpdateCaption();
    95102    }
    96103    private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) {
     
    123130      runMapping.Clear();
    124131
     132      UpdateCaption();
    125133      if (Content != null) {
    126134        UpdateDataTableComboBox();
     
    195203    }
    196204
     205    private void UpdateCaption() {
     206      Caption = Content != null ? Content.AlgorithmName + "Data Table" : ViewAttribute.GetViewName(GetType());
     207    }
     208
    197209    private void UpdateDataRowComboBox() {
    198210      dataRowComboBox.Items.Clear();
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTabularView.cs

    r8139 r8738  
    5555        UpdateRowAttributes();
    5656      }
     57      UpdateCaption();
    5758    }
    5859
     
    6465      Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    6566      Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged);
     67      Content.AlgorithmNameChanged += new EventHandler(Content_AlgorithmNameChanged);
    6668      RegisterRunEvents(Content);
    6769    }
     
    7678      Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    7779      Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged);
     80      Content.AlgorithmNameChanged -= new EventHandler(Content_AlgorithmNameChanged);
    7881      DeregisterRunEvents(Content);
    7982    }
     
    9194    private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
    9295      RegisterRunEvents(e.Items);
     96    }
     97    private void Content_AlgorithmNameChanged(object sender, EventArgs e) {
     98      if (InvokeRequired)
     99        Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e);
     100      else UpdateCaption();
    93101    }
    94102    private void run_Changed(object sender, EventArgs e) {
     
    101109    }
    102110    #endregion
     111
     112    private void UpdateCaption() {
     113      Caption = Content != null ? Content.AlgorithmName + "Tabular View" : ViewAttribute.GetViewName(GetType());
     114    }
    103115
    104116    protected override void UpdateColumnHeaders() {
Note: See TracChangeset for help on using the changeset viewer.