private double screenToNormalized(double screenCoord){
  int width=getWidth();
  if (width <= 2 * mLeftRightPadding) {
    return 0d;
  }
 else {
    double result=(screenCoord - mLeftRightPadding) / (width - 2 * mLeftRightPadding);
    return Math.min(1d,Math.max(0d,result));
  }
}

private double screenToNormalized ( double screenCoord ) { int width = getWidth ( ) ; if ( width <= 2 * mLeftRightPadding ) { return 0d ; } else { double result = ( screenCoord - mLeftRightPadding ) / ( width - 2 * mLeftRightPadding ) ; return Math . min ( 1d , Math . max ( 0d , result ) ) ; } }
converts screen space x - coordinates into normalized values .
