Hi Joachim,
This is a bug in the MouseBehavior() utility.
Bug 4465262 - MouseBehavior postID not work after
behavior disable and enable again
is filed for this. A workaround is to use WakeupOnAWTEvent
instead of AWT listeners and behavior posts.
i.e. use MouseBehavior() instead of MouseBehavior(Component c)
constructor.
But if WakeupOnAWTEvent is used, the first click will be igored
after enable again, see bug 4391507.
You can simply fix the utility by editing the source provided
in the SDK download under
com/sun/j3d/utils/behaviors/mouse/MouseBehavior.java
and remove the checking mouseq.size() == 1 :
if (mouseq.size() == 1)
postId(MouseEvent.MOUSE_DRAGGED);
A better fix would be to prevent event adding to the queue
when behavior disable.
Thanks for your test program.
- Kelvin
--------------------
Java 3D Team
Sun Microsystems Inc.
>X-Unix-From: [EMAIL PROTECTED] Tue May 29 18:16:45
2001
>MIME-Version: 1.0
>Date: Tue, 29 May 2001 17:02:57 +0200
>From: Joachim Diepstraten <[EMAIL PROTECTED]>
>Subject: [JAVA3D] Interesting behaviour with MouseRotator
>To: [EMAIL PROTECTED]
>
>Hi
>
>Allright I finaly really got some question or well more a strange
>behaviour.
>
>I've got a viewingPlatform with 4 multiTransformGroup I've attached to one
>transFormGroup (0) a MouseRotator. But I'll disable it with
>setEnabled(false) at the start. In my application I've got a
>Swing ToogleButton to activate/deactivate the MouseRotator. This works
>fine one time. I can enable it with setEnabled(true) and disable it again
>with setEnabled(false). But when I enable it for the 2nd time, nothing
>happens. I get a true when I call getEnable() but when I drag the
>mouse inside the canvas nothing happens?
>
>Any reason why?
>
>--
>Realtime Raytracer in JAVA
>(http://www.antiflash.net/raytrace)
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff JAVA3D-INTEREST". For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>X-Unix-From: [EMAIL PROTECTED] Fri Jun 1 01:57:06
2001
>Date: Fri, 1 Jun 2001 10:57:01 +0200 (METDST)
>From: Joachim Diepstraten <[EMAIL PROTECTED]>
>To: Kelvin Chung <[EMAIL PROTECTED]>
>Subject: Re: [JAVA3D] Interesting behaviour with MouseRotator
>MIME-Version: 1.0
>
>Hi Kelvin
>
>>
>> This might be a bug in Java3D, please send us a test case
>> for investigation.
>Here you are. The funny thing is sometimes it doesn't even work for the
>first time. It seems that it depends on if I drag the mouse at the
>beginning then switch it to enable or if I switch it on enable at once
>before dragging.
>
>Hope it helps. Anyway I wrote my own workarround by using the provided
>code and adding my own flag. This means it's not urgent for me
>
>EOF,
> J.D.
>
>--
>Jmark2k+1 (http://www.antiflash.net/jmark)
>Test the performance of your PC online!
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".