@Override
 @SuppressWarnings("unchecked")
 public V attach(final Layer layer) {
   if (null == colExpButton && isExpandable()) {
     colExpButton = createExpandCollapseButton();
     layer.add(colExpButton);
   }
   layer.add(getPalette());
   return (V) this;
 }
  private void testCircle(Layer layer) {

    Circle circle = new Circle(50).setX(0).setY(0).setFillColor(ColorName.RED);

    layer.add(circle);

    BoundingBox bb = circle.getBoundingBox();
    final double bbx = bb.getX();
    final double bby = bb.getY();
    final double bbw = bb.getWidth();
    final double bbh = bb.getHeight();

    GWT.log(" BB CIRCLE = [" + bbx + ", " + bby + ", " + bbw + ", " + bbh + "]");
  }
  private void testRectangle(Layer layer) {

    Rectangle rectangle = new Rectangle(50, 50).setX(100).setY(100).setFillColor(ColorName.RED);

    layer.add(rectangle);

    BoundingBox bb = rectangle.getBoundingBox();
    final double bbx = bb.getX();
    final double bby = bb.getY();
    final double bbw = bb.getWidth();
    final double bbh = bb.getHeight();

    GWT.log(" BB RECTANGLE = [" + bbx + ", " + bby + ", " + bbw + ", " + bbh + "]");
  }
 @Override
 protected void addToLayer(final Layer layer, final IPrimitive<?> shape) {
   layer.add(shape);
 }