handleGroup(destList,groupIterator,parentGroup,group,last,nodes,composition,preserveHierarchy);
}
groupIterator.previous();
}
private void handleGroup(List destList,ListIterator groupIterator,Node parentGroup,NodeGroup group,GraphicNode last, List nodes,NodeTransformer composition, boolean preserveHierarchy){
GraphicNode groupNode=createGroup(groupIterator.nextIndex(),group,group.getSorter(),last.getNode());
destList.add(groupNode);
model.addRelationship(parentGroup,groupNode.getNode());
if (groupIterator.hasNext()){
groupList(nodes,destList,groupIterator,groupNode.getNode(),composition,preserveHierarchy);
}
else{
for (Iterator j=nodes.iterator();j.hasNext();)
model.addRelationship(groupNode.getNode(),((GraphicNode)j.next()).getNode());
destList.addAll(nodes);
}
}