From: luukkainen Date: Tue, 28 Oct 2008 13:38:31 +0000 (+0000) Subject: git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@7316 ac1ea38d... X-Git-Tag: simantics-1.19.0~20^2~34 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=87cee3d9fefb2d9d238527b6fd5267e215eb1960;p=simantics%2F3d.git git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@7316 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapterImpl.java b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapterImpl.java index 43a53a27..adfcc652 100644 --- a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapterImpl.java +++ b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapterImpl.java @@ -262,7 +262,7 @@ public abstract class ScenegraphAdapterImpl implements ScenegraphAdapter { * @param root * @return */ - protected abstract NodeTransformationQuery newTransformationListener(G3DNode root); + protected abstract NodeTransformationQuery newTransformationListener(G3DNode node); /** * Returns propertyQuery for the root node. diff --git a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/SelectionAdapter.java b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/SelectionAdapter.java index 22b6bc6e..f3f9df91 100644 --- a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/SelectionAdapter.java +++ b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/SelectionAdapter.java @@ -43,6 +43,8 @@ public abstract class SelectionAdapter implements ISelectionProvider{ private Gizmo currentGizmo = null; public SelectionAdapter(ScenegraphAdapter adapter) { + if (adapter == null) + throw new NullPointerException("Scenegraph adapter must no be null"); this.adapter = adapter; } @@ -393,7 +395,11 @@ public abstract class SelectionAdapter implements ISelectionProvider{ * @param s * @return the filtered selection */ - protected abstract StructuredResourceSelection filterSelection(ISelection s); + protected StructuredResourceSelection filterSelection(ISelection s) { + if (!(selection instanceof StructuredResourceSelection)) + return new StructuredResourceSelection(); + return (StructuredResourceSelection) selection; + } /** * Updates visual part of selection event. Use getCurrentSelection() to get