<commit_before>;; Some java fx macros
;;
(ns app.jfx
  (:import (javafx.beans.value ChangeListener)
           (javafx.event ActionEvent EventHandler)
           (javafx.scene Scene)
           (javafx.fxml FXMLLoader)))

(defmacro fx-load-fxml [path]
  `(let [loc# (clojure.java.io/resource ~path)]
     (FXMLLoader/load loc#)))

(defmacro fx-add-text-listener [text-property action]
  `(.addListener ~text-property
                 (reify ChangeListener
                   (changed [this obsval oldval newval]
                     ~action))))

(defmacro fx-window [stage view title]
  `(let [root# (.loadFxml ~view)]
     (.setScene ~stage (Scene. root#))
     (.setTitle ~stage ~title)
     (.show ~stage)))

(defmacro fx-action [node action]
  `(.setOnAction ~node
                 (proxy [EventHandler] []
                   (handle [^ActionEvent event#]
                     ~action))))<commit_msg>add stay on top<commit_after>;; Some java fx macros
;;
(ns app.jfx
  (:import (javafx.beans.value ChangeListener)
           (javafx.event ActionEvent EventHandler)
           (javafx.scene Scene)
           (javafx.fxml FXMLLoader)))

(defmacro fx-load-fxml [path]
  `(let [loc# (clojure.java.io/resource ~path)]
     (FXMLLoader/load loc#)))

(defmacro fx-add-text-listener [text-property action]
  `(.addListener ~text-property
                 (reify ChangeListener
                   (changed [this obsval oldval newval]
                     ~action))))

(defmacro fx-window [stage view title]
  `(let [root# (.loadFxml ~view)]
     (.setScene ~stage (Scene. root#))
     (.setAlwaysOnTop ~stage 'true)
     ;;(.initStyle ~stage (StageStyle. 'TRANSPARENT))
     (.setTitle ~stage ~title)
     (.show ~stage)))

(defmacro fx-action [node action]
  `(.setOnAction ~node
                 (proxy [EventHandler] []
                   (handle [^ActionEvent event#]
                     ~action))))
{'fraction_non_alphanumeric': 0.13842105263157894, 'fraction_numerical': 0.0, 'mean_word_length': 2.277586206896552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5658233', 'n_tokens_mistral': 624, 'n_tokens_neox': 593, 'n_words': 149}