private int normalize(final int coordinate,final int dialogSize,final int maximum){
  if (coordinate + dialogSize > maximum) {
    return maximum - dialogSize - 10;
  }
 else {
    return coordinate;
  }
}

private int normalize ( final int coordinate , final int dialogSize , final int maximum ) { if ( coordinate + dialogSize > maximum ) { return maximum - dialogSize - 10 ; } else { return coordinate ; } }
normalizes a coordinate to make sure the whole dialog is visible .
