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 long
ANIMATION_DELAY
Display delay between one frame and another, in milliseconds.private static java.util.logging.Logger
logger
private float
scale
The image scale.private int
speed
The 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 void
executeWithLabel(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
- TheUnit
to be animated.sourceTile
- TheTile
the unit is moving from.destinationTile
- TheTile
the 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:
executeWithLabel
in classAnimation
- Parameters:
unitLabel
- AJLabel
with an image of the unit to animate.paintCallback
- A callback to request that the animation area be repainted.
-
-