]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java
White space clean-up
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / actions / AddComponentAction.java
index defee7024561616c386089806168175f591399cc..a39d84c8ebd31d7706d2848472c38464ce3293a6 100644 (file)
@@ -64,19 +64,19 @@ public class AddComponentAction extends vtkSwtAction {
                
                allowed.clear();
                if (component instanceof Nozzle) {
-                   if (component.getNext() == null && component.getPrevious() == null) {
-                   allowed.add(PositionType.NEXT);
-               }  
+                       if (component.getNext() == null && component.getPrevious() == null) {
+                               allowed.add(PositionType.NEXT);
+                       }  
                } else {
-               if (component.getNext() == null) {
-                       allowed.add(PositionType.NEXT);
-               }
-               if (component.getPrevious() == null) {
-                       allowed.add(PositionType.PREVIOUS);
-               }
-               if (component instanceof InlineComponent && !component.getControlPoint().isFixed()){
-                       allowed.add(PositionType.SPLIT);
-               }
+                       if (component.getNext() == null) {
+                               allowed.add(PositionType.NEXT);
+                       }
+                       if (component.getPrevious() == null) {
+                               allowed.add(PositionType.PREVIOUS);
+                       }
+                       if (component instanceof InlineComponent && !component.getControlPoint().isFixed()){
+                               allowed.add(PositionType.SPLIT);
+                       }
                }
                setEnabled(allowed.size() > 0);
        }
@@ -88,7 +88,7 @@ public class AddComponentAction extends vtkSwtAction {
        
        @Override
        public void run() {
-           
+               
                ComponentSelectionDialog dialog = new ComponentSelectionDialog(Display.getCurrent().getActiveShell(), allowed, component);
                if (dialog.open() == ComponentSelectionDialog.CANCEL)
                        return;
@@ -169,19 +169,19 @@ public class AddComponentAction extends vtkSwtAction {
        }
        
        public void doInsert(PositionType position) {
-           try  {
-               InsertInstruction inst = new InsertInstruction();
-               inst.typeUri = toAdd.getUri();
-               inst.angle = angle;
-               inst.diameter = diameter;
-               inst.length = length;
-               inst.turnRadius = turnRadius;
-               inst.insertPosition = insertPosition;
-               inst.position = position;
-               ComponentUtils.addComponent(root, component, inst);
-           } catch (Exception e) {
-           ExceptionUtils.logAndShowError("Cannot add component", e);
-        }
+               try  {
+                       InsertInstruction inst = new InsertInstruction();
+                       inst.typeUri = toAdd.getUri();
+                       inst.angle = angle;
+                       inst.diameter = diameter;
+                       inst.length = length;
+                       inst.turnRadius = turnRadius;
+                       inst.insertPosition = insertPosition;
+                       inst.position = position;
+                       ComponentUtils.addComponent(root, component, inst);
+               } catch (Exception e) {
+                       ExceptionUtils.logAndShowError("Cannot add component", e);
+               }
 //             try  {
 //                     PipelineComponent newComponent = ComponentUtils.createComponent(root,toAdd.getUri());
 //                     PipeControlPoint newPcp = newComponent.getControlPoint();
@@ -360,6 +360,6 @@ public class AddComponentAction extends vtkSwtAction {
        
        @Override
        public boolean mouseWheelMoved(MouseWheelEvent e) {
-           return getDefaultAction().mouseWheelMoved(e);
+               return getDefaultAction().mouseWheelMoved(e);
        }
 }