- java.lang.Object
-
- bdv.viewer.animate.MessageOverlayAnimator
-
- All Implemented Interfaces:
OverlayAnimator
public class MessageOverlayAnimator extends Object implements OverlayAnimator
Draw lines of text in the lower right corner of the display. Messages are fading in a specified time. If several messages are drawn at the same time, old messages scroll up.- Author:
- Tobias Pietzsch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classMessageOverlayAnimator.TextAnimator
-
Field Summary
Fields Modifier and Type Field Description protected longdurationprotected doublefadeInTimeprotected doublefadeOutTimeprotected Fontfontprotected List<MessageOverlayAnimator.TextAnimator>texts
-
Constructor Summary
Constructors Constructor Description MessageOverlayAnimator(long duration)MessageOverlayAnimator(long duration, double fadeInTime, double fadeOutTime)MessageOverlayAnimator(long duration, double fadeInTime, double fadeOutTime, Font font)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String text)booleanisComplete()Returns true if the animation is complete and the animator can be removed.voidpaint(Graphics2D g, long time)booleanrequiresRepaint()Returns true if the animator requires an immediate repaint to continue the animation.
-
-
-
Field Detail
-
font
protected final Font font
-
duration
protected final long duration
-
fadeInTime
protected final double fadeInTime
-
fadeOutTime
protected final double fadeOutTime
-
texts
protected final List<MessageOverlayAnimator.TextAnimator> texts
-
-
Constructor Detail
-
MessageOverlayAnimator
public MessageOverlayAnimator(long duration)
-
MessageOverlayAnimator
public MessageOverlayAnimator(long duration, double fadeInTime, double fadeOutTime)
-
MessageOverlayAnimator
public MessageOverlayAnimator(long duration, double fadeInTime, double fadeOutTime, Font font)
-
-
Method Detail
-
add
public void add(String text)
-
isComplete
public boolean isComplete()
Description copied from interface:OverlayAnimatorReturns true if the animation is complete and the animator can be removed.- Specified by:
isCompletein interfaceOverlayAnimator- Returns:
- whether the animation is complete and the animator can be removed.
-
requiresRepaint
public boolean requiresRepaint()
Description copied from interface:OverlayAnimatorReturns true if the animator requires an immediate repaint to continue the animation.- Specified by:
requiresRepaintin interfaceOverlayAnimator- Returns:
- whetherhe animator requires an immediate repaint.
-
paint
public void paint(Graphics2D g, long time)
- Specified by:
paintin interfaceOverlayAnimator
-
-