@Override public boolean isPackageEnabled(String packageURIOrName) { SBMLDocument doc = getSBMLDocument(); if (doc != null) { return doc.isPackageEnabled(packageURIOrName); } return false; }
/** * Enables or disables the given SBML Level 3 package on this * {@link SBMLDocument}. * * @param packageURIOrName * a package namespace URI or package name */ @Override public void enablePackage(String packageURIOrName, boolean enabled) { SBMLDocument doc = getSBMLDocument(); if (doc != null) { doc.enablePackage(packageURIOrName, enabled); } else if (logger.isDebugEnabled()) { logger.debug(resourceBundle.getString("AbstractSBase.enablePackage")); } }
@Override public void unregisterChild(SBase sbase) { if (logger.isDebugEnabled()) { logger.debug(format( resourceBundle.getString("AbstractSBase.unregisterChild1"), sbase.getElementName(), (sbase.isSetId() ? sbase.getId() : ""))); } if ((sbase != null)) { SBMLDocument doc = getSBMLDocument(); if (doc != null) { // unregister recursively all metaIds. doc.registerMetaIds(sbase, true, true); } IdManager idManager = getIdManager(sbase); // If possible, recursively unregister all ids of the SBase in our model: if ((idManager != null) && !idManager.unregister(sbase)) { throw new IllegalArgumentException(format( resourceBundle.getString("AbstractSBase.unregisterChild2"), sbase.getElementName())); } /* * Do not remove ChangeListeners from the sbase here, this will be done * in the super class. It is important to keep the change listeners for * now, because otherwise the listeners won't be informed that we are * going to delete something from the model. */ } }
/** * Registers recursively the given {@link SBasePlugin} from the {@link Model} * and {@link SBMLDocument}. * * @param sbasePlugin * the {@link SBasePlugin} to register. */ @SuppressWarnings("unused") private void registerChild(SBasePlugin sbasePlugin) { // Could/Should be used by the method #firePropertyChange // set package version and namespace if needed checkAndSetPackageNamespaceAndVersion(sbasePlugin, getSBMLDocument()); int childCount = sbasePlugin.getChildCount(); if (childCount > 0) { for (int i = 0; i < childCount; i++) { TreeNode childNode = sbasePlugin.getChildAt(i); if (childNode instanceof SBase) { registerChild((SBase) childNode); } } } }
SBMLDocument doc = getSBMLDocument(); SBasePlugin sbasePlugin = (SBasePlugin) newValue;
SBMLDocument doc = getSBMLDocument(); if (doc != null) { setMetaId(doc.nextMetaId());
@Override protected void notifyChildChange(TreeNode oldChild, TreeNode newChild) { if (oldChild instanceof SBase) { SBMLDocument doc = getSBMLDocument(); if (doc != null) { /* * Recursively remove pointers to oldValue's and all * sub-element's meta identifiers from the * SBMLDocument. */ doc.registerMetaIds((SBase) oldChild, true, true); /* * Do the same for all identifiers under the old value. */ IdManager idManager = ((AbstractSBase) oldChild).getIdManager((SBase) oldChild); if (idManager != null) { idManager.unregister((SBase) oldChild); SBase newNsb = (SBase) newChild; if (!idManager.register(newNsb)) { throw IdentifierException.createIdentifierExceptionForId(newNsb, newNsb.getId()); } } } } }
SBMLDocument doc = getSBMLDocument(); if (doc != null) {
SBMLDocument doc = getSBMLDocument(); String oldMetaId = this.metaId; if (doc != null) {