new EdgeDistComparator(element));
ListIterator li = l.listIterator();
while (li.hasNext()) {
SimpleEdge edge = (SimpleEdge) li.next();
SimpleVertex v1 = edge.getAnother(element);
SimpleGraph inner = (SimpleGraph) element.getProperty(Constant.LAYER_KEY);
boolean inside = false;
if (inner != null) {
List innerv = (List) inner.getProperty(AltMultiLayerBuilder.LOWERV_KEY);
List innerc = inner.getVertices();
if (innerv != null) {
if (innerv.contains(v1)) {
inside = true;
}
}
if (innerc.contains(v1)) {
inside = true;
}
}
double dist =
v1.getVertexext()
.getLeftTop()
.getX() - element.getVertexext()
.getLeftTop()
.getX();
EdgeExt ee = new EdgeExt();
Anchor src = null;
Anchor target = null;
if (dist < 0) {
// v1 is src, v1.x < target.x
src = v1.getVertexext()
.getTopRightmost();
if (!inside) {
target = element.getVertexext()
.getLeftUpmost();
} else {
target = element.getVertexext()
.getLeftLowmost();
}
} else {
src = v1.getVertexext()
.getTopLeftmost();
if (!inside) {
target = element.getVertexext()
.getRightUpmost();
} else {
target = element.getVertexext()
.getRightLowmost();
}
}
ee.setSrcAnchor(src);
ee.setTargetAnchor(target);
edge.setEdgeext(ee);
}
}