From: tcofoegbu Date: Fri, 22 May 2015 11:09:58 +0000 (+0100) Subject: Merge branch 'features/JAL-1745_PDB-redownload' into develop X-Git-Tag: Release_2_10_0~661 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=509576af439b7696ff2f0dcd00c319394ae4a664;hp=35b39c5d53fa12b9e9ab497d4a8a665ff3cfef5d;p=jalview.git Merge branch 'features/JAL-1745_PDB-redownload' into develop --- diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 142028a..ff7cdcb 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -224,7 +224,7 @@ public class StructureChooser extends GStructureChooser pdbEntry.getType(), pdbEntry.getFile() }; tableModel.addRow(pdbEntryRowData); - cachedEntryMap.put(seq.getDisplayId(false) + pdbEntry.getId(), + cachedEntryMap.put(pdbEntry.getId().toLowerCase(), pdbEntry); } } @@ -644,12 +644,16 @@ public class StructureChooser extends GStructureChooser { String pdbIdStr = tbl_summary.getValueAt(summaryRow, pdbIdCol) .toString(); - PDBEntry pdbEntry = new PDBEntry(); - pdbEntry.setId(pdbIdStr); - pdbEntry.setType(PDBEntry.Type.PDB); + + PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase()); + if (pdbEntry == null) + { + pdbEntry = new PDBEntry(); + pdbEntry.setId(pdbIdStr); + pdbEntry.setType(PDBEntry.Type.PDB); + } pdbEntriesToView[count++] = pdbEntry; } - launchStructureViewer(ap.getStructureSelectionManager(), pdbEntriesToView, ap, selectedSequences); } @@ -659,7 +663,8 @@ public class StructureChooser extends GStructureChooser int count = 0; for (int row : selectedRows) { - String entryKey = tbl_local_pdb.getValueAt(row, 0).toString() + tbl_local_pdb.getValueAt(row, 1).toString(); + String entryKey = tbl_local_pdb.getValueAt(row, 1).toString() + .toLowerCase(); pdbEntriesToView[count++] = cachedEntryMap.get(entryKey); } launchStructureViewer(ap.getStructureSelectionManager(), @@ -673,9 +678,16 @@ public class StructureChooser extends GStructureChooser { selectedSequence = userSelectedSeq; } - PDBEntry pdbEntry = new PDBEntry(); - pdbEntry.setId(txt_search.getText()); - pdbEntry.setType(PDBEntry.Type.PDB); + + String pdbIdStr = txt_search.getText(); + PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase()); + if (pdbEntry == null) + { + pdbEntry = new PDBEntry(); + pdbEntry.setId(txt_search.getText()); + pdbEntry.setType(PDBEntry.Type.PDB); + } + selectedSequence.getDatasetSequence().addPDBId(pdbEntry); PDBEntry[] pdbEntriesToView = new PDBEntry[] { pdbEntry }; @@ -823,4 +835,5 @@ public class StructureChooser extends GStructureChooser } } + }