import org.simantics.db.common.request.UnaryRead;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.RuntimeDatabaseException;
+import org.simantics.diagram.elements.DecorationSVGNode;
import org.simantics.diagram.elements.DiagramNodeUtil;
import org.simantics.diagram.elements.TextGridNode;
import org.simantics.diagram.elements.TextNode;
import org.simantics.scenegraph.g2d.nodes.BoundsNode;
import org.simantics.scenegraph.g2d.nodes.ConnectionNode;
import org.simantics.scenegraph.g2d.nodes.DataNode;
-import org.simantics.scenegraph.g2d.nodes.DecorationSVGNode;
import org.simantics.scenegraph.g2d.nodes.NavigationNode;
import org.simantics.scenegraph.g2d.nodes.SVGNode;
import org.simantics.scenegraph.g2d.nodes.SelectionNode;
}
G2DSceneGraph sg = ctx.getSceneGraph();
+ sg.performCleanup();
G2DParentNode root = (G2DParentNode) sg.getRootNode();
// rtree is the actual content of the diagram
if(!Double.isFinite(trX)) trX = 0;
if(!Double.isFinite(trY)) trY = 0;
- result.append(MAIN_SECTION, "<g transform=\"translate(");
- result.append(MAIN_SECTION, "" + trX);
- result.append(MAIN_SECTION, ", ");
- result.append(MAIN_SECTION, "" + trY);
- result.append(MAIN_SECTION, ")\">");
-
+ result.append(MAIN_SECTION, "<g class=\"symbols\">");
result.append(SELECTION_SECTION, "<g class=\"selections\">");
-
result.append(SELECTION_MASK_SECTION, "<g class=\"selectionMasks\">");
+
+ result.append(ALL_SECTIONS, "<g transform=\"translate(");
+ result.append(ALL_SECTIONS, "" + trX);
+ result.append(ALL_SECTIONS, ", ");
+ result.append(ALL_SECTIONS, "" + trY);
+ result.append(ALL_SECTIONS, ")\">");
+
KeyVisitor keyVisitor = new KeyVisitor();
sg.accept(keyVisitor);
}
- result.append(SELECTION_SECTION, "</g>");
- result.append(SELECTION_MASK_SECTION, "</g>");
- result.append(MAIN_SECTION, "</g>");
+ result.append(ALL_SECTIONS, "</g></g>");
StringBuilder res = new StringBuilder();
res.append("<svg width=\"100%\" height=\"100%\" stroke=\"black\">");
res.append(result.get(MAIN_SECTION));
res.append(result.get(SELECTION_SECTION));
res.append(result.get(SELECTION_MASK_SECTION));
- res.append(result.get("</svg>"));
+ res.append("</svg>");
// System.err.println(" == FINAL RESULT == ");
// System.err.println(res.toString());
RenderSVGContext parentBuilder2 = getParentBuilder(parentSEN);
String key = getKey(parentSEN);
+ n.setIgnore(false);
Element doc = renderSVGNode((IG2DNode)node);
+ n.setIgnore(true);
String svg = printSVGDocument(doc);
parentBuilder2.append(SELECTION_SECTION, "\n<g style=\"visibility:hidden\" class=\"selection\" id=\"" + key + "\">");
parentBuilder2.append(SELECTION_SECTION, svg);
parentBuilder2.append(SELECTION_MASK_SECTION,"></rect>");
}
parentBuilder2.append(SELECTION_MASK_SECTION,"\n</g>");
+
}
} else if (node instanceof SVGNode) {
SVGNode svg = (SVGNode)node;