From c169d9e5208916dd465ad8837b31004e45a2e938 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 5 Feb 2018 16:38:48 +0000 Subject: [PATCH] JAL-2780 JAL-2871 only look up current table view once --- src/jalview/gui/StructureChooser.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 217f653..452677e 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -745,21 +745,24 @@ public class StructureChooser extends GStructureChooser FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption .getSelectedItem()); String currentView = selectedFilterOpt.getView(); + JTable restable = (currentView == VIEWS_FILTER) ? getResultTable() + : tbl_local_pdb; + if (currentView == VIEWS_FILTER) { - int pdbIdColIndex = getResultTable().getColumn("PDB Id") + int pdbIdColIndex = restable.getColumn("PDB Id") .getModelIndex(); - int refSeqColIndex = getResultTable().getColumn("Ref Sequence") + int refSeqColIndex = restable.getColumn("Ref Sequence") .getModelIndex(); - int[] selectedRows = getResultTable().getSelectedRows(); + int[] selectedRows = restable.getSelectedRows(); PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length]; int count = 0; List selectedSeqsToView = new ArrayList<>(); for (int row : selectedRows) { - String pdbIdStr = getResultTable() + String pdbIdStr = restable .getValueAt(row, pdbIdColIndex).toString(); - SequenceI selectedSeq = (SequenceI) getResultTable() + SequenceI selectedSeq = (SequenceI) restable .getValueAt(row, refSeqColIndex); selectedSeqsToView.add(selectedSeq); PDBEntry pdbEntry = selectedSeq.getPDBEntry(pdbIdStr); -- 1.7.10.2