]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java
Added a length scaling factor for adding components
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / actions / AddComponentAction.java
index d9ee9d70849188f7f50e7ba0bc2b58513609c3ac..0ee0f6bc2bbcfbf137148357f50f47e70edba792 100644 (file)
@@ -50,6 +50,8 @@ public class AddComponentAction extends vtkSwtAction {
        
        private String libUri;
        
+       private double lengthFactor = 1.0;
+       
        public AddComponentAction(InteractiveVtkComposite panel, P3DRootNode root, String libUri) {
                super(panel);
                this.root = root;
@@ -60,6 +62,10 @@ public class AddComponentAction extends vtkSwtAction {
                this.libUri = libUri;
        }
        
+       public void setLengthFactor(double lengthFactor) {
+               this.lengthFactor = lengthFactor;
+       }
+
        public void setComponent(PipelineComponent component) {
                this.component = component;
                
@@ -97,6 +103,7 @@ public class AddComponentAction extends vtkSwtAction {
                
                // Set list of already reserved component names
                dialog.addUsedNames(ComponentUtils.getPipelineComponentNames(root));
+               dialog.setLengthFactor(lengthFactor);
                
                if (dialog.open() == ComponentSelectionDialog.CANCEL)
                        return;