]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/PropagateNewMarks.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.graph.compiler / src / org / simantics / graph / compiler / internal / procedures / PropagateNewMarks.java
diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/PropagateNewMarks.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/PropagateNewMarks.java
new file mode 100644 (file)
index 0000000..3fc6fe1
--- /dev/null
@@ -0,0 +1,24 @@
+package org.simantics.graph.compiler.internal.procedures;\r
+\r
+import org.simantics.graph.store.GraphStore;\r
+import org.simantics.graph.store.IdentityStore;\r
+\r
+public class PropagateNewMarks implements Runnable {\r
+       IdentityStore identities;\r
+\r
+       public PropagateNewMarks(GraphStore store) {\r
+               this.identities = store.identities;\r
+       }\r
+\r
+       private void propagateNewMarks(int resource) {\r
+               for(int child : identities.getChildren(resource))\r
+                       if(identities.markNew(child))\r
+                               propagateNewMarks(child);\r
+       }\r
+       \r
+       @Override\r
+       public void run() {\r
+               for(int resource : identities.getNewResources())\r
+                       propagateNewMarks(resource);    \r
+       }\r
+}\r