- pdbEntry = new PDBEntry();
- pdbEntry.setId(pdbIdStr);
- pdbEntry.setType(PDBEntry.Type.PDB);
- selectedSeq.getDatasetSequence().addPDBId(pdbEntry);
- }
- pdbEntriesToView[count++] = pdbEntry;
- }
- SequenceI[] selectedSeqs = selectedSeqsToView
- .toArray(new SequenceI[selectedSeqsToView.size()]);
+ int pdbIdColIndex = getResultTable().getColumn("PDB Id")
+ .getModelIndex();
+ int refSeqColIndex = getResultTable().getColumn("Ref Sequence")
+ .getModelIndex();
+ int[] selectedRows = getResultTable().getSelectedRows();
+ PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
+ int count = 0;
+ List<SequenceI> selectedSeqsToView = new ArrayList<>();
+ for (int row : selectedRows)
+ {
+ String pdbIdStr = getResultTable()
+ .getValueAt(row, pdbIdColIndex).toString();
+ SequenceI selectedSeq = (SequenceI) getResultTable()
+ .getValueAt(row, refSeqColIndex);
+ selectedSeqsToView.add(selectedSeq);
+ PDBEntry pdbEntry = selectedSeq.getPDBEntry(pdbIdStr);
+ if (pdbEntry == null)
+ {
+ pdbEntry = getFindEntry(pdbIdStr,
+ selectedSeq.getAllPDBEntries());
+ }
+
+ if (pdbEntry == null)
+ {
+ pdbEntry = new PDBEntry();
+ pdbEntry.setId(pdbIdStr);
+ pdbEntry.setType(PDBEntry.Type.PDB);
+ selectedSeq.getDatasetSequence().addPDBId(pdbEntry);
+ }
+ pdbEntriesToView[count++] = pdbEntry;
+ }
+ SequenceI[] selectedSeqs = selectedSeqsToView
+ .toArray(new SequenceI[selectedSeqsToView.size()]);