 	    (ref-set interaction-obj nil))
 	   nil)))))
 
-(defn connect-nodes [scn x y]
-  (let [[x1 x2] (:position @(.getUserData x))
-	[y1 y2] (:position @(.getUserData y))
-	c (GSegment.)]
-    (.addSegment scn c)
-    (.setGeometry c x1 x2 y1 y2)
-    (dosync
-     (alter (.getUserData x) assoc :upper #{c})
-     (alter (.getUserData y) assoc :lower #{c}))))
-
 (defn show-some-picture []
   (let [wnd (GWindow.)
 	scn (GScene. wnd)

      (event [scn evt x y]
	(condp = evt
	   GWindow/BUTTON1_DOWN
	   (let [thing (.findSegment scn x y)]
	     (when (.getUserData thing)
	       (dosync
		(ref-set interaction-obj thing)
		(ref-set x0 x)

	   (let [dx (- x @x0)
		 dy (- y @y0)]
	     (when @interaction-obj
	       (.translate (.getSegment @interaction-obj) dx dy)
	       (doseq [c (:upper @(.getUserData @interaction-obj))]
		 (let [c (.getSegment c)
		       c1 (aget (.getX c) 0)
		       c2 (aget (.getY c) 0)
		       d1 (aget (.getX c) 1)
		       d2 (aget (.getY c) 1)]
		   (.setGeometry c (+ c1 dx) (+ c2 dy) d1 d2)))
	       (doseq [c (:lower @(.getUserData @interaction-obj))]
		 (let [c (.getSegment c)
		       c1 (aget (.getX c) 0)
		       c2 (aget (.getY c) 0)
		       d1 (aget (.getX c) 1)
		       d2 (aget (.getY c) 1)]
