/** * Calculates the width of the line represented by the given element. * * @param line The line for which to get the length. * @param lineNumber The line number of the specified line in the document. * @return The width of the line. */ private float getLineWidth(int lineNumber) { Token tokenList = ((RSyntaxDocument) getDocument()).getTokenListForLine(lineNumber); return RSyntaxUtilities.getTokenListWidth(tokenList, (RSyntaxTextArea) getContainer(), this); }