/** * DOCUMENT ME! * * @param tag DOCUMENT ME! * @return DOCUMENT ME! */ public NodeSource getNodeSourceByTagName(String tag) { Iterator it = this.children.iterator(); while (it.hasNext()) { NodeSource src = (NodeSource) it.next(); if (tag.equals(src.getTagName())) { return src; } else { NodeSource result = src.getNodeSourceByTagName(tag); if (result != null) { return result; } } } return null; }
/** * DOCUMENT ME! * * @param groups DOCUMENT ME! */ public void layoutGroup(String[] groups) { NodeSource parent = this.getParent(); NodeSource[] srcs = new NodeSource[groups.length]; for (int i = 0; i < srcs.length; i++) { srcs[i] = parent.getNodeSourceByTagName(groups[i]); } parent.remove(this); NodeSource src = parent; for (int i = 0; i < srcs.length; i++) { NodeSource p = srcs[i].getParent(); if (p != null) { p.remove(srcs[i]); } src.add(srcs[i]); src = srcs[i]; } }