Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1989


Ignore:
Timestamp:
06/01/09 19:04:00 (16 years ago)
Author:
cbahner
Message:

#639 persist additional attributes: model title, thickness

Location:
trunk/sources/HeuristicLab.Visualization/3.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/3.2/ChartDataRowsModel.cs

    r1988 r1989  
    155155      node.AppendChild(labelProviderNode);
    156156
     157
     158     
     159      XmlNode modelProperties = document.CreateNode(XmlNodeType.Element, "modelProperties", null);
     160
     161      XmlAttribute attrTitle = document.CreateAttribute("title");
     162      attrTitle.Value = Title;
     163      modelProperties.Attributes.Append(attrTitle);
     164     
     165     
     166     
     167      node.AppendChild(modelProperties);
     168
    157169      return node;
    158170    }
     
    178190            defaultYAxisDescriptor = axis;
    179191          }
     192        }
     193      }
     194
     195      foreach (XmlNode dataRow in node.ChildNodes) {
     196        if (dataRow.Name.Equals("modelProperties")) {
     197          XmlAttributeCollection attrs = dataRow.Attributes;
     198          XmlAttribute attrYAxisLabel = (XmlAttribute)attrs.GetNamedItem("title");
     199          Title = attrYAxisLabel.Value;
    180200        }
    181201      }
     
    188208          XmlAttribute rowIdAttr = (XmlAttribute)attrs.GetNamedItem("label");
    189209          string rowLabel = rowIdAttr.Value;
     210
    190211          string rowColor = attrs.GetNamedItem("color").Value;
    191 
    192212          DataRow row = new DataRow();
    193213          row.RowSettings.Label = rowLabel;
    194           row.RowSettings.Color = Color.FromName(rowColor);
     214          row.RowSettings.Color = Color.FromArgb(Int32.Parse(rowColor));
     215
     216          string rowThickness = attrs.GetNamedItem("thickness").Value;
     217          int thick;
     218          Int32.TryParse(rowThickness, out thick);
     219          row.RowSettings.Thickness = thick;
    195220
    196221          string yAxisLabel = attrs.GetNamedItem("yAxis").Value;
  • trunk/sources/HeuristicLab.Visualization/3.2/DataRow.cs

    r1988 r1989  
    186186
    187187      XmlAttribute attrColor = document.CreateAttribute("color");
    188       attrColor.Value = row.RowSettings.Color.Name;
     188      attrColor.Value = row.RowSettings.Color.ToArgb().ToString();
    189189      columnElement.Attributes.Append(attrColor);
     190
     191      XmlAttribute attrThickness = document.CreateAttribute("thickness");
     192      attrThickness.Value = row.RowSettings.Thickness.ToString();
     193      columnElement.Attributes.Append(attrThickness);
    190194
    191195      XmlAttribute attrYAxis = document.CreateAttribute("yAxis");
Note: See TracChangeset for help on using the changeset viewer.