}
return clonedShape;
} else if (node instanceof Link) {
Link clonedLink = (Link)node.cloneNode(true);
// Force duplication of shared groups too
SharedGroup sharedGroup = clonedLink.getSharedGroup();
if (sharedGroup != null) {
SharedGroup clonedSharedGroup = clonedSharedGroups.get(sharedGroup);
if (clonedSharedGroup == null) {
clonedSharedGroup = (SharedGroup)cloneNode(sharedGroup, clonedSharedGroups);
clonedSharedGroups.put(sharedGroup, clonedSharedGroup);
}
clonedLink.setSharedGroup(clonedSharedGroup);