{
this(file, id, seq, ap, loadStatus, bounds, null);
}
+
public AppJmol(String file, String id, SequenceI[] seq,
- AlignmentPanel ap, String loadStatus, Rectangle bounds, String viewid)
+ AlignmentPanel ap, String loadStatus, Rectangle bounds,
+ String viewid)
{
loadingFromArchive = true;
pdbentry = new PDBEntry();
{
try
{
- EBIFetchClient ebi = new EBIFetchClient();
- String query = "pdb:" + pdbentry.getId();
- pdbentry.setFile(ebi.fetchDataAsFile(query, "default", "raw")
- .getAbsolutePath());
- initJmol("load " + pdbentry.getFile());
+ // TODO: replace with reference fetching/transfer code (validate PDBentry as a DBRef?)
+ jalview.ws.dbsources.Pdb pdbclient = new jalview.ws.dbsources.Pdb();
+ AlignmentI pdbseq;
+ if ((pdbseq=pdbclient.getSequenceRecords(pdbentry.getId())) != null)
+ {
+ // just transfer the file name from the first seuqence's first PDBEntry
+ pdbentry.setFile(((PDBEntry) pdbseq.getSequenceAt(0).getPDBId().elementAt(0)).getFile());
+ initJmol("load " + pdbentry.getFile());
+ }
+ else
+ {
+ JOptionPane
+ .showInternalMessageDialog(
+ Desktop.desktop,
+ pdbentry.getId()
+ + " could not be retrieved. Please try downloading the file manually.",
+ "Couldn't load file", JOptionPane.ERROR_MESSAGE);
+
+ }
} catch (OutOfMemoryError oomerror)
{
new OOMWarning("Retrieving PDB id " + pdbentry.getId() + " from MSD",
* DOCUMENT ME!
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void eps_actionPerformed(ActionEvent e)
{
* DOCUMENT ME!
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void png_actionPerformed(ActionEvent e)
{
}
}
}
- String viewId=null;
+
+ String viewId = null;
+
public String getViewId()
{
- if (viewId==null)
+ if (viewId == null)
{
- viewId=System.currentTimeMillis()+"."+this.hashCode();
+ viewId = System.currentTimeMillis() + "." + this.hashCode();
}
return viewId;
}