X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fscenegraph%2Fstructural%2FG3DStructuralParentNode.java;h=073ef79d49b2b6c89f9f6ad3182a6f7959915753;hb=refs%2Fchanges%2F60%2F3460%2F1;hp=7a99b8c1acf655f69ffebd30a82f2c84add256e2;hpb=87b3241ec277ba3d8e414b26186a032c9cdcaeed;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/G3DStructuralParentNode.java b/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/G3DStructuralParentNode.java index 7a99b8c1..073ef79d 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/G3DStructuralParentNode.java +++ b/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/G3DStructuralParentNode.java @@ -1,3 +1,14 @@ +/******************************************************************************* + * Copyright (c) 2012, 2013 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ package org.simantics.g3d.scenegraph.structural; import java.util.Collection; @@ -10,7 +21,6 @@ import org.simantics.g3d.ontology.G3D; import org.simantics.g3d.property.annotations.GetPropertyValue; import org.simantics.g3d.property.annotations.SetPropertyValue; import org.simantics.g3d.scenegraph.IG3DNode; -import org.simantics.g3d.scenegraph.base.INode; import org.simantics.g3d.scenegraph.base.NodeException; import org.simantics.g3d.tools.NodeTools; import org.simantics.objmap.graph.annotations.RelatedGetValue; @@ -157,15 +167,12 @@ public abstract class G3DStructuralParentNode extends protected Collection _getStrNodes(String id) { return getNodes(id+"/str"); } - - public Object getAdapter(Class adapter) { - if (INode.class == adapter) - return this; - if (IG3DNode.class == adapter) - return this; + + @Override + public U getAdapter(Class adapter) { + if (adapter.isInstance(this)) + return adapter.cast(this); return null; } - - }