]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Allow property tab contribution from all INodes. 28/3628/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Fri, 22 Nov 2019 10:40:17 +0000 (12:40 +0200)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Wed, 27 Nov 2019 11:07:18 +0000 (11:07 +0000)
gitlab #56

Change-Id: If6e7bc5138f22378c700c4fb9b4104990a622023
(cherry picked from commit 488e24d71d14e60c7da3272e2428a0b23b57c87c)

org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java
org.simantics.plant3d/src/org/simantics/plant3d/property/P3DSelectionProcessor.java

index 65b267cb6b96017eb49cf3ece8a92650433c025f..73526d1c3a60c7216b2d2e18efbea12a64278b5d 100644 (file)
@@ -76,7 +76,6 @@ import org.simantics.g3d.property.annotations.GetPropertyValue;
 import org.simantics.g3d.property.annotations.PropertyTabBlacklist;
 import org.simantics.g3d.property.annotations.SetComboPropertyValue;
 import org.simantics.g3d.property.annotations.SetPropertyValue;
-import org.simantics.g3d.scenegraph.IG3DNode;
 import org.simantics.g3d.scenegraph.NodeMap;
 import org.simantics.g3d.scenegraph.NodeMapProvider;
 import org.simantics.g3d.scenegraph.base.INode;
@@ -682,7 +681,7 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                                        if (nodeMap != null)
                                                break;
                                }
-                               n = (IG3DNode)n.getParent();
+                               n = (INode)n.getParent();
                        }
                        boolean readOnly =  (node instanceof IStructuralNode && ((IStructuralNode)node).isPartOfInstantiatedModel() && !((IStructuralNode)node).isInstantiatedModelRoot());
                        
index e48f33201a5c3cb120c946c4dca5925273640fe8..b78fac4e1bb58e020fa4e6dfe159a3ea98655024 100644 (file)
@@ -19,7 +19,7 @@ import org.simantics.db.management.ISessionContext;
 import org.simantics.db.request.Read;
 import org.simantics.g3d.property.PropertyTabContributor;
 import org.simantics.g3d.property.PropertyTabUtil;
-import org.simantics.g3d.scenegraph.IG3DNode;
+import org.simantics.g3d.scenegraph.base.INode;
 import org.simantics.g3d.tools.AdaptationUtils;
 import org.simantics.g3d.vtk.property.VTKPropertyTabContributor;
 import org.simantics.objmap.structural.StructuralResource;
@@ -43,7 +43,7 @@ public class P3DSelectionProcessor implements SelectionProcessor<Object, ReadGra
                Collection<Resource> resourceCollection = AdaptationUtils.adaptToCollection(selection, Resource.class);
                Collection<StructuralResource> structuralResourceCollection = AdaptationUtils.adaptToCollection(selection, StructuralResource.class);
                Collection<vtkProp> propCollection = AdaptationUtils.adaptToCollection(selection, vtkProp.class);
-               Collection<IG3DNode> nodeCollection = AdaptationUtils.adaptToCollection(selection, IG3DNode.class);
+               Collection<INode> nodeCollection = AdaptationUtils.adaptToCollection(selection, INode.class);
                boolean readOnly = false;
                if (resourceCollection.size() == 0 && structuralResourceCollection.size() > 0) {
                        for (StructuralResource sr : structuralResourceCollection) {
@@ -55,7 +55,7 @@ public class P3DSelectionProcessor implements SelectionProcessor<Object, ReadGra
 
 
                if (nodeCollection.size() == 1) {
-                       IG3DNode node = nodeCollection.iterator().next();
+                       INode node = nodeCollection.iterator().next();
                        List<PropertyTabContributor> contributors = PropertyTabUtil.getContributors(node);
                        int i = 100;
                        for (PropertyTabContributor c : contributors) {