package cnp.ew.diagram;

import java.awt.*;
import java.util.*;

import cnp.ew.lightweight.*;

class CpRubberRectangleLc extends CpAbstractDiagrammableLc
{
    Vector handles;

    public CpRubberRectangleLc(int x, int y, int w, int h)
    {
        super(x, y, w, h);
        setForeground(Color.gray);
    }

	public Vector getHandles()
	{
	    if (handles == null) {
    	    handles = new Vector();
	    	handles.addElement(new CpSizingHandle(this, CpBasicLocator.rightBottomLocator, CpBasicLocator.leftTopLocator, true));
	    }
	    return handles;
	}

	public void paint(Graphics g, Rectangle clip)
	{
	    Rectangle bounds = bounds();
	    // WHY THE -1!!!???
	    g.setColor(getForeground());
	    g.drawRect(0, 0, size().width - 1, size().height - 1);
	}

	public boolean isTransparent()
	{
	    return true;
	}
}