Rectangle b = s.getBounds(); view.setSize(b.width, b.height);
Rectangle b = s instanceof Rectangle ? (Rectangle) s : s.getBounds(); setSize(b.width, b.height);
    public void paint(Graphics g, Shape s)    {      if (view != null)        {          Rectangle b = s.getBounds();          view.setSize(b.width, b.height);        view.paint(g, s);    }    }