Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/11/15 10:11:47 (9 years ago)
Author:
ascheibe
Message:

#2388 merged trunk into branch

Location:
branches/HiveStatistics/sources
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views

  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/Plugin.cs.frame

    r12012 r12843  
    2626  /// Plugin class for HeuristicLab.Optimization.Views plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Optimization.Views", "3.3.11.$WCREV$")]
     28  [Plugin("HeuristicLab.Optimization.Views", "3.3.12.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Optimization.Views-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/Properties/AssemblyInfo.cs.frame

    r12012 r12843  
    5454// by using the '*' as shown below:
    5555[assembly: AssemblyVersion("3.3.0.0")]
    56 [assembly: AssemblyFileVersion("3.3.11.$WCREV$")]
     56[assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs

    r12077 r12843  
    345345      switch (axisDimension) {
    346346        case AxisDimension.Color: {
    347             value = GetCategoricalValue(-1, run.Color.ToString());
     347            const int colorDimension = -1;
     348            if (!categoricalMapping.ContainsKey(colorDimension)) {
     349              categoricalMapping[colorDimension] = Content.Where(r => r.Visible)
     350                  .Select(r => r.Color.Name)
     351                  .Distinct()
     352                  .OrderBy(c => c, new NaturalStringComparer())
     353                  .Select((c, i) => new { Color = c, Index = i })
     354                  .ToDictionary(a => (object)a.Color, a => (double)a.Index);
     355
     356            }
     357            value = GetCategoricalValue(colorDimension, run.Color.Name);
    348358            break;
    349359          }
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs

    r12689 r12843  
    242242      dataRowComboBox.Items.Clear();
    243243      var resultName = (string)dataTableComboBox.SelectedItem;
     244      if (resultName == null) return;
     245
    244246      var dataTables = from run in Content
    245247                       where run.Results.ContainsKey(resultName)
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTableView.cs

    r12077 r12843  
    5353      base.OnContentChanged();
    5454      if (Content != null) {
    55         runToRowMapping = Enumerable.Range(0, Content.Count).ToArray();
    5655        UpdateRowAttributes();
    5756      }
     
    151150        suppressUpdates = Content.UpdateOfRunsInProgress;
    152151        if (!suppressUpdates) {
     152          UpdateData();
    153153          UpdateRowAttributes();
    154           UpdateData();
    155154        }
    156155      }
     
    179178    protected override void ClearSorting() {
    180179      base.ClearSorting();
    181       runToRowMapping = Enumerable.Range(0, Content.Count).ToArray();
    182180      UpdateRowAttributes();
    183181    }
     
    198196        i++;
    199197      }
    200       UpdateRowAttributes();
     198      UpdateRowAttributes(rebuild: false);
    201199      return newSortedIndex;
    202200    }
    203201
    204     private void UpdateRowAttributes() {
     202    private void UpdateRowAttributes(bool rebuild = true) {
     203      if (rebuild) runToRowMapping = Enumerable.Range(0, Content.Count).ToArray();
    205204      int runIndex = 0;
    206205      foreach (IRun run in Content) {
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs

    r12012 r12843  
    4141    private Dictionary<IRun, List<ListViewItem>> itemListViewItemMapping;
    4242    private bool validDragOperation;
     43    private bool suppressUpdates;
    4344
    4445    public new IItemCollection<IRun> Content {
     
    6667      Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
    6768      Content.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
     69      if (RunCollection != null)
     70        RunCollection.UpdateOfRunsInProgressChanged -= new EventHandler(RunCollection_UpdateOfRunsInProgressChanged);
    6871      foreach (IRun run in itemListViewItemMapping.Keys) {
    6972        DeregisterItemEvents(run);
     
    7679      Content.ItemsRemoved += new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
    7780      Content.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
     81      if (RunCollection != null)
     82        RunCollection.UpdateOfRunsInProgressChanged += new EventHandler(RunCollection_UpdateOfRunsInProgressChanged);
    7883    }
    7984    private void DeregisterItemEvents(IRun item) {
     
    394399    #region Content Events
    395400    private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     401      if (suppressUpdates) return;
    396402      if (InvokeRequired)
    397403        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded), sender, e);
     
    407413    }
    408414    private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     415      if (suppressUpdates) return;
    409416      if (InvokeRequired)
    410417        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e);
     
    422429    }
    423430    private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     431      if (suppressUpdates) return;
    424432      if (InvokeRequired)
    425433        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e);
     
    440448      }
    441449    }
     450    private void RunCollection_UpdateOfRunsInProgressChanged(object sender, EventArgs e) {
     451      if (InvokeRequired) Invoke((Action<object, EventArgs>)RunCollection_UpdateOfRunsInProgressChanged, sender, e);
     452      else {
     453        suppressUpdates = RunCollection.UpdateOfRunsInProgress;
     454        if (!suppressUpdates) {
     455          foreach (IRun item in Content) {
     456            //remove only the first matching ListViewItem, because the IRun could be contained multiple times in the ItemCollection
     457            ListViewItem listViewItem = GetListViewItemsForItem(item).FirstOrDefault();
     458            if (listViewItem != null) RemoveListViewItem(listViewItem);
     459          }
     460          RebuildImageList();
     461          foreach (IRun item in Content)
     462            AddListViewItem(CreateListViewItem(item));
     463
     464          AdjustListViewColumnSizes();
     465          analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
     466          clearButton.Enabled = itemsListView.Items.Count > 0 && !Content.IsReadOnly && !ReadOnly;
     467          runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
     468        }
     469      }
     470    }
    442471    #endregion
    443472
    444473    #region Item Events
    445474    private void Item_ItemImageChanged(object sender, EventArgs e) {
     475      if (suppressUpdates) return;
    446476      if (InvokeRequired)
    447477        Invoke(new EventHandler(Item_ItemImageChanged), sender, e);
     
    453483    }
    454484    private void Item_ToStringChanged(object sender, EventArgs e) {
     485      if (suppressUpdates) return;
    455486      if (InvokeRequired)
    456487        Invoke(new EventHandler(Item_ToStringChanged), sender, e);
     
    463494    }
    464495    private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e) {
     496      if (suppressUpdates) return;
    465497      if (InvokeRequired)
    466         this.Invoke((Action<object, PropertyChangedEventArgs>)Item_PropertyChanged, sender, e);
     498        Invoke((Action<object, PropertyChangedEventArgs>)Item_PropertyChanged, sender, e);
    467499      else {
    468500        IRun run = (IRun)sender;
Note: See TracChangeset for help on using the changeset viewer.