From 87cee3d9fefb2d9d238527b6fd5267e215eb1960 Mon Sep 17 00:00:00 2001 From: luukkainen Date: Tue, 28 Oct 2008 13:38:31 +0000 Subject: [PATCH] git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@7316 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../simantics/proconf/g3d/base/ScenegraphAdapterImpl.java | 2 +- .../org/simantics/proconf/g3d/base/SelectionAdapter.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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 -- 2.46.2