do you think its a (good) common practise to use
java-shapes for collision detection (especially pointing to
action games) ?
If you’re using only circles and rectangles you’re pretty save with those methods from the AWT. The poly checks are pretty slow, because it’s one size fits all algo for concave and convex polys (convex polys are cheaper to check). Well, usually polys aren’t needed anyways.
As a rule of thumb… just write it plain and simple. If it’s too slow for your taste profile and take care about the time consuming spots.
I just checked the Polygon source. They actually already do that bounds check before doing the in depth test (the bounding rectangle gets cached). So even the simple way of checking (just poly.contains) should be fast enough. You can also get everything cached first by requesting the bounding rectangle for each poly once at the beginning.
So basically like Serethos said. Create the polys… call getBounds once for each poly (without storing the result) and then just loop through em, do a poly.contains() and if it’s positive stop.