#region License Information
/* HeuristicLab
* Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
*
* This file is part of HeuristicLab.
*
* HeuristicLab is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* HeuristicLab is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with HeuristicLab. If not, see .
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using HeuristicLab.Core;
using HeuristicLab.Data;
using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
namespace HeuristicLab.Logging {
///
/// Class for point xy charts.
///
public class PointXYChart : ItemBase, IVisualizationItem {
[Storable]
private ItemList myValues;
///
/// Gets or sets the values of the current instance.
///
/// Calls in the setter.
public ItemList Values {
get { return myValues; }
set {
if (value != myValues) {
myValues = value;
OnValuesChanged();
}
}
}
[Storable]
private BoolData myConnectDots;
///
/// Gets or sets the flag whether the dots should be connected or not.
///
/// Calls in the setter.
public BoolData ConnectDots {
get { return myConnectDots; }
set {
if (value != myConnectDots) {
myConnectDots = value;
OnConnectDotsChanged();
}
}
}
///
/// Initializes a new instance of with the ConnectDots flag set to
/// true.
///
public PointXYChart() {
myConnectDots = new BoolData(true);
}
///
/// Initializes a new instance of with the given
/// flag and the specified .
///
/// The flag whether the dots should be connected or not.
/// The values with which the current instance should be initialized.
public PointXYChart(bool connectDots,ItemList values) {
myConnectDots = new BoolData(connectDots);
myValues = values;
}
///
/// Clones the current instance (deep clone).
///
/// Deep clone through method of helper class
/// .
/// Dictionary of all already clone objects. (Needed to avoid cycles.)
/// The cloned object as .
public override object Clone(IDictionary clonedObjects) {
PointXYChart clone = (PointXYChart)base.Clone(clonedObjects);
clone.myValues = (ItemList)Auxiliary.Clone(Values, clonedObjects);
return clone;
}
///
/// Creates a new instance of to represent the current instance visually.
///
/// The created view as .
public override IView CreateView() {
return new PointXYChartView(this);
}
///
/// Occurs when the values of the current instance have been changed.
///
public event EventHandler ValuesChanged;
///
/// Fires a ValuesChanged event.
///
protected virtual void OnValuesChanged() {
if (ValuesChanged != null)
ValuesChanged(this, new EventArgs());
}
///
/// Occurs when the boolean flag has been changed.
///
public event EventHandler ConnectDotsChanged;
///
/// Fires a ConnectDotsChanged event.
///
protected virtual void OnConnectDotsChanged() {
if (ConnectDotsChanged != null)
ConnectDotsChanged(this, new EventArgs());
}
}
}