if (expanded)
Rectangle clip = gfx.getClipBounds(); gfx.setColor(getBackground()); gfx.fillRect(clip.x, clip.y, clip.width, clip.height);   if (!textArea.getBuffer().isLoaded()) return;   int lineHeight = textArea.getPainter().getFontMetrics() .getHeight();  int firstLine = clip.y / lineHeight + textArea.getFirstLine(); int lastLine = (clip.y + clip.height - 1) / lineHeight + textArea.getFirstLine();  FontMetrics pfm = textArea.getPainter().getFontMetrics(); Color fg = getForeground();  int baseline = (clip.y - clip.y % lineHeight) + (int) Math.round( (this.baseline + lineHeight - pfm.getDescent()) / 2.0);  int firstValidLine = firstLine >= 0 ? firstLine : 0; int lastValidLine = (lastLine >= textArea.getLineCount()) ? textArea.getLineCount() - 1 : lastLine;  boolean highlightCurrentLine = currentLineHighlightEnabled && (textArea.getSelectionStart() == textArea.getSelectionEnd());  int y = 0;  Buffer buffer = textArea.getBuffer();  for (int line = firstLine; line <= lastLine; line++, y += lineHeight)
	public void paintComponent(Graphics gfx)	{		if (expanded)		{			// fill the background			Rectangle r = gfx.getClipBounds();			gfx.setColor(getBackground());			gfx.fillRect(r.x, r.y, r.width, r.height);			// if buffer is loading, don't paint anything			if (!textArea.getBuffer().isLoaded())				return;			// paint custom highlights, if there are any			if (highlights != null) paintCustomHighlights(gfx);			// paint line numbers			paintLineNumbers(gfx);		}	}