// Increment the update level to aggregate any unburns with connection change edits.
undoableEditSupport.beginUpdate();
// Get the part which the user pressed. Should be connectable!
DisplayedPartConnectable partPressed =
(DisplayedPartConnectable)tableTop.getGemPartUnder(pressedAt);
// Keep track of the disconnected part.
disconnectedDisplayedPart = partPressed;
// Get the gem connection to disconnect.
DisplayedConnection disconnectConn = partPressed.getDisplayedConnection();
// Adjust the apparent click point to be the point of the arrow of the part that is
// not being disconnected.
if (partPressed instanceof DisplayedPartOutput) {
connectionDragAnchorPart = disconnectConn.getDestination();
} else {
connectionDragAnchorPart = disconnectConn.getSource();
}
pressedAt = connectionDragAnchorPart.getConnectionPoint();
// Indicate to the user that a drag disconnect is possible.
setCursor(connectCursor);
// Disconnect the connection.
tableTop.handleDisconnectGesture(disconnectConn.getConnection());
// Undo any autoburns if we disconnected an output
if (partPressed instanceof DisplayedPartOutput) {
DisplayedGem burnGem = partPressed.getDisplayedGem();
tableTop.getBurnManager().doUnburnAutomaticallyBurnedInputsUserAction(burnGem.getGem());
}
} else if (nextMode == TableTopDragMode.SELECTING && SwingUtilities.isLeftMouseButton(e)) {