x = (float) r.getX(); y = (float) r.getY(); width = (float) r.getWidth(); height = (float) r.getHeight();
this.x = x; this.y = y; width = w; height = h;
    public void setRect(Rectangle2D r)    {      x = (float) r.getX();      y = (float) r.getY();      width = (float) r.getWidth();      height = (float) r.getHeight();    }