diff --git a/src/seesaw/color.clj b/src/seesaw/color.clj index 79d598dd..0e888958 100644 --- a/src/seesaw/color.clj +++ b/src/seesaw/color.clj @@ -210,7 +210,7 @@ (color (resource s)) (or (color-names (.toLowerCase (name s))) (decode (name s))))) ([s a] (apply color (assoc (get-rgba (color s)) 3 a))) - ([^Integer r ^Integer g ^Integer b ^Integer a] (Color. r (or g 0) (or b 0) (or a 255))) + ([^Integer r ^Integer g ^Integer b ^Integer a] (Color. r (int (or g 0)) (int (or b 0)) (int (or a 255)))) ([r g b] (color r g b nil))) (defn ^Color default-color diff --git a/src/seesaw/event.clj b/src/seesaw/event.clj index 0fffad7d..92fdd35f 100644 --- a/src/seesaw/event.clj +++ b/src/seesaw/event.clj @@ -241,7 +241,7 @@ (for [{:keys [class] :as group} (vals event-groups)] [class group]))) -(defn- get-listener-class [m] +(defn- get-listener-class [^java.lang.reflect.Method m] (let [[arg] (.getParameterTypes m)] (if (and arg (.startsWith (.getName m) "add")) arg))) @@ -512,7 +512,7 @@ "List to propertyChange events on a target for a particular named property. List (listen), returns a function that, when called removes the installed listener." - [target property event-fn] + [^java.awt.Component target property event-fn] (let [listener (reify java.beans.PropertyChangeListener (propertyChange [this e] (event-fn e)))] (.addPropertyChangeListener target property listener) @@ -536,7 +536,7 @@ (seesaw.dev/show-events) " [v] - (let [base (->> (.getMethods (if (class? v) v (class v))) + (let [base (->> (.getMethods (if (class? v) ^java.lang.Class v (class v))) (map get-listener-class) (filter identity) (map event-groups-by-listener-class) diff --git a/src/seesaw/graphics.clj b/src/seesaw/graphics.clj index 75e6bd6d..cc779351 100644 --- a/src/seesaw/graphics.clj +++ b/src/seesaw/graphics.clj @@ -188,7 +188,7 @@ ;******************************************************************************* ; Gradients -(defn- to-point2d-f [[x y]] (java.awt.geom.Point2D$Float. (float x) (float y))) +(defn- ^java.awt.geom.Point2D$Float to-point2d-f [[x y]] (java.awt.geom.Point2D$Float. (float x) (float y))) (def ^{:private true} default-start [0 0]) (def ^{:private true} default-end [1 0]) (def ^{:private true} default-fractions [0.0 1.0]) @@ -274,8 +274,8 @@ (float radius) (to-point2d-f (or focus center)) (float-array fractions) - (into-array java.awt.Color (map to-color colors)) - (cycle-map cycle))) + ^{:tag "[Ljava.awt.Color;"} (into-array java.awt.Color (map to-color colors)) + ^java.awt.MultipleGradientPaint$CycleMethod (cycle-map cycle))) ;******************************************************************************* ; Strokes diff --git a/src/seesaw/layout.clj b/src/seesaw/layout.clj index 0d0e3445..b51a491a 100644 --- a/src/seesaw/layout.clj +++ b/src/seesaw/layout.clj @@ -37,7 +37,7 @@ ([^java.awt.Container c w constraint] (let [w* (if w (make-widget* w))] (check-args (not (nil? w*)) (str "Can't add nil widget. Original was (" w ")")) - (.add c w* constraint) + (.add c ^java.awt.Component w* constraint) w*))) (defn add-widgets diff --git a/src/seesaw/util.clj b/src/seesaw/util.clj index e5de71d6..f8a93a1d 100644 --- a/src/seesaw/util.clj +++ b/src/seesaw/util.clj @@ -194,7 +194,7 @@ [v] (cond (resource-key? v) (to-mnemonic-keycode (resource v)) - (string? v) (to-mnemonic-keycode (.charAt v 0)) + (string? v) (to-mnemonic-keycode (.charAt ^String v 0)) (char? v) (int (Character/toUpperCase ^Character v)) :else (int v)))