Since we are talking about mice, here is a hard one. I need to be able
to move the position of the cursor on the screen. That is, I need
something like:
SetMouse(258, 234)
which in applications would put this at screen location 258,234. Yes, I
know this breaks all kinds of user interface guidelines, but I really
need it for a psychology experiment. There are lots of java routines
for reading the mouse position, but I need one that will set the mouse
to a new location. Any ideas?
Thanks,
Tom
On Aug 26, 2004, at 9:22 AM, Ted Hill wrote:
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".
Thomas Busey, PhD
Associate Professor
Department of Psychology and Program in Cognitive Science
Indiana University, Bloomington
1101 E. 10th St
Bloomington, IN, 47405
(812) 855-4261
[EMAIL PROTECTED]
www.indiana.edu/~busey
===========================================================================
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".