+/*******************************************************************************\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
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
}\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