public void unlinkTrees() { // reuse previous PartitionTreePrior int[] selRows = dataTable.getSelectedRows(); for (int row : selRows) { AbstractPartitionData partition = options.dataPartitions.get(row); PartitionTreeModel model = partition.getPartitionTreeModel(); if (!model.getName().equals(partition.getName()) && partition.getTraits() == null) { // not a trait PartitionTreeModel newTree = new PartitionTreeModel(options, partition.getName(), model); // 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(); repaint(); }
public Object getValueAt(int row, int col) { // PartitionData partition = options.getPartitionDataNoSpecies().get(row); AbstractPartitionData partition = options.dataPartitions.get(row); switch (col) { case 0: return partition.getName(); case 1: return partition.getFileName(); case 2: return "" + (partition.getTaxonCount() >= 0 ? partition.getTaxonCount() : "-"); case 3: return "" + (partition.getSiteCount() >= 0 ? partition.getSiteCount() : "-"); case 4: return partition.getDataDescription(); case 5: // return partition.getPloidyType(); // case 6: return partition.getPartitionSubstitutionModel().getName(); case 6: return "" + (partition.getPartitionClockModel() != null ? partition.getPartitionClockModel().getName() : "-"); case 7: return partition.getPartitionTreeModel().getName(); default: throw new IllegalArgumentException("unknown column, " + col); } }
public void unlinkClocks() { // reuse previous PartitionTreePrior int[] selRows = dataTable.getSelectedRows(); for (int row : selRows) { AbstractPartitionData partition = options.dataPartitions.get(row); PartitionClockModel model = partition.getPartitionClockModel(); if (!model.getName().equals(partition.getName())) { PartitionClockModel newModel = new PartitionClockModel(options, partition.getName(), model); partition.setPartitionClockModel(newModel); newModel.setClockModelGroup(model.getClockModelGroup()); // set clock model group } } modelsChanged(); fireDataChanged(); repaint(); }
public void unlinkModels() { int[] selRows = dataTable.getSelectedRows(); for (int row : selRows) { AbstractPartitionData partition = options.dataPartitions.get(row); PartitionSubstitutionModel model = partition.getPartitionSubstitutionModel(); if (!model.getName().equals(partition.getName())) { PartitionSubstitutionModel newModel = new PartitionSubstitutionModel(options, partition.getName(), model); partition.setPartitionSubstitutionModel(newModel); } } modelsChanged(); fireDataChanged(); repaint(); }