]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java
White space clean-up
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / utils / P3DUtil.java
index 0d656b054de0e724e72d4592597fa46aa52b4a17..e5d1768a2c85da2cf2cdcb9bdcfbea36e6216c1e 100644 (file)
@@ -23,10 +23,10 @@ import org.simantics.plant3d.scenegraph.controlpoint.PipingRules;
 import org.simantics.plant3d.utils.Item.Type;
 
 public class P3DUtil {
-    
-    public static List<Item> getEquipments() throws DatabaseException {
-        return getEquipments(Plant3D.URIs.Builtin);
-    }
+       
+       public static List<Item> getEquipments() throws DatabaseException {
+               return getEquipments(Plant3D.URIs.Builtin);
+       }
        
        public static List<Item> getEquipments(final String libUri) throws DatabaseException {
                return Simantics.getSession().syncRequest(new Read<List<Item>>() {
@@ -74,17 +74,17 @@ public class P3DUtil {
                
                @Override
                public boolean equals(Object obj) {
-                   if (obj.getClass() != this.getClass())
-                       return false;
-                   ItemQuery other = (ItemQuery)obj;
-                   if (!type.equals(other.type))
-                       return false;
-                   return libUri.equals(other.libUri);
+                       if (obj.getClass() != this.getClass())
+                               return false;
+                       ItemQuery other = (ItemQuery)obj;
+                       if (!type.equals(other.type))
+                               return false;
+                       return libUri.equals(other.libUri);
                }
                
                @Override
                public int hashCode() {
-                   return type.hashCode() + libUri.hashCode();
+                       return type.hashCode() + libUri.hashCode();
                }
        }
        
@@ -122,12 +122,12 @@ public class P3DUtil {
        }
        
        public static List<Item> filterUserComponents(List<Item> items) {
-           List<Item> result = new ArrayList<Item>(items.size());
-           for (Item i : items) {
-               if (!i.isCode())
-                   result.add(i);
-           }
-           return result;
+               List<Item> result = new ArrayList<Item>(items.size());
+               for (Item i : items) {
+                       if (!i.isCode())
+                               result.add(i);
+               }
+               return result;
        }
        
        private static List<Item> getItems(ReadGraph graph, Resource lib, Resource type) throws DatabaseException{
@@ -156,11 +156,11 @@ public class P3DUtil {
                        }
                }
                Collections.sort(result, new Comparator<Item>() {
-                   @Override
-                   public int compare(Item o1, Item o2) {
-                       return o1.getName().compareTo(o2.getName());
-                   }
-        });
+                       @Override
+                       public int compare(Item o1, Item o2) {
+                               return o1.getName().compareTo(o2.getName());
+                       }
+               });
                return result;
        }
        
@@ -186,7 +186,7 @@ public class P3DUtil {
                if (graph.hasStatement(r, p3d.CodeComponent))
                        item.setCode(true);
                if (graph.hasStatement(r, p3d.VariableAngleTurnComponent) ||
-                   graph.hasStatement(r, p3d.VariableLengthInlineComponent))
+                       graph.hasStatement(r, p3d.VariableLengthInlineComponent))
                        item.setVariable(true);
                if (graph.hasStatement(r, p3d.SizeChangeComponent))
                        item.setSizeChange(true);
@@ -204,38 +204,38 @@ public class P3DUtil {
        }
        
        public static void finalizeDBLoad(P3DRootNode rootNode) throws Exception{
-           for (INode node : rootNode.getChild()) {
-            if (node instanceof PipeRun) {
-                for (PipelineComponent pc : ((PipeRun) node).getChild())
-                    pc.sync();
-            } else if (node instanceof Equipment) {
-                for (PipelineComponent pc : ((Equipment) node).getChild())
-                    pc.sync();
-            }
-        }
-        
-        for (INode node : rootNode.getChild()) {
-            if (node instanceof PipeRun) {
-                for (PipelineComponent pc : ((PipeRun) node).getChild())
-                    pc.sync2();
-            } else if (node instanceof Equipment) {
-                for (PipelineComponent pc : ((Equipment) node).getChild())
-                    pc.sync2();
-            }
-        }
-        for (INode node : rootNode.getChild()) {
-            if (node instanceof PipeRun) {
-                PipingRules.validate((PipeRun)node);
-            }
-        }
-        PipingRules.setEnabled(true);
-        for (INode node : rootNode.getChild()) {
-            if (node instanceof PipeRun) {
-                PipeRun run = (PipeRun)node;
-                for (PipeControlPoint pcp : run.getControlPoints())
-                    PipingRules.positionUpdate(pcp);        
-            }
-        }
+               for (INode node : rootNode.getChild()) {
+                       if (node instanceof PipeRun) {
+                               for (PipelineComponent pc : ((PipeRun) node).getChild())
+                                       pc.sync();
+                       } else if (node instanceof Equipment) {
+                               for (PipelineComponent pc : ((Equipment) node).getChild())
+                                       pc.sync();
+                       }
+               }
+               
+               for (INode node : rootNode.getChild()) {
+                       if (node instanceof PipeRun) {
+                               for (PipelineComponent pc : ((PipeRun) node).getChild())
+                                       pc.sync2();
+                       } else if (node instanceof Equipment) {
+                               for (PipelineComponent pc : ((Equipment) node).getChild())
+                                       pc.sync2();
+                       }
+               }
+               for (INode node : rootNode.getChild()) {
+                       if (node instanceof PipeRun) {
+                               PipingRules.validate((PipeRun)node);
+                       }
+               }
+               PipingRules.setEnabled(true);
+               for (INode node : rootNode.getChild()) {
+                       if (node instanceof PipeRun) {
+                               PipeRun run = (PipeRun)node;
+                               for (PipeControlPoint pcp : run.getControlPoints())
+                                       PipingRules.positionUpdate(pcp);        
+                       }
+               }
        }
 
 }