'Remove all selected items in the scheme.'

def removeSelected(self):

    selected = self.scene().selectedItems()
    if (not selected):
        return
    scene = self.scene()
    self.__undoStack.beginMacro(self.tr('Remove'))
    for item in selected:
        if isinstance(item, items.NodeItem):
            node = self.scene().node_for_item(item)
            self.__undoStack.push(commands.RemoveNodeCommand(self.__scheme, node))
        elif isinstance(item, items.annotationitem.Annotation):
            if (item.hasFocus() or item.isAncestorOf(scene.focusItem())):
                scene.focusItem().clearFocus()
            annot = self.scene().annotation_for_item(item)
            self.__undoStack.push(commands.RemoveAnnotationCommand(self.__scheme, annot))
    self.__undoStack.endMacro()
