Changeset 859
- Timestamp:
- 11/29/08 10:57:47 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Visualization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/ChartDataRowsModel.cs
r761 r859 7 7 public delegate void DataRowAddedHandler(IDataRow row); 8 8 public delegate void DataRowRemovedHandler(IDataRow row); 9 10 9 public delegate void ModelChangedHandler(); 11 10 12 public class ChartDataRowsModel : ChartDataModelBase, IChartDataRowsModel 11 public class ChartDataRowsModel : ChartDataModelBase, IChartDataRowsModel{ 13 12 private string title; 14 13 private string xAxisLabel; 15 private string yAxisLabel;16 14 17 public void AddLabel(string label) { 18 throw new NotImplementedException(); 19 // TODO ModelChangedEvent auslösen 15 private readonly List<IDataRow> rows = new List<IDataRow>(); 16 private readonly List<string> xLabels = new List<string>(); 17 18 public List<string> XLabels{ 19 get { return xLabels; } 20 20 } 21 21 22 public void AddLabel(string label, int index) { 23 throw new NotImplementedException(); 24 // TODO ModelChangedEvent auslösen 25 } 26 27 public void AddLabels(string[] labels) { 28 throw new NotImplementedException(); 29 // TODO ModelChangedEvent auslösen 30 } 31 32 public void AddLabels(string[] labels, int index) { 33 throw new NotImplementedException(); 34 // TODO ModelChangedEvent auslösen 35 } 36 37 public void ModifyLabel(string label, int index) { 38 throw new NotImplementedException(); 39 // TODO ModelChangedEvent auslösen 40 } 41 42 public void ModifyLabels(string[] labels, int index) { 43 throw new NotImplementedException(); 44 // TODO ModelChangedEvent auslösen 45 } 46 47 public void RemoveLabel(int index) { 48 throw new NotImplementedException(); 49 // TODO ModelChangedEvent auslösen 50 } 51 52 public void RemoveLabels(int index, int count) { 53 throw new NotImplementedException(); 54 // TODO ModelChangedEvent auslösen 22 public List<IDataRow> Rows{ 23 get { return rows; } 55 24 } 56 25 … … 62 31 } 63 32 } 64 65 33 public string XAxisLabel { 66 34 get { return xAxisLabel; } … … 71 39 } 72 40 73 public string YAxisLabel { 74 get { return yAxisLabel; } 75 set { 76 yAxisLabel = value; 77 OnModelChanged(); 78 } 41 public override IView CreateView() { 42 return new LineChart(this); 79 43 } 80 44 81 public event ModelChangedHandler ModelChanged; 82 83 protected void OnModelChanged() { 84 if (ModelChanged != null) { 85 ModelChanged(); 86 } 45 public void AddLabel(string label) { 46 xLabels.Add(label); 47 OnModelChanged(); 87 48 } 88 49 89 private readonly List<IDataRow> rows = new List<IDataRow>(); 90 91 public static IDataRow CreateDataRow() { 92 throw new NotImplementedException(); 50 public void AddLabel(string label, int index) { 51 xLabels[index] = label; 52 OnModelChanged(); 53 } 54 55 public void AddLabels(string[] labels) { 56 foreach (var s in labels){ 57 AddLabel(s); 58 } 59 //OnModelChanged(); 60 } 61 62 public void AddLabels(string[] labels, int index) { 63 int i = 0; 64 foreach (var s in labels){ 65 AddLabel(s, index + i); 66 i++; 67 } 68 //OnModelChanged(); 69 } 70 71 public void ModifyLabel(string label, int index) { 72 xLabels[index] = label; 73 OnModelChanged(); 74 } 75 76 public void ModifyLabels(string[] labels, int index) { 77 int i = 0; 78 foreach (var s in labels){ 79 ModifyLabel(s, index + i); 80 i++; 81 } 82 //OnModelChanged(); 83 } 84 85 public void RemoveLabel(int index) { 86 xLabels.RemoveAt(index); 87 OnModelChanged(); 88 } 89 90 public void RemoveLabels(int index, int count) { 91 for (int i = index; i < index + count; i++ ){ 92 RemoveLabel(i); 93 } 94 //OnModelChanged(); 93 95 } 94 96 … … 101 103 rows.Remove(row); 102 104 OnDataRowRemoved(row); 105 } 106 107 public event ModelChangedHandler ModelChanged; 108 109 protected void OnModelChanged() { 110 if (ModelChanged != null) { 111 ModelChanged(); 112 } 103 113 } 104 114 … … 119 129 } 120 130 121 public override IView CreateView() { 122 return new LineChart(this); //when LineChart is implemented 123 } 131 124 132 125 133 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { -
trunk/sources/HeuristicLab.Visualization/IChartDataRowsModel.cs
r761 r859 1 namespace HeuristicLab.Visualization { 1 using System.Collections.Generic; 2 3 namespace HeuristicLab.Visualization { 2 4 public interface IChartDataRowsModel { 3 5 string Title { get; set; } 4 6 string XAxisLabel { get; set; } 5 string YAxisLabel { get; set; } 7 List<string> XLabels { get; } 8 List<IDataRow> Rows { get; } 6 9 7 10 void AddDataRow(IDataRow row);
Note: See TracChangeset
for help on using the changeset viewer.