Examples of XMLNode

  • org.sf.bee.commons.xml.XmlNode
  • org.vietspider.parser.xml.XMLNode
    Created by VietSpider Studio Author : Nhu Dinh Thuan nhudinhthuan@yahoo.com Mar 13, 2006
  • org.webharvest.definition.XmlNode
  • org.zachtaylor.jnodalxml.XmlNode

  • Examples of com.lightcrafts.utils.xml.XmlNode

        ) throws IOException {
            // Construct the LZN data that encode the Document's state:
            XmlDocument xml = new XmlDocument(
                Application.LznNamespace, "LightZoneTransform"
            );
            XmlNode root = xml.getRoot();
            doc.save(root);

            // Try/catch XML manipulation errors:
            try {
                // The next steps depend on the SaveOptions:
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

        private static void mangleLznSidecarFile(XmlDocument xml, File file)
            throws XMLException
        {
            // Tags cloned from com.lightcrafts.ui.editor.Document:
            XmlNode root = xml.getRoot();
            XmlNode imageNode = root.getChild("Image");
            imageNode.setAttribute("path", file.getAbsolutePath());
            imageNode.setAttribute("relativePath", file.getName());
        }
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

        private static void mangleLznMultilayerTiff(XmlDocument xml)
            throws XMLException
        {
            // Tags cloned from com.lightcrafts.ui.editor.Document:
            XmlNode root = xml.getRoot();
            XmlNode imageNode = root.getChild("Image");
            imageNode.setAttribute("path", "");
            imageNode.setAttribute("relativePath", "");
            imageNode.setAttribute("self", "true");
        }
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

                        if (lznDoc != null) {
                            xmlDoc = new XmlDocument(lznDoc.getDocumentElement());
                            if (xmlDoc != null) {
                                // The original image may be in the same file,
                                // or referenced through a path pointer:
                                XmlNode root = xmlDoc.getRoot();
                                // (tag copied from ui.editor.Document)
                                XmlNode imageNode = root.getChild("Image");
                                // (tag written in export())
                                if ( imageNode.hasAttribute("self")) {
                                    imageFile = file;
                                }
                                else {
                                    LightweightDocument lwDoc =
                                        new LightweightDocument(file, xmlDoc);
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

        private final static String PointTag = "Point";
        private final static String XTag = "X";
        private final static String YTag = "Y";

        void save(XmlNode node) {
            XmlNode ptsNode = node.addChild(PointsTag);
            ptsNode.setAttribute(SizeTag, Integer.toString(size));
            for (int n=0; n<points.length; n++) {
                if (points[n] >= 0) {
                    Integer key = n;
                    Double value = points[n];
                    XmlNode ptNode = ptsNode.addChild(PointTag);
                    ptNode.setAttribute(XTag, key.toString());
                    ptNode.setAttribute(YTag, value.toString());
                }
            }
        }
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

                }
            }
        }

        void restore(XmlNode node) throws XMLException {
            XmlNode ptsNode = node.getChild(PointsTag);
            try {
                int s = Integer.parseInt(ptsNode.getAttribute(SizeTag));
                if (s != size) {
                    throw new XMLException("Unsupported size change");
                }
                reset();
            }
            catch (NumberFormatException e) {
                throw new XMLException(
                    "Not an integer: \"" + ptsNode.getAttribute(SizeTag) + "\"", e
                );
            }
            XmlNode[] ptNodes = ptsNode.getChildren(PointTag);
            for (XmlNode ptNode : ptNodes) {
                Integer key;
                Double value;
                try {
                    key = Integer.valueOf(ptNode.getAttribute(XTag));
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

        private final static String ColorTag = "Color";

        public void save(XmlNode node) {
            super.save(node);
            Color color = getWhitePoint();
            XmlNode whiteNode = node.addChild(ColorTag);
            whiteNode.setAttribute("r", Integer.toString(color.getRed()));
            whiteNode.setAttribute("g", Integer.toString(color.getGreen()));
            whiteNode.setAttribute("b", Integer.toString(color.getBlue()));
        }
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

            whiteNode.setAttribute("b", Integer.toString(color.getBlue()));
        }

        public void restore(XmlNode node) throws XMLException {
            super.restore(node);
            XmlNode whiteNode = node.getChild(ColorTag);
            int r = Integer.parseInt(whiteNode.getAttribute("r"));
            int g = Integer.parseInt(whiteNode.getAttribute("g"));
            int b = Integer.parseInt(whiteNode.getAttribute("b"));
            Color color = new Color(r, g, b);
            undoSupport.restoreStart();
            setWhitePoint(color);
            if (dropperButton.isSelected()) {
                dropperButton.setSelected(false);
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

        private final static String ChoiceTag = "Choice";

        public void save(XmlNode node) {
            super.save(node);
            Set keys;
            XmlNode sliderNode = node.addChild(SliderTag);
            keys = sliders.keySet();
            for (Iterator i=keys.iterator(); i.hasNext(); ) {
                String key = (String) i.next();
                GenericSlider slider = (GenericSlider) sliders.get(key);
                double value = slider.getConfiguredValue();
                sliderNode.setAttribute(key, Double.toString(value));
            }
            XmlNode checkboxNode = node.addChild(CheckBoxTag);
            keys = checkboxes.keySet();
            for (Iterator i=keys.iterator(); i.hasNext(); ) {
                String key = (String) i.next();
                JCheckBox checkbox = (JCheckBox) checkboxes.get(key);
                boolean value = checkbox.isSelected();
                checkboxNode.setAttribute(key, value ? "True" : "False");
            }
            XmlNode choiceNode = node.addChild(ChoiceTag);
            keys = choices.keySet();
            for (Iterator i=keys.iterator(); i.hasNext(); ) {
                String key = (String) i.next();
                JComboBox choice = (JComboBox) choices.get(key);
                String value = (String) choice.getSelectedItem();
                choiceNode.setAttribute(key, value);
            }
        }
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

            super.restore(node);
            undoSupport.restoreStart();
            op.changeBatchStarted();
            Set keys;
            if (node.hasChild(SliderTag)) {
                XmlNode sliderNode = node.getChild(SliderTag);
                keys = sliders.keySet();
                for (Iterator i=keys.iterator(); i.hasNext(); ) {
                    String key = (String) i.next();
                    GenericSlider slider = (GenericSlider) sliders.get(key);
                    try {
                        int version = sliderNode.getVersion();
                        if ((version >= 3) || (version < 0)) {
                            double value = Double.parseDouble(
                                sliderNode.getAttribute(key)
                            );
                            slider.setConfiguredValue(value);
                        }
                        else {
                            int value = Integer.parseInt(sliderNode.getAttribute(key));
                            slider.setSliderPosition(value);
                        }
                    }
                    catch (NumberFormatException e) {
                        throw new XMLException(
                            "Value at attribute \"" + key + "\" is not a number", e
                        );
                    }
                }
            }
            if (node.hasChild(CheckBoxTag)) {
                XmlNode checkboxNode = node.getChild(CheckBoxTag);
                keys = checkboxes.keySet();
                for (Iterator i=keys.iterator(); i.hasNext(); ) {
                    String key = (String) i.next();
                    JCheckBox checkbox = (JCheckBox) checkboxes.get(key);
                    String value = checkboxNode.getAttribute(key);
                    checkbox.setSelected(value.equals("True"));
                }
            }
            if (node.hasChild(ChoiceTag)) {
                XmlNode choiceNode = node.getChild(ChoiceTag);
                keys = choices.keySet();
                for (Iterator i=keys.iterator(); i.hasNext(); ) {
                    String key = (String) i.next();
                    JComboBox choice = (JComboBox) choices.get(key);
                    String value = choiceNode.getAttribute(key);
                    choice.setSelectedItem(value);
                }
            }
            op.changeBatchEnded();
            undoSupport.restoreEnd();
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.