From: Tuukka Lehtonen Date: Mon, 29 May 2017 09:58:32 +0000 (+0300) Subject: Added Simantics/Diagram function positionToVector. X-Git-Tag: v1.28.0^0 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fheads%2Frelease%2F1.28.0;p=simantics%2Fplatform.git Added Simantics/Diagram function positionToVector. This function complements the existing positionToDoubleArray and is required to support for instance diagram template scenegraph node transform property definition with SCL formulas. Also fixes: * Potential NPE in ExperimentUtil.scheduleShutdownActiveExperiment * MANIFEST.MF warnings from org.simantics.document.server refs #7246 Change-Id: Icfe41a33824c91e5be76940bbf4d46d34c8d0334 --- diff --git a/bundles/org.simantics.document.server/META-INF/MANIFEST.MF b/bundles/org.simantics.document.server/META-INF/MANIFEST.MF index 184361779..016ed9189 100644 --- a/bundles/org.simantics.document.server/META-INF/MANIFEST.MF +++ b/bundles/org.simantics.document.server/META-INF/MANIFEST.MF @@ -33,11 +33,4 @@ Export-Package: org.simantics.document.server, org.simantics.document.server.request, org.simantics.document.server.serverResponse Import-Package: org.simantics.layer0.utils.direct -Bundle-ClassPath: ., - batik/batik-dom.jar, - batik/batik-svg-dom.jar, - batik/batik-svggen.jar, - batik/batik-awt-util.jar, - batik/batik-util.jar, - batik/batik-ext.jar, - batik/batik-xml.jar +Bundle-ClassPath: . diff --git a/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl b/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl index 6e04a6f6d..bf5c589e8 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl @@ -57,6 +57,17 @@ flipY (Position xx xy yx yy x y) = Position xx (-xy) yx (-yy) x y positionToDoubleArray (Position a b c d e f) = toDoubleArray [a,b,c,d,e,f] +positionToVector :: Position -> Vector Double +positionToVector (Position a b c d e f) = runProc + (do r = createMVector 6 + setMVector r 0 a + setMVector r 1 b + setMVector r 2 c + setMVector r 3 d + setMVector r 4 e + setMVector r 5 f + freezeMVector r) + // --- Diagram element data types ----------------------------------- data Property res = Property res Dynamic diff --git a/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/ExperimentUtil.java b/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/ExperimentUtil.java index ecf7f0a9a..449afe59f 100644 --- a/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/ExperimentUtil.java +++ b/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/ExperimentUtil.java @@ -148,7 +148,8 @@ public final class ExperimentUtil { job.setUser(true); job.schedule(); } else { - callback.accept(null); + if (callback != null) + callback.accept(null); } }