{
logger.info("chimera open " + modelPath);
// stopListening();
+ List<ChimeraModel> modelList = getModelList();
List<String> response = null;
// TODO: [Optional] Handle modbase models
if (type == ModelType.MODBASE_MODEL)
logger.warn("Could not open " + modelPath);
return null;
}
- List<ChimeraModel> chimeraModels = getModelList();
+
+ List<ChimeraModel> newModelList = getModelList();
+ for (ChimeraModel newModel : newModelList)
+ {
+ if (!modelList.contains(newModel))
+ {
+ newModel.setModelName(modelName);
+ sendChimeraCommand(
+ "setattr M name " + modelName + " #"
+ + newModel.getModelNumber(), false);
+ modelList.add(newModel);
+
+ }
+ }
+
// assign color and residues to open models
- for (ChimeraModel chimeraModel : chimeraModels)
+ for (ChimeraModel chimeraModel : modelList)
{
// // patch for Jalview - set model name in Chimera
// // TODO: find a variant that works for sub-models
- chimeraModel.setModelName(modelName);
- sendChimeraCommand(
- "setattr M name " + modelName + " #"
- + chimeraModel.getModelNumber(), false);
// get model color
Color modelColor = getModelColor(chimeraModel);
if (modelColor != null)
sendChimeraCommand("focus", false);
// startListening(); // see ChimeraListener
- return chimeraModels;
+ return modelList;
}
/**