X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scenegraph%2Fsrc%2Forg%2Fsimantics%2Fscenegraph%2FNode.java;h=b9fb1b67fc00ad9d79e9e29221745f64e265e860;hp=7ce4611a38e0afd2a807e4d409ba324df6e34285;hb=refs%2Fchanges%2F63%2F1963%2F9;hpb=7e66fdd1670687a56d8ef980d14d83bfc5f16583 diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/Node.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/Node.java index 7ce4611a3..b9fb1b67f 100644 --- a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/Node.java +++ b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/Node.java @@ -22,7 +22,13 @@ public abstract class Node implements INode { private static final long serialVersionUID = -5540999051056414851L; + /** + * The scene graph is essentially single-threaded, meaning nodes should be + * created in one thread only. For this reason, we are not using AtomicLong + * here. + */ public transient static long IDCOUNTER = 1; + protected long id = IDCOUNTER++; protected transient ParentNode parent = null; protected transient Location location = Location.LOCAL; @@ -31,12 +37,10 @@ public abstract class Node implements INode { // Support for only one listener should be enough, thus we don't need PropertyChangeSupport protected transient PropertyChangeListener propertyChangeListener = null; - protected Long id = IDCOUNTER++; - /** * @see org.simantics.scenegraph.INode#getId() */ - public Long getId() { + public long getId() { return id; } @@ -78,10 +82,6 @@ public abstract class Node implements INode { */ public void init() { } - - public void attach() { - } - /** * @see org.simantics.scenegraph.INode#cleanup()