Skip to content

Commit

Permalink
Allow to drag more then one FBNetworkelement accross editor bounds
Browse files Browse the repository at this point in the history
With this fix also several selected FBNetworkElements can be dragged
across editor boundaries using the alt key and drag&drop.
  • Loading branch information
azoitl committed Jun 19, 2024
1 parent 4d3522b commit 8803ade
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private Request createRequest(final Point point) {
if (selectedEditParts.size() == 1 && selectedEditParts.get(0) instanceof final InterfaceEditPart iep) {
return createConnectionCreationRequest(iep);
}
if (selectedEditParts.size() == 1 && selectedEditParts.get(0).getModel() instanceof FBNetworkElement) {
if (atLeastOneFBSelected(selectedEditParts)) {
return createChangeBoundsRequest(selectedEditParts);
}
final List<ConnectionEditPart> connections = selectedEditParts.stream()
Expand All @@ -102,6 +102,10 @@ private static Request createConnectionCreationRequest(final InterfaceEditPart i
return req;
}

protected static boolean atLeastOneFBSelected(final List<? extends EditPart> selectedEditParts) {
return selectedEditParts.stream().anyMatch(ep -> ep.getModel() instanceof FBNetworkElement);
}

private static Request createReconnectRequest(final List<ConnectionEditPart> connections, final Point point) {
final ConnectionEditPart first = connections.get(0);
final String reconnectType = getReconnectType(first, point);
Expand Down

0 comments on commit 8803ade

Please sign in to comment.