public int xyToOffset(int x,int y){
  int line=yToLine(y);
  int start=getLineStartOffset(line);
  return start + xToOffset(line,x);
}

public int xyToOffset ( int x , int y ) { int line = yToLine ( y ) ; int start = getLineStartOffset ( line ) ; return start + xToOffset ( line , x ) ; }
converts a point to an offset , from the start of the text .
