fr.lri.swingstates.animations
Class AnimationTransparency

java.lang.Object
  extended by fr.lri.swingstates.animations.Animation
      extended by fr.lri.swingstates.animations.AnimationTransparency

public class AnimationTransparency
extends Animation

An animation that continuously changes the transparency (interior and/or outline) of a CElement to a given transparency level. By default, The pacing function is linear.

Author:
Caroline Appert

Field Summary
 
Fields inherited from class fr.lri.swingstates.animations.Animation
FUNCTION_LINEAR, FUNCTION_SIGMOID, INFINITE_NUMBER_OF_LAPS
 
Constructor Summary
AnimationTransparency(float t)
          Builds a AnimationTransparency that changes the transparency of both interior and outline of a CElement.
AnimationTransparency(float tFill, float tOutline)
          Builds a AnimationTransparency that changes the transparency of a CElement.
 
Method Summary
 void doStart()
          Method called when this animation is started.
 float getTransparencyFillTarget()
           
 float getTransparencyOutlineTarget()
           
 Animation setAnimatedElement(CElement ce)
          Sets the CElement that must be animated by this animation.
 AnimationTransparency setTransparencyFillTarget(float t)
          Sets the final transparency value for interior.
 AnimationTransparency setTransparencyOutlineTarget(float t)
          Sets the final transparency value for outline.
 void step(double t)
          Override this abstract to specify the effect of this animation.
 
Methods inherited from class fr.lri.swingstates.animations.Animation
addTag, addTag, doResume, doStop, doSuspend, getAnimated, getDelay, getLapDuration, getNbLaps, getPacingFunction, hasTag, hasTag, isStarted, isSuspended, removeTag, removeTag, resetAnimationManager, resume, setCanvas, setDelay, setFunction, setLapDuration, setNbLaps, start, stop, suspend
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnimationTransparency

public AnimationTransparency(float t)
Builds a AnimationTransparency that changes the transparency of both interior and outline of a CElement.

Parameters:
t - The target transparency level.

AnimationTransparency

public AnimationTransparency(float tFill,
                             float tOutline)
Builds a AnimationTransparency that changes the transparency of a CElement.

Parameters:
tFill - The target transparency level for interior.
tOutline - The target transparency level for interior.
Method Detail

doStart

public void doStart()
Method called when this animation is started. This method does nothing. It can be redefined in derived classes.

Overrides:
doStart in class Animation
See Also:
Animation.start()

step

public void step(double t)
Override this abstract to specify the effect of this animation.

Specified by:
step in class Animation
Parameters:
t - The parameter of this animation.

setAnimatedElement

public Animation setAnimatedElement(CElement ce)
Sets the CElement that must be animated by this animation. If the canvas that must received animation events has not yet been set, it is set to the canvas to which belongs this CElement.

Overrides:
setAnimatedElement in class Animation
Parameters:
ce - The CElement to animate.
Returns:
this animation.

getTransparencyFillTarget

public float getTransparencyFillTarget()
Returns:
the final transparency value for interior.

setTransparencyFillTarget

public AnimationTransparency setTransparencyFillTarget(float t)
Sets the final transparency value for interior.

Parameters:
t - The final angle of rotation.
Returns:
this animation.

getTransparencyOutlineTarget

public float getTransparencyOutlineTarget()
Returns:
the final transparency value for outline.

setTransparencyOutlineTarget

public AnimationTransparency setTransparencyOutlineTarget(float t)
Sets the final transparency value for outline.

Parameters:
t - The final angle of rotation.
Returns:
this animation.