diff --git a/src/org/ntlab/deltaViewer/ForwardLayout.java b/src/org/ntlab/deltaViewer/ForwardLayout.java index 7b307df..47e51a5 100644 --- a/src/org/ntlab/deltaViewer/ForwardLayout.java +++ b/src/org/ntlab/deltaViewer/ForwardLayout.java @@ -26,7 +26,7 @@ import com.mxgraph.util.mxPoint; public class ForwardLayout implements IObjectLayout { - private static final int angleStep = 15; + private static int angleStep = 15; private mxPoint coordinatorPoint = new mxPoint(0, 100); private double step; private double padding; @@ -106,7 +106,6 @@ setVertexCoordinate(objectToVertexMap.get(topObjId), xCor, yCor); fixed.add(topObjId); - // Fix the reverse branches from the destination side path. String curObjId = topObjId; List nextRefs = new ArrayList<>(succs.get(curObjId)); if (nextRefs.size() > 0) { @@ -117,12 +116,12 @@ nextRefs.remove(firstRef); } while (nextRefs.size() > 1); nextRefs2.add(nextRefs.remove(0)); - double direction = 210; + double direction = 225; for (Reference r: nextRefs2) { List path = new ArrayList<>(); path.add(r.getSrcObjectId()); traverseSuccs(succs, r, direction, true, referenceHistory, objectToVertexMap, fixed, path); - direction = getDirection(r, objectToVertexMap) + 180 + angleStep; + if (nextRefs2.size() > 1) direction = getDirection(r, objectToVertexMap) + 180 + 90 / (nextRefs2.size() - 1); } } }