String mset[] = new String[viewer.getModelCount()];\r
_modelFileNameMap = new int[mset.length];\r
int j = 1;\r
- mset[0] = viewer.getModelFileName(0);\r
+ String m=viewer.getModelFileName(0);\r
+ if (m!=null)\r
+ {\r
+ mset[0] = new File(m).getAbsolutePath();\r
+ }\r
for (int i = 1; i < mset.length; i++)\r
{\r
- mset[j] = viewer.getModelFileName(i);\r
+ m=viewer.getModelFileName(i);\r
+ if (m!=null) {\r
+ mset[j] = new File(m).getAbsolutePath();\r
+ }\r
_modelFileNameMap[j] = i; // record the model index for the filename\r
// skip any additional models in the same file (NMR structures)\r
if ((mset[j] == null ? mset[j] != mset[j - 1]\r
try\r
{\r
// recover PDB filename for the model hovered over.\r
- pdbfilename = viewer\r
- .getModelFileName(new Integer(mdlId).intValue() - 1);\r
+ int _mp=_modelFileNameMap.length-1,\r
+ mnumber=new Integer(mdlId).intValue() - 1;\r
+ while(mnumber<_modelFileNameMap[_mp])\r
+ {\r
+ _mp--;\r
+ }\r
+ pdbfilename = modelFileNames[_mp];\r
+ if (pdbfilename==null) {pdbfilename=new File(viewer\r
+ .getModelFileName(mnumber)).getAbsolutePath();\r
+ }\r
\r
} catch (Exception e)\r
{\r