void (final Graphics2D g, char[] text, int length, Point2D position, Color backColor, Color underscoredColor) { ProgressManager.checkCanceled(); if (length <= 0) return; double xStart = position.getX(); double x = position.getX(); double y = getLineHeight(g) - getDescent(g) + position.getY(); if (backColor != null && myPerformActualDrawing) { Color savedColor = g.getColor(); setBackgroundColor(g, backColor); double w = getTextSegmentWidth(text, myOffset, length, position.getX(), g); g.fill(new Area(new Rectangle2D.Double(position.getX(), y - getLineHeight(g) + getDescent(g), w, getLineHeight(g)))); g.setColor(savedColor); } int start = myOffset; for (int i = myOffset; i < myOffset + length; i++) { if (text[i] != '\t') continue; if (i > start) { String s = new String(text, start, i - start); x += drawStringToGraphics(g, s, x, y); } x = nextTabStop(g, x); start = i + 1; } if (myOffset + length > start) { String s = new String(text, start, myOffset + length - start); x += drawStringToGraphics(g, s, x, y); } if (underscoredColor != null && myPerformActualDrawing) { Color savedColor = g.getColor(); setForegroundColor(g, underscoredColor); double w = getTextSegmentWidth(text, myOffset, length, position.getX(), g); LinePainter2D.paint(g, (int)position.getX(), (int)y + 1, (int)(xStart + w), (int)(y + 1)); g.setColor(savedColor); } position.setLocation(x, position.getY()); myOffset += length; }