basic support for Java FX;
authorwenzelm
Sun, 02 Sep 2012 19:26:05 +0200
changeset 49065 8ead9e8b15fb
parent 49064 bd6cc0b911a1
child 49066 1067a639d42a
basic support for Java FX;
src/Pure/System/jfx_thread.scala
src/Pure/build-jars
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/System/jfx_thread.scala	Sun Sep 02 19:26:05 2012 +0200
@@ -0,0 +1,28 @@
+/*  Title:      Pure/System/jfx_thread.scala
+    Module:     PIDE
+    Author:     Makarius
+
+Evaluation within the Java FX application thread.
+*/
+
+package isabelle
+
+import javafx.application.{Platform => JFX_Platform}
+
+
+object JFX_Thread
+{
+  /* checks */
+
+  def assert() = Predef.assert(JFX_Platform.isFxApplicationThread())
+  def require() = Predef.require(JFX_Platform.isFxApplicationThread())
+
+
+  /* asynchronous context switch */
+
+  def later(body: => Unit)
+  {
+    if (JFX_Platform.isFxApplicationThread()) body
+    else JFX_Platform.runLater(new Runnable { def run = body })
+  }
+}
--- a/src/Pure/build-jars	Sun Sep 02 14:02:05 2012 +0200
+++ b/src/Pure/build-jars	Sun Sep 02 19:26:05 2012 +0200
@@ -48,6 +48,7 @@
   System/isabelle_charset.scala
   System/isabelle_process.scala
   System/isabelle_system.scala
+  System/jfx_thread.scala
   System/main.scala
   System/options.scala
   System/platform.scala
@@ -200,7 +201,8 @@
   isabelle_jdk jar cfe "$(jvmpath "$TARGET")" isabelle.GUI_Setup META-INF isabelle || \
     fail "Failed to produce $TARGET"
 
-  cp "$SCALA_HOME/lib/scala-compiler.jar" \
+  cp "$ISABELLE_JDK_HOME/jre/lib/jfxrt.jar" \
+    "$SCALA_HOME/lib/scala-compiler.jar" \
     "$SCALA_HOME/lib/scala-library.jar" \
     "$SCALA_HOME/lib/scala-swing.jar" "$TARGET_DIR/ext"