/** * Checks the Level/Version configuration of the new parent (if it is * compliant to the one of this {@link SBase}), adds all changeListeners from * the parent to this {@link SBase}, fires a * {@link TreeNodeChangeListener#nodeAdded(TreeNode)} event, and and finally, * it will forward the new parent to {@link #setParentSBML(SBase)}. * Note that this will cause another event to be triggered: * {@link TreeNodeChangeListener#propertyChange(java.beans.PropertyChangeEvent)} * with the old and the new parent. * * @param sbase * the new parent element. * @throws LevelVersionError * if the SBML Level and Version configuration of the new parent * differs from the one of this {@link SBase}. * @see #setParentSBML(SBase) */ protected void setParentSBMLObject(SBase sbase) throws LevelVersionError { if (sbase instanceof AbstractSBase) { ((AbstractSBase) sbase).checkLevelAndVersionCompatibility(this); } addAllChangeListeners(sbase.getListOfTreeNodeChangeListeners()); fireNodeAddedEvent(); setParentSBML(sbase); }
if ((sbase != null) && checkLevelAndVersionCompatibility(sbase) && checkAndSetPackageNamespaceAndVersion(sbase)) { SBMLDocument doc = getSBMLDocument();