I've posted a XHelloUniverse.java applet with an inner Behavior
at
http://www.brockeng.com/VMech/XBehavior/XHelloUniverse.html
public class XBehavior extends Behavior
{
WakeupOnElapsedFrames alarm;
static final boolean DEBUG = true;
XBehavior()
{ if(DEBUG) System.out.print("XBehavior Constructor\n");
if(DEBUG) System.out.print(" os.arch =
"+System.getProperty("os.arch")+"\n");
if(DEBUG) System.out.print(" os.name =
"+System.getProperty("os.name")+"\n");
if(DEBUG) System.out.print(" os.version
="+System.getProperty("os.version")+"\n");
if(DEBUG) System.out.print(" J2 :
j2sdk-1_3_1_01a-win.exe\n");
if(DEBUG) System.out.print(" J3D:
java3d-1_3-beta1-win-opengl-sdk.exe\n");
alarm = new WakeupOnElapsedFrames(0);
}
public void initialize()
{ wakeupOn(alarm);
if(DEBUG) System.out.print("XBehavior initialize()\n");
if(DEBUG) System.out.print(" alarm = "+alarm+"\n");
if(DEBUG) System.out.print(" getWakeupCondition() =
"+getWakeupCondition()+"\n");
}
public void processStimulus(java.util.Enumeration e)
{ wakeupOn(alarm);
if(DEBUG) System.out.print("XBehavior processStimulus()\n");
if(DEBUG) System.out.print(" alarm = "+alarm+"\n");
if(DEBUG) System.out.print(" getWakeupCondition() =
"+getWakeupCondition()+"\n");
}
}
I patch it into the HelloUniverse just above the
objRoot.compile() in createSceneGraph() with::
XBehavior xb = new XBehavior();
xb.setBounds(bounds);
objRoot.addChild(xb);
When I run it as an Applet, the console window shows:
Java(TM) Plug-in: Version 1.3.1_01
Using JRE version 1.3.1_01 Java HotSpot(TM) Client VM
. . .
XBehavior Constructor
os.arch = x86
os.name = Windows 2000
os.version =5.0
J2 : j2sdk-1_3_1_01a-win.exe
J3D: java3d-1_3-beta1-win-opengl-sdk.exe
XBehavior initialize()
alarm = javax.media.j3d.WakeupOnElapsedFrames@3bc473
getWakeupCondition() = null
and that's all. The model runs, but xb never wakes up. How
come?
TIA,
Fred Klingener
Brock Engineering
===========================================================================
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".