Look at Graphics2D.hit()

You can build a small Rectangle centered at the mouse click and see if
it intersects a Shape.

Will this work for you?

-----Original Message-----
From: Discussion list for Java 2D API
[mailto:[EMAIL PROTECTED] On Behalf Of Danilo Costa
Sent: Thursday, August 26, 2004 8:55 AM
To: [EMAIL PROTECTED]
Subject: [JAVA2D] Click detection


Hi EveryBody!

I'm trying to do the following:

 I have some geometrics objects such as ellipses, rectanglesand
poly-lines instancied and drawn on a canvas, and I need to know when the
user clicks over the lines of one of its.

 There is the method called "contains(double x, double y)" but it checks
if the point is inside of some geom object .. I need something
like the Line2D method : " int    relativeCCW(double PX, double PY)"
that return 0 when the point lies exactly on the line segment. But I
need to know when it lies on a ellipse , on the lines of a rectangle, or
polyline, or polygon!

I hope I was clear
Please, I realy need help on it!
[]
Danilo

========================================================================
===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body of the message "signoff JAVA2D-INTEREST".  For general help, send
email to [EMAIL PROTECTED] and include in the body of the message
"help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to