Free cookie consent management tool by TermsFeed Policy Generator

Changeset 873


Ignore:
Timestamp:
11/29/08 13:43:00 (16 years ago)
Author:
shofstad
Message:

changes on LegendForm (#407)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/LegendShape.cs

    r866 r873  
     1using System.Collections.Generic;
    12using System.Drawing;
    23
    34namespace HeuristicLab.Visualization {
     5  public class LegendItem {
     6    public LegendItem(string label, Color color) {
     7      Label = label;
     8      Color = color;
     9    }
     10
     11    public string Label { get; set; }
     12    public Color Color { get; set; }
     13  }
     14
     15
    416  public class LegendShape : IShape {
    517    private readonly Color color;
     18
     19    private readonly IList<LegendItem> legendItems = new List<LegendItem>();
    620    private readonly RectangleD rect;
    721
    822    public LegendShape(double x1, double y1, double x2, double y2, double z, Color color) {
    923      rect = new RectangleD(x1, y1, x2, y2);
    10       this.Z = z;
     24      Z = z;
    1125      this.color = color;
    1226    }
     
    3145
    3246    #endregion
     47
     48    public void AddLegendItem(LegendItem item) {
     49      legendItems.Add(item);
     50    }
     51
     52    public void RemoveLegendItem(LegendItem item) {
     53      legendItems.Remove(item);
     54    }
     55
     56    public void ClearLegendItems() {
     57      legendItems.Clear();
     58    }
    3359  }
    3460}
Note: See TracChangeset for help on using the changeset viewer.