p1--; getDocument().getText(p0, p1 - p0, segment); int len = segment.toString().length();  char[] buffer = new char[len]; for (int index = 0; index < len; ++index) buffer[index] = ch;  y += getPreferredSpan(Y_AXIS)/2;   g.drawChars(buffer, 0, len, x, y);   return x + (len * metrics.charWidth(ch));
for (int index = p0; index < p1; ++index) x = drawEchoCharacter(g, x, y, ch); return x;
  protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1)    throws BadLocationException  {    // FIXME: Throw BadLocationException somehow.    // Update font metrics.    updateMetrics();        // Get echo character.    char ch = getEchoChar();    Segment segment = new Segment();        // Set color for unselected text.    g.setColor(unselectedColor);    g.setColor(Color.BLACK);    // Initialize buffer for faster drawing of all characters.    p1--;    getDocument().getText(p0, p1 - p0, segment);    int len = segment.toString().length();        char[] buffer = new char[len];    for (int index = 0; index < len; ++index)      buffer[index] = ch;        y += getPreferredSpan(Y_AXIS)/2;        // Draw echo charaters.    g.drawChars(buffer, 0, len, x, y);    // Return new x position right of all drawn characters.    return x + (len * metrics.charWidth(ch));  }