Source:
private Command layoutBorderItems(final List<?> selectedObjects, final int nbIterations, ArrayList<IDiagramElementEditPart> elementsToKeepFixed) { CompoundCommand cc = new CompoundCommand(); for (Object object : selectedObjects) { if (object instanceof GraphicalEditPart) { final Command layoutBorderItems = layoutBorderItems((GraphicalEditPart) object, elementsToKeepFixed); if (layoutBorderItems != null && layoutBorderItems.canExecute()) { cc.add(layoutBorderItems); } } } if (hasBeenMovedBorderItemsDuringLastIteration() && nbIterations < MAX_ITERATIONS) { removeRequestsOfThisCommand(cc); cc = (CompoundCommand) layoutBorderItems(selectedObjects, nbIterations + 1, elementsToKeepFixed); } Set<Edge> resetedEdges = new HashSet<Edge>(); for (Entry<View, List<Request>> requestByView : getViewsToChangeBoundsRequest().entrySet()) { View view = requestByView.getKey(); Option<IBorderItemEditPart> optionalPart = getCorrespondingEditPart(view); if (optionalPart.some()) { IBorderItemEditPart borderItemEditPart = optionalPart.get(); List<Request> requests = requestByView.getValue(); if (!(view.getSourceEdges().isEmpty() && view.getTargetEdges().isEmpty())) { for (Object obj : view.getSourceEdges()) { if (!resetedEdges.contains(obj) && obj instanceof Edge) { Edge sourceEdge = (Edge) obj; resetBendpoints(sourceEdge, cc, borderItemEditPart, requests, true); resetedEdges.add(sourceEdge); } } for (Object obj : view.getTargetEdges()) { if (!resetedEdges.contains(obj) && obj instanceof Edge) { Edge targetEdge = (Edge) obj; resetBendpoints(targetEdge, cc, borderItemEditPart, requests, false); resetedEdges.add(targetEdge); } } } } } clearBorderItemLocations(); return cc; }

Target:
private Command layoutBorderItems(final List<?> selectedObjects, final int nbIterations, ArrayList<IDiagramElementEditPart> elementsToKeepFixed) { CompoundCommand cc = new CompoundCommand(); for (Object object : selectedObjects) { if (object instanceof GraphicalEditPart) { final Command layoutBorderItems = layoutBorderItems((GraphicalEditPart) object, elementsToKeepFixed); if (layoutBorderItems != null && layoutBorderItems.canExecute()) { cc.add(layoutBorderItems); } } } if (hasBeenMovedBorderItemsDuringLastIteration() && nbIterations < MAX_ITERATIONS) { removeRequestsOfThisCommand(cc); cc = (CompoundCommand) layoutBorderItems(selectedObjects, nbIterations + 1, elementsToKeepFixed); } Set<Edge> resetEdges = new HashSet<Edge>(); for (Entry<View, List<Request>> requestByView : getViewsToChangeBoundsRequest().entrySet()) { View view = requestByView.getKey(); Option<IBorderItemEditPart> optionalPart = getCorrespondingEditPart(view); if (optionalPart.some()) { IBorderItemEditPart borderItemEditPart = optionalPart.get(); List<Request> requests = requestByView.getValue(); if (!(view.getSourceEdges().isEmpty() && view.getTargetEdges().isEmpty())) { for (Object obj : view.getSourceEdges()) { if (!resetEdges.contains(obj) && obj instanceof Edge) { Edge sourceEdge = (Edge) obj; resetBendpoints(sourceEdge, cc, borderItemEditPart, requests, true); resetEdges.add(sourceEdge); } } for (Object obj : view.getTargetEdges()) { if (!resetEdges.contains(obj) && obj instanceof Edge) { Edge targetEdge = (Edge) obj; resetBendpoints(targetEdge, cc, borderItemEditPart, requests, false); resetEdges.add(targetEdge); } } } } } clearBorderItemLocations(); return cc; }