Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PersistenceSpeedUp/HeuristicLab.Analysis/3.3/DataVisualization/DataRowVisualProperties.cs @ 6406

Last change on this file since 6406 was 5445, checked in by swagner, 14 years ago

Updated year of copyrights (#1406)

File size: 3.9 KB
Line 
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
22using System.ComponentModel;
23using System.Drawing;
24using HeuristicLab.Common;
25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
26
27namespace 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    }
40    #endregion
41
42    private DataRowChartType chartType;
43    public DataRowChartType ChartType {
44      get { return chartType; }
45      set {
46        if (chartType != value) {
47          chartType = value;
48          OnPropertyChanged("ChartType");
49        }
50      }
51    }
52    private bool secondYAxis;
53    public bool SecondYAxis {
54      get { return secondYAxis; }
55      set {
56        if (secondYAxis != value) {
57          secondYAxis = value;
58          OnPropertyChanged("SecondYAxis");
59        }
60      }
61    }
62    private Color color;
63    public Color Color {
64      get { return color; }
65      set {
66        if (color != value) {
67          color = value;
68          OnPropertyChanged("Color");
69        }
70      }
71    }
72    private bool startIndexZero;
73    public bool StartIndexZero {
74      get { return startIndexZero; }
75      set {
76        if (startIndexZero != value) {
77          startIndexZero = value;
78          OnPropertyChanged("StartIndexZero");
79        }
80      }
81    }
82
83    #region Persistence Properties
84    [Storable(Name = "ChartType")]
85    private DataRowChartType StorableChartType {
86      get { return chartType; }
87      set { chartType = value; }
88    }
89    [Storable(Name = "SecondYAxis")]
90    private bool StorableSecondYAxis {
91      get { return secondYAxis; }
92      set { secondYAxis = value; }
93    }
94    [Storable(Name = "Color")]
95    private Color StorableColor {
96      get { return color; }
97      set { color = value; }
98    }
99    [Storable(Name = "StartIndexZero")]
100    private bool StorableStartIndexZero {
101      get { return startIndexZero; }
102      set { startIndexZero = value; }
103    }
104    #endregion
105
106    [StorableConstructor]
107    protected DataRowVisualProperties(bool deserializing) : base() { }
108    protected DataRowVisualProperties(DataRowVisualProperties original, Cloner cloner)
109      : base(original, cloner) {
110      this.chartType = original.chartType;
111      this.secondYAxis = original.secondYAxis;
112      this.color = original.color;
113      this.startIndexZero = original.startIndexZero;
114    }
115    public DataRowVisualProperties() {
116      chartType = DataRowChartType.Line;
117      secondYAxis = false;
118      color = Color.Empty;
119      startIndexZero = false;
120    }
121
122    public override IDeepCloneable Clone(Cloner cloner) {
123      return new DataRowVisualProperties(this, cloner);
124    }
125
126    public event PropertyChangedEventHandler PropertyChanged;
127    protected virtual void OnPropertyChanged(string propertyName) {
128      PropertyChangedEventHandler handler = PropertyChanged;
129      if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
130    }
131  }
132}
Note: See TracBrowser for help on using the repository browser.