]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/SCLScenegraph.java
Closing svg tag not added by SCLScenegraph
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / SCLScenegraph.java
index dd09f9ebf6ced3a93018fe3ecafb8f141dbdd067..b3a0ff251502a41cc772352710553cfcc64957eb 100644 (file)
@@ -36,6 +36,7 @@ import org.simantics.db.Resource;
 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;
@@ -61,7 +62,6 @@ import org.simantics.scenegraph.g2d.nodes.BackgroundNode;
 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;
@@ -599,6 +599,7 @@ public class SCLScenegraph {
             }
 
                        G2DSceneGraph sg = ctx.getSceneGraph();
+                       sg.performCleanup();
                        G2DParentNode root = (G2DParentNode) sg.getRootNode();
 
                        // rtree is the actual content of the diagram
@@ -670,7 +671,7 @@ public class SCLScenegraph {
                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());
@@ -781,7 +782,9 @@ public class SCLScenegraph {
                        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);
@@ -796,6 +799,7 @@ public class SCLScenegraph {
                            parentBuilder2.append(SELECTION_MASK_SECTION,"></rect>");
                     }
                     parentBuilder2.append(SELECTION_MASK_SECTION,"\n</g>");
+                   
                 }
             } else if (node instanceof SVGNode) {
                 SVGNode svg = (SVGNode)node;