1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System.ComponentModel;
|
---|
23 | using System.Drawing;
|
---|
24 | using HeuristicLab.Common;
|
---|
25 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
26 |
|
---|
27 | namespace HeuristicLab.Analysis {
|
---|
28 | /// <summary>
|
---|
29 | /// Visual properties of a DataRow.
|
---|
30 | /// </summary>
|
---|
31 | [StorableClass]
|
---|
32 | public class DataRowVisualProperties : DeepCloneable, INotifyPropertyChanged {
|
---|
33 | #region ChartType
|
---|
34 | public enum DataRowChartType {
|
---|
35 | Line,
|
---|
36 | Columns,
|
---|
37 | Points,
|
---|
38 | Bars,
|
---|
39 | Histogram
|
---|
40 | }
|
---|
41 | #endregion
|
---|
42 |
|
---|
43 | private DataRowChartType chartType;
|
---|
44 | public DataRowChartType ChartType {
|
---|
45 | get { return chartType; }
|
---|
46 | set {
|
---|
47 | if (chartType != value) {
|
---|
48 | chartType = value;
|
---|
49 | OnPropertyChanged("ChartType");
|
---|
50 | }
|
---|
51 | }
|
---|
52 | }
|
---|
53 | private bool secondYAxis;
|
---|
54 | public bool SecondYAxis {
|
---|
55 | get { return secondYAxis; }
|
---|
56 | set {
|
---|
57 | if (secondYAxis != value) {
|
---|
58 | secondYAxis = value;
|
---|
59 | OnPropertyChanged("SecondYAxis");
|
---|
60 | }
|
---|
61 | }
|
---|
62 | }
|
---|
63 | private Color color;
|
---|
64 | public Color Color {
|
---|
65 | get { return color; }
|
---|
66 | set {
|
---|
67 | if (color != value) {
|
---|
68 | color = value;
|
---|
69 | OnPropertyChanged("Color");
|
---|
70 | }
|
---|
71 | }
|
---|
72 | }
|
---|
73 | private bool startIndexZero;
|
---|
74 | public bool StartIndexZero {
|
---|
75 | get { return startIndexZero; }
|
---|
76 | set {
|
---|
77 | if (startIndexZero != value) {
|
---|
78 | startIndexZero = value;
|
---|
79 | OnPropertyChanged("StartIndexZero");
|
---|
80 | }
|
---|
81 | }
|
---|
82 | }
|
---|
83 | private int bins;
|
---|
84 | public int Bins {
|
---|
85 | get { return bins; }
|
---|
86 | set {
|
---|
87 | if (bins != value) {
|
---|
88 | bins = value;
|
---|
89 | OnPropertyChanged("Bins");
|
---|
90 | }
|
---|
91 | }
|
---|
92 | }
|
---|
93 | private bool exactBins;
|
---|
94 | public bool ExactBins {
|
---|
95 | get { return exactBins; }
|
---|
96 | set {
|
---|
97 | if (exactBins != value) {
|
---|
98 | exactBins = value;
|
---|
99 | OnPropertyChanged("ExactBins");
|
---|
100 | }
|
---|
101 | }
|
---|
102 | }
|
---|
103 |
|
---|
104 | #region Persistence Properties
|
---|
105 | [Storable(Name = "ChartType")]
|
---|
106 | private DataRowChartType StorableChartType {
|
---|
107 | get { return chartType; }
|
---|
108 | set { chartType = value; }
|
---|
109 | }
|
---|
110 | [Storable(Name = "SecondYAxis")]
|
---|
111 | private bool StorableSecondYAxis {
|
---|
112 | get { return secondYAxis; }
|
---|
113 | set { secondYAxis = value; }
|
---|
114 | }
|
---|
115 | [Storable(Name = "Color")]
|
---|
116 | private Color StorableColor {
|
---|
117 | get { return color; }
|
---|
118 | set { color = value; }
|
---|
119 | }
|
---|
120 | [Storable(Name = "StartIndexZero")]
|
---|
121 | private bool StorableStartIndexZero {
|
---|
122 | get { return startIndexZero; }
|
---|
123 | set { startIndexZero = value; }
|
---|
124 | }
|
---|
125 | [Storable(Name = "Bins")]
|
---|
126 | private int StorableBins {
|
---|
127 | get { return bins; }
|
---|
128 | set { bins = value; }
|
---|
129 | }
|
---|
130 | [Storable(Name = "ExactBins")]
|
---|
131 | private bool StorableExactBins {
|
---|
132 | get { return exactBins; }
|
---|
133 | set { exactBins = value; }
|
---|
134 | }
|
---|
135 | #endregion
|
---|
136 |
|
---|
137 | [StorableConstructor]
|
---|
138 | protected DataRowVisualProperties(bool deserializing) : base() { }
|
---|
139 | protected DataRowVisualProperties(DataRowVisualProperties original, Cloner cloner)
|
---|
140 | : base(original, cloner) {
|
---|
141 | this.chartType = original.chartType;
|
---|
142 | this.secondYAxis = original.secondYAxis;
|
---|
143 | this.color = original.color;
|
---|
144 | this.startIndexZero = original.startIndexZero;
|
---|
145 | }
|
---|
146 | public DataRowVisualProperties() {
|
---|
147 | chartType = DataRowChartType.Line;
|
---|
148 | secondYAxis = false;
|
---|
149 | color = Color.Empty;
|
---|
150 | startIndexZero = false;
|
---|
151 | }
|
---|
152 |
|
---|
153 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
154 | return new DataRowVisualProperties(this, cloner);
|
---|
155 | }
|
---|
156 |
|
---|
157 | public event PropertyChangedEventHandler PropertyChanged;
|
---|
158 | protected virtual void OnPropertyChanged(string propertyName) {
|
---|
159 | PropertyChangedEventHandler handler = PropertyChanged;
|
---|
160 | if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
|
---|
161 | }
|
---|
162 | }
|
---|
163 | }
|
---|