@Override void paint(Graphics2D g) { Rectangle r = new Rectangle(getSize()); JBInsets.removeFrom(r, getInsets()); if (r.height % 2 == 1) r.height++; int arcSize = JBUI.scale(26); JBInsets.removeFrom(r, new JBInsets(1, 1, 1, 1)); if (myTextArea.hasFocus()) { g.setColor(myTextArea.getBackground()); RectanglePainter.FILL.paint(g, r.x, r.y, r.width, r.height, arcSize); DarculaUIUtil.paintSearchFocusRing(g, r, myTextArea, arcSize); } else { arcSize -= JBUI.scale(5); RectanglePainter .paint(g, r.x, r.y, r.width, r.height, arcSize, myTextArea.getBackground(), myTextArea.isEnabled() ? Gray._100 : Gray._83); } }
protected void draw(final Graphics2D g, final int x, final int y, final int width, final int height) { RectanglePainter.DRAW.paint(g, x, y, width, height, null); }
@Override protected void fill(Graphics2D g, int x, int y, int width, int height, boolean border) { RectanglePainter.FILL.paint(g, x, y, width, height, Math.min(width, height)); }
@Override protected void draw(Graphics2D g, int x, int y, int width, int height) { RectanglePainter.DRAW.paint(g, x, y, width, height, Math.min(width, height)); }
@Override public void paint(@Nonnull final Crumb c, @Nonnull final Graphics2D g2, final int height, final int pageOffset) { final PainterSettings s = getSettings(); final Font oldFont = g2.getFont(); final int offset = c.getOffset() - pageOffset; final int width = c.getWidth(); RectanglePainter.paint(g2, offset + 2, 2, width - 4, height - 4, ROUND_VALUE + 2, s.getBackgroundColor(c), s.getBorderColor(c)); final Color textColor = s.getForegroundColor(c); if (textColor != null) { g2.setColor(textColor); } final Font font = s.getFont(g2, c); if (font != null) { g2.setFont(font); } final FontMetrics fm = g2.getFontMetrics(); String string = c.getString(); if (fm.stringWidth(string) > width) { final int dotsWidth = fm.stringWidth("..."); final StringBuilder sb = new StringBuilder(); int length = 0; for (int i = 0; i < string.length(); i++) { final int charWidth = fm.charWidth(string.charAt(i)); if (length + charWidth + dotsWidth > width) { break; } length += charWidth; sb.append(string.charAt(i)); } string = sb.append("...").toString(); } g2.drawString(string, offset + ROUND_VALUE + 5, height - fm.getDescent() - 5); g2.setFont(oldFont); }