- java.lang.Object
-
- bdv.viewer.animate.AbstractAnimator
-
- Direct Known Subclasses:
AbstractTransformAnimator,MessageOverlayAnimator.TextAnimator,TextOverlayAnimator
public class AbstractAnimator extends Object
Mother abstract class for animators that can animate the current view in aViewerFrameinstance. The time unit for animation duration, start time and current time is not specified, for example you can use ms obtained fromSystem.currentTimeMillis()or a frame number when rendering movies.- Author:
- Tobias Pietzsch, Jean-Yves Tinevez
-
-
Constructor Summary
Constructors Constructor Description AbstractAnimator(long duration)Create new animator with the given duration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisComplete()Returns true if the animation is completed at thecurrent time.doubleratioComplete()Returns the completion ratio.voidsetTime(long time)Sets the current time for the animation.
-
-
-
Constructor Detail
-
AbstractAnimator
public AbstractAnimator(long duration)
Create new animator with the given duration. The animation will start with the first call tosetTime(long).- Parameters:
duration- animation duration (in time units)
-
-
Method Detail
-
setTime
public void setTime(long time)
Sets the current time for the animation. The first call starts the animation.- Parameters:
time- current time (in time units)
-
isComplete
public boolean isComplete()
Returns true if the animation is completed at thecurrent time.- Returns:
- true if the animation completed.
-
ratioComplete
public double ratioComplete()
Returns the completion ratio. It is a double ranging from 0 to 1, 0 indicating that the animation just started, 1 indicating that it completed.- Returns:
- the completion ratio.
-
-