Package com.lightcrafts.utils.xml

Examples of com.lightcrafts.utils.xml.XmlDocument


        File file = new File(dir, "test.tif");
        options.setExportFile(file);

        // Must enqueue the dialog because the file filter listener
        // enqueues some of its actions:
        final XmlDocument doc = new XmlDocument("Root");
        EventQueue.invokeAndWait(
            new Runnable() {
                public void run() {
                    ImageExportOptions o = showDialog(options, null);
                    if (o != null) {
                        o.write(doc.getRoot());
                    }
                    else {
                        System.out.println("cancelled");
                        System.exit(0);
                    }
                }
            }
        );
        doc.write(System.out);
        ImageExportOptions.read(doc.getRoot());
        System.exit(0);
    }
View Full Code Here


            if (text != null) {
                try {
                    InputStream in = new ByteArrayInputStream(
                        text.getBytes("UTF-8")
                    );
                    XmlDocument doc = new XmlDocument(in);
                    XmlNode root = doc.getRoot();
                    SaveOptions options = SaveOptions.restore(root);
                    return options;
                }
                catch (Exception e) {   // IOException, XMLException
                    e.printStackTrace();
View Full Code Here

        export.resizeHeight.setValue(ExportControls.defaultSaveSize);
        return options;
    }

    public static void setDefaultSaveOptions(SaveOptions options) {
        XmlDocument doc = new XmlDocument("SaveOptions");
        XmlNode root = doc.getRoot();
        options.save(root);
        try {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            doc.write(out);
            String text = out.toString("UTF-8");
            Prefs.put(SaveOptionsKey, text);
        }
        catch (IOException e) {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of com.lightcrafts.utils.xml.XmlDocument

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.