]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@7316 ac1ea38d...
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 28 Oct 2008 13:38:31 +0000 (13:38 +0000)
committerluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 28 Oct 2008 13:38:31 +0000 (13:38 +0000)
org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapterImpl.java
org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/SelectionAdapter.java

index 43a53a27517b2919e9c859f500fc8480c3b7cff4..adfcc6527cf717428885a62e490d0ba95a26c2f9 100644 (file)
@@ -262,7 +262,7 @@ public abstract class ScenegraphAdapterImpl implements ScenegraphAdapter {
      * @param root\r
      * @return\r
      */\r
-    protected abstract NodeTransformationQuery newTransformationListener(G3DNode root);\r
+    protected abstract NodeTransformationQuery newTransformationListener(G3DNode node);\r
     \r
     /**\r
      * Returns propertyQuery for the root node.\r
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