At 01:11 AM 5/6/2002 +0900, bh ahn wrote:
>hi all
>
>I have tried to make program using Behavior class.
>
>In this program, I used WakeupOnElapsedFrames to effect smoothing movement.
>
>But I try to process keyevent, that used WakeupOnAWTEvent to wakeup behavior.
>
>How to code using WakeupOnElapsedFrames and WakeupOnAWTEvent simutaneously.
>
>thanks
>

I think the 'standard' pattern for this is to write a class that extends
Behavior and implements whatever Listener you need to respond to your
event.  You set the alarm to wake up on either PostId or ElapsedFrames.  In
your event response method (the one you need to supply to implement the
Listener), your class posts an Id to itself, then in processStimulus(), you
pick apart the wakeup (whether it's PostId or ElapsedFrame) and respond
accordingly.

At least this is the way I've settled on.  It puts everything in one place,
and it seems to produce no surprises in the way J3D schedules its
processing.  So far.



--
Fred Klingener
www.BrockEng.com

===========================================================================
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".

Reply via email to