/** * Disables the given SBML Level 3 package on this {@link SBMLDocument}. * * @param packageURIOrName * a package namespace URI or package name */ @Override public void disablePackage(String packageURIOrName) { enablePackage(packageURIOrName, false); }
/** * Enables 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) { enablePackage(packageURIOrName, true); }
@Override public void addExtension(String nameOrUri, SBasePlugin sbasePlugin) { if (!isPackageEnabled(nameOrUri)) { enablePackage(nameOrUri); } // use always the package name in the map PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); if (packageParser != null) { // unset the previous plugin if needed if (extensions.get(packageParser.getPackageName()) != null) { unsetPlugin(packageParser.getPackageName()); } extensions.put(packageParser.getPackageName(), sbasePlugin); // Making sure that the correct extendedSBase is set in the SBasePlugin // And that all the ids and metaids are registered if ((sbasePlugin.getExtendedSBase() == null) || (sbasePlugin.getExtendedSBase() != this)) { ((AbstractSBasePlugin) sbasePlugin).setExtendedSBase(this); } // the package namespace and version will be set in firePropertyChange firePropertyChange(TreeNodeChangeEvent.addExtension, null, sbasePlugin); } else { throw new IllegalArgumentException(format( resourceBundle.getString("AbstractSBase.addExtensionExc"), nameOrUri)); } }