X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Futils%2FP3DUtil.java;h=2f5972a8d86a160dd4fd022fd93c605cc2706194;hb=refs%2Fchanges%2F03%2F3903%2F1;hp=c125f105c84d0dfa5eb3686303609456bf283ab5;hpb=6893513f254ffe9e35c2fda3371bd296cc22905c;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java b/org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java index c125f105..2f5972a8 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/utils/P3DUtil.java @@ -11,6 +11,7 @@ import java.util.Set; import org.simantics.Simantics; import org.simantics.db.ReadGraph; +import org.simantics.db.RequestProcessor; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.exception.DatabaseException; @@ -28,12 +29,12 @@ import org.simantics.plant3d.utils.Item.Type; public class P3DUtil { - public static List getEquipments() throws DatabaseException { - return getEquipments(Plant3D.URIs.Builtin); + public static List getEquipments(RequestProcessor session) throws DatabaseException { + return getEquipments(session, Plant3D.URIs.Builtin); } - public static List getEquipments(final String libUri) throws DatabaseException { - return Simantics.getSession().syncRequest(new Read>() { + public static List getEquipments(RequestProcessor session, final String libUri) throws DatabaseException { + return session.syncRequest(new Read>() { @Override public List perform(ReadGraph graph) throws DatabaseException { Plant3D p3d = Plant3D.getInstance(graph); @@ -48,8 +49,8 @@ public class P3DUtil { }); } - public static List getNozzles(String libUri) throws DatabaseException { - return Simantics.getSession().syncRequest(new Read>() { + public static List getNozzles(RequestProcessor session, String libUri) throws DatabaseException { + return session.syncRequest(new Read>() { @Override public List perform(ReadGraph graph) throws DatabaseException { Plant3D p3d = Plant3D.getInstance(graph); @@ -92,9 +93,9 @@ public class P3DUtil { return type.hashCode() + libUri.hashCode(); } } - - public static List getEnds(String libUri) throws DatabaseException { - return Simantics.getSession().syncRequest(new Read>() { + + public static List getEnds(RequestProcessor session, String libUri) throws DatabaseException { + return session.syncRequest(new Read>() { @Override public List perform(ReadGraph graph) throws DatabaseException { Plant3D p3d = Plant3D.getInstance(graph); @@ -104,8 +105,8 @@ public class P3DUtil { }); } - public static List getTurns(String libUri) throws DatabaseException { - return Simantics.getSession().syncRequest(new Read>() { + public static List getTurns(RequestProcessor session, String libUri) throws DatabaseException { + return session.syncRequest(new Read>() { @Override public List perform(ReadGraph graph) throws DatabaseException { Plant3D p3d = Plant3D.getInstance(graph); @@ -115,8 +116,8 @@ public class P3DUtil { }); } - public static List getInlines(String libUri) throws DatabaseException { - return Simantics.getSession().syncRequest(new Read>() { + public static List getInlines(RequestProcessor session, String libUri) throws DatabaseException { + return session.syncRequest(new Read>() { @Override public List perform(ReadGraph graph) throws DatabaseException { Plant3D p3d = Plant3D.getInstance(graph);