        :doc (:doc (meta #'stroke-float))}
   stroke stroke-float)
 
-(defn stroke-cap [cap] (.strokeCap *applet* (int cap)))
+(defn stroke-cap
+  "Sets the style for rendering line endings. These ends are either squared,
+  extended, or rounded and specified with the corresponding parameters :square,
+  :project, and :round. The default cap is :round. "
+  [cap-mode]
+  (let [cap-mode (resolve-stroke-cap-mode cap-mode)]
+    (.strokeCap *applet* (int cap-mode))))
 
 (defn stroke-join [jn] (.strokeJoin *applet* (int jn)))
 

;; $$saveFile

(defn save-frame
  ([] (.saveFrame *applet*))
  ([what] (.saveFrame *applet*)))

;; $$savePath
;; $$saveStream

;; $$stop
;; $$str

(def ^{:private true}
  stroke-cap-map {:square SQUARE
                  :round ROUND
                  :project PROJECT
                  :model MODEL})

(defn- resolve-stroke-cap-mode
  [mode]
  (if (keyword? mode)
    (get stroke-cap-map mode)
    mode))

(defn stroke-float
  "Sets the color used to draw lines and borders around shapes."
  ([gray] (.stroke *applet* (float gray)))
