]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph.loader/src/org/simantics/scenegraph/loader/function/All.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scenegraph.loader / src / org / simantics / scenegraph / loader / function / All.java
index 5efa5d6054416ce08523096637f90d8cf009d801..83714a9a43dc067a25b704a579104669bc22f356 100644 (file)
@@ -1,76 +1,76 @@
-package org.simantics.scenegraph.loader.function;\r
-\r
-import org.simantics.databoard.Bindings;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.db.layer0.variable.Variables;\r
-import org.simantics.layer0.Layer0;\r
-import org.simantics.scenegraph.loader.SceneGraphContext;\r
-import org.simantics.scenegraph.loader.ScenegraphLoaderUtils;\r
-import org.simantics.scenegraph.ontology.ScenegraphResources;\r
-import org.simantics.scl.reflection.annotations.SCLValue;\r
-\r
-public class All {\r
-\r
-    @SCLValue(type = "ReadGraph -> Resource -> Variable -> Variable")\r
-    public static Variable defaultRuntimeVariable(ReadGraph graph, Resource converter, Variable context) throws DatabaseException {\r
-       \r
-       SceneGraphContext vc = ScenegraphLoaderUtils.getContext(graph, context);\r
-       if(vc == null) return null;\r
-       \r
-       ScenegraphResources SG = ScenegraphResources.getInstance(graph);\r
-       String uri = graph.getRelatedValue(vc.getRuntime(), SG.Runtime_HasVariable, Bindings.STRING);\r
-       return Variables.getVariable(graph, uri);\r
-       \r
-    }\r
-\r
-    @SCLValue(type = "ReadGraph -> Resource -> Variable -> Resource")\r
-    public static Resource defaultRuntimeResource(ReadGraph graph, Resource converter, Variable context) throws DatabaseException {\r
-       \r
-       SceneGraphContext vc = ScenegraphLoaderUtils.getContext(graph, context);\r
-       if(vc == null) return null;\r
-       \r
-       ScenegraphResources SG = ScenegraphResources.getInstance(graph);\r
-       return graph.getSingleObject(vc.getRuntime(), SG.Runtime_HasResource);\r
-       \r
-    }\r
-\r
-    \r
-       private static Object walk(ReadGraph graph, Variable context, String name) throws DatabaseException {\r
-               \r
-               Variable var = context.getPossibleProperty(graph, name);\r
-               if(var != null) return var.getValue(graph);\r
-               \r
-               Variable parent = context.getParent(graph);\r
-               if(parent == null) return null; \r
-               \r
-               return walk(graph, parent, name);\r
-               \r
-       }\r
-       \r
-    @SCLValue(type = "ReadGraph -> Resource -> Variable -> a")\r
-    public static Object liftedProperty(ReadGraph graph, Resource converter, Variable context) throws DatabaseException {\r
-       \r
-       ScenegraphResources SG = ScenegraphResources.getInstance(graph);\r
-       final Resource predicate = graph.getSingleObject(converter, SG.LiftedProperty_HasPredicate);\r
-       \r
-               try {\r
-                       Layer0 L0 = Layer0.getInstance(graph);\r
-                       Variable parent = context.getParent(graph);\r
-                       String name = graph.getRelatedValue(predicate, L0.HasName, Bindings.STRING);\r
-                       return walk(graph, parent, name);\r
-               } catch (DatabaseException e) {\r
-                       e.printStackTrace();\r
-                       return null;\r
-               }\r
-        \r
-    }\r
-       \r
-    @SCLValue(type = "ReadGraph -> Resource -> Variable -> Variable")\r
-    public static Variable singleVariableSelection(ReadGraph graph, Resource resource, Variable context) throws DatabaseException {\r
-       return ScenegraphLoaderUtils.getVariableSelection(graph, context);\r
-    }\r
-    \r
-}\r
+package org.simantics.scenegraph.loader.function;
+
+import org.simantics.databoard.Bindings;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.variable.Variable;
+import org.simantics.db.layer0.variable.Variables;
+import org.simantics.layer0.Layer0;
+import org.simantics.scenegraph.loader.SceneGraphContext;
+import org.simantics.scenegraph.loader.ScenegraphLoaderUtils;
+import org.simantics.scenegraph.ontology.ScenegraphResources;
+import org.simantics.scl.reflection.annotations.SCLValue;
+
+public class All {
+
+    @SCLValue(type = "ReadGraph -> Resource -> Variable -> Variable")
+    public static Variable defaultRuntimeVariable(ReadGraph graph, Resource converter, Variable context) throws DatabaseException {
+       
+       SceneGraphContext vc = ScenegraphLoaderUtils.getContext(graph, context);
+       if(vc == null) return null;
+       
+       ScenegraphResources SG = ScenegraphResources.getInstance(graph);
+       String uri = graph.getRelatedValue(vc.getRuntime(), SG.Runtime_HasVariable, Bindings.STRING);
+       return Variables.getVariable(graph, uri);
+       
+    }
+
+    @SCLValue(type = "ReadGraph -> Resource -> Variable -> Resource")
+    public static Resource defaultRuntimeResource(ReadGraph graph, Resource converter, Variable context) throws DatabaseException {
+       
+       SceneGraphContext vc = ScenegraphLoaderUtils.getContext(graph, context);
+       if(vc == null) return null;
+       
+       ScenegraphResources SG = ScenegraphResources.getInstance(graph);
+       return graph.getSingleObject(vc.getRuntime(), SG.Runtime_HasResource);
+       
+    }
+
+    
+       private static Object walk(ReadGraph graph, Variable context, String name) throws DatabaseException {
+               
+               Variable var = context.getPossibleProperty(graph, name);
+               if(var != null) return var.getValue(graph);
+               
+               Variable parent = context.getParent(graph);
+               if(parent == null) return null; 
+               
+               return walk(graph, parent, name);
+               
+       }
+       
+    @SCLValue(type = "ReadGraph -> Resource -> Variable -> a")
+    public static Object liftedProperty(ReadGraph graph, Resource converter, Variable context) throws DatabaseException {
+       
+       ScenegraphResources SG = ScenegraphResources.getInstance(graph);
+       final Resource predicate = graph.getSingleObject(converter, SG.LiftedProperty_HasPredicate);
+       
+               try {
+                       Layer0 L0 = Layer0.getInstance(graph);
+                       Variable parent = context.getParent(graph);
+                       String name = graph.getRelatedValue(predicate, L0.HasName, Bindings.STRING);
+                       return walk(graph, parent, name);
+               } catch (DatabaseException e) {
+                       e.printStackTrace();
+                       return null;
+               }
+        
+    }
+       
+    @SCLValue(type = "ReadGraph -> Resource -> Variable -> Variable")
+    public static Variable singleVariableSelection(ReadGraph graph, Resource resource, Variable context) throws DatabaseException {
+       return ScenegraphLoaderUtils.getVariableSelection(graph, context);
+    }
+    
+}