- retractMapping();\r
- }\r
-\r
- /**\r
- * @see org.simantics.scenegraph.INode#delete()\r
- */\r
- public void delete() {\r
- // 1. Remove this node from parent\r
- parent.asyncRemoveNode(this);\r
- }\r
-\r
- /**\r
- * Remove any ID<->Node mapping this node might have in the scene graph's\r
- * {@link LookupService}.\r
- */\r
- protected void retractMapping() {\r
- NodeUtil.tryUnmap(this);\r
- }\r
-\r
- public <TC> TC appendParent(String id, Class<TC> nc) {\r
- assert(parent != null);\r
-\r
- // 0. Find identifier from parent\r
- String identifier = null;\r
- for(String s : parent.children.keySet()) { // FIXME: should not be this complicated\r
- if(parent.children.get(s) == this) { // Find this from parent child list\r
- identifier = s;\r
- break;\r
- }\r
- }\r
- if (identifier == null)\r
- identifier = "" + this.id;\r
-\r
- // 1. Remove this node from original parent\r
- parent.unlinkChild(this);\r
-\r
- // 2. Add new node under parent\r
- TC instance = parent.addNode(id, nc);\r
-\r
- // 3. Add this node under new parent\r
- ((ParentNode<?>)instance).appendChild(identifier, this);\r
-\r
- return instance;\r
- }\r
+ retractMapping();
+ }
+
+ /**
+ * @see org.simantics.scenegraph.INode#delete()
+ */
+ public void delete() {
+ // 1. Remove this node from parent
+ parent.asyncRemoveNode(this);
+ }
+
+ /**
+ * Remove any ID<->Node mapping this node might have in the scene graph's
+ * {@link LookupService}.
+ */
+ protected void retractMapping() {
+ NodeUtil.tryUnmap(this);
+ }
+
+ public <TC> TC appendParent(String id, Class<TC> nc) {
+ assert(parent != null);
+
+ // 0. Find identifier from parent
+ String identifier = null;
+ for(String s : parent.children.keySet()) { // FIXME: should not be this complicated
+ if(parent.children.get(s) == this) { // Find this from parent child list
+ identifier = s;
+ break;
+ }
+ }
+ if (identifier == null)
+ identifier = "" + this.id;
+
+ // 1. Remove this node from original parent
+ parent.unlinkChild(this);
+
+ // 2. Add new node under parent
+ TC instance = parent.addNode(id, nc);
+
+ // 3. Add this node under new parent
+ ((ParentNode<?>)instance).appendChild(identifier, this);
+
+ return instance;
+ }