Class UnitMoveAnimation
- java.lang.Object
-
- net.sf.freecol.client.gui.animation.Animation
-
- net.sf.freecol.client.gui.animation.UnitMoveAnimation
-
final class UnitMoveAnimation extends Animation
Class for the animation of units movement.
-
-
Field Summary
Fields Modifier and Type Field Description private static longANIMATION_DELAYDisplay delay between one frame and another, in milliseconds.private static java.util.logging.Loggerloggerprivate floatscaleThe image scale.private intspeedThe animation speed client option.
-
Constructor Summary
Constructors Constructor Description UnitMoveAnimation(Unit unit, Tile sourceTile, Tile destinationTile, int speed, float scale)Build a new movement animation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteWithLabel(javax.swing.JLabel unitLabel, Animations.Procedure paintCallback)The code to be executed when a unit is out for animation.
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
ANIMATION_DELAY
private static final long ANIMATION_DELAY
Display delay between one frame and another, in milliseconds. 33ms == 30 fps- See Also:
- Constant Field Values
-
speed
private final int speed
The animation speed client option.
-
scale
private final float scale
The image scale.
-
-
Constructor Detail
-
UnitMoveAnimation
public UnitMoveAnimation(Unit unit, Tile sourceTile, Tile destinationTile, int speed, float scale)
Build a new movement animation.- Parameters:
unit- TheUnitto be animated.sourceTile- TheTilethe unit is moving from.destinationTile- TheTilethe unit is moving to.speed- The animation speed.scale- The scale factor for the unit image.
-
-
Method Detail
-
executeWithLabel
public void executeWithLabel(javax.swing.JLabel unitLabel, Animations.Procedure paintCallback)The code to be executed when a unit is out for animation.- Specified by:
executeWithLabelin classAnimation- Parameters:
unitLabel- AJLabelwith an image of the unit to animate.paintCallback- A callback to request that the animation area be repainted.
-
-