]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d/src/org/simantics/g3d/scenegraph/G3DNode.java
Show busy cursor and block UI input while committing changes
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / scenegraph / G3DNode.java
index 714e7a5bc4d2a6fdbf33e4826bab47e7f9fceac5..c955dc6a3d21642bc23b4ff5b3f4420f177b74bd 100644 (file)
@@ -1,3 +1,14 @@
+/*******************************************************************************\r
+ * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
 package org.simantics.g3d.scenegraph;\r
 \r
 import javax.vecmath.Quat4d;\r
@@ -7,7 +18,6 @@ import org.simantics.g3d.ontology.G3D;
 import org.simantics.g3d.property.annotations.GetPropertyValue;\r
 import org.simantics.g3d.property.annotations.PropertyContributor;\r
 import org.simantics.g3d.property.annotations.SetPropertyValue;\r
-import org.simantics.g3d.scenegraph.base.INode;\r
 import org.simantics.g3d.scenegraph.base.Node;\r
 import org.simantics.g3d.tools.NodeTools;\r
 import org.simantics.objmap.graph.annotations.RelatedGetValue;\r
@@ -138,11 +148,9 @@ public class G3DNode extends Node implements IG3DNode {
        }\r
        \r
        @Override\r
-       public Object getAdapter(Class adapter) {\r
-               if (INode.class == adapter)\r
-                       return this;\r
-               if (IG3DNode.class == adapter)\r
-                       return this;\r
+       public <C> C getAdapter(Class<C> adapter) {\r
+               if (adapter.isInstance(this))\r
+                       return adapter.cast(this);\r
                return null;\r
        }\r
 \r