/** * Resumes this alpha object as of the specified time. If the alpha * object was paused, the difference between the specified * time and the pause time will be used to adjust the startTime of * this alpha. The equation is as follows: * * <ul><code>startTime += time - pauseTime</code></ul> * * Since the alpha object is no longer paused, this has the effect * of resuming the interpolator as of the specified time. If the * alpha object is not paused when this method is called, then this * method does nothing--the start time is not adjusted in this case. * * @param time the time at which to resume the alpha * * @exception IllegalArgumentException if time <= 0 * * @since Java 3D 1.3 */ public void resume(long time) { if (time <= 0L) { throw new IllegalArgumentException(J3dI18N.getString("Alpha0")); } if (paused) { long newStartTime = startTime + time - pauseTime; paused = false; pauseTime = 0L; setStartTime(newStartTime); } }
/** * Called from the RotationInterpolator, indicating that the animation was * paused. */ private void animationPaused() { rotpol.setEnable(false); incorporateAnimationInRotation(); animation.setStartTime(System.currentTimeMillis()); fireTransformationUpdated(); fireTransformationFinished(); }
@Override public void readObject( DataInput in ) throws IOException { super.readObject( in ); Alpha alpha = (Alpha)node; alpha.setAlphaAtOneDuration( in.readLong() ); alpha.setAlphaAtZeroDuration( in.readLong() ); alpha.setDecreasingAlphaDuration( in.readLong() ); alpha.setDecreasingAlphaRampDuration( in.readLong() ); alpha.setIncreasingAlphaDuration( in.readLong() ); alpha.setIncreasingAlphaRampDuration( in.readLong() ); alpha.setLoopCount( in.readInt() ); alpha.setMode( in.readInt() ); alpha.setPhaseDelayDuration( in.readLong() ); alpha.setStartTime( in.readLong() ); alpha.setTriggerTime( in.readLong() ); long x = in.readLong(); if (x!=0L) alpha.pause(x); }
animation.setStartTime(System.currentTimeMillis()); final BranchGroup bg = new BranchGroup(); rotpol = new RotationInterpolator(animation, animationTG) {
/** * This internal method returns a clone of the Alpha * * @return a duplicate of this Alpha */ Alpha cloneAlpha() { Alpha a = new Alpha(); a.setStartTime(getStartTime()); a.setLoopCount(getLoopCount()); a.setMode(getMode()); a.setTriggerTime(getTriggerTime()); a.setPhaseDelayDuration(getPhaseDelayDuration()); a.setIncreasingAlphaDuration(getIncreasingAlphaDuration()); a.setIncreasingAlphaRampDuration(getIncreasingAlphaRampDuration()); a.setAlphaAtOneDuration(getAlphaAtOneDuration()); a.setDecreasingAlphaDuration(getDecreasingAlphaDuration()); a.setDecreasingAlphaRampDuration(getDecreasingAlphaRampDuration()); a.setAlphaAtZeroDuration(getAlphaAtZeroDuration()); return a; }
alpha.setStartTime(System.currentTimeMillis()); alpha.setMode(Alpha.DECREASING_ENABLE | Alpha.INCREASING_ENABLE); alpha.setIncreasingAlphaDuration(300);