public void paint(Graphics g, Shape allocation){ Rectangle allocRect = allocation.getBounds(); g.setColor(getBackColor()); int x = allocRect.x+2; int y = allocRect.y; int width = allocRect.width-1; int height = allocRect.height-1; g.fillRect(x, y, width, height); g.setColor(getForeColor()); g.setFont(getColoringFont()); g.drawRect(x, y, width, height); g.drawString(foldDescription, x, y + getEditorUI().getLineAscent()-1); }
g.setColor(Color.white); g.drawChars(dotChar, 0, 1, x, y + editorUI.getLineAscent());
g.setColor(Color.white); int ascent = FontMetricsCache.getFontMetrics(afterCaretFont, c).getAscent(); g.drawChars(dotChar, 0, 1, x, y + editorUI.getLineAscent());
/** * Paints one view that corresponds to a line (or * multiple lines if folding takes effect). */ private void paintView(View view, Graphics g, int yBase) { JTextComponent component = editorUI.getComponent(); if (component == null) return; BaseTextUI textUI = (BaseTextUI)component.getUI(); Element rootElem = textUI.getRootView(component).getElement(); int line = rootElem.getElementIndex(view.getStartOffset()); String annotation = ""; // NOI18N AnnotateLine al = null; if (!elementAnnotations.isEmpty()) { al = getAnnotateLine(line); if (al != null) { annotation = getDisplayName(al); // NOI18N } } else { annotation = elementAnnotationsSubstitute; } if (al != null && al.getRevision().equals(recentRevision)) { g.setColor(selectedColor()); } else { g.setColor(foregroundColor()); } int texty = yBase + editorUI.getLineAscent(); int textx = 2; g.drawString(annotation, textx, texty); }
if (line < lineCount) { int lineNumberWidth = fm.stringWidth("" + (line + 1)); g.drawString("" + (line + 1), numberWidth - lineNumberWidth - rightMargin, y + editorUI.getLineAscent());
g.drawString(String.valueOf(line + 1), numberWidth-lineNumberWidth-rightMargin, y + editorUI.getLineAscent());
ctx.drawGraphics.setDefaultBackColor(ctx.defaultColoring.getBackColor()); ctx.drawGraphics.setLineHeight(ctx.lineHeight); ctx.drawGraphics.setLineAscent(ctx.editorUI.getLineAscent()); ctx.drawGraphics.setX(ctx.x); ctx.drawGraphics.setY(ctx.y);
ctx.drawGraphics.setDefaultBackColor(ctx.defaultColoring.getBackColor()); ctx.drawGraphics.setLineHeight(ctx.lineHeight); ctx.drawGraphics.setLineAscent(ctx.editorUI.getLineAscent()); ctx.drawGraphics.setX(ctx.x); ctx.drawGraphics.setY(ctx.y);