]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph.ontology/src/org/simantics/scenegraph/ontology/ScenegraphResources.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scenegraph.ontology / src / org / simantics / scenegraph / ontology / ScenegraphResources.java
index a382d9c24ff3024829e1b5968be47e1e1bd9ed50..7849e4da3bed1b7d81a75a37a69faf4f376161f7 100644 (file)
-package org.simantics.scenegraph.ontology;\r
-\r
-import org.simantics.db.RequestProcessor;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.request.Read;\r
-import org.simantics.db.Session;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.service.QueryControl;\r
-\r
-public class ScenegraphResources {\r
-    \r
-    public final Resource Functions;\r
-    public final Resource Functions_defaultRuntimeResource;\r
-    public final Resource Functions_defaultRuntimeVariable;\r
-    public final Resource Functions_liftedProperty;\r
-    public final Resource Functions_singleVariableSelection;\r
-    public final Resource LiftedProperty;\r
-    public final Resource LiftedPropertyRelation;\r
-    public final Resource LiftedProperty_HasPredicate;\r
-    public final Resource LiftedProperty_HasPredicate_Inverse;\r
-    public final Resource Node;\r
-    public final Resource Node_HasProperty;\r
-    public final Resource Node_HasProperty_Inverse;\r
-    public final Resource Node_children;\r
-    public final Resource Node_children_Inverse;\r
-    public final Resource Runtime;\r
-    public final Resource Runtime_HasResource;\r
-    public final Resource Runtime_HasResource_Inverse;\r
-    public final Resource Runtime_HasVariable;\r
-    public final Resource Runtime_HasVariable_Inverse;\r
-    public final Resource Runtime_resource;\r
-    public final Resource Runtime_resource_Inverse;\r
-    public final Resource Runtime_variable;\r
-    public final Resource Runtime_variable_Inverse;\r
-    public final Resource lifted;\r
-    public final Resource userProperty;\r
-    public final Resource userProperty_Inverse;\r
-        \r
-    public static class URIs {\r
-        public static final String Functions = "http://www.simantics.org/Scenegraph-1.1/Functions";\r
-        public static final String Functions_defaultRuntimeResource = "http://www.simantics.org/Scenegraph-1.1/Functions/defaultRuntimeResource";\r
-        public static final String Functions_defaultRuntimeVariable = "http://www.simantics.org/Scenegraph-1.1/Functions/defaultRuntimeVariable";\r
-        public static final String Functions_liftedProperty = "http://www.simantics.org/Scenegraph-1.1/Functions/liftedProperty";\r
-        public static final String Functions_singleVariableSelection = "http://www.simantics.org/Scenegraph-1.1/Functions/singleVariableSelection";\r
-        public static final String LiftedProperty = "http://www.simantics.org/Scenegraph-1.1/LiftedProperty";\r
-        public static final String LiftedPropertyRelation = "http://www.simantics.org/Scenegraph-1.1/LiftedPropertyRelation";\r
-        public static final String LiftedProperty_HasPredicate = "http://www.simantics.org/Scenegraph-1.1/LiftedProperty/HasPredicate";\r
-        public static final String LiftedProperty_HasPredicate_Inverse = "http://www.simantics.org/Scenegraph-1.1/LiftedProperty/HasPredicate/Inverse";\r
-        public static final String Node = "http://www.simantics.org/Scenegraph-1.1/Node";\r
-        public static final String Node_HasProperty = "http://www.simantics.org/Scenegraph-1.1/Node/HasProperty";\r
-        public static final String Node_HasProperty_Inverse = "http://www.simantics.org/Scenegraph-1.1/Node/HasProperty/Inverse";\r
-        public static final String Node_children = "http://www.simantics.org/Scenegraph-1.1/Node/children";\r
-        public static final String Node_children_Inverse = "http://www.simantics.org/Scenegraph-1.1/Node/children/Inverse";\r
-        public static final String Runtime = "http://www.simantics.org/Scenegraph-1.1/Runtime";\r
-        public static final String Runtime_HasResource = "http://www.simantics.org/Scenegraph-1.1/Runtime/HasResource";\r
-        public static final String Runtime_HasResource_Inverse = "http://www.simantics.org/Scenegraph-1.1/Runtime/HasResource/Inverse";\r
-        public static final String Runtime_HasVariable = "http://www.simantics.org/Scenegraph-1.1/Runtime/HasVariable";\r
-        public static final String Runtime_HasVariable_Inverse = "http://www.simantics.org/Scenegraph-1.1/Runtime/HasVariable/Inverse";\r
-        public static final String Runtime_resource = "http://www.simantics.org/Scenegraph-1.1/Runtime/resource";\r
-        public static final String Runtime_resource_Inverse = "http://www.simantics.org/Scenegraph-1.1/Runtime/resource/Inverse";\r
-        public static final String Runtime_variable = "http://www.simantics.org/Scenegraph-1.1/Runtime/variable";\r
-        public static final String Runtime_variable_Inverse = "http://www.simantics.org/Scenegraph-1.1/Runtime/variable/Inverse";\r
-        public static final String lifted = "http://www.simantics.org/Scenegraph-1.1/lifted";\r
-        public static final String userProperty = "http://www.simantics.org/Scenegraph-1.1/userProperty";\r
-        public static final String userProperty_Inverse = "http://www.simantics.org/Scenegraph-1.1/userProperty/Inverse";\r
-    }\r
-    \r
-    public static Resource getResourceOrNull(ReadGraph graph, String uri) {\r
-        try {\r
-            return graph.getResource(uri);\r
-        } catch(DatabaseException e) {\r
-            System.err.println(e.getMessage());\r
-            return null;\r
-        }\r
-    }\r
-    \r
-    public ScenegraphResources(ReadGraph graph) {\r
-        Functions = getResourceOrNull(graph, URIs.Functions);\r
-        Functions_defaultRuntimeResource = getResourceOrNull(graph, URIs.Functions_defaultRuntimeResource);\r
-        Functions_defaultRuntimeVariable = getResourceOrNull(graph, URIs.Functions_defaultRuntimeVariable);\r
-        Functions_liftedProperty = getResourceOrNull(graph, URIs.Functions_liftedProperty);\r
-        Functions_singleVariableSelection = getResourceOrNull(graph, URIs.Functions_singleVariableSelection);\r
-        LiftedProperty = getResourceOrNull(graph, URIs.LiftedProperty);\r
-        LiftedPropertyRelation = getResourceOrNull(graph, URIs.LiftedPropertyRelation);\r
-        LiftedProperty_HasPredicate = getResourceOrNull(graph, URIs.LiftedProperty_HasPredicate);\r
-        LiftedProperty_HasPredicate_Inverse = getResourceOrNull(graph, URIs.LiftedProperty_HasPredicate_Inverse);\r
-        Node = getResourceOrNull(graph, URIs.Node);\r
-        Node_HasProperty = getResourceOrNull(graph, URIs.Node_HasProperty);\r
-        Node_HasProperty_Inverse = getResourceOrNull(graph, URIs.Node_HasProperty_Inverse);\r
-        Node_children = getResourceOrNull(graph, URIs.Node_children);\r
-        Node_children_Inverse = getResourceOrNull(graph, URIs.Node_children_Inverse);\r
-        Runtime = getResourceOrNull(graph, URIs.Runtime);\r
-        Runtime_HasResource = getResourceOrNull(graph, URIs.Runtime_HasResource);\r
-        Runtime_HasResource_Inverse = getResourceOrNull(graph, URIs.Runtime_HasResource_Inverse);\r
-        Runtime_HasVariable = getResourceOrNull(graph, URIs.Runtime_HasVariable);\r
-        Runtime_HasVariable_Inverse = getResourceOrNull(graph, URIs.Runtime_HasVariable_Inverse);\r
-        Runtime_resource = getResourceOrNull(graph, URIs.Runtime_resource);\r
-        Runtime_resource_Inverse = getResourceOrNull(graph, URIs.Runtime_resource_Inverse);\r
-        Runtime_variable = getResourceOrNull(graph, URIs.Runtime_variable);\r
-        Runtime_variable_Inverse = getResourceOrNull(graph, URIs.Runtime_variable_Inverse);\r
-        lifted = getResourceOrNull(graph, URIs.lifted);\r
-        userProperty = getResourceOrNull(graph, URIs.userProperty);\r
-        userProperty_Inverse = getResourceOrNull(graph, URIs.userProperty_Inverse);\r
-    }\r
-    \r
-    public static ScenegraphResources getInstance(ReadGraph graph) {\r
-        Session session = graph.getSession();\r
-        ScenegraphResources ret = session.peekService(ScenegraphResources.class);\r
-        if(ret == null) {\r
-            QueryControl qc = graph.getService(QueryControl.class);\r
-            ret = new ScenegraphResources(qc.getIndependentGraph(graph));\r
-            session.registerService(ScenegraphResources.class, ret);\r
-        }\r
-        return ret;\r
-    }\r
-    \r
-    public static ScenegraphResources getInstance(RequestProcessor session) throws DatabaseException {\r
-        ScenegraphResources ret = session.peekService(ScenegraphResources.class);\r
-        if(ret == null) {\r
-            ret = session.syncRequest(new Read<ScenegraphResources>() {\r
-                public ScenegraphResources perform(ReadGraph graph) throws DatabaseException {\r
-                    QueryControl qc = graph.getService(QueryControl.class);\r
-                    return new ScenegraphResources(qc.getIndependentGraph(graph));\r
-                }\r
-            });\r
-            session.registerService(ScenegraphResources.class, ret);\r
-        }\r
-        return ret;\r
-    }\r
-    \r
-}\r
-\r
+package org.simantics.scenegraph.ontology;
+
+import org.simantics.db.RequestProcessor;
+import org.simantics.db.Resource;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.request.Read;
+import org.simantics.db.Session;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.service.QueryControl;
+
+public class ScenegraphResources {
+    
+    public final Resource Functions;
+    public final Resource Functions_defaultRuntimeResource;
+    public final Resource Functions_defaultRuntimeVariable;
+    public final Resource Functions_liftedProperty;
+    public final Resource Functions_singleVariableSelection;
+    public final Resource LiftedProperty;
+    public final Resource LiftedPropertyRelation;
+    public final Resource LiftedProperty_HasPredicate;
+    public final Resource LiftedProperty_HasPredicate_Inverse;
+    public final Resource Node;
+    public final Resource Node_HasProperty;
+    public final Resource Node_HasProperty_Inverse;
+    public final Resource Node_children;
+    public final Resource Node_children_Inverse;
+    public final Resource Runtime;
+    public final Resource Runtime_HasResource;
+    public final Resource Runtime_HasResource_Inverse;
+    public final Resource Runtime_HasVariable;
+    public final Resource Runtime_HasVariable_Inverse;
+    public final Resource Runtime_resource;
+    public final Resource Runtime_resource_Inverse;
+    public final Resource Runtime_variable;
+    public final Resource Runtime_variable_Inverse;
+    public final Resource lifted;
+    public final Resource userProperty;
+    public final Resource userProperty_Inverse;
+        
+    public static class URIs {
+        public static final String Functions = "http://www.simantics.org/Scenegraph-1.1/Functions";
+        public static final String Functions_defaultRuntimeResource = "http://www.simantics.org/Scenegraph-1.1/Functions/defaultRuntimeResource";
+        public static final String Functions_defaultRuntimeVariable = "http://www.simantics.org/Scenegraph-1.1/Functions/defaultRuntimeVariable";
+        public static final String Functions_liftedProperty = "http://www.simantics.org/Scenegraph-1.1/Functions/liftedProperty";
+        public static final String Functions_singleVariableSelection = "http://www.simantics.org/Scenegraph-1.1/Functions/singleVariableSelection";
+        public static final String LiftedProperty = "http://www.simantics.org/Scenegraph-1.1/LiftedProperty";
+        public static final String LiftedPropertyRelation = "http://www.simantics.org/Scenegraph-1.1/LiftedPropertyRelation";
+        public static final String LiftedProperty_HasPredicate = "http://www.simantics.org/Scenegraph-1.1/LiftedProperty/HasPredicate";
+        public static final String LiftedProperty_HasPredicate_Inverse = "http://www.simantics.org/Scenegraph-1.1/LiftedProperty/HasPredicate/Inverse";
+        public static final String Node = "http://www.simantics.org/Scenegraph-1.1/Node";
+        public static final String Node_HasProperty = "http://www.simantics.org/Scenegraph-1.1/Node/HasProperty";
+        public static final String Node_HasProperty_Inverse = "http://www.simantics.org/Scenegraph-1.1/Node/HasProperty/Inverse";
+        public static final String Node_children = "http://www.simantics.org/Scenegraph-1.1/Node/children";
+        public static final String Node_children_Inverse = "http://www.simantics.org/Scenegraph-1.1/Node/children/Inverse";
+        public static final String Runtime = "http://www.simantics.org/Scenegraph-1.1/Runtime";
+        public static final String Runtime_HasResource = "http://www.simantics.org/Scenegraph-1.1/Runtime/HasResource";
+        public static final String Runtime_HasResource_Inverse = "http://www.simantics.org/Scenegraph-1.1/Runtime/HasResource/Inverse";
+        public static final String Runtime_HasVariable = "http://www.simantics.org/Scenegraph-1.1/Runtime/HasVariable";
+        public static final String Runtime_HasVariable_Inverse = "http://www.simantics.org/Scenegraph-1.1/Runtime/HasVariable/Inverse";
+        public static final String Runtime_resource = "http://www.simantics.org/Scenegraph-1.1/Runtime/resource";
+        public static final String Runtime_resource_Inverse = "http://www.simantics.org/Scenegraph-1.1/Runtime/resource/Inverse";
+        public static final String Runtime_variable = "http://www.simantics.org/Scenegraph-1.1/Runtime/variable";
+        public static final String Runtime_variable_Inverse = "http://www.simantics.org/Scenegraph-1.1/Runtime/variable/Inverse";
+        public static final String lifted = "http://www.simantics.org/Scenegraph-1.1/lifted";
+        public static final String userProperty = "http://www.simantics.org/Scenegraph-1.1/userProperty";
+        public static final String userProperty_Inverse = "http://www.simantics.org/Scenegraph-1.1/userProperty/Inverse";
+    }
+    
+    public static Resource getResourceOrNull(ReadGraph graph, String uri) {
+        try {
+            return graph.getResource(uri);
+        } catch(DatabaseException e) {
+            System.err.println(e.getMessage());
+            return null;
+        }
+    }
+    
+    public ScenegraphResources(ReadGraph graph) {
+        Functions = getResourceOrNull(graph, URIs.Functions);
+        Functions_defaultRuntimeResource = getResourceOrNull(graph, URIs.Functions_defaultRuntimeResource);
+        Functions_defaultRuntimeVariable = getResourceOrNull(graph, URIs.Functions_defaultRuntimeVariable);
+        Functions_liftedProperty = getResourceOrNull(graph, URIs.Functions_liftedProperty);
+        Functions_singleVariableSelection = getResourceOrNull(graph, URIs.Functions_singleVariableSelection);
+        LiftedProperty = getResourceOrNull(graph, URIs.LiftedProperty);
+        LiftedPropertyRelation = getResourceOrNull(graph, URIs.LiftedPropertyRelation);
+        LiftedProperty_HasPredicate = getResourceOrNull(graph, URIs.LiftedProperty_HasPredicate);
+        LiftedProperty_HasPredicate_Inverse = getResourceOrNull(graph, URIs.LiftedProperty_HasPredicate_Inverse);
+        Node = getResourceOrNull(graph, URIs.Node);
+        Node_HasProperty = getResourceOrNull(graph, URIs.Node_HasProperty);
+        Node_HasProperty_Inverse = getResourceOrNull(graph, URIs.Node_HasProperty_Inverse);
+        Node_children = getResourceOrNull(graph, URIs.Node_children);
+        Node_children_Inverse = getResourceOrNull(graph, URIs.Node_children_Inverse);
+        Runtime = getResourceOrNull(graph, URIs.Runtime);
+        Runtime_HasResource = getResourceOrNull(graph, URIs.Runtime_HasResource);
+        Runtime_HasResource_Inverse = getResourceOrNull(graph, URIs.Runtime_HasResource_Inverse);
+        Runtime_HasVariable = getResourceOrNull(graph, URIs.Runtime_HasVariable);
+        Runtime_HasVariable_Inverse = getResourceOrNull(graph, URIs.Runtime_HasVariable_Inverse);
+        Runtime_resource = getResourceOrNull(graph, URIs.Runtime_resource);
+        Runtime_resource_Inverse = getResourceOrNull(graph, URIs.Runtime_resource_Inverse);
+        Runtime_variable = getResourceOrNull(graph, URIs.Runtime_variable);
+        Runtime_variable_Inverse = getResourceOrNull(graph, URIs.Runtime_variable_Inverse);
+        lifted = getResourceOrNull(graph, URIs.lifted);
+        userProperty = getResourceOrNull(graph, URIs.userProperty);
+        userProperty_Inverse = getResourceOrNull(graph, URIs.userProperty_Inverse);
+    }
+    
+    public static ScenegraphResources getInstance(ReadGraph graph) {
+        Session session = graph.getSession();
+        ScenegraphResources ret = session.peekService(ScenegraphResources.class);
+        if(ret == null) {
+            QueryControl qc = graph.getService(QueryControl.class);
+            ret = new ScenegraphResources(qc.getIndependentGraph(graph));
+            session.registerService(ScenegraphResources.class, ret);
+        }
+        return ret;
+    }
+    
+    public static ScenegraphResources getInstance(RequestProcessor session) throws DatabaseException {
+        ScenegraphResources ret = session.peekService(ScenegraphResources.class);
+        if(ret == null) {
+            ret = session.syncRequest(new Read<ScenegraphResources>() {
+                public ScenegraphResources perform(ReadGraph graph) throws DatabaseException {
+                    QueryControl qc = graph.getService(QueryControl.class);
+                    return new ScenegraphResources(qc.getIndependentGraph(graph));
+                }
+            });
+            session.registerService(ScenegraphResources.class, ret);
+        }
+        return ret;
+    }
+    
+}
+