// NOTE: this gives at iteration over locations.
Iterator nodes = model.nodes(composite);
while (nodes.hasNext()) {
Location location = (Location) nodes.next();
// Get the containing element
NamedObj element = location.getContainer();
// Give default values in case the previous locations value
// has not yet been set
String expression = location.getExpression();
if (expression == null) {
expression = "0, 0";
}
// Create the MoML, wrapping the location attribute
// in an element refering to the container
String containingElementName = element.getElementName();
moml.append("<" + containingElementName + " name=\""
+ element.getName() + "\" >\n");
// NOTE: use the moml info element name here in case the
// location is a vertex
moml.append("<" + location.getElementName() + " name=\""
+ location.getName() + "\" value=\"" + expression
+ "\" />\n");
moml.append("</" + containingElementName + ">\n");
}
moml.append("</group>\n");