Changeset 5995


Ignore:
Timestamp:
04/09/11 14:48:19 (8 years ago)
Author:
abeham
Message:

#1465

  • Changed HistogramHistory to derive from CheckedItemList<T> instead of ItemCollection<T>
  • Changed AggregatedHistogramHistoryView to aggregate only checked entries
Location:
branches/histogram
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram/HeuristicLab.Analysis.Views/3.3/AggregatedHistogramHistoryView.Designer.cs

    r5994 r5995  
    5050      // histogramControl
    5151      //
    52       this.histogramControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    53                   | System.Windows.Forms.AnchorStyles.Left)
    54                   | System.Windows.Forms.AnchorStyles.Right)));
    55       this.histogramControl.Location = new System.Drawing.Point(0, 26);
     52      this.histogramControl.CalculateExactBins = false;
     53      this.histogramControl.Dock = System.Windows.Forms.DockStyle.Fill;
     54      this.histogramControl.IncrementNumberOfBins = 1;
     55      this.histogramControl.Location = new System.Drawing.Point(0, 0);
     56      this.histogramControl.MaximumNumberOfBins = 100000;
     57      this.histogramControl.MinimumNumberOfBins = 1;
    5658      this.histogramControl.Name = "histogramControl";
    57       this.histogramControl.Size = new System.Drawing.Size(543, 346);
     59      this.histogramControl.NumberOfBins = 10;
     60      this.histogramControl.ShowExactCheckbox = true;
     61      this.histogramControl.Size = new System.Drawing.Size(543, 372);
    5862      this.histogramControl.TabIndex = 3;
    5963      //
    60       // HistogramView
     64      // AggregatedHistogramHistoryView
    6165      //
    6266      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    6367      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    6468      this.Controls.Add(this.histogramControl);
    65       this.Name = "HistogramView";
     69      this.Name = "AggregatedHistogramHistoryView";
    6670      this.Size = new System.Drawing.Size(543, 372);
    67       this.Controls.SetChildIndex(this.histogramControl, 0);
    6871      this.ResumeLayout(false);
    69       this.PerformLayout();
    7072
    7173    }
  • branches/histogram/HeuristicLab.Analysis.Views/3.3/AggregatedHistogramHistoryView.cs

    r5994 r5995  
    4343
    4444    protected override void DeregisterContentEvents() {
    45       Content.ItemsAdded -= new CollectionItemsChangedEventHandler<Histogram>(Content_ItemsAdded);
    46       Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<Histogram>(Content_ItemsRemoved);
    47       Content.CollectionReset -= new CollectionItemsChangedEventHandler<Histogram>(Content_CollectionReset);
     45      Content.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<Histogram>>(Content_ItemsAdded);
     46      Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<Histogram>>(Content_ItemsRemoved);
     47      Content.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<Histogram>>(Content_CollectionReset);
     48      Content.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<IndexedItem<Histogram>>(Content_CheckedItemsChanged);
    4849      foreach (Histogram h in Content) {
    4950        DeregisterHistogramEvents(h);
     
    6061    protected override void RegisterContentEvents() {
    6162      base.RegisterContentEvents();
    62       Content.ItemsAdded += new CollectionItemsChangedEventHandler<Histogram>(Content_ItemsAdded);
    63       Content.ItemsRemoved += new CollectionItemsChangedEventHandler<Histogram>(Content_ItemsRemoved);
    64       Content.CollectionReset += new CollectionItemsChangedEventHandler<Histogram>(Content_CollectionReset);
     63      Content.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<Histogram>>(Content_ItemsAdded);
     64      Content.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<Histogram>>(Content_ItemsRemoved);
     65      Content.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<Histogram>>(Content_CollectionReset);
     66      Content.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<Histogram>>(Content_CheckedItemsChanged);
    6567      foreach (Histogram h in Content) {
    6668        RegisterHistogramEvents(h);
     
    8486      InitializeHistogram();
    8587    }
    86     private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<Histogram> e) {
     88    private void Content_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<Histogram>> e) {
     89      InitializeHistogram();
     90    }
     91    private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Histogram>> e) {
    8792      List<double> added = new List<double>();
    88       foreach (Histogram h in e.Items) {
    89         RegisterHistogramEvents(h);
    90         added.AddRange(h.Values);
     93      foreach (IndexedItem<Histogram> h in e.Items) {
     94        RegisterHistogramEvents(h.Value);
     95        added.AddRange(h.Value.Values);
    9196      }
    9297      histogramControl.AddPoints(added);
    9398    }
    94     private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<Histogram> e) {
    95       foreach (Histogram h in e.Items) {
    96         DeregisterHistogramEvents(h);
     99    private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Histogram>> e) {
     100      foreach (IndexedItem<Histogram> h in e.Items) {
     101        DeregisterHistogramEvents(h.Value);
    97102      }
    98103      InitializeHistogram();
    99104    }
    100     private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<Histogram> e) {
    101       foreach (Histogram h in e.OldItems) {
    102         DeregisterHistogramEvents(h);
     105    private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<Histogram>> e) {
     106      foreach (IndexedItem<Histogram> h in e.OldItems) {
     107        DeregisterHistogramEvents(h.Value);
    103108      }
    104109      InitializeHistogram();
     
    123128      if (Content == null) return;
    124129      histogramControl.ClearPoints();
    125       var points = Content.SelectMany(x => x.Values);
     130      var points = Content.CheckedItems.SelectMany(x => x.Value.Values);
    126131      histogramControl.AddPoints(points);
    127132    }
  • branches/histogram/HeuristicLab.Analysis.Views/3.3/AggregatedHistogramHistoryView.resx

    r5994 r5995  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
    120   <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    121     <value>107, 17</value>
    122   </metadata>
    123   <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    124     <value>17, 17</value>
    125   </metadata>
    126120</root>
  • branches/histogram/HeuristicLab.Analysis/3.3/DataVisualization/HistogramHistory.cs

    r5961 r5995  
    3232  [Item("HistogramHistory", "Represents history values of histograms.")]
    3333  [StorableClass]
    34   public class HistogramHistory : ItemCollection<Histogram> {
     34  public class HistogramHistory : CheckedItemList<Histogram> {
    3535    public override Image ItemImage {
    3636      get { return HeuristicLab.Common.Resources.VSImageLibrary.Cab; }
     
    4141    protected HistogramHistory(HistogramHistory original, Cloner cloner) : base(original, cloner) { }
    4242    public HistogramHistory() : base() { }
    43     public HistogramHistory(IEnumerable<Histogram> collection) : base(new ItemCollection<Histogram>(collection)) { }
     43    public HistogramHistory(IEnumerable<Histogram> collection) : base(collection) { }
    4444
    4545    public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset for help on using the changeset viewer.