/** * Subclasses should union their bounding rectangle with the Rectangle passed in as the rect * parameter. * * @param rect The rectangle with which to union this MenuItem's rectangle. * @param buff A buffer Rectangle2D object, to be used for anything. */ protected void getRect(Rectangle2D.Float rect, Rectangle2D.Float buff) { if (!isOpen()) return; for (int i = 0; i < items.size(); i++) { MenuItem item = (MenuItem) items.get(i); item.getRect(rect, buff); } }
protected void getRect(Rectangle2D.Float rect, Rectangle2D.Float buff) { buff.setFrame(x, y, width, height); Rectangle2D.union(rect, buff, rect); super.getRect(rect, buff); }