]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.simulator.toolkit/src/org/simantics/simulator/toolkit/StandardRealm.java
Refactoring of simulator toolkit
[simantics/platform.git] / bundles / org.simantics.simulator.toolkit / src / org / simantics / simulator / toolkit / StandardRealm.java
index e228b603d803d86a2fa6146bccbdd51a294b57ad..8551222b22d2183b866aff466a83e35a537e8dcf 100644 (file)
@@ -46,7 +46,21 @@ abstract public class StandardRealm<Node, Engine extends StandardNodeManagerSupp
         this.nodeManager = createManager();
     }
 
-    abstract protected StandardNodeManager<Node, Engine> createManager();
+    protected StandardNodeManager<Node, Engine> createManager(Node root) {
+        return new StandardNodeManager<Node, Engine>(this, root);
+    }
+
+    protected StandardNodeManager<Node, Engine> createManager() {
+        return createManager(createRootNode());
+    }
+
+    /*
+     * For compatibility reasons. Existing implementations implement createManager() directly and in that case this is not needed.
+     * New implementations should not implement createManager() but rather implement this.
+     */
+    protected Node createRootNode() {
+        throw new UnsupportedOperationException();
+    }
 
     protected String getSCLContextKey() {
         return getClass().getSimpleName();