Package diva.util.xml

Examples of diva.util.xml.XmlElement


            public void run() throws Exception {
                TreeMap attrs = new TreeMap();
                attrs.put("name0", "value0");
                attrs.put("name1", "value1");
                elt = new XmlElement("element", attrs);
            }

            public void check() throws TestFailedException {
                String result = "<element name0=\"value0\" name1=\"value1\"></element>\n";
                assertEquals(result, elt.toString(), result + " != "
View Full Code Here


    public void testAttributes() {
        runTestCase(new TestCase("XmlElement attributes") {
            XmlElement elt;

            public void run() throws Exception {
                elt = new XmlElement("element");
                elt.setAttribute("name0", "value0");
                elt.setAttribute("name1", "value1");
            }

            public void check() throws TestFailedException {
View Full Code Here

            XmlElement elt1;

            XmlElement elt2;

            public void init() throws Exception {
                elt0 = new XmlElement("element0");
                elt1 = new XmlElement("element1");
                elt2 = new XmlElement("element2");
            }

            public void run() throws Exception {
                elt0.addElement(elt1);
                elt1.addElement(elt2);
View Full Code Here

        }

        Iterator children = root.elements();

        while (children.hasNext()) {
            XmlElement child = (XmlElement) children.next();
            _createAttribute(child.getType(), child.getAttributeMap(), child
                    .getPCData());
        }
    }
View Full Code Here

        Reader in = new StringReader(text);
        XmlDocument document = new XmlDocument((URL) null);
        XmlReader reader = new XmlReader();
        reader.parse(document, in);

        XmlElement root = document.getRoot();

        _generateContents(root);

        // FIXME: What to do about the _smallIconDescription?
    }
View Full Code Here

            // NOTE: Do we need a base here?
            XmlDocument document = new XmlDocument((URL) null);
            XmlReader reader = new XmlReader();
            reader.parse(document, in);

            XmlElement root = document.getRoot();
            PaintedList paintedList = SVGParser.createPaintedList(root);
            figure = new PaintedFigure(paintedList);
        } catch (Exception ex) {
            return super.createIcon();
        }
View Full Code Here

            // FIXME: Do we need a base here?
            XmlDocument document = new XmlDocument((URL) null);
            XmlReader reader = new XmlReader();
            reader.parse(document, in);

            XmlElement root = document.getRoot();

            _paintedList = SVGParser.createPaintedList(root);
        } catch (Exception ex) {
            // If we fail, then we'll just get a default figure.
            _paintedList = null;
View Full Code Here

            // NOTE: Do we need a base here?
            XmlDocument document = new XmlDocument((URL) null);
            XmlReader reader = new XmlReader();
            reader.parse(document, in);

            XmlElement root = document.getRoot();
            String name = root.getType();

            if (name.equals("svg")) {
                Iterator children = root.elements();

                while (children.hasNext()) {
                    XmlElement child = (XmlElement) children.next();
                    name = child.getType();

                    if (name.equals("text")) {
                        text = child.getPCData();

                        String style = (String) child.getAttributeMap().get(
                                "style");

                        if (style != null) {
                            StringTokenizer tokenizer = new StringTokenizer(
                                    style, ";");
View Full Code Here

     * @param out The writer.
     * @param prefix The prefix, usually a string of spaces.
     * @exception IOException If there is a problem writing the MoML.
     */
    public void exportMoML(Writer out, String prefix) throws IOException {
        XmlElement element = new XmlElement(_type, _attributes);
        element.setPCData(_label);
        element.writeXML(out, prefix);
    }
View Full Code Here

        }

        Iterator children = root.elements();

        while (children.hasNext()) {
            XmlElement child = (XmlElement) children.next();
            PaintedObject object = createPaintedObject(child.getType(), child
                    .getAttributeMap(), child.getPCData());

            if (object != null) {
                list.add(object);
            }
        }
View Full Code Here

TOP

Related Classes of diva.util.xml.XmlElement

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.