drawSelectedText(g, x, y, selectionStart, selectionEnd);
drawSelectedText(g, x, y, selectionStart, endOffset);
  protected void drawLine(int lineIndex, Graphics g, int x, int y)  {    try      {	Element line = getElement().getElement(lineIndex);        int startOffset = line.getStartOffset();        int endOffset = line.getEndOffset();                if (selectionStart <= startOffset)          // Selection starts before the line ...          if (selectionEnd <= startOffset)            {              // end ends before the line: Draw completely unselected text.              drawUnselectedText(g, x, y, startOffset, endOffset);            }          else if (selectionEnd <= endOffset)            {              // and ends within the line: First part is selected,              // second is not.              x = drawSelectedText(g, x, y, startOffset, selectionEnd);              drawUnselectedText(g, x, y, selectionEnd, endOffset);            }          else            // and ends behind the line: Draw completely selected text.            drawSelectedText(g, x, y, startOffset, endOffset);        else if (selectionStart < endOffset)          // Selection starts within the line ..          if (selectionEnd < endOffset)            {              // and ends within it: First part unselected, second part              // selected, third part unselected.              x = drawUnselectedText(g, x, y, startOffset, selectionStart);              x = drawSelectedText(g, x, y, selectionStart, selectionEnd);              drawUnselectedText(g, x, y, selectionEnd, endOffset);            }          else            {              // and ends behind the line: First part unselected, second              // part selected.              x = drawUnselectedText(g, x, y, startOffset, selectionStart);              drawSelectedText(g, x, y, selectionStart, selectionEnd);            }        else          // Selection is behind this line: Draw completely unselected text.          drawUnselectedText(g, x, y, startOffset, endOffset);      }    catch (BadLocationException e)      {	AssertionError ae = new AssertionError("Unexpected bad location");	ae.initCause(e);	throw ae;      }  }