]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
StructuralConnection added into Simantics/Structural 38/138/1
authorAntti Villberg <antti.villberg@semantum.fi>
Wed, 9 Nov 2016 10:11:18 +0000 (12:11 +0200)
committerAntti Villberg <antti.villberg@semantum.fi>
Wed, 9 Nov 2016 10:11:18 +0000 (12:11 +0200)
Also added getter structuralConnectionConnectionPoints

refs #6799

Change-Id: If9fe0b432437624b5fa082d042ffac9bd176ebca

bundles/org.simantics.structural2/scl/Simantics/Structural.scl
bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java

index c27dcf356db5b1ce90def23cb681d8f13ffb5b98..c948b5f27aef00349df9f311a1f88d200bc06665 100644 (file)
@@ -8,5 +8,9 @@ isPartOfUC variable = do
   composite = singleObject component L0.PartOf\r
   existsStatement composite STR.Defines\r
 \r
+importJava "org.simantics.structural2.variables.Connection" where\r
+  @JavaName Connection\r
+  data StructuralConnection\r
 \r
-\r
+importJava "org.simantics.structural2.utils.StructuralUtils" where\r
+  structuralConnectionConnectionPoints :: StructuralConnection -> Resource -> <ReadGraph> [Variable]\r
index d029f3ae7942db8592e2bc68241b30f5af17b2af..45ca49873021d57e44d788dddf1b979ea8a81259 100644 (file)
@@ -1,10 +1,9 @@
 package org.simantics.structural2.utils;\r
 \r
-import gnu.trove.set.hash.THashSet;\r
-\r
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 import java.util.HashMap;\r
+import java.util.List;\r
 import java.util.Set;\r
 \r
 import org.simantics.databoard.Bindings;\r
@@ -32,6 +31,8 @@ import org.simantics.structural2.queries.Terminal;
 import org.simantics.structural2.variables.Connection;\r
 import org.simantics.utils.datastructures.Pair;\r
 \r
+import gnu.trove.set.hash.THashSet;\r
+\r
 /**\r
  * A utility class for manipulating structural models.\r
  * \r
@@ -286,5 +287,9 @@ public class StructuralUtils {
                 || Layer0Utils.isContainerPublished(graph, r)\r
                 ;\r
     }\r
+    \r
+    public static List<Variable> structuralConnectionConnectionPoints(ReadGraph graph, Connection conn, Resource relationType) throws DatabaseException {\r
+       return new ArrayList<Variable>(conn.getConnectionPoints(graph, relationType));\r
+    }\r
 \r
 }\r