protected int calculateTimeForScrolling(int dx){
  return (int)Math.ceil(Math.abs(dx) * MILLISECONDS_PER_PX);
}

protected int calculateTimeForScrolling ( int dx ) { return ( int ) Math . ceil ( Math . abs ( dx ) * MILLISECONDS_PER_PX ) ; }
calculates the time it should take to scroll the given distance ( in pixels )
