- int j = 1;
- for (int i = 1; i < mset.length; i++)
- {
- m = viewer.ms.getModelFileName(i);
- mset[j] = m;
- if (m != null)
- {
- try
- {
- mset[j] = new File(m).getAbsolutePath();
- } catch (AccessControlException x)
- {
- // usually not allowed to do this in applet, so keep raw handle
- // System.err.println("jmolBinding: Using local file string from Jmol: "+m);
- }
- }
- _modelFileNameMap[j] = i; // record the model index for the filename
- // skip any additional models in the same file (NMR structures)
- if ((mset[j] == null ? mset[j] != mset[j - 1]
- : (mset[j - 1] == null || !mset[j].equals(mset[j - 1]))))
- {
- j++;
- }
- }
- modelFileNames = new String[j];
- System.arraycopy(mset, 0, modelFileNames, 0, j);