protected double animateValue(double curVal,double goalVal,double speed){
  double ret=curVal;
  if (ret < goalVal) {
    ret+=speed;
  }
 else   if (ret > goalVal) {
    ret-=speed;
  }
  if (Math.abs(ret - goalVal) < speed) {
    ret=goalVal;
  }
  return ret;
}

protected double animateValue ( double curVal , double goalVal , double speed ) { double ret = curVal ; if ( ret < goalVal ) { ret += speed ; } else if ( ret > goalVal ) { ret -= speed ; } if ( Math . abs ( ret - goalVal ) < speed ) { ret = goalVal ; } return ret ; }
do a simple animation towards a value with a given speed
