AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ble); throw ae;
  public int viewToModel(float x, float y, Shape a, Position.Bias[] b)  {    Rectangle rec = a.getBounds();    Document doc = getDocument();    Element root = doc.getDefaultRootElement();        // PlainView doesn't support line-wrapping so we can find out which    // Element was clicked on just by the y-position        int lineClicked = (int) (y - rec.y) / metrics.getHeight();    if (lineClicked >= root.getElementCount())      return getEndOffset() - 1;        Element line = root.getElement(lineClicked);    Segment s = getLineBuffer();    int start = line.getStartOffset();    int end = line.getEndOffset();    try    {      doc.getText(start, end - start, s);    }    catch (BadLocationException ble)    {      //this should never happen    }        int pos = Utilities.getTabbedTextOffset(s, metrics, rec.x, (int)x, this, start);    return Math.max (0, pos);  }     