Changeset 1962 for trunk/sources/HeuristicLab.Visualization/3.2
- Timestamp:
- 05/29/09 17:23:18 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Visualization/3.2
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/3.2/ChartDataRowsModel.cs
r1886 r1962 121 121 122 122 XmlAttribute idAttr = document.CreateAttribute("label"); 123 idAttr.Value = row. Label;123 idAttr.Value = row.RowSettings.Label; 124 124 columnElement.Attributes.Append(idAttr); 125 125 … … 156 156 string rowLabel = rowIdAttr.Value; 157 157 DataRow row = new DataRow(); 158 row. Label = rowLabel;158 row.RowSettings.Label = rowLabel; 159 159 160 160 string[] tokens = dataRow.InnerText.Split(';'); -
trunk/sources/HeuristicLab.Visualization/3.2/ChartDataRowsModelDummy.cs
r1530 r1962 15 15 // TODO change to call new DataRow("Datarow 1"); 16 16 DataRow row1 = new DataRow(); 17 row1. Label = "Datarow 1";18 row1. Color = Color.Red;17 row1.RowSettings.Label = "Datarow 1"; 18 row1.RowSettings.Color = Color.Red; 19 19 DataRow row2 = new DataRow(); 20 row2. Label = "Datarow 2";21 row2. Color = Color.Blue;20 row2.RowSettings.Label = "Datarow 2"; 21 row2.RowSettings.Color = Color.Blue; 22 22 DataRow row3 = new DataRow(); 23 row3. Label = "Datarow 3";24 row3. Color = Color.DeepPink;23 row3.RowSettings.Label = "Datarow 3"; 24 row3.RowSettings.Color = Color.DeepPink; 25 25 26 26 AddDataRow(row1); -
trunk/sources/HeuristicLab.Visualization/3.2/DataExport/CSVDataExport.cs
r1881 r1962 29 29 writer.AddString(model.XAxis.Label); 30 30 foreach (IDataRow row in model.Rows) 31 writer.AddString(row. Label);31 writer.AddString(row.RowSettings.Label); 32 32 writer.NewLine(); 33 33 -
trunk/sources/HeuristicLab.Visualization/3.2/DataRow.cs
r1561 r1962 18 18 private readonly List<double> dataRow = new List<double>(); 19 19 20 // TODO implement calculation of min and max values21 20 private double minValue = double.MaxValue; 22 21 private double maxValue = double.MinValue; … … 26 25 27 26 public DataRow(string label) { 28 this. Label = label;27 this.RowSettings.Label = label; 29 28 } 30 29 31 30 public DataRow(string label, Color color, int thickness, DrawingStyle style, List<double> dataRow) { 32 this. Label = label;33 this. Color = color;34 this. Thickness = thickness;31 this.RowSettings.Label = label; 32 this.RowSettings.Color = color; 33 this.RowSettings.Thickness = thickness; 35 34 this.Style = style; 36 35 this.dataRow = dataRow; … … 39 38 40 39 public DataRow(string label, Color color, int thickness, DrawingStyle style, List<double> dataRow, bool showMarkers) { 41 this. Label = label;42 this. Color = color;43 this. Thickness = thickness;40 this.RowSettings.Label = label; 41 this.RowSettings.Color = color; 42 this.RowSettings.Thickness = thickness; 44 43 this.Style = style; 45 44 this.ShowMarkers = showMarkers; -
trunk/sources/HeuristicLab.Visualization/3.2/DataRowBase.cs
r1561 r1962 1 using System.Drawing;1 using HeuristicLab.Visualization.Options; 2 2 3 3 namespace HeuristicLab.Visualization { 4 4 public abstract class DataRowBase : IDataRow { 5 private string label = "";6 private Color color = Color.Black;7 private int thickness = 2;5 //private string label = ""; 6 //private Color color = Color.Black; 7 //private int thickness = 2; 8 8 private DrawingStyle style = DrawingStyle.Solid; 9 9 private DataRowType lineType = DataRowType.Normal; 10 10 private YAxisDescriptor yAxis; 11 11 private bool showMarkers = true; 12 13 private DataRowSettings rowSettings = new DataRowSettings(); 14 15 public DataRowSettings RowSettings { 16 get { return rowSettings; } 17 set { rowSettings = value; } 18 } 12 19 13 20 public bool ShowMarkers { … … 19 26 } 20 27 21 public string Label {22 get { return label; }23 set {24 label = value;25 OnDataRowChanged(this);26 }27 }28 29 public Color Color {30 get { return color; }31 set {32 color = value;33 OnDataRowChanged(this);34 }35 }36 37 public int Thickness {38 get { return thickness; }39 set {40 thickness = value;41 OnDataRowChanged(this);42 }43 }28 // public string Label { 29 // get { return label; } 30 // set { 31 // label = value; 32 // OnDataRowChanged(this); 33 // } 34 // } 35 // 36 // public Color Color { 37 // get { return color; } 38 // set { 39 // color = value; 40 // OnDataRowChanged(this); 41 // } 42 // } 43 // 44 // public int Thickness { 45 // get { return thickness; } 46 // set { 47 // thickness = value; 48 // OnDataRowChanged(this); 49 // } 50 // } 44 51 45 52 public DrawingStyle Style { -
trunk/sources/HeuristicLab.Visualization/3.2/HeuristicLab.Visualization-3.2.csproj
r1886 r1962 4 4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 5 5 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 6 <ProductVersion>9.0. 30729</ProductVersion>6 <ProductVersion>9.0.21022</ProductVersion> 7 7 <SchemaVersion>2.0</SchemaVersion> 8 8 <ProjectGuid>{E392A1E2-DC95-4E33-B82E-8ED690EDA1AB}</ProjectGuid> … … 120 120 <DependentUpon>ColorSelection.cs</DependentUpon> 121 121 </Compile> 122 <Compile Include="Options\DataRowSettings.cs" /> 122 123 <Compile Include="XAxisDescriptor.cs" /> 123 124 <Compile Include="YAxisGrid.cs" /> -
trunk/sources/HeuristicLab.Visualization/3.2/IDataRow.cs
r1883 r1962 1 using System.Drawing;1 using HeuristicLab.Visualization.Options; 2 2 3 3 namespace HeuristicLab.Visualization { … … 8 8 9 9 public interface IDataRow { 10 string Label { get; set; }11 Color Color { get; set; }12 int Thickness { get; set; }10 //string Label { get; set; } 11 //Color Color { get; set; } 12 //int Thickness { get; set; } 13 13 DrawingStyle Style { get; set; } 14 14 DataRowType LineType { get; set; } 15 15 bool ShowMarkers { get; set; } 16 DataRowSettings RowSettings { get; set; } 16 17 17 18 YAxisDescriptor YAxis { get; set; } -
trunk/sources/HeuristicLab.Visualization/3.2/LineChart.cs
r1885 r1962 366 366 row.DataRowChanged += OnDataRowChanged; 367 367 368 legendShape.AddLegendItem(new LegendItem(row. Label, row.Color, row.Thickness));368 legendShape.AddLegendItem(new LegendItem(row.RowSettings.Label, row.RowSettings.Color, row.RowSettings.Thickness)); 369 369 legendShape.CreateLegend(); 370 370 … … 466 466 if ((row.LineType == DataRowType.SingleValue)) { 467 467 if (row.Count > 0) { 468 LineShape lineShape = new HorizontalLineShape(0, row[0], double.MaxValue, row[0], row. Color, row.Thickness,468 LineShape lineShape = new HorizontalLineShape(0, row[0], double.MaxValue, row[0], row.RowSettings.Color, row.RowSettings.Thickness, 469 469 row.Style); 470 470 rowEntry.LinesShape.AddShape(lineShape); … … 473 473 rowEntry.showMarkers(true); //no lines, only markers are shown!! 474 474 for (int i = 0; i < row.Count; i++) 475 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(i , row[i], 8, row.Color));475 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(i, row[i], 8, row.RowSettings.Color)); 476 476 } else if (row.LineType == DataRowType.Normal) { 477 477 rowEntry.showMarkers(row.ShowMarkers); 478 478 for (int i = 1; i < row.Count; i++) { 479 LineShape lineShape = new LineShape(i - 1, row[i - 1], i, row[i], row. Color, row.Thickness, row.Style);479 LineShape lineShape = new LineShape(i - 1, row[i - 1], i, row[i], row.RowSettings.Color, row.RowSettings.Thickness, row.Style); 480 480 rowEntry.LinesShape.AddShape(lineShape); 481 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(i - 1, row[i - 1], 8, row. Color));481 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(i - 1, row[i - 1], 8, row.RowSettings.Color)); 482 482 } 483 483 if (row.Count > 0) { 484 rowEntry.LinesShape.AddMarkerShape(new MarkerShape((row.Count - 1), row[(row.Count - 1)], 8, row. Color));484 rowEntry.LinesShape.AddMarkerShape(new MarkerShape((row.Count - 1), row[(row.Count - 1)], 8, row.RowSettings.Color)); 485 485 } 486 486 } … … 501 501 if (row.LineType == DataRowType.SingleValue) { 502 502 if (action == Action.Added) { 503 LineShape lineShape = new HorizontalLineShape(0, row[0], double.MaxValue, row[0], row. Color, row.Thickness,503 LineShape lineShape = new HorizontalLineShape(0, row[0], double.MaxValue, row[0], row.RowSettings.Color, row.RowSettings.Thickness, 504 504 row.Style); 505 505 rowEntry.LinesShape.AddShape(lineShape); … … 514 514 if (action == Action.Added) { 515 515 if(rowEntry.LinesShape.Count==0) 516 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(0, row[0], 8, row. Color));516 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(0, row[0], 8, row.RowSettings.Color)); 517 517 if (index > 0 && index == rowEntry.LinesShape.Count + 1) { 518 LineShape lineShape = new LineShape(index - 1, row[index - 1], index, row[index], row. Color, row.Thickness,518 LineShape lineShape = new LineShape(index - 1, row[index - 1], index, row[index], row.RowSettings.Color, row.RowSettings.Thickness, 519 519 row.Style); 520 520 rowEntry.LinesShape.AddShape(lineShape); 521 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(index, row[index], 8, row. Color));521 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(index, row[index], 8, row.RowSettings.Color)); 522 522 } else { 523 523 throw new ArgumentException("Adding a value is only possible at the end of a row!"); … … 549 549 if (action == Action.Added) { 550 550 if (rowEntry.LinesShape.Count == 0) 551 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(0, row[0], 8, row. Color));551 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(0, row[0], 8, row.RowSettings.Color)); 552 552 if (index > 0 && index == rowEntry.LinesShape.Count + 1) { 553 LineShape lineShape = new LineShape(index -1, row[index-1], index, row[index], row.Color, row.Thickness,553 LineShape lineShape = new LineShape(index - 1, row[index - 1], index, row[index], row.RowSettings.Color, row.RowSettings.Thickness, 554 554 row.Style); 555 555 rowEntry.LinesShape.AddShape(lineShape); 556 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(index, row[index], 8, row. Color));556 rowEntry.LinesShape.AddMarkerShape(new MarkerShape(index, row[index], 8, row.RowSettings.Color)); 557 557 } 558 558 } else if (action == Action.Modified) { … … 744 744 LineShape lineShape = shape as LineShape; 745 745 if (lineShape != null) { 746 lineShape.LSColor = row. Color;746 lineShape.LSColor = row.RowSettings.Color; 747 747 lineShape.LSDrawingStyle = row.Style; 748 lineShape.LSThickness = row. Thickness;748 lineShape.LSThickness = row.RowSettings.Thickness; 749 749 } 750 750 } -
trunk/sources/HeuristicLab.Visualization/3.2/Options/Options.cs
r1885 r1962 26 26 27 27 public LineParams(IDataRow row) { 28 Label = row. Label;29 Color = row. Color;30 Thickness = row. Thickness;28 Label = row.RowSettings.Label; 29 Color = row.RowSettings.Color; 30 Thickness = row.RowSettings.Thickness; 31 31 Style = row.Style; 32 32 this.row = row; … … 35 35 36 36 public void applySettings() { 37 row. Label = Label;38 row. Color = Color;39 row. Thickness = Thickness;37 row.RowSettings.Label = Label; 38 row.RowSettings.Color = Color; 39 row.RowSettings.Thickness = Thickness; 40 40 row.Style = Style; 41 41 row.ShowMarkers = this.ShowMarkers; … … 171 171 LinestyleCB.DataSource = GetStyles(); 172 172 LinestyleCB.SelectedItem = model.Rows[0].Style; 173 LineThicknessCB.SelectedItem = model.Rows[0]. Thickness;173 LineThicknessCB.SelectedItem = model.Rows[0].RowSettings.Thickness; 174 174 MarkercheckBox.Checked = model.Rows[0].ShowMarkers; 175 175 … … 215 215 index = LinestyleCB.FindStringExact(((IDataRow)LineSelectCB.SelectedValue).Style.ToString()); 216 216 LinestyleCB.SelectedIndex = index; */ 217 LineThicknessCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedValue). Thickness;217 LineThicknessCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedValue).RowSettings.Thickness; 218 218 LinestyleCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedValue).Style; 219 selectedLineColorSelection.Color = ((IDataRow)LineSelectCB.SelectedValue). Color;219 selectedLineColorSelection.Color = ((IDataRow)LineSelectCB.SelectedValue).RowSettings.Color; 220 220 MarkercheckBox.Checked = ((IDataRow)LineSelectCB.SelectedValue).ShowMarkers; 221 221 } … … 235 235 private void LineThicknessCB_SelectedIndexChanged(object sender, EventArgs e) { 236 236 if (LineSelectCB.SelectedValue != null) { 237 ((IDataRow)LineSelectCB.SelectedValue). Thickness = (int)LineThicknessCB.SelectedItem;237 ((IDataRow)LineSelectCB.SelectedValue).RowSettings.Thickness = (int)LineThicknessCB.SelectedItem; 238 238 } 239 239 } … … 255 255 256 256 private void selectedLineColorSelection_ColorChanged(ColorSelection sender) { 257 ((IDataRow)LineSelectCB.SelectedValue). Color = selectedLineColorSelection.Color;257 ((IDataRow)LineSelectCB.SelectedValue).RowSettings.Color = selectedLineColorSelection.Color; 258 258 } 259 259
Note: See TracChangeset
for help on using the changeset viewer.