currentGraph.getModel().beginUpdate();
for (Object cell : cells) {
if (((mxCell) cell).isVertex()) {
for (StorableVertex v : vertexes) {
if (((mxCell) cell).getId().equals("v" + v.getStorableId())) {
mxCell c = (mxCell) cell;
mxCell c2 = (mxCell) currentGraph.insertVertex(parent, c.getId(), c.getValue(), c.getGeometry().getX(), c
.getGeometry().getY(), c.getGeometry().getWidth(), c.getGeometry().getHeight(), c.getStyle());
id2vert.put(c.getId(), c2);
if (view.subgraphsid.get(c) != null) {
this.subgraphsid.put((mxCell) c2, view.subgraphsid.get(c));
}
HashMap<StorableAttribute, Boolean> m = view.vertexAttributes.get(c);
HashMap<StorableAttribute, Boolean> m2 = new HashMap<StorableAttribute, Boolean>();
for (StorableAttribute s : m.keySet()) {
m2.put(s, m.get(s));
}
vertexAttributes.put(c2, m2);
break;
}
}
}
}
cells = view.currentGraph.getAllEdges(cells);
for (StorableEdge edge : this.subGraph.getEdges()) {
for (Object cell : cells) {
mxCell c = (mxCell) cell;
mxCell source = (mxCell) c.getSource();
mxCell target = (mxCell) c.getTarget();
if (source == null || target == null)
continue;
if (!source.getId().equals("v" + edge.getStorableSource().getStorableId())
|| !target.getId().equals("v" + edge.getStorableTarget().getStorableId()))
continue;
Object source2 = id2vert.get(source.getId());
Object target2 = id2vert.get(target.getId());
if (source2 != null && target2 != null) {
mxCell c2 = (mxCell) currentGraph.insertEdge(parent, c.getId(), c.getValue(), source2, target2, c.getStyle());
c2.setGeometry(c.getGeometry());
HashMap<StorableAttribute, Boolean> m = view.edgeAttributes.get(c);
HashMap<StorableAttribute, Boolean> m2 = new HashMap<StorableAttribute, Boolean>();
for (StorableAttribute s : m.keySet()) {
m2.put(s, m.get(s));
}