}
EList<Connection> connections = d.getConnections();
for (Connection connection : connections) {
//Be wary about broken connections
AnchorContainer source = null;
if (connection.getStart() != null) {
source = connection.getStart().getParent();
}
AnchorContainer target = null;
if (connection.getEnd() != null) {
target = connection.getEnd().getParent();
}
if (target == null || source == null) {
break;
}
Node srcNode = shapeToNode.get(source);
if (srcNode == null) {
srcNode = shapeToNode.get(source.eContainer());
}
Node tgtNode = shapeToNode.get(target);
if (tgtNode == null) {
tgtNode = shapeToNode.get(target.eContainer());
}
Edge edge = new Edge(srcNode, tgtNode);
edge.data = connection;
edgeList.add(edge);
}