'Set the :class:`~.scheme.Scheme` instance to display/edit.'

def setScheme(self, scheme):

    if (self.__scheme is not scheme):
        if self.__scheme:
            self.__scheme.title_changed.disconnect(self.titleChanged)
            self.__scheme.removeEventFilter(self)
            sm = self.__scheme.findChild(signalmanager.SignalManager)
            if sm:
                sm.stateChanged.disconnect(self.__signalManagerStateChanged)
        self.__scheme = scheme
        self.setPath('')
        if self.__scheme:
            self.__scheme.title_changed.connect(self.titleChanged)
            self.titleChanged.emit(scheme.title)
            self.__cleanProperties = node_properties(scheme)
            sm = scheme.findChild(signalmanager.SignalManager)
            if sm:
                sm.stateChanged.connect(self.__signalManagerStateChanged)
        else:
            self.__cleanProperties = []
        self.__teardownScene(self.__scene)
        self.__scene.deleteLater()
        self.__undoStack.clear()
        self.__scene = CanvasScene(self)
        self.__scene.setItemIndexMethod(CanvasScene.NoIndex)
        self.__setupScene(self.__scene)
        self.__scene.set_scheme(scheme)
        self.__view.setScene(self.__scene)
        if self.__scheme:
            self.__scheme.installEventFilter(self)
            nodes = self.__scheme.nodes
            if nodes:
                self.ensureVisible(nodes[0])
