Custom shapes: zooming and picking
843807Feb 6 2007 — edited Feb 13 2007I need design advice regarding a screen-full of custom shapes I am making: my app will draw literally thousands of primitive octagons. I have seen this issue in other threads, but answers didn't fully apply to my situation.
Using Graphics2D's scale, I will enable zooming ability. The current problem involves zooming: getting contains() to work in the event I'm zoomed in or out. I've heard of a method that AffineTransform has that returns you a transformed shape?
Assuming that works, then I still have to run contains(), followed by AffineTransform's transformed shape method roughly 4000 times. Any advice on this? If performance isn't instantaneous I'm going to have to choose a clever data structure/alg.
The octagons are more or less in "grid format" and it forms a big rectangular array. Thanks!