Java Graphics Draw drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)

Here you can find the source of drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)

Description

draw Groove

License

Open Source License

Declaration

public static void drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;

import java.awt.Graphics;

public class Main {
    public static void drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight) {
        Color oldColor = g.getColor(); // Make no net change to g
        g.translate(x, y);/*from  ww  w . j av a2  s.c om*/

        g.setColor(shadow);
        g.drawRect(0, 0, w - 2, h - 2);

        g.setColor(highlight);
        g.drawLine(1, h - 3, 1, 1);
        g.drawLine(1, 1, w - 3, 1);

        g.drawLine(0, h - 1, w - 1, h - 1);
        g.drawLine(w - 1, h - 1, w - 1, 0);

        g.translate(-x, -y);
        g.setColor(oldColor);
    }
}

Related

  1. drawFocus(Graphics g, int x, int y, int w, int h)
  2. drawFocus(Graphics2D g2, int iX, int iY, int iWidth, int iHeight)
  3. drawFrank(Graphics g, int x, int y)
  4. drawGatter(Graphics g, int xDist, int yDist)
  5. drawGlow(Graphics2D g2, Area area, double width, Color color)
  6. drawGroove(Graphics g, int x, int y, int width, int height, Color shadow, Color highlight)
  7. drawHandles(final Graphics g, final int[] x, final int[] y)
  8. drawIcon(Graphics g, String icon, int x, int y)
  9. drawInnerButtonDecoration(Graphics g, int x, int y, int w, int h, Color baseColor)