> Hi
>
[quoted text clipped - 6 lines]
>
> java.awt.Point[x=-17,y=38]
The coordinate system is based on the default origin, (0,0), being in the
upper left corner. That results in both the X and Y coordinates of any point
being positive since every point south or east of the origin has a higher X
or Y coordinate than zero.
But there is a method, translate(), that can change the origin to some other
point. Is it possible that your code does a translate()? That could explain
your results.
--
Rhino
Mike - 16 Feb 2006 14:49 GMT
> But there is a method, translate(), that can change the origin to some
> other point. Is it possible that your code does a translate()? That could
> explain your results.
My code does not use translate at any point. If translate is used it is done
within AWT. But the thing is that im not doing anything to change the
result. It's the point directly from the event thats negative. I strongly
suspect its a bug since java 1.1 is very buggy. Its no problem fixing it. I
just make sure to check for negative values. But since in my mind it
shouldnt be possible to get a negative value from mousePressed i think its a
bug.
Mike
Monique Y. Mudama - 16 Feb 2006 17:43 GMT
>> But there is a method, translate(), that can change the origin to
>> some other point. Is it possible that your code does a translate()?
[quoted text clipped - 7 lines]
> values. But since in my mind it shouldnt be possible to get a
> negative value from mousePressed i think its a bug.
Having to use 1.1 is like having to code with your hands tied behind
your back.

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Mike - 17 Feb 2006 11:29 GMT
> Having to use 1.1 is like having to code with your hands tied behind
> your back.
agreed. however i have no choice since its my job:\
Mike
Roedy Green - 17 Feb 2006 04:59 GMT
On Thu, 16 Feb 2006 09:15:48 -0500, "Rhino"
<no.offline.contact.please@nospam.com> wrote, quoted or indirectly
quoted someone who said :
>The coordinate system is based on the default origin, (0,0), being in the
>upper left corner. That results in both the X and Y coordinates of any point
>being positive since every point south or east of the origin has a higher X
>or Y coordinate than zero.
see http://mindprod.com/jgloss/coordinates.html
for a pictorial explanation

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Mike - 17 Feb 2006 11:27 GMT
> see http://mindprod.com/jgloss/coordinates.html
> for a pictorial explanation
The problem is not wether i understand how coordinates work i java. The
question is: is it possible to get a negative point when mousePressed is
called or is this a bug in java 1.1?
Roedy Green - 18 Feb 2006 00:54 GMT
>The problem is not wether i understand how coordinates work i java. The
>question is: is it possible to get a negative point when mousePressed is
>called or is this a bug in java 1.1?
A could see a negative point occurring like this. A mouse click comes
in. Through magical processes it arrives at the Container. The
container looks at the bounds of all its contents and picks the one
containing the point. If it can't find one it has to deal with it
itself. It then selects triggers the event handler of the content
component with the x,y adjusted to be relative to the component.
What could happen to screw this up?
Mainly a second thread meddling, say moving or resizing components
while the container was in the process of dispatching the event.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Mike - 18 Feb 2006 10:47 GMT
> A could see a negative point occurring like this. A mouse click comes
> in. Through magical processes it arrives at the Container. The
[quoted text clipped - 7 lines]
> Mainly a second thread meddling, say moving or resizing components
> while the container was in the process of dispatching the event.
Interesting point. Actually it occurs while moving(animating) an object. So
basically its a synchronization issue?
Im still a bit puzzled about how it can occur. I would like java to be able
to handle this synchronization issue. But am i wrong in assuming that?
Mike.