int[] (PresentableNodeDescriptor node, AbstractTreeStructure structure) { int x = 0; int y = 0; Object[] children = structure.getChildElements(node); for (Object child : children) { if (child instanceof PresentableNodeDescriptor) { TreePath childPath = getPath((PresentableNodeDescriptor)child); if (childPath != null) { if (isExpanded(childPath)) { int[] tmp = getMax((PresentableNodeDescriptor)child, structure); y = Math.max(y, tmp[0]); x = Math.max(x, tmp[1]); } Rectangle r = getPathBounds(childPath); if (r != null) { y = Math.max(y, (int)r.getMaxY()); x = Math.max(x, (int)r.getMaxX()); } } } } return new int[]{y, x}; }