Package com.joshondesign.xml

Examples of com.joshondesign.xml.Elem.xpath()


            loadBooleanAttribute(info,sdoc,"gridActive");
            loadBooleanAttribute(info,sdoc,"pagesVisible");
            if(info.hasAttr("backgroundFill")) {
                sdoc.setBackgroundFill(loadFillPaint(info, "backgroundFill", zipFile));
            }
            for(Elem element : info.xpath("property")) {
                sdoc.setStringProperty(
                        element.attr("name"),
                        element.attr("value"));
            }
View Full Code Here


                    ;
            if(egrad.hasAttr("startXSnapped")) fill.setStartXSnapped(LinearGradientFill.Snap.valueOf(egrad.attr("startXSnapped")));
            if(egrad.hasAttr("startYSnapped"))fill.setStartYSnapped(LinearGradientFill.Snap.valueOf(egrad.attr("startYSnapped")));
            if(egrad.hasAttr("endXSnapped"))fill.setEndXSnapped(LinearGradientFill.Snap.valueOf(egrad.attr("endXSnapped")));
            if(egrad.hasAttr("endYSnapped"))fill.setEndYSnapped(LinearGradientFill.Snap.valueOf(egrad.attr("endYSnapped")));
            for(Elem stop : egrad.xpath("stop")) {
                fill.addStop(
                        Double.parseDouble(stop.attr("position")),
                        new FlatColor(stop.attr("color"))
                        );
            }
View Full Code Here

            RadialGradientFill fill = new RadialGradientFill()
                    .setCenterX(Double.parseDouble(egrad.attr("centerX")))
                    .setCenterY(Double.parseDouble(egrad.attr("centerY")))
                    .setRadius(Double.parseDouble(egrad.attr("radius")))
                    ;
            for(Elem stop : egrad.xpath("stop")) {
                fill.addStop(
                        Double.parseDouble(stop.attr("position")),
                        new FlatColor(stop.attr("color"))
                        );
            }
View Full Code Here

        SketchDocument.SketchPage page = sdoc.addPage();
        u.p("parsing");
        Doc doc = XMLParser.parse(stream);
        u.p("parsed");
        Elem svg = doc.xpathElement("/svg");
        for(Elem n : svg.xpath("./*")) {
            u.p("node = " + n + " " + n.name());
            SNode node = loadNode(n);
            if(node != null) page.add(node);
        }
        return sdoc;
View Full Code Here

        try {
            Doc doc = XMLParser.parse(file);
            Elem e = doc.xpathElement("/example");
            Example ex = new Example();
            ex.name = e.attr("name");
            for(Elem k : e.xpath("keyword")) {
                ex.keywords.add(k.text().toLowerCase());
                //Util.p("added keyword: " + k.text().toLowerCase());
            }
            ex.description = e.xpathString("description/text()");
            ex.directory = file.getParentFile();
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.