Package com.joshondesign.xml

Examples of com.joshondesign.xml.XMLWriter


    }


    private void saveRecentFiles(List<File> recentFiles, File file) {
        try {
            XMLWriter out = new XMLWriter(file);
            out.start("files");
            for(File f : recentFiles) {
                out.start("file","filepath",f.getAbsolutePath());
                out.end();
            }
            out.end();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here


        File fxmlfile = new File(appdir,"src/fxmltemplate/Generated.fxml");
        File outdir = new File(appdir,"src/fxmltemplate/");
        try {
            u.p("generating: " + fxmlfile);
            XMLWriter out = new XMLWriter(fxmlfile);
            ExportProcessor.process(new FXMLExport(outdir), out, (SketchDocument) context.getDocument());
            out.close();
        } catch (Exception ex) {
            u.p(ex);
        }
       
        //execute ant script to run on the roku, passing in the IP addr on the commandline
View Full Code Here

        context.addNotification("Saving");
        try {
            if(useZip) {
                saveAsZip(file);
            } else {
                XMLWriter out = new XMLWriter(new PrintWriter(new OutputStreamWriter(new FileOutputStream(file),"UTF-8")),file.toURI());
                ExportProcessor.process(new NativeExport(), out, ((SketchDocument)context.getDocument()));
                out.close();
            }
            context.getDocument().setFile(file);
            context.getDocument().setTitle(file.getName());
            context.getStage().setTitle(file.getName());
            context.getDocument().setDirty(false);
View Full Code Here

    private void saveAsZip(File file) throws IOException {
        ZipOutputStream out = new ZipOutputStream(new FileOutputStream(file));
        String dir = file.getName().replace(".leoz", "");
        ZipEntry entry = new ZipEntry(dir+"/leo.xml");
        out.putNextEntry(entry);
        XMLWriter outx = new XMLWriter(new PrintWriter(new OutputStreamWriter(out,"UTF-8")),file.toURI());
        NativeExport export = new NativeExport();
        export.setDelayedImageWriting(true);
        ExportProcessor.process(export, outx, ((SketchDocument)context.getDocument()));
        outx.flush();
        out.closeEntry();

        List images = export.getDelayedImages();
        Map<String,BufferedImage> writtenImages = new HashMap<String,BufferedImage>();
        for(Object i : images) {
View Full Code Here

    public static void saveAsZip(OutputStream fout, String fileName, URI fileURI, SketchDocument doc) throws IOException {
        ZipOutputStream out = new ZipOutputStream(fout);
        String dir = fileName.replace(".leoz", "");
        ZipEntry entry = new ZipEntry(dir+"/leo.xml");
        out.putNextEntry(entry);
        XMLWriter outx = new XMLWriter(new PrintWriter(new OutputStreamWriter(out,"UTF-8")),fileURI);
        NativeExport export = new NativeExport();
        export.setDelayedImageWriting(true);
        ExportProcessor.process(export, outx, doc);
        outx.flush();
        out.closeEntry();
        List images = export.getDelayedImages();
        for(Object image : images) {
            BufferedImage img = null;
            String relUrl = null;
View Full Code Here

    public void execute() throws Exception {
        File basedir = Util.requestDirectory("Choose Output Directory:",context);
        if(basedir == null) return;

        File file = new File(basedir,"presentation.html");
        XMLWriter out = new XMLWriter(new PrintWriter(new OutputStreamWriter(new FileOutputStream(file),"UTF-8")),file.toURI());
        ExportProcessor.process(new HTMLPresoExport(basedir), out, context.getDocument());
        OSUtil.openBrowser(file.toURI().toASCIIString());
    }
View Full Code Here

                e.printStackTrace();
            }
        }
        private void saveSymbols() throws FileNotFoundException, UnsupportedEncodingException {
            u.p("persisting symbol set to: " + asset.getFile().getName());
            XMLWriter out = new XMLWriter(new PrintWriter(new OutputStreamWriter(new FileOutputStream(asset.getFile()), "UTF-8")),
                    asset.getFile().toURI());
            out.header();
            out.start("sketchy","version","-1");
            ExportProcessor.processFragment(new NativeExport(), out, getSymbols());
            out.end();
            out.close();
        }
View Full Code Here

        return "svg";
    }

    public void export(File file, SketchDocument doc) {
        try {
            XMLWriter out = new XMLWriter(file);
            ExportProcessor.process(new SVGExport(), out, doc);
            out.close();
        } catch (Exception ex) {
            u.p(ex);
        }
    }
View Full Code Here

            out.dir.mkdir();
        }

        public void pageStart(MultiFileOutput out, SketchDocument.SketchPage page) {
            out.startPage();
            XMLWriter xml = out.getXML();
            xml.start("html")
                .start("head");
            xml.start("style")
                .attr("type", "text/css")
                .text("body { background-color: " + toText(page.getDocument().getBackgroundFill()) + ";}")
                .end();
            xml.start("title").text("slide").end();
            xml.end();//head
            xml.start("body");
        }
View Full Code Here

            double y = shape.getTranslateY();
            if(shape instanceof SResizeableNode) {
                x += ((SResizeableNode) shape).getX();
                y += ((SResizeableNode) shape).getY();
            }
            XMLWriter xml = out.getXML();
            if(shape.isLink()) {
                xml.start("a", "href", getPageFilenameById(out,shape.getLinkTarget()));
            }
            xml.start("img")
                    .attr("src",imf.getName())
                    .attr("style","position:absolute;"
                        +" left:"+x+"px;"
                        +" top:" +y+"px;"
                    ).end();
            if(shape.isLink()) {
                xml.end();//a
            }
        }
View Full Code Here

TOP

Related Classes of com.joshondesign.xml.XMLWriter

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.