Paint the mouse-over state of the button foreground.

@param g      the Graphics2D context to paint with.
@param c      the button to paint.
@param width  the width to paint.
@param height the height to paint.
519943
public void paintHover(Graphics2D g, JComponent c, int width, int height) {
        paint(g, c, width, height, hoverBorder, hoverCorner, hoverInterior);
    }
957019
public void paint(Graphics g) {

        if (g == null) {
            return;
        }

        if (sColHead.length == 0) {
            super.paint(g);

            return;
        }

        if (iWidth <= 0 || iHeight <= 0) {
            return;
        }

        g.setColor(SystemColor.control);
        g.fillRect(iWidth, iHeight, iSbWidth, iSbHeight);

        if (iImage == null) {
            iImage = createImage(iWidth, iHeight);
            gImage = iImage.getGraphics();

            gImage.setFont(fFont);

            if (fMetrics == null) {
                fMetrics = gImage.getFontMetrics();
            }
        }

        if (iRowHeight == 0) {
            iRowHeight = getMaxHeight(fMetrics);

            for (int i = 0; i < iColCount; i++) {
                calcAutoWidth(i);
            }

            adjustScroll();
        }

        gImage.setColor(Color.white);
        gImage.fillRect(0, 0, iWidth, iHeight);
        gImage.setColor(Color.darkGray);
        gImage.drawLine(0, iRowHeight, iWidth, iRowHeight);

        int x = -iX;

        for (int i = 0; i < iColCount; i++) {
            int w = iColWidth[i];

            gImage.setColor(SystemColor.control);
            gImage.fillRect(x + 1, 0, w - 2, iRowHeight);
            gImage.setColor(Color.black);
            gImage.drawString(sColHead[i], x + 2, iRowHeight - 5);
            gImage.setColor(Color.darkGray);
            gImage.drawLine(x + w - 1, 0, x + w - 1, iRowHeight - 1);
            gImage.setColor(Color.white);
            gImage.drawLine(x + w, 0, x + w, iRowHeight - 1);

            x += w;
        }

        gImage.setColor(SystemColor.control);
        gImage.fillRect(0, 0, 1, iRowHeight);
        gImage.fillRect(x + 1, 0, iWidth - x, iRowHeight);
        gImage.drawLine(0, 0, 0, iRowHeight - 1);

        int y = iRowHeight + 1 - iY;
        int j = 0;

        while (y < iRowHeight + 1) {
            j++;

            y += iRowHeight;
        }

        iFirstRow = j;
        y         = iRowHeight + 1;

        for (; y < iHeight && j < iRowCount; j++, y += iRowHeight) {
            x = -iX;

            for (int i = 0; i < iColCount; i++) {
                int   w = iColWidth[i];
                Color b = Color.white,
                      t = Color.black;

                gImage.setColor(b);
                gImage.fillRect(x, y, w - 1, iRowHeight - 1);
                gImage.setColor(t);
                gImage.drawString(getDisplay(i, j), x + 2,
                                  y + iRowHeight - 5);
                gImage.setColor(Color.lightGray);
                gImage.drawLine(x + w - 1, y, x + w - 1, y + iRowHeight - 1);
                gImage.drawLine(x, y + iRowHeight - 1, x + w - 1,
                                y + iRowHeight - 1);

                x += w;
            }

            gImage.setColor(Color.white);
            gImage.fillRect(x, y, iWidth - x, iRowHeight - 1);
        }

        g.drawImage(iImage, 0, 0, this);
    }
455922
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c)
	{
		try
		{
			Rectangle r = c.modelToView(c.getCaretPosition());
			g.setColor( color );
			g.fillRect(0, r.y, c.getWidth(), r.height);

			if (lastView == null)
				lastView = r;
		}
		catch(BadLocationException ble) {System.out.println(ble);}
	}
176188
private void drawOverlayGraphic(Graphics2D g, int width, int height) {
        Shape s = shapeGenerator.createTabCloseIcon(2, 2, width - 4, height - 4);

        g.setPaint(graphicBase);
        g.fill(s);

        s = shapeGenerator.createTabCloseIcon(2, 3, width - 4, height - 4);
        g.setPaint(createGraphicDropShadowGradient(s));
        Shape oldClip = g.getClip();

        g.setClip(2, 3, width - 4, height - 4);
        g.fill(s);
        g.setClip(oldClip);
    }
183605
protected void paint(SeaGlassContext context, Graphics g) {
        AbstractButton b = (AbstractButton) context.getComponent();

        g.setColor(context.getStyle().getColor(context, ColorType.TEXT_FOREGROUND));
        g.setFont(style.getFont(context));
        context.getStyle().getGraphicsUtils(context).paintText(context, g, b.getText(), getIcon(b), b.getHorizontalAlignment(),
                                                               b.getVerticalAlignment(), b.getHorizontalTextPosition(),
                                                               b.getVerticalTextPosition(), b.getIconTextGap(),
                                                               b.getDisplayedMnemonicIndex(), getTextShiftOffset(context));
    }
716779
public void paintIcon (Component c, Graphics g, int x, int y)
    {
        Graphics2D gfx = (Graphics2D) g;
        Composite ocomp = gfx.getComposite();
        gfx.setComposite(_alpha);
        _icon.paintIcon(c, gfx, x, y);
        gfx.setComposite(ocomp);
    }
1206940
private void paintCheckIconEnabledAndSelected(Graphics2D g, int width, int height) {
        Shape s = shapeGenerator.createCheckMark(0, 0, width, height);
        g.setPaint(iconEnabledSelected);
        g.fill(s);
    }
571116
@Override
    public void draw(Graphics2D g, int width, int height)
    {
        Rectangle bounds = getOwner().getAbsoluteBackgroundBounds();
        computeCoordinates(bounds);
        drawScaledImage(g, image, bounds.x + imgx, bounds.y + imgy, observer);
    }
814444
private void paintCheckIconEnabled(Graphics2D g, int width, int height) {
        g.setPaint(iconEnabled);
        g.drawRoundRect(0, 1, width-1, height-2, 4, 4);
    }
848557
private void paintRestoreEnabled(Graphics2D g, JComponent c, int width, int height) {
        restorePainter.paintEnabled(g, c, width, height);
    }
1055909
@ Override
	public void paint(Graphics g) {
		super.paint(g);
		boolean change = indeterminate;
		Graphics2D g2 = (Graphics2D) g.create();
		updateComponentMiddelpoint(g2);

		for (int animationPointID = animationPointCount - 1; animationPointID >= 0; animationPointID--) {
			if (indeterminate) {
				indeterminateAnimation(g2, animationPointID);
			} else {
				progressAnimation(g2, animationPoint[animationPointID], animationPointID);
				if (!(animationPoint[animationPointID] == 0 || animationPoint[animationPointID] == 255)) {
					change = true;
				}
			}
            Thread.yield();
		}

		if (!change) {
			synchronized (animationTimer) {
				animationTimer.stop();
				animationTimer.notifyAll();
			}
		}
		//Rectangle rec = g2.getClipBounds();
		//((GroupLayout) this.getLayout()).
		//stateTextLabel.setPreferredSize(new Dimension((int) stateTextLabel.getWidth(), ));
		//debugPaint(g2);
		g2.dispose();
	}
1249222
private void paintBackgroundEnabled(Graphics2D g, JComponent c, int width, int height) {
        paintBackground(g, c, width, height, enabled);
    }
1257928
@Override
	public void draw(float x,float y,float width,float height) {
		init();
		draw(x,y,width,height,Color.white);
	}
837105
@Override
    protected void paintComponent(Graphics g) {
        if (!isInitialized()) {
            return;
        }

        final Graphics2D G2 = (Graphics2D) g.create();

        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
        G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

        G2.translate(getFramelessOffset().getX(), getFramelessOffset().getY());

        final AffineTransform OLD_TRANSFORM = G2.getTransform();

        // Draw combined background image
        G2.drawImage(bImage, 0, 0, null);

        // Highlight active area
        if (isHighlightArea()) {
            for(Section area : getAreas()) {
                if (area.contains(getValue())) {
                    G2.setColor(area.getHighlightColor());
                    G2.fill(area.getFilledArea());
                    break;
                }
            }
        }

        // Highlight active section
        if (isHighlightSection()) {
            for(Section section : getSections()) {
                if (section.contains(getValue())) {
                    G2.setColor(section.getHighlightColor());
                    G2.fill(section.getSectionArea());
                    break;
                }
            }
        }

        // Draw title
        final FontRenderContext RENDER_CONTEXT = new FontRenderContext(null, true, true);
        if (!getTitle().isEmpty()) {
            if (isLabelColorFromThemeEnabled()) {
                G2.setColor(getBackgroundColor().LABEL_COLOR);
            } else {
                G2.setColor(getLabelColor());
            }

            // Use custom font if selected
            if (isTitleAndUnitFontEnabled()) {
                G2.setFont(new Font(getTitleAndUnitFont().getFamily(), 0, (int) (0.04672897196261682 * getGaugeBounds().width)));
            } else {
                G2.setFont(new Font("Verdana", 0, (int) (0.04672897196261682 * getGaugeBounds().width)));
            }
            final TextLayout TITLE_LAYOUT = new TextLayout(getTitle(), G2.getFont(), RENDER_CONTEXT);
            final Rectangle2D TITLE_BOUNDARY = TITLE_LAYOUT.getBounds();
            G2.drawString(getTitle(), (float) ((getGaugeBounds().width - TITLE_BOUNDARY.getWidth()) / 2), titleOffsetYFactor * getGaugeBounds().height + TITLE_LAYOUT.getAscent() - TITLE_LAYOUT.getDescent());
        }

        // Draw unit string
        if (!getUnitString().isEmpty()) {
            if (isLabelColorFromThemeEnabled()) {
                G2.setColor(getBackgroundColor().LABEL_COLOR);
            } else {
                G2.setColor(getLabelColor());
            }

            // Use custom font if selected
            if (isTitleAndUnitFontEnabled()) {
                G2.setFont(new Font(getTitleAndUnitFont().getFamily(), 0, (int) (0.04672897196261682 * getGaugeBounds().width)));
            } else {
                G2.setFont(new Font("Verdana", 0, (int) (0.04672897196261682 * bImage.getWidth())));
            }

            final TextLayout UNIT_LAYOUT = new TextLayout(getUnitString(), G2.getFont(), RENDER_CONTEXT);
            final Rectangle2D UNIT_BOUNDARY = UNIT_LAYOUT.getBounds();
            G2.drawString(getUnitString(), (float) ((getGaugeBounds().width - UNIT_BOUNDARY.getWidth()) / 2), unitOffsetYFactor * getGaugeBounds().width + UNIT_LAYOUT.getAscent() - UNIT_LAYOUT.getDescent());
        }

        // Draw threshold indicator
        if (isThresholdVisible()) {
            G2.rotate(thresholdRotationOffset, ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
            G2.drawImage(thresholdImage, (int) THRESHOLD_OFFSET.getX(), (int) THRESHOLD_OFFSET.getY(), null);
            G2.setTransform(OLD_TRANSFORM);
        }

        // Draw min measured value indicator
        if (isMinMeasuredValueVisible()) {
            switch (getOrientation()) {
                case NORTH_EAST:
                    if (!isLogScale()) {
                        G2.rotate(measuredRotationOffset + (getMaxValue() - getMinMeasuredValue() - getMinValue()) * getAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    } else {
                        G2.rotate(measuredRotationOffset + UTIL.logOfBase(BASE, getMaxValue() - getMinMeasuredValue() - getMinValue()) * getLogAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    }
                    break;
                case SOUTH_EAST:
                    if (!isLogScale()) {
                        G2.rotate(measuredRotationOffset + (getMaxValue() - getMinMeasuredValue() - getMinValue()) * getAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    } else {
                        G2.rotate(measuredRotationOffset + UTIL.logOfBase(BASE, getMaxValue() - getMinMeasuredValue() - getMinValue()) * getLogAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    }
                    break;
                case SOUTH_WEST:
                    if (!isLogScale()) {
                        G2.rotate(measuredRotationOffset + (getMinMeasuredValue() - getMinValue()) * getAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    } else {
                        G2.rotate(measuredRotationOffset + UTIL.logOfBase(BASE, getMinMeasuredValue() - getMinValue()) * getLogAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    }
                    break;
                case NORTH_WEST:
                    if (!isLogScale()) {
                        G2.rotate(measuredRotationOffset + (getMinMeasuredValue() - getMinValue()) * getAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    } else {
                        G2.rotate(measuredRotationOffset + UTIL.logOfBase(BASE, getMinMeasuredValue() - getMinValue()) * getLogAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    }
                    break;
            }
            G2.drawImage(minMeasuredImage, (int) MEASURED_OFFSET.getX(), (int) MEASURED_OFFSET.getY(), null);
            G2.setTransform(OLD_TRANSFORM);
        }

        // Draw max measured value indicator
        if (isMaxMeasuredValueVisible()) {
            switch (getOrientation()) {
                case NORTH_EAST:
                    if (!isLogScale()) {
                        G2.rotate(measuredRotationOffset + (getMaxValue() - getMaxMeasuredValue() - getMinValue()) * getAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    } else {
                        G2.rotate(measuredRotationOffset + UTIL.logOfBase(BASE, getMaxValue() - getMaxMeasuredValue() - getMinValue()) * getLogAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    }
                    break;
                case SOUTH_EAST:
                    if (!isLogScale()) {
                        G2.rotate(measuredRotationOffset + (getMaxValue() - getMaxMeasuredValue() - getMinValue()) * getAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    } else {
                        G2.rotate(measuredRotationOffset + UTIL.logOfBase(BASE, getMaxValue() - getMaxMeasuredValue() - getMinValue()) * getLogAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    }
                    break;
                case SOUTH_WEST:
                    if (!isLogScale()) {
                        G2.rotate(measuredRotationOffset + (getMaxMeasuredValue() - getMinValue()) * getAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    } else {
                        G2.rotate(measuredRotationOffset + UTIL.logOfBase(BASE, getMaxMeasuredValue() - getMinValue()) * getLogAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    }
                    break;
                case NORTH_WEST:
                    if (!isLogScale()) {
                        G2.rotate(measuredRotationOffset + (getMaxMeasuredValue() - getMinValue()) * getAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    } else {
                        G2.rotate(measuredRotationOffset + UTIL.logOfBase(BASE, getMaxMeasuredValue() - getMinValue()) * getLogAngleStep(), ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
                    }
                    break;
            }
            G2.drawImage(maxMeasuredImage, (int) MEASURED_OFFSET.getX(), (int) MEASURED_OFFSET.getY(), null);
            G2.setTransform(OLD_TRANSFORM);
        }

        // Draw LED if enabled
        if (isLedVisible()) {
            G2.drawImage(getCurrentLedImage(), (int) (getGaugeBounds().width * getLedPosition().getX()), (int) (getGaugeBounds().width * getLedPosition().getY()), null);
        }

        // Draw user LED if enabled
        if (isUserLedVisible()) {
            G2.drawImage(getCurrentUserLedImage(), (int) (getGaugeBounds().width * getUserLedPosition().getX()), (int) (getGaugeBounds().width * getUserLedPosition().getY()), null);
        }

        // Draw the pointer
        switch (getOrientation()) {
            case SOUTH_EAST:
                if (!isLogScale()) {
                    angle = (getValue() - getMinValue() - getMaxValue()) * (-getAngleStep());
                } else {
                    angle = UTIL.logOfBase(BASE, getValue() - getMinValue() - getMaxValue()) * (-getLogAngleStep());
                }
                break;
            case SOUTH_WEST:
                if (!isLogScale()) {
                    angle = (getValue() - getMinValue() - getMaxValue()) * getAngleStep();
                } else {
                    angle = UTIL.logOfBase(BASE, getValue() - getMinValue() - getMaxValue()) * getLogAngleStep();
                }
                break;
            case NORTH_EAST:
                if (!isLogScale()) {
                    angle = (getValue() - getMinValue()) * (-getAngleStep());
                } else {
                    angle = UTIL.logOfBase(BASE, getValue() - getMinValue()) * (-getLogAngleStep());
                }
                break;
            case NORTH_WEST:

            default:
                if (!isLogScale()) {
                    angle = (getValue() - getMinValue()) * getAngleStep();
                } else {
                    angle = UTIL.logOfBase(BASE, getValue() - getMinValue()) * getLogAngleStep();
                }
                break;
        }

        //G2.rotate(ANGLE + (Math.cos(Math.toRadians(ANGLE - 91.0))), CENTER.getX(), CENTER.getY());
        G2.rotate(angle, ROTATION_CENTER.getX(), ROTATION_CENTER.getY() + 2);
        G2.drawImage(pointerShadowImage, 0, 0, null);
        G2.setTransform(OLD_TRANSFORM);
        G2.rotate(angle, ROTATION_CENTER.getX(), ROTATION_CENTER.getY());
        G2.drawImage(pointerImage, 0, 0, null);
        G2.setTransform(OLD_TRANSFORM);

        // Draw the foreground
        G2.drawImage(fImage, 0, 0, null);

        // Draw glow indicator
        if (isGlowVisible()) {
            if (isGlowing()) {
                G2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, getGlowAlpha()));
                G2.drawImage(glowImageOn, 0, 0, null);
                G2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f));
            } else
            {
                G2.drawImage(glowImageOff, 0, 0, null);
            }
        }

        if (!isEnabled()) {
            G2.drawImage(disabledImage, 0, 0, null);
        }

        G2.translate(-getInnerBounds().x, -getInnerBounds().y);

        G2.dispose();
    }
1179589
public void paint (Graphics2D gfx)
    {
        gfx.setColor(Color.red);
        gfx.drawLine(_source.x, _source.y, _dest.x, _dest.y);
    }
1245210
private void paintCloseHover(Graphics2D g, JComponent c, int width, int height) {
        paintClose(g, c, width, height, hover);
    }
615434
@Override
    protected void paintComponent(Graphics g) {
        if (!initialized) {
            return;
        }

        final Graphics2D G2 = (Graphics2D) g.create();

        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);

        G2.translate(INNER_BOUNDS.x, INNER_BOUNDS.y);

        G2.drawImage(batteryImage, 0, 0, null);

        G2.translate(-INNER_BOUNDS.x, -INNER_BOUNDS.y);

        G2.dispose();
    }