/** * Updates the bounds of this view and its children * */ protected void updateGroupBounds() { // Note: Prevent infinite recursion by removing // child edges that point to their parent. CellView[] childViews = getChildViews(); LinkedList result = new LinkedList(); for (int i = 0; i < childViews.length; i++) if (includeInGroupBounds(childViews[i])) result.add(childViews[i]); childViews = new CellView[result.size()]; result.toArray(childViews); Rectangle2D r = getBounds(childViews); int groupBorder = GraphConstants.getInset(getAllAttributes()); if (r != null) r.setFrame(r.getX() - groupBorder, r.getY() - groupBorder, r .getWidth() + 2 * groupBorder, r.getHeight() + 2 * groupBorder); groupBounds = r; }