Consider this example:
(defn todo-view [{:keys [text id done]}]
{:fx/type :h-box
:children [{:fx/type :check-box
:selected done
:on-selected-changed #(swap! *state assoc-in [:by-id id :done] %)
;; deps are: | |
;; {org.apache.xmlgraphics/batik-codec {:mvn/version "1.9.1"} | |
;; clj-http/clj-http {:mvn/version "3.12.3"} | |
;; org.clojure/data.json {:mvn/version "2.4.0"}} | |
(import '[org.apache.batik.svggen SVGGraphics2D] | |
'[org.apache.batik.dom GenericDOMImplementation] | |
'[java.awt Font]) | |
(require '[clj-http.client :as http] | |
'[clojure.data.json :as json]) |
{:deps {;; does not work, needs JDK 8 with JavaFX | |
;; halgari/fn-fx {:mvn/version "0.4.0"} | |
;; works, needs JDK 11 | |
fn-fx/fn-fx-openjfx11 {:mvn/version "0.5.0-SNAPSHOT"}} | |
:paths ["."] | |
:aliases {:wayland {:jvm-opts ["-Djdk.gtk.version=2"]}}} |
private EventListener dragListener = new ActorGestureListener() { | |
private float initialScale; | |
private float iX; | |
private float iY; | |
@Override | |
public void touchDown(InputEvent event, float x, float y, int pointer, int button) { | |
if (event.getTarget() != stage.getRoot()) | |
return; |