I think you could just keep a vector of (color,shape) pairs as an atom, and reify a subclass of JPanel whose paint() method closes around that atom, calling (.draw shape color). Then as long as you call repaint every time you modify the atom, you should be done. Seems like it's hard to see a library making this much easier, as there's not much incidental complexity to begin with. And alpha will be trivial, since java.awt.Color supports alpha values - you won't even have to know about it.
On Sep 14, 1:17 pm, Lee Spector <lspec...@hampshire.edu> wrote: > On Sep 14, 2010, at 2:13 PM, Miki wrote: > > > Maybe the ants demo will help -http://tinyurl.com/29rqe5r > > Thanks Miki -- I've seen that code, and the video of Rich discussing it, and > I've been toying with some of the elements that it uses (JFrames etc.). But > that is in a more elaborate context with an animation thread, a grid world > stored in a vector or refs to cells, etc., and it's not clear from this -- at > least to me -- what the code-minimal (and library-free) core would be that > supports just the kind of simple drawing that I described (with one call to > create the window, and subsequent calls that can dynamically add shapes to > the window). I'm able to do graphics by pasting these things together -- what > I'm after is the code-minimal way of doing so. > > -Lee -- 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