               (try
                 (f (.getSelectedRow table))
                 (catch Exception e (.printStackTrace e)))))))))
-
-(defn populate-list [list data]
-  (let [model (.getModel list)]
-    (.clear model)
-    (doseq [datum data]
-      (.addElement model datum)))
-  list)
-
-(defn handle-group-text-changed [e]
-  (println (.getText (.getComponent (.getSource e)))))
-
-(defn allow-group-renaming [table]
-  (.. table
-      (getDefaultEditor String)
-      (addCellEditorListener
-        (reify CellEditorListener 
-          (editingStopped [this e]
-            (handle-group-text-changed e))))))
 
 (defn group-table-model []
   (proxy [AbstractTableModel] []

    (getColumnName [column] (property-name (nth (properties @group-data) column)))
    (getColumnCount [] (count (properties @group-data)))
    (getRowCount [] (count (keys @group-data)))
    (isCellEditable [_ _] true)
    (getValueAt [row column] (get (nth (vals @group-data) row)
                                  (nth (properties @group-data) column)))
    (setValueAt [val row column]
      (let [old-val (.getValueAt this row column)]
        (core renameConfig (get-selected-group) old-val val)
        (update-group-data)))))

(defn link-table-row-selection [table-src table-dest]
  (let [model (proxy [DefaultListSelectionModel] [])]
    (.setListSelectionModel table-src model)
    (.setListSelectionModel table-dest model)))
  


(def widgets (atom nil))

(defn get-selected-group []
  (let [row (.getSelectedRow (@widgets :groups-table))]
    (when (<= 0 row)
      (nth @groups row))))

;; swing layout 

(defn put-constraint [comp1 edge1 comp2 edge2 dist]
  (let [edges {:n SpringLayout/NORTH
