Package com.joshondesign.xml

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


            return fill;
        }
        if("radialGradient".equals(e.attr(attName))) {
            Elem egrad = e.xpath("radialGradient").iterator().next();
            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(
View Full Code Here


        }
        if("radialGradient".equals(e.attr(attName))) {
            Elem egrad = e.xpath("radialGradient").iterator().next();
            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")),
View Full Code Here

        if("radialGradient".equals(e.attr(attName))) {
            Elem egrad = e.xpath("radialGradient").iterator().next();
            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

            return fill;
        }
        if("patternPaint".equals(e.attr(attName))) {
            Elem pp = e.xpath("patternPaint").iterator().next();
            PatternPaint pat = null;
            u.p("using url " + pp.attr("relativeURL"));

            try {
                u.p("loading an image from a file");
                String path = pp.attr("relativeURL");
                String fullpath = "resources/"+path;
View Full Code Here

            PatternPaint pat = null;
            u.p("using url " + pp.attr("relativeURL"));

            try {
                u.p("loading an image from a file");
                String path = pp.attr("relativeURL");
                String fullpath = "resources/"+path;
                u.p("path = " + path);
                u.p("fullpath = " + fullpath);

                String zfname = zipFile.getName();
View Full Code Here

                u.p("entry = " + entry);
                BufferedImage img = ImageIO.read(zipFile.getInputStream(entry));
                pat = PatternPaint
                    .create(img,path)
                    .deriveNewStart(new Point2D.Double(
                            Double.parseDouble(pp.attr("startX")),
                            Double.parseDouble(pp.attr("startY"))))
                    .deriveNewEnd(new Point2D.Double(
                            Double.parseDouble(pp.attr("endX")),
                            Double.parseDouble(pp.attr("endY"))));
            } catch (IOException e1) {
View Full Code Here

                BufferedImage img = ImageIO.read(zipFile.getInputStream(entry));
                pat = PatternPaint
                    .create(img,path)
                    .deriveNewStart(new Point2D.Double(
                            Double.parseDouble(pp.attr("startX")),
                            Double.parseDouble(pp.attr("startY"))))
                    .deriveNewEnd(new Point2D.Double(
                            Double.parseDouble(pp.attr("endX")),
                            Double.parseDouble(pp.attr("endY"))));
            } catch (IOException e1) {
                e1.printStackTrace();
View Full Code Here

                    .create(img,path)
                    .deriveNewStart(new Point2D.Double(
                            Double.parseDouble(pp.attr("startX")),
                            Double.parseDouble(pp.attr("startY"))))
                    .deriveNewEnd(new Point2D.Double(
                            Double.parseDouble(pp.attr("endX")),
                            Double.parseDouble(pp.attr("endY"))));
            } catch (IOException e1) {
                e1.printStackTrace();
            }
            return pat;
View Full Code Here

                    .deriveNewStart(new Point2D.Double(
                            Double.parseDouble(pp.attr("startX")),
                            Double.parseDouble(pp.attr("startY"))))
                    .deriveNewEnd(new Point2D.Double(
                            Double.parseDouble(pp.attr("endX")),
                            Double.parseDouble(pp.attr("endY"))));
            } catch (IOException e1) {
                e1.printStackTrace();
            }
            return pat;
        }
View Full Code Here

    private static void loadShadow(Elem e, SShape shape) throws XPathExpressionException {
        if(e.xpath("shadow").iterator().hasNext()) {
            Elem shadow = e.xpath("shadow").iterator().next();
            shape.setShadow(new DropShadow()
                    .setColor(new FlatColor(shadow.attr("color")))
                    .setBlurRadius(Integer.parseInt(shadow.attr("radius")))
                    .setOpacity(Double.parseDouble(shadow.attr("opacity")))
                    .setXOffset(Double.parseDouble(shadow.attr("xOffset")))
                    .setYOffset(Double.parseDouble(shadow.attr("yOffset")))
                    );
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.