/** * {@inheritDoc} */ protected void doPaint(Graphics2D g, Object component, int width, int height) { Paint p = getFillPaint(); if (p != null) { if(isPaintStretched()) { p = calculateSnappedPaint(p,width,height); } g.setPaint(p); g.fillRect(0, 0, width, height); } }
/** * {@inheritDoc} */ @Override protected void doPaint(Graphics2D g, Object component, int width, int height) { Paint p = getFillPaint(); if (p != null) { Insets insets = getInsets(); int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; if (isPaintStretched()) { p = calculateSnappedPaint(p, w, h); } g.translate(insets.left, insets.top); g.setPaint(p); g.fill(provideShape(g, component, w, h)); } }
/** * {@inheritDoc} */ @Override protected void doPaint(Graphics2D g, Object component, int width, int height) { Paint p = getFillPaint(); if (p != null) { Insets insets = getInsets(); int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; if (isPaintStretched()) { p = calculateSnappedPaint(p, w, h); } g.translate(insets.left, insets.top); g.setPaint(p); g.fill(provideShape(g, component, w, h)); } }
/** * {@inheritDoc} */ @Override protected void doPaint(Graphics2D g, Object component, int width, int height) { Paint p = getFillPaint(); if (p != null) { Insets insets = getInsets(); int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; if (isPaintStretched()) { p = calculateSnappedPaint(p, w, h); } g.translate(insets.left, insets.top); g.setPaint(p); g.fill(provideShape(g, component, w, h)); } }