public void removeSelection() { int[] selRows = dataTable.getSelectedRows(); Set<PartitionData> partitionsToRemove = new HashSet<PartitionData>(); for (int row : selRows) { partitionsToRemove.add(options.dataPartitions.get(row)); } // TODO: would probably be a good idea to check if the user wants to remove the last partition options.dataPartitions.removeAll(partitionsToRemove); // if (options.allowDifferentTaxa && options.dataPartitions.size() < 2) { // uncheckAllowDifferentTaxa(); // } if (options.getNonTraitsDataList().size() == 0) { // all data partitions removed so reset the taxa options.reset(); useStarBEASTCheck.setSelected(false); frame.statusLabel.setText(""); frame.setAllOptions(); frame.getExportAction().setEnabled(false); } dataTableModel.fireTableDataChanged(); fireDataChanged(); }
public void removeSelection() { int[] selRows = dataTable.getSelectedRows(); Set<AbstractPartitionData> partitionsToRemove = new HashSet<AbstractPartitionData>(); for (int row : selRows) { partitionsToRemove.add(options.dataPartitions.get(row)); } boolean hasIdenticalTaxa = options.hasIdenticalTaxa(); // need to check this before removing partitions // TODO: would probably be a good idea to check if the user wants to remove the last partition options.dataPartitions.removeAll(partitionsToRemove); if (options.dataPartitions.size() == 0) { // all data partitions removed so reset the taxa options.reset(); useStarBEASTCheck.setSelected(false); frame.setupStarBEAST(false); frame.statusLabel.setText(""); frame.setAllOptions(); frame.getExportAction().setEnabled(false); } else if (!hasIdenticalTaxa) { options.updateTaxonList(); } dataTableModel.fireTableDataChanged(); fireDataChanged(); }