/**
 * @author mtarlton
 *
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates.
 * To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation.
 */
import javax.media.j3d.*;
import java.util.Enumeration;


/**
 * this is the troublesome behavior.  It will simply trigger a call to have
 * the shape update its data.
 *
 * @author mtarlton
 */
public class NullUpdateBehavior extends Behavior {



        public NullUpdateBehavior(GeometryByReferenceTest applet) {
                this.applet = applet;
        }

        /**
         * @see javax.media.j3d.Behavior#initialize()
         */
        public void initialize() {
                wakeupOn(w);
        }
        /**
         * @see javax.media.j3d.Behavior#processStimulus(java.util.Enumeration)
         */
        public void processStimulus(Enumeration arg0) {


                applet.rotateShape( angle );
                angle = angle + 0.001f;


                applet.tetraIndexed.updateData( applet) ;
                wakeupOn(w);
        }

        /**
         * Wakeup trigger used by Java3D Behavior.  trigger to cause the behavior to run for every
         * animation frame
         */
        private WakeupOnElapsedFrames w = new WakeupOnElapsedFrames(0);

        GeometryByReferenceTest applet = null;


        private float angle = 0.0f;

}




