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;
}
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;
}
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;
}
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;
}
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);
}
}
Aggregations