Package fr.soleil.model.scanserver

Examples of fr.soleil.model.scanserver.ScanProperties


                NodeList scanNodeList = d.getElementsByTagName("scanconfiglist");
                String runName = null;
                if ((scanNodeList != null) && (scanNodeList.getLength() > 0)) {
                    Element scanElements = (Element) scanNodeList.item(0);
                    NodeList runNameNodes = scanElements.getElementsByTagName("item");
                    ScanProperties prop = null;
                    if ((runNameNodes != null) && (runNameNodes.getLength() > 0)) {
                        for (int j = 0; j < runNameNodes.getLength(); j++) {
                            Node child = runNameNodes.item(j);
                            Element propertyElement = ((Element) child);
                            runName = propertyElement.getAttribute("key");
                            prop = new ScanProperties(runName);

                            NodeList chartNode = propertyElement.getElementsByTagName("chart");
                            if ((chartNode != null) && (chartNode.getLength() > 0)) {
                                Element chartElement = (Element) chartNode.item(0);
                                String xmlChart = chartElement.getTextContent();
                                Node node = XMLUtils.getRootNodeFromFileContent(xmlChart);
                                prop.setChartProperties(ChartPropertiesXmlManager.loadChartProperties(node));
                            }

                            NodeList y1NodeList = propertyElement.getElementsByTagName("y1List");
                            if ((y1NodeList != null) && (y1NodeList.getLength() > 0)) {
                                prop.setY1AttributeList(getAttributeList((Element) y1NodeList.item(0)));
                            }

                            NodeList y2NodeList = propertyElement.getElementsByTagName("y2List");
                            if ((y2NodeList != null) && (y2NodeList.getLength() > 0)) {
                                prop.setY2AttributeList(getAttributeList((Element) y2NodeList.item(0)));
                            }

                            NodeList zNodeList = propertyElement.getElementsByTagName("zList");
                            if ((zNodeList != null) && (zNodeList.getLength() > 0)) {
                                prop.setZAttributeList(getAttributeList((Element) zNodeList.item(0)));
                            }

                            NodeList xNode = propertyElement.getElementsByTagName("xAttribute");
                            if ((xNode != null) && (xNode.getLength() > 0)) {
                                prop.setXAttribute(((Element) xNode.item(0)).getAttribute("name"));
                            }
                            UIPreferences.getInstance().addCurrentScanProperties(prop);
                        }
                    }
                }
View Full Code Here


                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);
                            }
View Full Code Here

                NodeList scanNodeList = d.getElementsByTagName("scanconfiglist");
                String runName = null;
                if (scanNodeList != null && scanNodeList.getLength() > 0) {
                    Element scanElements = (Element) scanNodeList.item(0);
                    NodeList runNameNodes = scanElements.getElementsByTagName("item");
                    ScanProperties prop = null;
                    if (runNameNodes != null && runNameNodes.getLength() > 0) {
                        for (int j = 0; j < runNameNodes.getLength(); j++) {
                            Node child = runNameNodes.item(j);
                            Element propertyElement = ((Element) child);
                            runName = propertyElement.getAttribute("key");
                            prop = new ScanProperties(runName);

                            NodeList chartNode = propertyElement.getElementsByTagName("chart");
                            if (chartNode != null && chartNode.getLength() > 0) {
                                Element chartElement = (Element) chartNode.item(0);
                                String xmlChart = chartElement.getTextContent();
                                Node node = XMLUtils.getRootNodeFromFileContent(xmlChart);
                                prop.setChartProperties(ChartPropertiesXmlManager.loadChartProperties(node));
                            }

                            NodeList y1NodeList = propertyElement.getElementsByTagName("y1List");
                            if (y1NodeList != null && y1NodeList.getLength() > 0) {
                                prop.setY1AttributeList(getAttributeList((Element) y1NodeList.item(0)));
                            }

                            NodeList y2NodeList = propertyElement.getElementsByTagName("y2List");
                            if (y2NodeList != null && y2NodeList.getLength() > 0) {
                                prop.setY2AttributeList(getAttributeList((Element) y2NodeList.item(0)));
                            }

                            NodeList zNodeList = propertyElement.getElementsByTagName("zList");
                            if (zNodeList != null && zNodeList.getLength() > 0) {
                                prop.setZAttributeList(getAttributeList((Element) zNodeList.item(0)));
                            }

                            NodeList xNode = propertyElement.getElementsByTagName("xAttribute");
                            if (xNode != null && xNode.getLength() > 0) {
                                prop.setXAttribute(((Element) xNode.item(0)).getAttribute("name"));
                            }

                            // System.out.println("Load property=" + prop);
                            UIPreferences.getInstance().addCurrentScanProperties(prop);
                        }
View Full Code Here

                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);
                            }
View Full Code Here

TOP

Related Classes of fr.soleil.model.scanserver.ScanProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.