From: Antti Villberg Date: Wed, 9 Nov 2016 10:11:18 +0000 (+0200) Subject: StructuralConnection added into Simantics/Structural X-Git-Tag: v1.25.0~57 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e7715622bee64fd2c8fe74d260a560e688720f75;p=simantics%2Fplatform.git StructuralConnection added into Simantics/Structural Also added getter structuralConnectionConnectionPoints refs #6799 Change-Id: If9fe0b432437624b5fa082d042ffac9bd176ebca --- diff --git a/bundles/org.simantics.structural2/scl/Simantics/Structural.scl b/bundles/org.simantics.structural2/scl/Simantics/Structural.scl index c27dcf356..c948b5f27 100644 --- a/bundles/org.simantics.structural2/scl/Simantics/Structural.scl +++ b/bundles/org.simantics.structural2/scl/Simantics/Structural.scl @@ -8,5 +8,9 @@ isPartOfUC variable = do composite = singleObject component L0.PartOf existsStatement composite STR.Defines +importJava "org.simantics.structural2.variables.Connection" where + @JavaName Connection + data StructuralConnection - +importJava "org.simantics.structural2.utils.StructuralUtils" where + structuralConnectionConnectionPoints :: StructuralConnection -> Resource -> [Variable] diff --git a/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java b/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java index d029f3ae7..45ca49873 100644 --- a/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java +++ b/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java @@ -1,10 +1,9 @@ package org.simantics.structural2.utils; -import gnu.trove.set.hash.THashSet; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.List; import java.util.Set; import org.simantics.databoard.Bindings; @@ -32,6 +31,8 @@ import org.simantics.structural2.queries.Terminal; import org.simantics.structural2.variables.Connection; import org.simantics.utils.datastructures.Pair; +import gnu.trove.set.hash.THashSet; + /** * A utility class for manipulating structural models. * @@ -286,5 +287,9 @@ public class StructuralUtils { || Layer0Utils.isContainerPublished(graph, r) ; } + + public static List structuralConnectionConnectionPoints(ReadGraph graph, Connection conn, Resource relationType) throws DatabaseException { + return new ArrayList(conn.getConnectionPoints(graph, relationType)); + } }