Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Persistence Test/HeuristicLab.Visualization/3.2/Options/ViewSettings.cs @ 3810

Last change on this file since 3810 was 1993, checked in by mstoeger, 15 years ago

added many new persisted properties.
removed useless comments.
added XmlSupport class since the code for setting xml attributes is always the same.
#639

File size: 1.6 KB
Line 
1using System.Drawing;
2using HeuristicLab.Visualization.Legend;
3
4namespace HeuristicLab.Visualization.Options {
5  public class ViewSettings {
6    public event UpdateViewSettingsHandler OnUpdateSettings;
7
8    private Font titleFont;
9    private Color titleColor;
10    private Font legendFont;
11    private Color legendColor;
12    private LegendPosition legendPosition;
13
14    public ViewSettings() {
15      titleFont = new Font("Arial", 8);
16      titleColor = Color.Blue;
17
18      legendFont = new Font("Arial", 8);
19      legendColor = Color.Blue;
20
21      legendPosition = LegendPosition.Right;
22    }
23
24    public ViewSettings(ViewSettings src) {
25     
26      titleFont = (Font)(src.titleFont.Clone());
27      titleColor = src.TitleColor;
28
29      legendFont = (Font)(src.legendFont.Clone());
30      legendColor = src.LegendColor;
31
32      legendPosition = src.LegendPosition;
33    }
34
35    public void UpdateView() {
36      if (OnUpdateSettings != null) {
37        OnUpdateSettings();
38      }
39    }
40
41    public Font TitleFont {
42      get { return titleFont; }
43      set { titleFont = value; }
44    }
45
46    public Color TitleColor {
47      get { return titleColor; }
48      set { titleColor = value; }
49    }
50
51    public Font LegendFont {
52      get { return legendFont; }
53      set { legendFont = value; }
54    }
55
56    public Color LegendColor {
57      get { return legendColor; }
58      set { legendColor = value; }
59    }
60
61    public LegendPosition LegendPosition {
62      get { return legendPosition; }
63      set { legendPosition = value; }
64    }
65  }
66
67  public delegate void UpdateViewSettingsHandler();
68}
Note: See TracBrowser for help on using the repository browser.