for (DiagramNodePart nodePart : nodeTemplate.getDiagramNodes())
{
String nodeId = nodePart.getId();
DiagramNodeLayout diagramNode = this.layoutModel.getDiagramNodesLayout().insert();
diagramNode.setNodeId(nodeId);
DiagramNodeBounds bounds = nodePart.getNodeBounds();
diagramNode.setX(bounds.getX());
diagramNode.setY(bounds.getY());
if (nodePart.canResizeShape())
{
IDiagramNodeDef nodeDef = (IDiagramNodeDef)nodePart.definition();
if (bounds.getHeight() != -1 &&
((nodeDef.getHeight().content() != null && nodeDef.getHeight().content() != bounds.getHeight()) ||
nodeDef.getHeight().content() == null))
{
diagramNode.setHeight(bounds.getHeight());
}
if (bounds.getWidth() != -1 &&
((nodeDef.getWidth().content() != null && nodeDef.getWidth().content() != bounds.getWidth()) ||
nodeDef.getWidth().content() == null))
{
diagramNode.setWidth(bounds.getWidth());
}
}
// save the embedded connection bendpoints
diagramNode.getEmbeddedConnectionsLayout().clear();
if (nodePart.getDiagramNodeTemplate().getEmbeddedConnectionTemplate() != null)