parentBuilder.append(SELECTION_MASK_SECTION, "\n</g>");
parentBuilder.append(SELECTION_SECTION, "\n</g>");
- parentBuilder.append(MAIN_SECTION, "\n</g>");
+ senBuilders.put((ConnectionNode)node, new RenderSVGContext());
+
} else if (isSelection0(node)) {
@Override
public void leave(IG2DNode node) {
- if(node instanceof ConnectionNode || node instanceof SVGNode) {
+ if( node instanceof SVGNode) {
// We are done
+ } else if (node instanceof ConnectionNode) {
+ RenderSVGContext parentBuilder = getParentBuilder(node);
+ SingleElementNode sen = (SingleElementNode)node;
+ RenderSVGContext b = senBuilders.get(sen);
+ String content = b.get(MAIN_SECTION);
+ if(content.isEmpty()) {
+ if(sen.getKey() != null) {
+
+ for(SelectionNode n : NodeUtil.collectNodes(node, SelectionNode.class)) {
+ n.setIgnore(true);
+ }
+
+ Element doc = renderSVGNode(svgGenerator, (IG2DNode)node);
+ String svg = printSVGDocument(doc);
+ parentBuilder.append(MAIN_SECTION, svg);
+ }
+ } else {
+ parentBuilder.append(b);
+ }
+ parentBuilder.append(MAIN_SECTION, "\n</g>");
} else if (node instanceof G2DParentNode) {
RenderSVGContext parentBuilder = getParentBuilder(node);