diff --git a/project.clj b/project.clj index 4beb340..ec64d8a 100644 --- a/project.clj +++ b/project.clj @@ -1,12 +1,11 @@ -(defproject clojurefx/clojurefx "0.4.0" +(defproject clojurefx/clojurefx "0.5.0-SNAPSHOT" :description "A Clojure wrapper for JavaFX." :license "Like Clojure." :url "https://www.bitbucket.org/zilti/clojurefx" :signing {:gpg-key "68484437"} - :dependencies [[org.clojure/clojure "1.9.0-RC2"] + :dependencies [[org.clojure/clojure "1.9.0"] [swiss-arrows "1.0.0"] [camel-snake-kebab "0.4.0"] - [org.controlsfx/controlsfx "8.40.13"] [com.taoensso/timbre "4.7.4" :exclusions [com.taoensso/carmine]] [net.openhft/compiler "2.3.0"] [org.ow2.asm/asm "6.0"] diff --git a/src/clojurefx/clojurefx.clj b/src/clojurefx/clojurefx.clj index 4f675c5..860fe61 100644 --- a/src/clojurefx/clojurefx.clj +++ b/src/clojurefx/clojurefx.clj @@ -6,7 +6,8 @@ [clojure.string :as str] [swiss.arrows :refer :all]) (:import (javafx.scene.layout Region) - (javafx.scene.shape Rectangle))) + (javafx.scene.shape Rectangle) + (clojurefx.ApplicationInitializer))) (timbre/refer-timbre) @@ -15,11 +16,9 @@ (defmacro fi [interface args & code] (debug "interface:" interface) - (let [iface-ref (reflect/type-reflect interface) - bogus (debug "iface-ref:" iface-ref) + (let [iface-ref (reflect/type-reflect interface) methods (filter #(instance? clojure.reflect.Method %) (:members iface-ref)) - functional-method (filter (fn [x] (some #(= % :abstract) (:flags x))) methods) - bogus (debug "methods:" (pr-str functional-method)) + functional-method (filter (fn [x] (some #(= % :abstract) (:flags x))) methods) method-sym (:name (first functional-method))] (debug "method-sym:" method-sym) @@ -38,6 +37,9 @@ code (drop 2 fun)] `(.setValue (~(symbol (str (name obj) "/" (name prop)))) (fi javafx.event.ActionEvent ~argument ~@code)))) +(defn start-app [app-init app-start app-stop] + (clojurefx.ApplicationInitializer/initApp app-init app-start app-stop)) + ;; ## Data (def constructor-args diff --git a/src/clojurefx/controllergen.clj b/src/clojurefx/controllergen.clj index 156f3fa..73eff6a 100644 --- a/src/clojurefx/controllergen.clj +++ b/src/clojurefx/controllergen.clj @@ -28,7 +28,6 @@ (reduce conj imports))) (defn qualify-class [imports class-str] - (debug imports) (let [classname (first (filter #(= class-str (last (str/split (pr-str %) #"\."))) imports)) classfull (str/replace classname #"\." "/") classreal (str/split classfull #"\s")]