]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/G3DStructuralParentNode.java
Compiler warning elimination
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / scenegraph / structural / G3DStructuralParentNode.java
index 7a99b8c1acf655f69ffebd30a82f2c84add256e2..073ef79d49b2b6c89f9f6ad3182a6f7959915753 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.structural;\r
 \r
 import java.util.Collection;\r
@@ -10,7 +21,6 @@ import org.simantics.g3d.ontology.G3D;
 import org.simantics.g3d.property.annotations.GetPropertyValue;\r
 import org.simantics.g3d.property.annotations.SetPropertyValue;\r
 import org.simantics.g3d.scenegraph.IG3DNode;\r
-import org.simantics.g3d.scenegraph.base.INode;\r
 import org.simantics.g3d.scenegraph.base.NodeException;\r
 import org.simantics.g3d.tools.NodeTools;\r
 import org.simantics.objmap.graph.annotations.RelatedGetValue;\r
@@ -157,15 +167,12 @@ public abstract class G3DStructuralParentNode<T extends IStructuralNode> extends
        protected Collection<T> _getStrNodes(String id) {\r
                return getNodes(id+"/str");\r
        }\r
-       \r
-       public Object getAdapter(Class adapter) {\r
-               if (INode.class == adapter)\r
-                       return this;\r
-               if (IG3DNode.class == adapter)\r
-                       return this;\r
+\r
+       @Override\r
+       public <U> U getAdapter(Class<U> adapter) {\r
+               if (adapter.isInstance(this))\r
+                       return adapter.cast(this);\r
                return null;\r
        }\r
        \r
-       \r
-       \r
 }\r