 
 (ns ^{:doc    "Utilities for arranging container component layout."
       :author "Denys Lebediev"}
-flatgui.layout
+  flatgui.layout
     (:require [flatgui.base :as fg]
       [flatgui.awt :as awt]
-      [flatgui.util.matrix :as m] [flatgui.util.matrix :as m])
+      [flatgui.util.matrix :as m])
   (:import (java.util.regex Pattern)))
 
 

;;;          - either equally if nothing else specified
;;;          - or according to specified weights (may be specified with digits or
;;;            with smile lengths like :--- or :|||)



;(fg/defevolverfn :position-matrix)
;
;(fg/defevolverfn :clip-size)


      ;; TODO
      nil)))

(fg/defevolverfn :coord-map
 (if-let [layout (map cmd->smile (get-property [:this] :layout))]
   (flagnestedvec->coordmap (map-direction component layout \- \< m/x))))

(fg/defevolverfn :position-matrix
  (if-let [coord-map (get-property [] :coord-map)]
    (if-let [coord ((:id component) coord-map)]
      (let [ps (get-property [] :clip-size)]
        (m/translation (* (:x coord) (m/x ps)) (* (:y coord (m/y ps)))))
      old-position-matrix)
    old-position-matrix))

(fg/defevolverfn :clip-size
  (if-let [coord-map (get-property [] :coord-map)]
    (if-let [coord ((:id component) coord-map)]
      (let [ps (get-property [] :clip-size)]
        (m/defpoint (* (:w coord) (m/x ps)) (* (:h coord (m/y ps)))))
      old-clip-size)
    old-clip-size))


;;; 1. After map-direction is used for elements of each row, each row will
;;; receive it's own set of smile flags. Then map-direction will be used
