Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/Options/ViewSettings.cs @ 1389

Last change on this file since 1389 was 1389, checked in by dwagner, 15 years ago

Added Functionality: Changes in dialog are directly applied to the linechart & reset button resets the values (#478)

File size: 2.0 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 Font xAxisFont;
13    private Color xAxisColor;
14    private LegendPosition legendPosition;
15
16    public ViewSettings() {
17      titleFont = new Font("Arial", 8);
18      titleColor = Color.Blue;
19
20      legendFont = new Font("Arial", 8);
21      legendColor = Color.Blue;
22
23      xAxisFont = new Font("Arial", 8);
24      xAxisColor = Color.Blue;
25
26      legendPosition = LegendPosition.Bottom;
27    }
28
29    public ViewSettings(ViewSettings src) {
30     
31      titleFont = (Font)(src.titleFont.Clone());
32      titleColor = src.TitleColor;
33
34      legendFont = (Font)(src.legendFont.Clone());
35      legendColor = src.LegendColor;
36
37      xAxisFont = (Font) (src.xAxisFont.Clone());
38      xAxisColor = src.XAxisColor;
39
40      legendPosition = src.LegendPosition;
41    }
42
43    public void UpdateView() {
44      if (OnUpdateSettings != null) {
45        OnUpdateSettings();
46      }
47    }
48
49    public Font TitleFont {
50      get { return titleFont; }
51      set { titleFont = value; }
52    }
53
54    public Color TitleColor {
55      get { return titleColor; }
56      set { titleColor = value; }
57    }
58
59    public Font LegendFont {
60      get { return legendFont; }
61      set { legendFont = value; }
62    }
63
64    public Color LegendColor {
65      get { return legendColor; }
66      set { legendColor = value; }
67    }
68
69    public Font XAxisFont {
70      get { return xAxisFont; }
71      set { xAxisFont = value; }
72    }
73
74    public Color XAxisColor {
75      get { return xAxisColor; }
76      set { xAxisColor = value; }
77    }
78
79    public LegendPosition LegendPosition {
80      get { return legendPosition; }
81      set { legendPosition = value; }
82    }
83  }
84
85  public delegate void UpdateViewSettingsHandler();
86}
Note: See TracBrowser for help on using the repository browser.