/**
* Copy the given graph and make the nodes/edges in the copied
* graph point to the nodes/edges in the original.
*/
protected Object copyComposite(Object origComposite) {
GraphModel model = getLayoutTarget().getGraphModel();
Object copyComposite = _local.createComposite(null);
HashMap map = new HashMap();
for (Iterator i = model.nodes(origComposite); i.hasNext();) {
Object origNode = i.next();
if (getLayoutTarget().isNodeVisible(origNode)) {
Rectangle2D r = getLayoutTarget().getBounds(origNode);
LevelInfo inf = new LevelInfo();
inf.origNode = origNode;
inf.x = r.getX();
inf.y = r.getY();
inf.width = r.getWidth();
inf.height = r.getHeight();
Object copyNode = _local.createNode(inf);
_local.addNode(this, copyNode, copyComposite);
map.put(origNode, copyNode);
}
}
for (Iterator i = model.nodes(origComposite); i.hasNext();) {
Object origTail = i.next();
for (Iterator j = model.outEdges(origTail); j.hasNext();) {
Object origEdge = j.next();
Object origHead = model.getHead(origEdge);
if (origHead != null) {
Object copyTail = map.get(origTail);
Object copyHead = map.get(origHead);