Search in sources :

Example 56 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class GeoPoint method createPlaceMark.

@Override
public XMLElement createPlaceMark() {
    XMLElement c = new CaseSensitiveXMLElement("Placemark");
    c.setAttribute("id", id);
    c.addTagKeyValue("name", id);
    XMLElement point = createElement();
    c.addChild(point);
    return c;
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 57 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class GeoPolygon method createElement.

@Override
public XMLElement createElement() {
    XMLElement c = new CaseSensitiveXMLElement("Polygon");
    XMLElement d = new CaseSensitiveXMLElement("outerBoundaryIs");
    XMLElement e = new CaseSensitiveXMLElement("LinearRing");
    c.addChild(d);
    d.addChild(e);
    StringBuffer sb = new StringBuffer();
    // for (GeoEdge g : createEdgeList()) {
    // sb.append(g.a);
    // sb.append(" ");
    // }
    c.addTagKeyValue("name", id);
    c.setAttribute("id", id);
    for (GeoPoint a : myStartPoints) {
        sb.append(a.getCoordinates());
        sb.append(" ");
    }
    e.addTagKeyValue("coordinates", sb.toString());
    return c;
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 58 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class GeoPolygon method createPlaceMarkList.

@Override
public List<XMLElement> createPlaceMarkList() {
    List<XMLElement> result = new ArrayList<XMLElement>();
    result.add(createElement());
    System.err.println("Creating debug. stating points: " + myStartPoints.size());
    for (GeoPoint g : myStartPoints) {
        GeoPoint gg = new GeoPoint(g.getCoordinates());
        XMLElement xx = gg.createPlaceMark();
        result.add(xx);
    }
    result.add(createPlaceMark());
    return result;
}
Also used : ArrayList(java.util.ArrayList) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 59 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class GeoPolygon method createPlaceMark.

public XMLElement createPlaceMark(String label) {
    XMLElement c = new CaseSensitiveXMLElement("Placemark");
    if (label == null) {
        c.setAttribute("id", id);
        c.addTagKeyValue("name", id);
    } else {
        c.setAttribute("id", label);
        c.addTagKeyValue("name", label);
    }
    XMLElement poly = createElement();
    c.addChild(poly);
    return c;
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Example 60 with XMLElement

use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.

the class NavajoFactory method readTypes.

private void readTypes() throws ClassNotFoundException, IOException {
    ClassLoader cl = getClass().getClassLoader();
    if (cl == null) {
        logger.info("Bootstrap classloader detected!");
        cl = ClassLoader.getSystemClassLoader();
    }
    InputStream is = cl.getResourceAsStream("navajotypes.xml");
    CaseSensitiveXMLElement types = new CaseSensitiveXMLElement();
    types.parseFromStream(is);
    is.close();
    Vector<XMLElement> children = types.getChildren();
    for (int i = 0; i < children.size(); i++) {
        XMLElement child = children.get(i);
        String navajotype = (String) child.getAttribute("name");
        String javaclass = (String) child.getAttribute("type");
        String generic = (String) child.getAttribute("generic");
        Class<?> c = Class.forName(javaclass);
        toJavaType.put(navajotype, c);
        toJavaGenericType.put(navajotype, generic);
        toNavajoType.put(c, navajotype);
    }
}
Also used : CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) CaseSensitiveXMLElement(com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement) XMLElement(com.dexels.navajo.document.nanoimpl.XMLElement)

Aggregations

XMLElement (com.dexels.navajo.document.nanoimpl.XMLElement)120 CaseSensitiveXMLElement (com.dexels.navajo.document.nanoimpl.CaseSensitiveXMLElement)109 MapTag (com.dexels.navajo.document.navascript.tags.MapTag)12 IOException (java.io.IOException)12 NS3Compatible (com.dexels.navajo.document.navascript.tags.NS3Compatible)10 ArrayList (java.util.ArrayList)8 ParamTag (com.dexels.navajo.document.navascript.tags.ParamTag)7 InputStreamReader (java.io.InputStreamReader)7 HashMap (java.util.HashMap)7 APIException (com.dexels.navajo.article.APIException)6 ExpressionTag (com.dexels.navajo.document.navascript.tags.ExpressionTag)5 FieldTag (com.dexels.navajo.document.navascript.tags.FieldTag)5 FileInputStream (java.io.FileInputStream)5 FileReader (java.io.FileReader)5 Property (com.dexels.navajo.document.Property)4 IncludeTag (com.dexels.navajo.document.navascript.tags.IncludeTag)4 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)4 File (java.io.File)4 Message (com.dexels.navajo.document.Message)3 BlockTag (com.dexels.navajo.document.navascript.tags.BlockTag)3