         (and (coll? size) (= 2 (count size))) size
         :else (throw (IllegalArgumentException.
                       (str "Invalid size definition:" size ". Was expecting :fullscreen or 2 elements vector: [x-size y-size].")))))
-
-(def ^{:private true} VALID-TARGETS #{:frame :perm-frame})
-
-(defn- validate-target!
-  "Checks that the target option is one of the following allowed
-  targets: [:frame, :perm-frame]."
-  [target]
-  (when-not (some VALID-TARGETS [target])
-    (throw (IllegalArgumentException. (str "Invalid target:" target". Was expecting one of: " (vec VALID-TARGETS)))))
-  target)
 
 (defn- to-method-name [keyword]
   "Converts keyword to java-style method symbol. :on-key-pressed => onKeyPressed"

  (set! (.finished applet) true))

(defn- prepare-applet-frame
  [applet title renderer keep-on-top?]
  (let [keep-on-top?   (boolean keep-on-top?)
        frame          (.frame applet)]
    (doseq [listener (.getWindowListeners frame)]
      (.removeWindowListener frame listener))


(defn- applet-run
  "Launches the applet to the specified target."
  [applet title renderer]
  (PApplet/runSketch (into-array String ["--hide-stop" title]) applet)
  (prepare-applet-frame applet title renderer))


(def ^{:private true}
