/** * 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(); } }
/** * Returns the font used for line numbers. * * @return The font used for line numbers. * @see #setLineNumberFont(Font) */ public Font getLineNumberFont() { return lineNumberList.getFont(); }
/** * Changes the width of the cells in the JList so you can see every digit * of each. */ private void updateCellWidths() { int oldCellWidth = cellWidth; cellWidth = RHS_BORDER_WIDTH; // 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(); while (lineCount >= 10) { lineCount = lineCount/10; count++; } cellWidth += fontMetrics.charWidth('9')*(count+1) + 5; } } if (cellWidth!=oldCellWidth) { // Always true revalidate(); } }
/** * Returns the font used for line numbers. * * @return The font used for line numbers. * @see #setLineNumberFont(Font) */ public Font getLineNumberFont() { return lineNumberList.getFont(); }
/** * Changes the width of the cells in the JList so you can see every digit * of each. */ private void updateCellWidths() { int oldCellWidth = cellWidth; cellWidth = RHS_BORDER_WIDTH; // 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(); while (lineCount >= 10) { lineCount = lineCount/10; count++; } cellWidth += fontMetrics.charWidth('9')*(count+1) + 5; } } if (cellWidth!=oldCellWidth) { // Always true revalidate(); } }
g.setFont(getFont()); if (aaHints!=null) { ((Graphics2D)g).addRenderingHints(aaHints);
/** * 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(); } }
g.setFont(getFont());
g.setFont(getFont());
g.setFont(getFont()); if (aaHints!=null) { ((Graphics2D)g).addRenderingHints(aaHints);