int lineIndex = getLineIndex(height);
lineIndex = getLineIndex(height);
void doPageDown(boolean select, int height) {	if (isSingleLine()) return;	int oldColumnX = columnX;	int oldHScrollOffset = horizontalScrollOffset;	if (isFixedLineHeight()) {		int lineCount = content.getLineCount();		int caretLine = getCaretLine();		if (caretLine < lineCount - 1) {			int lineHeight = renderer.getLineHeight();			int lines = (height == -1 ? clientAreaHeight : height) / lineHeight;			int scrollLines = Math.min(lineCount - caretLine - 1, lines);			// ensure that scrollLines never gets negative and at least one 			// line is scrolled. fixes bug 5602.			scrollLines = Math.max(1, scrollLines);			caretOffset = getOffsetAtPoint(columnX, getLinePixel(caretLine + scrollLines));			if (select) {				doSelection(ST.COLUMN_NEXT);			}			// scroll one page down or to the bottom			int verticalMaximum = lineCount * getVerticalIncrement();			int pageSize = clientAreaHeight;			int verticalScrollOffset = getVerticalScrollOffset();			int scrollOffset = verticalScrollOffset + scrollLines * getVerticalIncrement();			if (scrollOffset + pageSize > verticalMaximum) {				scrollOffset = verticalMaximum - pageSize;			}			if (scrollOffset > verticalScrollOffset) {				scrollVertical(scrollOffset - verticalScrollOffset, true);			}		}	} else {		int lineCount = content.getLineCount();		int caretLine = getCaretLine();		int partialBottomIndex = getPartialBottomIndex();		int topY = getLinePixel(partialBottomIndex);		int lineHeight = renderer.getLineHeight(partialBottomIndex);		if (height == -1) {			height = topY;			if (topY + lineHeight <= clientAreaHeight) {				height += lineHeight;			} else {				if (wordWrap) {					TextLayout layout = renderer.getTextLayout(partialBottomIndex);					int y = clientAreaHeight - topY;					for (int i = 0; i < layout.getLineCount(); i++) {						Rectangle bounds = layout.getLineBounds(i);						if (bounds.contains(bounds.x, y)) {							height += bounds.y;							break;						}					}					renderer.disposeTextLayout(layout);				}			}		} else {			int lineIndex = getLineIndex(height);			int topLineY = getLinePixel(lineIndex);			if (wordWrap) {				TextLayout layout = renderer.getTextLayout(lineIndex);				int y = height - topLineY;				for (int i = 0; i < layout.getLineCount(); i++) {					Rectangle bounds = layout.getLineBounds(i);					if (bounds.contains(bounds.x, y)) {						height = topLineY + bounds.y + bounds.height;						break;					}				}				renderer.disposeTextLayout(layout);			} else {				height = topLineY + renderer.getLineHeight(lineIndex);			}		}		int availableHeight = 0;		if (topY + lineHeight > clientAreaHeight) {			availableHeight = lineHeight - (clientAreaHeight - topY);		}		int lineIndex = partialBottomIndex + 1;		while (height > availableHeight && lineIndex < lineCount) {			availableHeight += renderer.getLineHeight(lineIndex++);		}		int caretHeight = height;		if (wordWrap) {			TextLayout layout = renderer.getTextLayout(caretLine);			int offsetInLine = caretOffset - content.getOffsetAtLine(caretLine);			lineIndex = getVisualLineIndex(layout, offsetInLine);			caretHeight += layout.getLineBounds(lineIndex).y;			renderer.disposeTextLayout(layout);		}		lineIndex = caretLine;		lineHeight = renderer.getLineHeight(lineIndex);		while (caretHeight - lineHeight >= 0 && lineIndex < lineCount - 1) {			caretHeight -= lineHeight;			lineHeight = renderer.getLineHeight(++lineIndex);		}		caretOffset = getOffsetAtPoint(columnX, caretHeight, lineIndex);		if (select) doSelection(ST.COLUMN_NEXT);		height = Math.min(height, availableHeight);		scrollVertical(height, true);		if (height == 0) setCaretLocation();	}		showCaret();	int hScrollChange = oldHScrollOffset - horizontalScrollOffset;	columnX = oldColumnX + hScrollChange;	}