]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java
Translate action for inline components
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / editor / Plant3DEditor.java
index 618e08533f33b97cae6c583eddac57d5b802c7b9..033f8544cf6f71103130d6b7db37a986609959f0 100644 (file)
@@ -46,6 +46,7 @@ import org.simantics.plant3d.actions.AddComponentAction;
 import org.simantics.plant3d.actions.AddEquipmentAction;
 import org.simantics.plant3d.actions.AddNozzleAction;
 import org.simantics.plant3d.actions.RoutePipeAction;
+import org.simantics.plant3d.actions.TranslateInlineAction;
 import org.simantics.plant3d.scenegraph.EndComponent;
 import org.simantics.plant3d.scenegraph.Equipment;
 import org.simantics.plant3d.scenegraph.IP3DNode;
@@ -96,6 +97,7 @@ public class Plant3DEditor extends ResourceEditorPart {
        
        private vtkCameraAndSelectorAction cameraAction;
        private TranslateAction translateAction;
+       private TranslateInlineAction translateInlineAction;
        private RotateAction rotateAction;
        private RemoveAction removeAction;
        private RoutePipeAction routePipeAction;
@@ -244,6 +246,7 @@ public class Plant3DEditor extends ResourceEditorPart {
                }
                
                translateAction = new TranslateAction(panel,nodeMap);
+               translateInlineAction = new TranslateInlineAction(panel, nodeMap);
                rotateAction = new RotateAction(panel,nodeMap);
                removeAction = new RemoveAction(nodeMap) {
                        public void setNode(IG3DNode node) {
@@ -382,6 +385,7 @@ public class Plant3DEditor extends ResourceEditorPart {
                                } else if (node instanceof InlineComponent) {
                                        //m.add(translateInlineAction);
                                        InlineComponent component = (InlineComponent)node;
+                                       m.add(translateInlineAction);
                                        m.add(routePipeAction);
                                        routePipeAction.setComponent(component);
                                        m.add(addComponentAction);
@@ -390,6 +394,7 @@ public class Plant3DEditor extends ResourceEditorPart {
                                
                                m.add(removeAction);
                                translateAction.setNode(node);
+                               translateInlineAction.setNode(node);
                                rotateAction.setNode(node);
                                removeAction.setNode(node);