if (appState.getCurrentFocusedComponent() instanceof DiagramTree) {
DiagramTree tree = (DiagramTree) appState.getCurrentFocusedComponent();
if (tree.getSelectionPath() != null) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode)
tree.getSelectionPath().getLastPathComponent();
DeleteDiagramCommand command = new DeleteDiagramCommand(
appState.getUmlModel(), (UmlDiagram) node.getUserObject());
appState.execute(command);
}
} else if (appState.getCurrentEditor() != null) {
appState.getCurrentEditor().deleteSelection();