]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/G2DParentNode.java
Move state changes away from render method to refresh method
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / G2DParentNode.java
index 231b616e2a0a1a8f09497ce12941a6a562782a4c..de4631e770187c8db2f1a372776a8aea9175797d 100644 (file)
@@ -122,6 +122,26 @@ public class G2DParentNode extends ParentNode<IG2DNode> implements IG2DNode, Ini
             g2d.setTransform(ot);
     }
 
+    @Override
+    public void refresh() {
+        for (IG2DNode node : getSortedNodes()) {
+            if (node.validate()) {
+                node.refresh();
+            }
+        }
+    }
+
+    @Override
+    public void accept(IG2DNodeVisitor visitor) {
+        visitor.enter(this);
+        for (IG2DNode node : getSortedNodes()) {
+            if (node.validate()) {
+                node.accept(visitor);
+            }
+        }
+        visitor.leave(this);
+    }
+
     /**
      * Return the IDs of the children of this node in ascending Z order. This
      * method will always allocate a new result list and sort it. To get the IDs
@@ -591,4 +611,5 @@ public class G2DParentNode extends ParentNode<IG2DNode> implements IG2DNode, Ini
        public void synchronizeTransform(double[] data) {
                this.setTransform(new AffineTransform(data));
        }
+
 }