package cnp.ew.displayer;

import java.awt.*;
import cnp.ew.lightweight.*;

public class CpDropShadowBorderDisplayer extends CpAbstractBorderDisplayer
{

    public Color borderColor = Color.black;

    int shadowThickness = 2;

    /**
     * Display the borders in rect, using g.
     */
    public void paintBordersIn(CpLightweightComponent c, Graphics g, int x, int y, int w, int h)
    {
        g.setColor(borderColor);
        g.drawRect(x, y, w - shadowThickness - 1, h - shadowThickness - 1);
        g.fillRect(x + w - shadowThickness, y + shadowThickness, shadowThickness, h - shadowThickness);
        g.fillRect(x + shadowThickness, y + h - shadowThickness, w - shadowThickness, shadowThickness);
    }


    public int getLeftBorderThickness(CpLightweightComponent c)
    {
        return 1;
    }

    public int getRightBorderThickness(CpLightweightComponent c)
    {
        return shadowThickness + 1;
    }

    public int getTopBorderThickness(CpLightweightComponent c)
    {
        return 1;
    }

    public int getBottomBorderThickness(CpLightweightComponent c)
    {
        return shadowThickness + 1;
    }

}