Examples of PlotMLParser


Examples of ptolemy.plot.plotml.PlotMLParser

        _base = base;
        _source = source;
        _text = text;

        if (plot instanceof Plot) {
            PlotMLParser parser = new PlotMLParser((Plot) plot);

            if ((source != null) && !source.trim().equals("")) {
                URL xmlFile = new URL(base, source);
                InputStream stream = xmlFile.openStream();
                parser.parse(base, stream);
                stream.close();
                _configureSource = source;
            }

            if ((text != null) && !text.equals("")) {
                // NOTE: Regrettably, the XML parser we are using cannot
                // deal with having a single processing instruction at the
                // outer level.  Thus, we have to strip it.
                String trimmed = text.trim();

                if (trimmed.startsWith("<?") && trimmed.endsWith("?>")) {
                    trimmed = trimmed.substring(2, trimmed.length() - 2).trim();

                    if (trimmed.startsWith("plotml")) {
                        trimmed = trimmed.substring(6).trim();
                        parser.parse(base, trimmed);
                    }

                    // If it's not a plotml processing instruction, ignore.
                } else {
                    // Data is not enclosed in a processing instruction.
                    // Must have been given in a CDATA section.
                    parser.parse(base, text);
                }
            }
        } else {
            // Defer until plot has been placed.
            if (_configureBases == null) {
View Full Code Here

Examples of ptolemy.plot.plotml.PlotMLParser

            PlotTableauFrame frame = ((PlotTableauFrame) getFrame());

            if (frame != null) {
                // FIXME: Should use a HistogramMLParser to get a histogram
                // view... But how can we know that is what is wanted?
                PlotMLParser parser = new PlotMLParser((Plot) frame.plot);
                InputStream stream = url.openStream();
                parser.parse(url, stream);
                stream.close();
                _toRead = null;
            } else {
                // There is no plotter yet.  Have to defer.
                _toRead = url;
View Full Code Here

Examples of ptolemy.plot.plotml.PlotMLParser

    /**
     * Parse PlotML file into plot.
     */
    private static void read(Plot plot, InputStream in)
        throws IOException {
        PlotMLParser parser;
        parser = new PlotMLParser(plot);

        try {
            parser.parse(null, in);
        } catch (Exception ex) {
            String msg;

            if (ex instanceof XmlException) {
                XmlException xmlex = (XmlException) ex;
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.