public void loadLocalCachedPDBEntries()
{
- DefaultTableModel tableModel = new DefaultTableModel();
- tableModel.addColumn("Sequence");
+ DefaultTableModel tableModel = new DefaultTableModel()
+ {
+ @Override
+ public boolean isCellEditable(int row, int column)
+ {
+ return false;
+ }
+ };
+ tableModel.addColumn("Ref Sequence");
tableModel.addColumn("PDB Id");
tableModel.addColumn("Chain");
tableModel.addColumn("Type");
String chain = pdbEntry.getChainCode() == null ? "_" : pdbEntry
.getChainCode();
- String[] pdbEntryRowData = new String[]
- { seq.getDisplayId(false), pdbEntry.getId(),
+ Object[] pdbEntryRowData = new Object[]
+ { seq, pdbEntry.getId(),
chain,
pdbEntry.getType(),
pdbEntry.getFile() };
int[] selectedRows = tbl_local_pdb.getSelectedRows();
PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
int count = 0;
+ int pdbIdColIndex = tbl_local_pdb.getColumn(
+ PDBRestClient.PDBDocField.PDB_ID.getName()).getModelIndex();
+ int refSeqColIndex = tbl_local_pdb.getColumn("Ref Sequence")
+ .getModelIndex();
+ ArrayList<SequenceI> selectedSeqsToView = new ArrayList<SequenceI>();
for (int row : selectedRows)
{
- String entryKey = tbl_local_pdb.getValueAt(row, 1).toString()
+ String entryKey = tbl_local_pdb.getValueAt(row, pdbIdColIndex)
+ .toString()
.toLowerCase();
pdbEntriesToView[count++] = cachedEntryMap.get(entryKey);
+ SequenceI selectedSeq = (SequenceI) tbl_summary.getValueAt(row,
+ refSeqColIndex);
+ selectedSeqsToView.add(selectedSeq);
}
+ SequenceI[] selectedSeqs = selectedSeqsToView
+ .toArray(new SequenceI[selectedSeqsToView.size()]);
launchStructureViewer(ap.getStructureSelectionManager(),
- pdbEntriesToView, ap, selectedSequences);
+ pdbEntriesToView, ap, selectedSeqs);
}
else if (currentView == VIEWS_ENTER_ID)
{