I did math.
I just did some math. Not complicated math. Really simple stuff. Like rearranging equations and trig and things like that. It took me three tries to get it right; my equation-handling skills are pretty atrophied at this point. Still, I got the job done. The problem was simple: If you want to put n circles of radius r inside another larger circle of radius R, and have them touching each other, what is the value of r given R and n?
Like I said, it took me a while. I'm glad to see that the laws of mathematics still apply in the Bush era. At least, they do on paper.
So I have my pretty rings all displayed in a pretty form, nice hit-testing, and TreeModel compatibility. Over the next few days I'll refine the algorithm for display, try to do some LOD, and figure out a good mechanism for showing what's under the cursor.
The idea is to produce a nice circular layout that's plug-compatible with JTree. I don't know if I'll get the whole way there because in a circular layout you can't retain the desired order if you want to use more than one ring to represent a level of a tree. Otherwise, you can. What I'll probably do is retain as much of the order as I can.
Time to sleep -- much work to get done tomorrow.
Automatic layout and visualization is interesting!
1:22:45 AM
|