Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataTableVisualProperties.cs @ 5991

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

Updated year of copyrights (#1406)

File size: 3.6 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 HeuristicLab.Common;
24using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
25
26namespace HeuristicLab.Analysis {
27  /// <summary>
28  /// Visual properties of a DataTable.
29  /// </summary>
30  [StorableClass]
31  public class DataTableVisualProperties : DeepCloneable, INotifyPropertyChanged {
32    private string xAxisTitle;
33    public string XAxisTitle {
34      get { return xAxisTitle; }
35      set {
36        if (value == null) value = string.Empty;
37        if (xAxisTitle != value) {
38          xAxisTitle = value;
39          OnPropertyChanged("XAxisTitle");
40        }
41      }
42    }
43
44    private string yAxisTitle;
45    public string YAxisTitle {
46      get { return yAxisTitle; }
47      set {
48        if (value == null) value = string.Empty;
49        if (yAxisTitle != value) {
50          yAxisTitle = value;
51          OnPropertyChanged("YAxisTitle");
52        }
53      }
54    }
55
56    private string secondYAxisTitle;
57    public string SecondYAxisTitle {
58      get { return secondYAxisTitle; }
59      set {
60        if (value == null) value = string.Empty;
61        if (secondYAxisTitle != value) {
62          secondYAxisTitle = value;
63          OnPropertyChanged("SecondYAxisTitle");
64        }
65      }
66    }
67
68    #region Persistence Properties
69    [Storable(Name = "XAxisTitle")]
70    private string StorableXAxisTitle {
71      get { return xAxisTitle; }
72      set { xAxisTitle = value; }
73    }
74    [Storable(Name = "YAxisTitle")]
75    private string StorableYAxisTitle {
76      get { return yAxisTitle; }
77      set { yAxisTitle = value; }
78    }
79    [Storable(Name = "SecondYAxisTitle")]
80    private string StorableSecondYAxisTitle {
81      get { return secondYAxisTitle; }
82      set { secondYAxisTitle = value; }
83    }
84    #endregion
85
86    [StorableConstructor]
87    protected DataTableVisualProperties(bool deserializing) : base() { }
88    protected DataTableVisualProperties(DataTableVisualProperties original, Cloner cloner)
89      : base(original, cloner) {
90      this.xAxisTitle = original.xAxisTitle;
91      this.yAxisTitle = original.yAxisTitle;
92      this.secondYAxisTitle = original.secondYAxisTitle;
93    }
94    public DataTableVisualProperties() {
95      this.xAxisTitle = string.Empty;
96      this.yAxisTitle = string.Empty;
97      this.secondYAxisTitle = string.Empty;
98    }
99
100    public override IDeepCloneable Clone(Cloner cloner) {
101      return new DataTableVisualProperties(this, cloner);
102    }
103
104    public event PropertyChangedEventHandler PropertyChanged;
105    protected virtual void OnPropertyChanged(string propertyName) {
106      PropertyChangedEventHandler handler = PropertyChanged;
107      if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
108    }
109  }
110}
Note: See TracBrowser for help on using the repository browser.