public void animate(float fraction){
  float animationFactor;
  if (linear) {
    animationFactor=fraction;
  }
 else {
    animationFactor=(float)Math.sin(fraction * (float)Math.PI / 2);
  }
  animationFactor=Math.min(animationFactor,1.0f);
  animationFactor=Math.max(animationFactor,0.0f);
  opacity=animationFactor;
  moveX=moveMinX + (int)(.5f + animationFactor * (float)(moveMaxX - moveMinX));
  repaint();
}

public void animate ( float fraction ) { float animationFactor ; if ( linear ) { animationFactor = fraction ; } else { animationFactor = ( float ) Math . sin ( fraction * ( float ) Math . PI / 2 ) ; } animationFactor = Math . min ( animationFactor , 1.0f ) ; animationFactor = Math . max ( animationFactor , 0.0f ) ; opacity = animationFactor ; moveX = moveMinX + ( int ) ( .5f + animationFactor * ( float ) ( moveMaxX - moveMinX ) ) ; repaint ( ) ; }
animate the opacity and location factors , according to the current fraction .
