       (prn (.-timeStamp event) " ... was not yet handled!")
       true)))
 
+(defn handle-click [e state]
+  ; add/remove morph from preserve list
+  ; (branch-merge/toggle-preserve state)
+  ; handle the custom behavior
+  (when (and (not-yet-handled e) (.-altKey e))
+    (@right-click-behavior e @state))
+  (when-let [cb (get-in @state [:morph :onClick])] 
+              (cb state)))
+
 ; morph property to CSS property translators
 
 (defn get-fill-css [value]

(defn render-submorphs [app]
  (dom/div #js {:className "originNode"}
    (apply dom/div nil
      (om/build-all morph (:submorphs app)))))

; property accessors


            (concat path [:submorphs %])) (range (count submorphs)))
          nil)))))

(defn find-morph [*model id]
  (make-cursor *model (find-morph-path @*model id)))

(defn add-morph [->owner morph]
  (let [submorphs (or (get @->owner :submorphs) [])
        morph-owner (assoc morph :owner ->owner)]
    (om/update! ->owner :submorphs (conj submorphs morph-owner))))

(defn remove-morph [->owner morph-id]
  (let [submorphs (get @->owner :submorphs)]
    (om/update! ->owner :submorphs (into [] (filter #(not= (% :id) morph-id) submorphs)))))

(defn set-position [->morph pos]
  (om/update! ->morph [:morph :Position] pos))

(defn set-fill [->morph color]
  (om/update! ->morph [:shape :Fill] color))

(defn set-extent [->morph extent]
  (om/update! ->morph [:shape :Extent] extent))

(defn set-border-color [->morph fill]
  (om/update! ->morph [:shape :BorderColor] fill))

(defn toggle-halo [->morph]
  (om/transact! ->morph [:morph :Halo] 
     (fn [halo] 
        (if halo
            false
            true))))

; render based on ad hoc definition of morph like frame
; to visualize the halo
(defn render-halo [app owner])

(defmethod morph :default [app owner]
  (reify
    om/IRender
    (render [this]
        (let [style (dict->js (extract-morph-css app))]
          (dom/div  #js {:style style
                       :className "morphNode"
                       :onClick #(handle-click % app)
                       :onMouseDown #(draggable/start-dragging % app owner)
                       :onMouseUp #(draggable/stop-dragging % app owner)} 
                   (when (get-in app [:morph :Halo])
                      (render-halo app owner))
                   (shape app owner))))))

;; multi method for shape

(defmethod shape "Image" [app owner]
  (let [style (dict->js (extract-shape-css app))]
    (dom/img #js {:style style
                  :draggable false
                  :src (get-in app [:shape :url])})))

  
(defmethod shape "Ellipse" [app owner]
  (let [style (extract-shape-css app)]
    ;; we apply some customizations to the style, to make the shape elliptical
    (let [ellipse-style (assoc style 
                          "border-radius" (str (style "width") " /" (style "height")))]
      (dom/div #js {:style (dict->js ellipse-style)} (render-submorphs app)))))

(defmethod shape :default [app owner]
  (let [style (extract-shape-css app)]
    (dom/div #js {:style (dict->js style)} (render-submorphs app))))

; PATH MORPH

(defn handle-path-element [e]
  (case (e :type)
