/**
* note: this is taken verbatim from jalview.io.VamsasAppDatastore
-
+ * with added call to updateRegistryEntry
* @param jvobj
* @param vobj
*/
: "unregisterable") + " object " + vobj);
}
}
-
if (vobj2jv.containsKey(vobj.getVorbaId())
&& !(vobj2jv.get(vobj.getVorbaId())).equals(jvobj))
{
vobj2jv.put(vobj.getVorbaId(), jvobj);
// JBPNote - better implementing a hybrid invertible hash.
jv2vobj.put(jvobj, vobj.getVorbaId());
+ if (jvobj==this.jvobj || vobj==this.vobj)
+ {
+ updateRegistryEntry(jvobj,vobj);
+ }
+ }
+ /**
+ * update the vobj and jvobj references and the registry entry for this datastore object
+ * called by bindjvvobj and replacejvobjmapping
+ */
+ private void updateRegistryEntry(Object jvobj,Vobject vobj)
+ {
+ if (this.jvobj!=null && this.vobj!=null) {
+ Cache.log.debug("updating dsobj registry. ("+this.getClass().getName()+")");
+ }
+ this.jvobj = jvobj;
+ this.vobj = vobj;
+ dsReg.registerDsObj(this);
}
+
/**
* replaces oldjvobject with newjvobject in the Jalview Object <> VorbaID
* binding tables
- * note: this is taken verbatim from jalview.io.VamsasAppDatastore
+ * note: originally taken verbatim from jalview.io.VamsasAppDatastore with added call to updateRegistryEntry
* @param oldjvobject
* @param newjvobject (may be null to forget the oldjvobject's document mapping)
*
{
jv2vobj.put(newjvobject, vobject);
vobj2jv.put(vobject, newjvobject);
+ updateRegistryEntry(newjvobject,(Vobject) vobject);
}
}