- File fl = new File(file);
- String protocol = AppletFormatAdapter.URL;
- try
- {
- if (fl.exists())
- {
- protocol = AppletFormatAdapter.FILE;
- }
- } catch (Exception e)
- {
- } catch (Error e)
- {
- }
- // Explicitly map to the filename used by Chimera ;
- // pdbentry[pe].getFile(), protocol);
+ /*
+ * If Chimera doesn't yet have this model, ask it to open it, and retrieve
+ * the model names added by Chimera.
+ */
+ if (!alreadyOpen)
+ {
+ viewer.openModel(file, pe.getId(), ModelType.PDB_MODEL);
+ modelsToMap = viewer.getModelList();
+ modelsToMap.removeAll(oldList);
+ }
+
+ chimeraMaps.put(file, modelsToMap);