private void getSubunits(Renderable node, Set subunits) { List comps = node.getComponents(); if (comps == null || comps.size() == 0) { // Treat an empty complex as a subunit. This might not be good. if (node instanceof Shortcut) subunits.add(((Shortcut) node).getTarget()); else subunits.add(node); } else { Node tmp = null; for (Iterator it = comps.iterator(); it.hasNext(); ) { tmp = (Node) it.next(); getSubunits(tmp, subunits); } } }