package cnp.ew.tdemo;

import cnp.ew.util.*;
import cnp.ew.lightweight.*;
import java.awt.*;

public class CpWpPanelLc extends CpAbstractLc
{
    boolean continueToWidth;
    int xLine;

    public CpWpPanelLc(int newXLine, boolean newContinueToWidth)
    {
        super();
        xLine = newXLine;
        continueToWidth = newContinueToWidth;
    }

    void drawLineAtY(Graphics g, int y)
    {
        int toX;
        g.setColor(Color.gray);
        if (continueToWidth) {
            toX = size().width;
        } else {
            toX = xLine;
        }
        g.drawLine(0, y, toX, y);
        g.setColor(Color.white);
        g.drawLine(0, y + 1, toX, y + 1);
    }

    public void paint(Graphics g, Rectangle clip)
    {
        g.setColor(Color.lightGray);
     //   g.fillRect(0, 0, size().width, size().height);
        drawLineAtY(g, 0);
        if (xLine != 0) {
            g.setColor(Color.gray);
            g.drawLine(xLine, 2, xLine, size().height);
            g.setColor(Color.white);
            g.drawLine(xLine + 1, 2, xLine + 1, size().height);
        }
    }
}

