Object[] userObjects = new Object[selection.length];
// First remove the selection.
for (int i = 0; i < selection.length; i++) {
userObjects[i] = ((Figure) selection[i]).getUserObject();
model.removeSelection(selection[i]);
}
// Remove all the edges first, since if we remove the nodes first,
// then removing the nodes might remove some of the edges.
for (int i = 0; i < userObjects.length; i++) {