@Override void handleDocumentEvent(DocumentEvent e) { int newLineCount = textArea.getLineCount(); if (newLineCount!=currentLineCount) { currentLineCount = newLineCount; repaint(); } }
/** * Calculates the last line number index painted in this component. * * @return The last line number index painted in this component. */ private int calculateLastVisibleLineNumber() { int lastLine = 0; if (textArea!=null) { lastLine = textArea.getLineCount()+getLineNumberingStartIndex()-1; } return lastLine; }
/** * {@inheritDoc} */ @Override void handleDocumentEvent(DocumentEvent e) { int newLineCount = textArea.getLineCount(); if (newLineCount!=currentLineCount) { currentLineCount = newLineCount; repaint(); } }
/** * Sets the text area being displayed. Subclasses can override, but * should call the super implementation. * * @param textArea The text area. */ public void setTextArea(RTextArea textArea) { this.textArea = textArea; int lineCount = textArea==null ? 0 : textArea.getLineCount(); if (currentLineCount!=lineCount) { currentLineCount = lineCount; repaint(); } }
int start = textArea.getLineStartOffset(line); int end = textArea.getLineEndOffset(line); if (line==textArea.getLineCount()-1) {
/** * Changes the width of the cells in the JList so you can see every digit * of each. */ void updateCellWidths() { int oldCellWidth = cellWidth; cellWidth = getRhsBorderWidth(); // Adjust the amount of space the line numbers take up, if necessary. if (textArea!=null) { Font font = getFont(); if (font!=null) { FontMetrics fontMetrics = getFontMetrics(font); int count = 0; int lineCount = textArea.getLineCount() + getLineNumberingStartIndex() - 1; do { lineCount = lineCount/10; count++; } while (lineCount >= 10); cellWidth += fontMetrics.charWidth('9')*(count+1) + 3; } } if (cellWidth!=oldCellWidth) { // Always true revalidate(); } }
doc.remove(start, end - start); int insertLine = Math.min(line + 1, textArea.getLineCount()); boolean newlineInserted = false; if (insertLine == textArea.getLineCount()) { textArea.append("\n"); newlineInserted = true;
elem = root.getElement(endLine); int end = elem.getEndOffset(); int lineCount = textArea.getLineCount(); boolean movingLastLine = false; if (endLine == lineCount - 1) {
int lastLine = textArea.getLineCount() - 1; for (int i=trackingIcons.size()-1; i>=0; i--) { // Last to first GutterIconInfo ti = getTrackingIcon(i);
int lineCount = textArea.getLineCount(); while (++line<lineCount && fm.isLineHidden(line));
int rhs = getWidth() - rhsBorderWidth; int line = topLine + 1; while (y<visibleRect.y+visibleRect.height+ascent && line<=textArea.getLineCount()) { String number = Integer.toString(line + getLineNumberingStartIndex() - 1); int width = metrics.stringWidth(number); while (y<visibleRect.y+visibleRect.height && line<textArea.getLineCount()) { String number = Integer.toString(line + getLineNumberingStartIndex() - 1); g.drawString(number, rhsBorderWidth, y);
if (line!=textArea.getLineCount()-1) {
int lastLine = textArea.getLineCount() - 1; for (int i=trackingIcons.size()-1; i>=0; i--) { // Last to first GutterIconInfo ti = getTrackingIcon(i);
if (line!=textArea.getLineCount()-1) { end--;
if (line!=textArea.getLineCount()-1) { end--;
@Override void handleDocumentEvent(DocumentEvent e) { int newLineCount = textArea.getLineCount(); if (newLineCount!=currentLineCount) { currentLineCount = newLineCount; repaint(); } }
/** * Calculates the last line number index painted in this component. * * @return The last line number index painted in this component. */ private int calculateLastVisibleLineNumber() { int lastLine = 0; if (textArea!=null) { lastLine = textArea.getLineCount()+getLineNumberingStartIndex()-1; } return lastLine; }
/** * {@inheritDoc} */ void handleDocumentEvent(DocumentEvent e) { int newLineCount = textArea.getLineCount(); if (newLineCount!=currentLineCount) { currentLineCount = newLineCount; repaint(); } }
/** * {@inheritDoc} */ @Override void handleDocumentEvent(DocumentEvent e) { int newLineCount = textArea.getLineCount(); if (newLineCount!=currentLineCount) { currentLineCount = newLineCount; repaint(); } }
/** * {@inheritDoc} */ void handleDocumentEvent(DocumentEvent e) { int newLineCount = textArea.getLineCount(); if (newLineCount!=currentLineCount) { currentLineCount = newLineCount; repaint(); } }