src/Pure/GUI/jfx_thread.scala
changeset 57908 1937603dbdf2
parent 57907 7fc36b4c7cce
child 57909 0fb331032f02
--- a/src/Pure/GUI/jfx_thread.scala	Tue Aug 12 00:23:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*  Title:      Pure/GUI/jfx_thread.scala
-    Module:     PIDE-GUI
-    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 })
-  }
-
-  def future[A](body: => A): Future[A] =
-  {
-    if (JFX_Platform.isFxApplicationThread()) Future.value(body)
-    else {
-      val promise = Future.promise[A]
-      later { promise.fulfill_result(Exn.capture(body)) }
-      promise
-    }
-  }
-}