Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Custom shapes: zooming and picking

843807Feb 6 2007 — edited Feb 13 2007
I 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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2007
Added on Feb 6 2007
3 comments
158 views