@Override protected void paintTrack(Graphics g, JComponent c, Rectangle bounds) { g.setColor(TRACK_BACKGROUND); g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height); g.setColor(TRACK_BORDER); int border = isMirrored() ? bounds.x + bounds.width - 1 : bounds.x; g.drawLine(border, bounds.y, border, bounds.y + bounds.height); ((ApplicationImpl) ApplicationManager.getApplication()).editorPaintStart(); try { Rectangle clipBounds = g.getClipBounds(); repaint(g, ERROR_ICON_WIDTH - 1, clipBounds); } finally { ((ApplicationImpl) ApplicationManager.getApplication()).editorPaintFinish(); } }
private void drawSpot( Graphics g, int width, boolean thinErrorStripeMark, int yStart, int yEnd, Color color, boolean drawTopDecoration, boolean drawBottomDecoration) { int x = isMirrored() ? 3 : 5; int paintWidth = width; if (thinErrorStripeMark) { paintWidth /= 2; paintWidth += 1; x = isMirrored() ? width + 2 : 0; } if (color == null) return; g.setColor(color); g.fillRect(x + 1, yStart, paintWidth - 2, yEnd - yStart + 1); Color brighter = color.brighter(); g.setColor(brighter); // left decoration UIUtil.drawLine(g, x, yStart, x, yEnd /* - 1*/); if (drawTopDecoration) { // top decoration UIUtil.drawLine(g, x + 1, yStart, x + paintWidth - 2, yStart); } Color darker = ColorUtil.shift(color, 0.75); g.setColor(darker); if (drawBottomDecoration) { // bottom decoration UIUtil.drawLine( g, x + 1, yEnd /* - 1*/, x + paintWidth - 2, yEnd /* - 1*/); // large bottom to let overwrite by hl below } // right decoration UIUtil.drawLine(g, x + paintWidth - 2, yStart, x + paintWidth - 2, yEnd /* - 1*/); }
@Override public void paint(Graphics g) { ((ApplicationImpl) ApplicationManager.getApplication()).editorPaintStart(); final Rectangle bounds = getBounds(); g.setColor(ButtonlessScrollBarUI.TRACK_BACKGROUND); g.fillRect(0, 0, bounds.width, bounds.height); g.setColor(ButtonlessScrollBarUI.TRACK_BORDER); g.drawLine(0, 0, 0, bounds.height); try { if (myErrorStripeRenderer != null) { myErrorStripeRenderer.paint( this, g, new Rectangle(5, 2, ERROR_ICON_WIDTH, ERROR_ICON_HEIGHT)); } } finally { ((ApplicationImpl) ApplicationManager.getApplication()).editorPaintFinish(); } }