A_POINT.setLocation(conn.getSourceAnchor().getLocation(ref1));
conn.translateToRelative(A_POINT);
points.addPoint(A_POINT);
for (int i = 0; i < bendpoints.size(); i++) {
Bendpoint bp = bendpoints.get(i);
points.addPoint(bp.getLocation());
}
A_POINT.setLocation(conn.getTargetAnchor().getLocation(ref2));
conn.translateToRelative(A_POINT);
points.addPoint(A_POINT);