if (chartPropertiesMap != null && !chartPropertiesMap.isEmpty()) {
Element chartPropertiesElement = document.createElement("chartpropertiesmap");
root.appendChild(chartPropertiesElement);
String chartXml = null;
String key = null;
ChartProperties prop = null;
for (Map.Entry<String, ChartProperties> entry : chartPropertiesMap.entrySet()) {
key = entry.getKey();
prop = entry.getValue();
if (prop != null) {
Element itemElement = document.createElement("item");
itemElement.setAttribute("key", key);
chartXml = ChartPropertiesXmlManager.toXmlString(prop);
itemElement.setTextContent(chartXml);
chartPropertiesElement.appendChild(itemElement);
}
}
}
Map<String, ScanProperties> scanPropertiesMap = UIPreferences.getInstance()
.getCurrentScanPropertiesMap();
if (scanPropertiesMap != null && !scanPropertiesMap.isEmpty()) {
Element scanConfigElement = document.createElement("scanconfiglist");
root.appendChild(scanConfigElement);
ScanProperties prop = null;
String key = null;
String chartXml = null;
for (Map.Entry<String, ScanProperties> entry : scanPropertiesMap.entrySet()) {
key = entry.getKey();
prop = entry.getValue();
if (prop != null) {
Element itemElement = document.createElement("item");
itemElement.setAttribute("key", key);
if (prop.getChartProperties() != null) {
Element chartElement = document.createElement("chart");
chartXml = ChartPropertiesXmlManager.toXmlString(prop.getChartProperties());
chartElement.setTextContent(chartXml);
itemElement.appendChild(chartElement);
}
Element y1Element = createAxisElement(document, prop.getY1AttributeList(), "y1List");
if (y1Element != null) {
itemElement.appendChild(y1Element);
}
Element y2Element = createAxisElement(document, prop.getY2AttributeList(), "y2List");
if (y2Element != null) {
itemElement.appendChild(y2Element);
}
Element zElement = createAxisElement(document, prop.getZAttributeList(), "zList");
if (zElement != null) {
itemElement.appendChild(zElement);
}
String xAttribute = prop.getXAttribute();
if (xAttribute != null && !xAttribute.isEmpty()) {
Element xElement = document.createElement("xAttribute");
xElement.setAttribute("name", xAttribute);
itemElement.appendChild(xElement);
}