/*-*-c++-*-*/

import java.awt.*;

public class embossRect{
  int xpos;
  int ypos;
  int width;
  int height;
  int thickness;
  boolean emboss;
  Color hilight;
  Color shadow;

  embossRect(int x, int y, int w, int h, int t, boolean emb){
    xpos = x;
    ypos = y;
    width = w;
    height = h;
    thickness = t;
    emboss = emb;
  }

  public void drawYourself(Graphics g){
    if (emboss){
      hilight = new Color(255,255,255);
      shadow = new Color(128,128,128);
    }
    
    else {
      shadow = new Color(255,255,255);
      hilight = new Color(128,128,128);
    }
    
    g.setColor(hilight);
    
    for (int i = 0; i < thickness; i++){
      //horizontal line
      g.drawLine(xpos, ypos + i, xpos + width - i, ypos + i);	
      
      //vertical line
      g.drawLine(xpos + i, ypos, xpos + i, ypos + height - i);
    }
    
    g.setColor(shadow);
    for (int i = 0; i < thickness; i++){
      //horizontal line
      g.drawLine(xpos+i+1, ypos+height-i, xpos+width, ypos+height-i );	
      
      //vertical line
      g.drawLine(xpos+width-i, ypos+i+1, xpos+width-i, ypos+height );
    }
  }
}






