Hi Scott,
>Delivered-To: [EMAIL PROTECTED]
>X-Priority: 3 (Normal)
>Mime-Version: 1.0
>Date: Thu, 16 Aug 2001 15:49:34 -0600
>From: Scott Rutlege <[EMAIL PROTECTED]>
>Subject: [JAVA3D] Custom events with WakeupOnAWTEvent: possible?
>To: [EMAIL PROTECTED]
>
>I've been working at this all day, so either it's not possible, I'm doing something
>wrong, or I found
a bug.
>
>I'm trying to use a custom AWTEvent (with an id > AWTEvent.RESERVED_ID_MAX) to
>trigger a behavior. So
I create a simple concrete version of AWTEvent, create one with my own ID, and
dispatch it to the
active Canvas3D.
>However, My behavior set to wakeup on an AWTEvent with this ID never gets triggered.
>I played around
with some different conditions, and I was only able to get events through if they were
standard ones
(any in java.awt.event).
>
>So which of the following is true?
>
>- J3D is only meant to processes standard AWTEvents
>- I'm doing something wrong
>- This _should_ work (aka bug)
>
>I'll provide more detailed information/code on further request.
In Java3D, there is a class EventCatcher (not public)
which implements ComponentListener, FocusListener,
KeyListener, MouseListener, MouseMotionListener, WindowListener
only. This class capture all AWTEvent in Canvas3D and
send it to Behavior scheduler to process.
Your custom AWTEvent will not capture by EventCatcher
since it did not implement your custom interface and
add the custom listeners. Therefore it will not work.
An alternative is to use WakeupOnBehaviorPost instead.
- Kelvin
----------------
Java 3D Team
Sun Microsystems Inc.
===========================================================================
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".