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(); }
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(); }
private void fireDataChanged() { // options.updateLinksBetweenPDPCMPSMPTMPTPP(); options.updatePartitionAllLinks(); if (!(options.clockModelOptions.getRateOptionClockModel() == FixRateType.TIP_CALIBRATED || options.clockModelOptions.getRateOptionClockModel() == FixRateType.NODE_CALIBRATED || options.clockModelOptions.getRateOptionClockModel() == FixRateType.RATE_CALIBRATED)) { // TODO correct? options.clockModelOptions.fixRateOfFirstClockPartition(); } frame.setDirty(); }
public void selectionChanged() { int[] selRows = dataTable.getSelectedRows(); boolean hasSelection = (selRows != null && selRows.length != 0); frame.dataSelectionChanged(hasSelection); boolean canUnlink = options.dataPartitions.size() > 1 && hasSelection; boolean canLink = options.dataPartitions.size() > 1 && hasSelection && selRows.length > 1; unlinkModelsAction.setEnabled(canUnlink); linkModelsAction.setEnabled(canLink); unlinkClocksAction.setEnabled(canUnlink); linkClocksAction.setEnabled(canLink); unlinkTreesAction.setEnabled(canUnlink); linkTreesAction.setEnabled(canLink); }
public void fireModelChanged() { frame.setDirty(); }
public void createFromTraits() { frame.createImportTraits(); dataTableModel.fireTableDataChanged(); }
private void fireDataChanged() { options.updatePartitionAllLinks(); frame.setDirty(); }