public class Slave extends Behavior{
WakeupCondition wakeup;
private Runnable task;
public void initialize(){
wakeup = new WakeupOnBehaviorPost( this, 0 );
wakeupOn( wakeup );
}
public void processStimulus( Enumeration criteria ){
task.run();
wakeupOn( wakeup );
}
public void executeTask( Runnable r ){
task = r;
postId( 0 );
}
}
-----Original Message-----
From: Fred Klingener [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 19, 2001 11:54 PM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Controlling unpredictable motion
From: "Kasparian, Raffi J." <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 2:32 PM
> Create a behavior that wakes up on WakeupOnBehaviorPost. Then
whenever your
> program gets a request from your stream to update the scene
graph, wake up
> your Behavior by calling its postID() method. Your Behavior
will wake up and
> execute processStimulus(). If you define your Behavior's
processStimulus to
> call the run method of a Runnable that you passed it when you
called postID,
Clarify please? Do you extend Behavior to send a Runnable
object along with the postID?
TIA,
Fred
===========================================================================
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".
===========================================================================
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".