Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/29/09 17:23:18 (15 years ago)
Author:
cbahner
Message:

#636 first impl. of drawingStyle (DataRowSettings)

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  
    121121
    122122        XmlAttribute idAttr = document.CreateAttribute("label");
    123         idAttr.Value = row.Label;
     123        idAttr.Value = row.RowSettings.Label;
    124124        columnElement.Attributes.Append(idAttr);
    125125
     
    156156          string rowLabel = rowIdAttr.Value;
    157157          DataRow row = new DataRow();
    158           row.Label = rowLabel;
     158          row.RowSettings.Label = rowLabel;
    159159
    160160          string[] tokens = dataRow.InnerText.Split(';');
  • trunk/sources/HeuristicLab.Visualization/3.2/ChartDataRowsModelDummy.cs

    r1530 r1962  
    1515      // TODO change to call new DataRow("Datarow 1");
    1616      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;
    1919      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;
    2222      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;
    2525
    2626      AddDataRow(row1);
  • trunk/sources/HeuristicLab.Visualization/3.2/DataExport/CSVDataExport.cs

    r1881 r1962  
    2929        writer.AddString(model.XAxis.Label);
    3030        foreach (IDataRow row in model.Rows)
    31           writer.AddString(row.Label);
     31          writer.AddString(row.RowSettings.Label);
    3232        writer.NewLine();
    3333
  • trunk/sources/HeuristicLab.Visualization/3.2/DataRow.cs

    r1561 r1962  
    1818    private readonly List<double> dataRow = new List<double>();
    1919
    20     // TODO implement calculation of min and max values
    2120    private double minValue = double.MaxValue;
    2221    private double maxValue = double.MinValue;
     
    2625   
    2726    public DataRow(string label) {
    28       this.Label = label;
     27      this.RowSettings.Label = label;
    2928    }
    3029
    3130    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;
    3534      this.Style = style;
    3635      this.dataRow = dataRow;
     
    3938
    4039    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;
    4443      this.Style = style;
    4544      this.ShowMarkers = showMarkers;
  • trunk/sources/HeuristicLab.Visualization/3.2/DataRowBase.cs

    r1561 r1962  
    1 using System.Drawing;
     1using HeuristicLab.Visualization.Options;
    22
    33namespace HeuristicLab.Visualization {
    44  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;
    88    private DrawingStyle style = DrawingStyle.Solid;
    99    private DataRowType lineType = DataRowType.Normal;
    1010    private YAxisDescriptor yAxis;
    1111    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    }
    1219
    1320    public bool ShowMarkers {
     
    1926    }         
    2027
    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//    }
    4451
    4552    public DrawingStyle Style {
  • trunk/sources/HeuristicLab.Visualization/3.2/HeuristicLab.Visualization-3.2.csproj

    r1886 r1962  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    6     <ProductVersion>9.0.30729</ProductVersion>
     6    <ProductVersion>9.0.21022</ProductVersion>
    77    <SchemaVersion>2.0</SchemaVersion>
    88    <ProjectGuid>{E392A1E2-DC95-4E33-B82E-8ED690EDA1AB}</ProjectGuid>
     
    120120      <DependentUpon>ColorSelection.cs</DependentUpon>
    121121    </Compile>
     122    <Compile Include="Options\DataRowSettings.cs" />
    122123    <Compile Include="XAxisDescriptor.cs" />
    123124    <Compile Include="YAxisGrid.cs" />
  • trunk/sources/HeuristicLab.Visualization/3.2/IDataRow.cs

    r1883 r1962  
    1 using System.Drawing;
     1using HeuristicLab.Visualization.Options;
    22
    33namespace HeuristicLab.Visualization {
     
    88
    99  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; }
    1313    DrawingStyle Style { get; set; }
    1414    DataRowType LineType { get; set; }
    1515    bool ShowMarkers { get; set; }
     16    DataRowSettings RowSettings { get; set; }
    1617 
    1718    YAxisDescriptor YAxis { get; set; }
  • trunk/sources/HeuristicLab.Visualization/3.2/LineChart.cs

    r1885 r1962  
    366366      row.DataRowChanged += OnDataRowChanged;
    367367
    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));
    369369      legendShape.CreateLegend();
    370370
     
    466466      if ((row.LineType == DataRowType.SingleValue)) {
    467467        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,
    469469                                                        row.Style);
    470470          rowEntry.LinesShape.AddShape(lineShape);
     
    473473        rowEntry.showMarkers(true);      //no lines, only markers are shown!!
    474474        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));
    476476      } else if (row.LineType == DataRowType.Normal) {
    477477        rowEntry.showMarkers(row.ShowMarkers);
    478478        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);
    480480          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));
    482482        }
    483483        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));
    485485        }
    486486      }
     
    501501      if (row.LineType == DataRowType.SingleValue) {
    502502        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,
    504504                                                        row.Style);
    505505          rowEntry.LinesShape.AddShape(lineShape);
     
    514514        if (action == Action.Added) {
    515515          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));
    517517          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,
    519519                                                row.Style);
    520520            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));
    522522          } else {
    523523            throw new ArgumentException("Adding a value is only possible at the end of a row!");
     
    549549        if (action == Action.Added) {
    550550          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));
    552552          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,
    554554                                                row.Style);
    555555            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));
    557557          }
    558558        } else if (action == Action.Modified) {
     
    744744          LineShape lineShape = shape as LineShape;
    745745          if (lineShape != null) {
    746             lineShape.LSColor = row.Color;
     746            lineShape.LSColor = row.RowSettings.Color;
    747747            lineShape.LSDrawingStyle = row.Style;
    748             lineShape.LSThickness = row.Thickness;
     748            lineShape.LSThickness = row.RowSettings.Thickness;
    749749          }
    750750        }
  • trunk/sources/HeuristicLab.Visualization/3.2/Options/Options.cs

    r1885 r1962  
    2626
    2727      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;
    3131        Style = row.Style;
    3232        this.row = row;
     
    3535
    3636      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;
    4040        row.Style = Style;
    4141        row.ShowMarkers = this.ShowMarkers;
     
    171171        LinestyleCB.DataSource = GetStyles();
    172172        LinestyleCB.SelectedItem = model.Rows[0].Style;
    173         LineThicknessCB.SelectedItem = model.Rows[0].Thickness;
     173        LineThicknessCB.SelectedItem = model.Rows[0].RowSettings.Thickness;
    174174        MarkercheckBox.Checked = model.Rows[0].ShowMarkers;
    175175
     
    215215          index = LinestyleCB.FindStringExact(((IDataRow)LineSelectCB.SelectedValue).Style.ToString());
    216216          LinestyleCB.SelectedIndex = index;  */
    217         LineThicknessCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedValue).Thickness;
     217        LineThicknessCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedValue).RowSettings.Thickness;
    218218        LinestyleCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedValue).Style;
    219         selectedLineColorSelection.Color = ((IDataRow)LineSelectCB.SelectedValue).Color;
     219        selectedLineColorSelection.Color = ((IDataRow)LineSelectCB.SelectedValue).RowSettings.Color;
    220220        MarkercheckBox.Checked = ((IDataRow)LineSelectCB.SelectedValue).ShowMarkers;
    221221      }
     
    235235    private void LineThicknessCB_SelectedIndexChanged(object sender, EventArgs e) {
    236236      if (LineSelectCB.SelectedValue != null) {
    237         ((IDataRow)LineSelectCB.SelectedValue).Thickness = (int)LineThicknessCB.SelectedItem;
     237        ((IDataRow)LineSelectCB.SelectedValue).RowSettings.Thickness = (int)LineThicknessCB.SelectedItem;
    238238      }
    239239    }
     
    255255
    256256    private void selectedLineColorSelection_ColorChanged(ColorSelection sender) {
    257       ((IDataRow)LineSelectCB.SelectedValue).Color = selectedLineColorSelection.Color;
     257      ((IDataRow)LineSelectCB.SelectedValue).RowSettings.Color = selectedLineColorSelection.Color;
    258258    }
    259259
Note: See TracChangeset for help on using the changeset viewer.