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

            int orientation =
                Integer.parseInt(pageRoot.getAttribute(OrientationTag));
            pageFormat.setOrientation(orientation);

            Paper paper = pageFormat.getPaper();
            XmlNode paperNode = pageRoot.getChild(PaperTag);

            // Backwards compatibility: releases 1.0.5 and earlier omitted
            // Paper width and height.
            if (paperNode.hasAttribute("width") && paperNode.hasAttribute("height")) {
                double width = Double.parseDouble(paperNode.getAttribute("width"));
                double height = Double.parseDouble(paperNode.getAttribute("height"));
                paper.setSize(width, height);
            }
            double x = Double.parseDouble(paperNode.getAttribute("x"));
            double y = Double.parseDouble(paperNode.getAttribute("y"));
            double w = Double.parseDouble(paperNode.getAttribute("w"));
            double h = Double.parseDouble(paperNode.getAttribute("h"));
            paper.setImageableArea(x, y, w, h);

            pageFormat.setPaper(paper);
        }
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

            TreePath path = tree.getPathForLocation(p.x, p.y);
            if (path != null) {
                Object last = path.getLastPathComponent();
                if (last instanceof TemplateTreeNode) {
                    TemplateTreeNode node = (TemplateTreeNode) last;
                    XmlNode xml = node.node;
                    preview.showTemplatePreview(xml);
                    setPreviewNode((TemplateTreeNode) last);
                }
                else {
                    preview.showNormalPreview();
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

        ) throws TemplateDatabase.TemplateException, XMLException {
            this.key = key;
            this.parent = parent;
            this.key = key;
            XmlDocument xml = TemplateDatabase.getTemplateDocument(key);
            XmlNode root = xml.getRoot();
            // Tag name copied from Document.ControlTag:
            node = root.getChild("Controls");
        }
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

                    editor.removeControls(controls);
                }
            }
            if (template != null) {
                selected = template;
                XmlNode node = template.node;
                try {
                    selected.opControls = editor.addControls(node);
                }
                catch (Throwable t) {
                    // Let the control just do nothing.
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

            // Loop until a unique name is selected or the dialog is cancelled:
            boolean done = false;
            TemplateKey key;
            do {
                XmlDocument xml = new XmlDocument("Template")// See Document()
                XmlNode root = xml.getRoot();
                doc.saveTemplate(root);

                SaveTemplateDialog dialog = new SaveTemplateDialog();
                ImageMetadata meta = doc.getMetadata();
                key = dialog.showDialog(meta, xml, namespace, frame);
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

                return;
            }
            try {
                XmlDocument template = TemplateDatabase.getTemplateDocument(key);
                if (template != null) {
                    XmlNode root = template.getRoot();
                    doc.applyTemplate(root);
                }
                else {
                    showError(
                        LOCALE.get("TemplateNameError", key.toString()), null, frame
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

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

    Examples of com.lightcrafts.utils.xml.XmlNode

            if (bounds.isAngleOnly()) {
                double angle = bounds.getAngle();
                node.setAttribute(AngleTag, Double.toString(angle));
            }
            else {
                XmlNode ulNode = node.addChild(ULtag);
                Point2D ul = bounds.getUpperLeft();
                ulNode.setAttribute(Xtag, Double.toString(ul.getX()));
                ulNode.setAttribute(Ytag, Double.toString(ul.getY()));

                XmlNode urNode = node.addChild(URtag);
                Point2D ur = bounds.getUpperRight();
                urNode.setAttribute(Xtag, Double.toString(ur.getX()));
                urNode.setAttribute(Ytag, Double.toString(ur.getY()));

                XmlNode llNode = node.addChild(LLtag);
                Point2D ll = bounds.getLowerLeft();
                llNode.setAttribute(Xtag, Double.toString(ll.getX()));
                llNode.setAttribute(Ytag, Double.toString(ll.getY()));

                XmlNode lrNode = node.addChild(LRtag);
                Point2D lr = bounds.getLowerRight();
                lrNode.setAttribute(Xtag, Double.toString(lr.getX()));
                lrNode.setAttribute(Ytag, Double.toString(lr.getY()));
            }
        }
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

                double x, y;
                Point2D.Double ul, ur, ll, lr;

                try {
                    XmlNode ulNode = node.getChild(ULtag);
                    x = Double.parseDouble(ulNode.getAttribute(Xtag));
                    y = Double.parseDouble(ulNode.getAttribute(Ytag));
                    ul = new Point2D.Double(x, y);

                    XmlNode urNode = node.getChild(URtag);
                    x = Double.parseDouble(urNode.getAttribute(Xtag));
                    y = Double.parseDouble(urNode.getAttribute(Ytag));
                    ur = new Point2D.Double(x, y);

                    XmlNode llNode = node.getChild(LLtag);
                    x = Double.parseDouble(llNode.getAttribute(Xtag));
                    y = Double.parseDouble(llNode.getAttribute(Ytag));
                    ll = new Point2D.Double(x, y);

                    XmlNode lrNode = node.getChild(LRtag);
                    x = Double.parseDouble(lrNode.getAttribute(Xtag));
                    y = Double.parseDouble(lrNode.getAttribute(Ytag));
                    lr = new Point2D.Double(x, y);
                }
                catch (NumberFormatException e) {
                    throw new XMLException("Invalid crop coordinates", e);
                }
    View Full Code Here

    Examples of com.lightcrafts.utils.xml.XmlNode

        /**
         * Preserve state under the given XmlNode.
         */
        public void save(XmlNode node) {
            for (OpControl control : opControls) {
                XmlNode child;
                if (control instanceof ZoneControl) {
                    child = node.addChild(ZoneTag);
                }
                else if (control instanceof CloneControl) {
                    child = node.addChild(CloneTag);
                }
                else if (control instanceof SpotControl) {
                    child = node.addChild(SpotTag);
                }
                else if (control instanceof WhitePointControl) {
                    // WhitePointOperation is deprecated.
                    child = node.addChild(WhitePointTag);
                }
                else {
                    child = node.addChild(GenericTag);
                    GenericOperation op = (GenericOperation) control.getOperation();
                    OperationType opType = op.getType();
                    child.setAttribute(OpTypeTag, opType.getName());
                }
                control.save(child);
            }
        }
    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.