>>>>> "MP" == Michał Piotrowski <[EMAIL PROTECTED]> writes:
MP> How can I write own mouse hit detector for my extension without
MP> rewriting org.apache.batik.gvt.ShapeNode? Is it possible or the
MP> only way is to rewrite method 'contains()' in class ShapeNode?
Well I must admit that I haven't tried to write a hit detector for
an extension (and you aren't very clear on what the exact problem is)
so this response may be a bit abstract, but...
1) It isn't clear why ShapeNode's contains method is inappropriate, it
seems to return true when the click is inside the paintedArea.
This seems like a really reasonable implementation and as long as
you are interested in clicks in a particular geometric area should
suffice (I should also mention the 'isVisible' data member or
the 'visible=""false"' SVG attribute).
2) If you needed some 'whacked out' implementation of contains, Java is
an object oriented language so you can subclass ShapeNode and add
your new implementation:
return new ShapeNode(...) {
public boolean contains(Point2D p) {
// I get all clicks!!!
return true;
}
};
(Note, Using an anonymous subclass is probably not the best route
but it could be done).
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]