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

Reply via email to