public void unlinkTrees() { // reuse previous PartitionTreePrior int[] selRows = dataTable.getSelectedRows(); for (int row : selRows) { PartitionData partition = options.dataPartitions.get(row); PartitionTreeModel model = partition.getPartitionTreeModel(); if (!model.getName().equals(partition.getName()) && partition.getTraitType() == null) { // not a trait PartitionTreeModel newTree = new PartitionTreeModel(options, partition); // this prevents partition not broken, and used for unsharing tree prior only, // because sharing uses shareSameTreePrior, unsharing uses getPartitionTreePrior // newTree.setPartitionTreePrior(newPrior); // important partition.setPartitionTreeModel(newTree); } } options.linkTreePriors(frame.getCurrentPartitionTreePrior()); modelsChanged(); fireDataChanged(); options.taxonSets.clear(); options.taxonSetsMono.clear(); repaint(); }