    :methods [
              [setState [clojure.lang.Keyword Object] void]
              [getState [clojure.lang.Keyword] Object]
+             [reset [] void]
              ]
    :exposes-methods {paint superpaint}
    :extends javax.swing.JFrame
    )
   (:import
-   (javax.swing JButton JTextField JLabel)
+   (javax.swing JButton JTextField JLabel JOptionPane)
+   (java.io File)
+   (javax.imageio ImageIO)
+   (javax.swing.event DocumentListener)
    (java.awt Toolkit Dimension Color FlowLayout)
-   (java.awt.event ActionListener)
+   (java.awt.event ActionListener MouseAdapter MouseMotionAdapter)
    (java.awt.image BufferedImage)
    )
   (:require [levycurve.core :as fractal])

      (if (contains? actions name)
        (.addActionListener component (get actions name))
        ))
    (doto graphics
      (.setColor Color/black)
      (.fillRect 0 0 (.getWidth img) (.getHeight img))


(defn -init []
  "Sets Initial State"
  [["Levy Curve Generator"] (atom {:path [], :angle 45, :iterations 15, :color 16711680})]
  )

(defn -setup [ui]
  "Setup UI components, listeners"
  (let [screen-size (.getScreenSize (Toolkit/getDefaultToolkit))
        width (- (.width screen-size) 400)
        height (- (.height screen-size) 100)
        comp-size (Dimension. 100 20) ;Component Size
        components {:angle-label (JLabel. "Angle")
                    :angle (JTextField. "45")
                    :step (JButton. "Step")
                    :save (JButton. "Save")
                    :reset (JButton. "Reset")}
        create-listener (fn [f & args]
                          (proxy [ActionListener] []
                            (actionPerformed [e]
                              (apply f args)))
                          )
        actions {:step (create-listener -step ui)
                 :reset (create-listener -reset ui true)
                 :save (create-listener -save ui)
                 }
        img (BufferedImage. width height BufferedImage/TYPE_INT_RGB)
        graphics (.createGraphics img)
        ]
    (doto ui ;Set size and add state
