}
}
for (Object obj : graph.getChildEdges(parent)) {
if (obj instanceof mxCell) {
mxCell cell = (mxCell) obj;
SimpleEdge se = new SimpleEdge(vertexes.get(cell.getSource()), vertexes.get(cell.getTarget()));
se.setProperty("id", cell.getId());
sg.addEdge(se);
}
}
MultiLayerLayouter.layout(sg);
mxCell someCell = ((mxCell)vertexes.keySet().toArray()[0]);
double xscale = someCell.getGeometry().getWidth() / (vertexes.get(someCell).getVertexext().getWidth() - .5);
double yscale = someCell.getGeometry().getHeight() / (vertexes.get(someCell).getVertexext().getHeight() - .5);
for (Object obj : sg.getVertices()) {
if (obj instanceof SimpleVertex) {
SimpleVertex sv = (SimpleVertex) obj;
for (mxCell vertex: vertexes.keySet()) {
if (vertex.getId().equals(sv.getProperty("id"))) {
VertexExt ve = sv.getVertexext();
mxGeometry vertexGeometry = vertex.getGeometry();
super.setVertexLocation(vertex, ve.getLeftTop().getX()*xscale, ve.getLeftTop().getY()*yscale);
}
}
}
}
for (Object obj : sg.getEdges()) {
if (obj instanceof SimpleEdge) {
SimpleEdge se = (SimpleEdge) obj;
for (Object e : graph.getChildEdges(parent)) {
if (e instanceof mxCell) {
mxCell edge = (mxCell) e;
if (edge.getId().equals(se.getProperty("id"))) {
List<mxPoint> jgraphpoints = new ArrayList<mxPoint>();
jgraphpoints.add(new mxPoint(edge.getSource().getGeometry().getCenterX(),
edge.getTarget().getGeometry().getCenterY()));
super.setEdgePoints(edge, jgraphpoints);
super.setOrthogonalEdge(edge, true);