'When a different tree is given.'

def set_tree(self, model=None):

    self.clear()
    self.model = model
    if (model is not None):
        self.instances = model.instances
        if ((self.instances is not None) and (self.instances.domain != model.domain)):
            self.clf_dataset = self.instances.transform(self.model.domain)
        else:
            self.clf_dataset = self.instances
        self.tree_adapter = self._get_tree_adapter(self.model)
        self.ptree.clear()
        self.ptree.set_tree(self.tree_adapter, weight_adjustment=self.SIZE_CALCULATION[self.size_calc_idx][1], target_class_index=self.target_class_index)
        self._update_depth_slider()
        self.color_palette = self.ptree.root.color_palette
        self._update_legend_colors()
        self._update_legend_visibility()
        self._update_info_box()
        self._update_target_class_combo()
        self._update_main_area()
        if hasattr(model, 'meta_target_class_index'):
            self.target_class_index = model.meta_target_class_index
            self.update_colors()
        if hasattr(model, 'meta_size_calc_idx'):
            self.size_calc_idx = model.meta_size_calc_idx
            self.update_size_calc()
    self.send(ANNOTATED_DATA_SIGNAL_NAME, create_annotated_table(self.instances, None))
