 (ns controller
   (:require [clojure.java.io :as io]
+            [clojure.tools.logging :as log]
             [com.lemondronor.turboshrimp :as ar-drone]
             [com.lemondronor.turboshrimp.pave :as pave]
             [com.lemondronor.turboshrimp.xuggler :as video]
             [com.lemonodor.gflags :as gflags]
             [seesaw.core :as seesaw])
-  (:import [java.awt.event InputEvent KeyEvent]))
+  (:import [java.awt.event InputEvent KeyEvent]
+           [java.awt Graphics]
+           [java.awt.image BufferedImage]
+           [java.net Socket]
+           [javax.swing JPanel]))
 
-
-(defn data-display [text id]
-  (seesaw/grid-panel
-   :columns 2
-   :items [(seesaw/make-widget [:fill-h 10])
-           (seesaw/label :text text)
-           (seesaw/label :id id :text "0")]))
-
-
-(defn glue-button [id text]
-  (seesaw/horizontal-panel
-   :items
-   [(seesaw/make-widget :fill-h)
-    (seesaw/button :id id :text text)
-    (seesaw/make-widget :fill-h)]))
 
 
 (defn make-ui []

   [{:code KeyEvent/VK_A} ar-drone/counter-clockwise]
   [{:code KeyEvent/VK_D} ar-drone/clockwise]
   [{:code KeyEvent/VK_Q} ar-drone/up]
   [{:code KeyEvent/VK_Z} ar-drone/down]])


(defn key-descriptor-matches? [descriptor ^KeyEvent evt]

    :size [1280 :by 720])))


;; Keys are WASD/QZ, with Shift to "strafe":
;; W / S  -  Move forward / Move backward
;; A / D  -  Yaw left / Yaw right
;; Q / Z  -  Climb / Descend
;; Shift-A / Shift D  - Move left / Move right.

(def key-actions
  ;; Checked in order as they appear here, so make sure to put keys
  ;; with mods first.
  [[{:code KeyEvent/VK_A :mod InputEvent/SHIFT_MASK} ar-drone/left]
   [{:code KeyEvent/VK_D :mod InputEvent/SHIFT_MASK} ar-drone/right]
   [{:code KeyEvent/VK_W} ar-drone/front]
