AppJmol jmol;
// This must have been loaded, is it still visible?
JInternalFrame[] frames = Desktop.desktop.getAllFrames();
+ String matchedFile=null;
for (int f = frames.length - 1; f > -1; f--)
{
if (frames[f] instanceof AppJmol)
jmol = (AppJmol) frames[f];
if (!jmol.pdbentry.getId().equals(entry.getId())
&& !(entry.getId().length()>4
- && entry.getId().startsWith(jmol.pdbentry.getId())))
+ && entry.getId().toLowerCase().startsWith(jmol.pdbentry.getId().toLowerCase())))
continue;
-
+ matchedFile = jmol.pdbentry.getFile(); // record the file so we can get at it if the ID match is ambiguous (e.g. 1QIP==1qipA)
StructureState state = new StructureState();
state.setVisible(true);
state.setXpos(jmol.getX());
}
}
- if (entry.getFile() != null)
+ if (matchedFile!=null || entry.getFile() != null )
{
- pdb.setFile(entry.getFile());
+ if (entry.getFile()!=null)
+ {
+ // use entry's file
+ matchedFile = entry.getFile();
+ }
+ pdb.setFile(matchedFile); // entry.getFile());
if (pdbfiles == null)
{
pdbfiles = new Vector();
pdbfiles.addElement(entry.getId());
try
{
- File file = new File(entry.getFile());
+ File file = new File(matchedFile);
if (file.exists() && jout != null)
{
byte[] data = new byte[(int) file.length()];
.getHeight(), tree.getXpos(), tree.getYpos());
if (tree.getId() != null)
{
-
+ // perhaps bind the tree id to something ?
}
}
else
{
// update local tree attributes ?
+ // TODO: should check if tp has been manipulated by user - if so its settings shouldn't be modified
tp.setTitle(tree.getTitle());
tp.setBounds(new Rectangle(tree.getXpos(), tree.getYpos(), tree
.getWidth(), tree.getHeight()));
}
}
}
- Desktop.desktop.getComponentAt(x, y);
+ // Probably don't need to do this anymore...
+ // Desktop.desktop.getComponentAt(x, y);
// TODO: NOW: check that this recovers the PDB file correctly.
String pdbFile = loadPDBFile(jprovider, ids[p].getId());