]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/SelectionAdapter.java
git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@7316 ac1ea38d...
[simantics/3d.git] / org.simantics.proconf.g3d / src / org / simantics / proconf / g3d / base / SelectionAdapter.java
index 22b6bc6efdbdc7393b588b699cc8f3103a0b0b82..f3f9df914585e1a7f63be1a2cd93083bf4e84747 100644 (file)
@@ -43,6 +43,8 @@ public abstract class SelectionAdapter implements ISelectionProvider{
        private Gizmo currentGizmo = null;\r
        \r
        public SelectionAdapter(ScenegraphAdapter adapter) {\r
+               if (adapter == null)\r
+                       throw new NullPointerException("Scenegraph adapter must no be null");\r
                this.adapter = adapter;\r
        }\r
        \r
@@ -393,7 +395,11 @@ public abstract class SelectionAdapter implements ISelectionProvider{
      * @param s\r
      * @return the filtered selection\r
      */\r
-    protected abstract StructuredResourceSelection filterSelection(ISelection s);\r
+    protected StructuredResourceSelection filterSelection(ISelection s) {\r
+       if (!(selection instanceof StructuredResourceSelection))\r
+                       return new StructuredResourceSelection();\r
+               return (StructuredResourceSelection) selection;\r
+    }\r
 \r
     /**\r
      * Updates visual part of selection event. Use getCurrentSelection() to get\r