From 6ccbb59858f572ca7935239585913cfa5cbfbd36 Mon Sep 17 00:00:00 2001 From: zilti Date: Tue, 12 Dec 2017 03:09:16 +0000 Subject: [PATCH] Added missing file --- project.clj | 8 +++--- src/clojurefx/ApplicationInitializer.java | 33 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 src/clojurefx/ApplicationInitializer.java diff --git a/project.clj b/project.clj index ec64d8a..0be31ea 100644 --- a/project.clj +++ b/project.clj @@ -6,14 +6,16 @@ :dependencies [[org.clojure/clojure "1.9.0"] [swiss-arrows "1.0.0"] [camel-snake-kebab "0.4.0"] - [com.taoensso/timbre "4.7.4" :exclusions [com.taoensso/carmine]] + [com.taoensso/timbre "4.10.0" :exclusions [com.taoensso/carmine]] [net.openhft/compiler "2.3.0"] [org.ow2.asm/asm "6.0"] - [org.ow2.asm/asm-util "6.0"] - [clojure-jsr-223 "0.1.0"]] + [org.ow2.asm/asm-util "6.0"] + [clojure-jsr-223 "0.1.0"] + ] :profiles {:test {:source-paths ["test"] :resource-paths ["test-resources"]} :uberjar {:aot :all}} :aot :all + :omit-source true :source-paths ["src"] :java-source-paths ["src"]) diff --git a/src/clojurefx/ApplicationInitializer.java b/src/clojurefx/ApplicationInitializer.java new file mode 100644 index 0000000..f9a0e32 --- /dev/null +++ b/src/clojurefx/ApplicationInitializer.java @@ -0,0 +1,33 @@ +package clojurefx; + +import javafx.application.Application; +import javafx.stage.Stage; +import clojure.lang.IFn; + +public class ApplicationInitializer extends Application { + + private static IFn initfn; + private static IFn startfn; + private static IFn stopfn; + + @Override + public void init() { + initfn.invoke(); + } + + public void start(Stage stage) { + startfn.invoke(stage); + } + + public void stop() { + stopfn.invoke(); + } + + public static void initApp(IFn initApp, IFn startApp, IFn stopApp) { + initfn = initApp; + startfn = startApp; + stopfn = stopApp; + launch(); + } + +}