Alex, thanks for your two posts and for taking the time to look at the original source code. Some comments:
Re: Integer being final. Actually, I remembered that...and then forgot. Tired? Clueless? You decide. I'm going to fold your observations into a new test program to see what happens; thanks. Re: subclassing: Unless I'm missing something, I still want to subclass PCanvas because the class adds another method, updateEdge, which gets called within the drag event handler. Anyway, I'll post again when I have something to report. On Apr 28, 12:30 am, Alex Osborne <a...@meshy.org> wrote: > GreggWilliams<greg...@innerpaths.net> writes: > > Now I'm working on > > the "Graph Editor" program described > > athttp://www.piccolo2d.org/learn/grapheditor.html > > . > > > In this sample program (which you don't really need to look at) I need > > to subclass a Piccolo2D class to create a class named GraphEditor , > > but unlike the last time (see "Java interop question: proxy or gen- > > class?" in this group), I can't subclass using proxy because *this* > > subclass, GraphEditor, adds a new method. This means I have to use gen- > > class. > > Actually looking at the sample code, GraphEditor doesn't appear to > override any methods of PCanvas, so why does it need to be a subclass at > all? I'd just create a regular instance of PCanvas and work with that > instead: > > (defn create-graph-editor [width height] > (let [canvas (doto (PCanvas.) > (.setPreferredSize width height)) > node-layer (.getLayer canvas) > edge-layer (PLayer.) > random (Random.)] > (-> canvas (.getRoot) (.addChild edgeLayer)) > (-> canvas (.getCamera) (.addLayer 0 edgeLayer)) > ;; > ;; ... and so on. I'd actually probably break the > ;; constructor up into multiple functions, it's > ;; rather large. > ;; > canvas)) > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en