Hi Joel,

The other way to determine when an Alpha is finished is to write your
own Subclass of Alpha and overide the method value() to check for
completion and call your listener.

Rgds

Paul


>MIME-Version: 1.0
>Date: Fri, 1 Sep 2000 08:25:18 -0400
>From: "J. Lee Dixon" <[EMAIL PROTECTED]>
>Subject: [JAVA3D] Interpolator completion event
>To: [EMAIL PROTECTED]
>
>Does anybody know an easy way to be notified when an interpolator has
>completed?  The way I figure it, I could watch the Alpha that I supply
>to the interpolator to see when it has Alpha.finished().  But this would
>mean making my own Behavior to be triggered every frame to watch it.  It
>would make much more sense to have an interface called an
>InterpolatorListener.  The interpolators should notice when their Alpha
>has .finished(), and then tell any listeners about it...
>
>... or at the least, there is a WakeupOnBehaviorPost.  The interpolator
>could post a message saying that it's alpha has finished using the
>Behavior.postID() function.
>
>After thinking this through, I think I could extend the interpolator
>like below.  Anybody at SUN interested in this?
>
>interface InterpolatorListener
>{
>  abstract public void InterpolatorCompleted();
>}
>
>class PositionInterpolatorWithEvent extends PositionInterpolator
>{
>  //  constructors...
>
>  public void setListener(InterpolatorListener listener)
>  {
>    // do stuff
>  }
>
>  // override the processStimulus function...
>  public void processStimulus(java.util.Enumeration criteria)
>  {
>    super.processStimulus(criteria);
>    if(  (super.getAlpha()).finished() )
>    {
>      myListener.InterpolatorCompleted();
>    }
>  }
>}
>
>J. Lee Dixon
>Software Engineer
>SAIC - Celebration, FL
>[EMAIL PROTECTED]
>
>===========================================================================
>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".

----------------------------------------------------------
Paul Byrne                      Email : [EMAIL PROTECTED]
Sun Microsystems                Phone : (650) 786 9926
Visualization Software Group    Fax   : (650) 786 5852
----------------------------------------------------------

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