git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ff63e53
)
JAL-1745 improvement to retreive already downloaded pdb structure file from cache
author
tcofoegbu
<tcnofoegbu@dundee.ac.uk>
Fri, 22 May 2015 11:09:09 +0000
(12:09 +0100)
committer
tcofoegbu
<tcnofoegbu@dundee.ac.uk>
Fri, 22 May 2015 11:09:09 +0000
(12:09 +0100)
src/jalview/gui/StructureChooser.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/StructureChooser.java
b/src/jalview/gui/StructureChooser.java
index
142028a
..
ff7cdcb
100644
(file)
--- 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);
pdbEntry.getType(),
pdbEntry.getFile() };
tableModel.addRow(pdbEntryRowData);
- cachedEntryMap.put(seq.getDisplayId(false) + pdbEntry.getId(),
+ cachedEntryMap.put(pdbEntry.getId().toLowerCase(),
pdbEntry);
}
}
pdbEntry);
}
}
@@
-644,12
+644,16
@@
public class StructureChooser extends GStructureChooser
{
String pdbIdStr = tbl_summary.getValueAt(summaryRow, pdbIdCol)
.toString();
{
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;
}
pdbEntriesToView[count++] = pdbEntry;
}
-
launchStructureViewer(ap.getStructureSelectionManager(),
pdbEntriesToView, ap, selectedSequences);
}
launchStructureViewer(ap.getStructureSelectionManager(),
pdbEntriesToView, ap, selectedSequences);
}
@@
-659,7
+663,8
@@
public class StructureChooser extends GStructureChooser
int count = 0;
for (int row : selectedRows)
{
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(),
pdbEntriesToView[count++] = cachedEntryMap.get(entryKey);
}
launchStructureViewer(ap.getStructureSelectionManager(),
@@
-673,9
+678,16
@@
public class StructureChooser extends GStructureChooser
{
selectedSequence = userSelectedSeq;
}
{
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 };
selectedSequence.getDatasetSequence().addPDBId(pdbEntry);
PDBEntry[] pdbEntriesToView = new PDBEntry[]
{ pdbEntry };
@@
-823,4
+835,5
@@
public class StructureChooser extends GStructureChooser
}
}
}
}
+
}
}