From: <nik...@us...> - 2015-12-03 17:04:08
|
Revision: 2432 http://sourceforge.net/p/jsbml/code/2432 Author: niko-rodrigue Date: 2015-12-03 17:04:05 +0000 (Thu, 03 Dec 2015) Log Message: ----------- detected and corrected more package namespace error while checking the tests outputs + reduced the default output of the arrays flattening tests a lot which allow to see some of the errors Modified Paths: -------------- trunk/NEWS.txt trunk/core/src/org/sbml/jsbml/AbstractSBase.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/FlatteningTest.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Deletion.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ExternalModelDefinition.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedBy.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedElement.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GeneralGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/TextGlyph.java Modified: trunk/NEWS.txt =================================================================== --- trunk/NEWS.txt 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/NEWS.txt 2015-12-03 17:04:05 UTC (rev 2432) @@ -11,9 +11,9 @@ package definitions. - Improved the Maven pom files, and changed the Maven group ids and - artifact ids. They should be stable now. With these changes in place, we - can update the Maven repository much more quickly and easily. Next steps - are to make JSBML available in Maven Central. + artifact ids. They should be stable now. With these changes in place, + we can update the Maven repository much more quickly and easily. Next + steps are to make JSBML available in Maven Central. - Added some utility classes to improve support for SBML files written by the Cobra toolbox before the SBML Level 3 FBC package was created. The @@ -32,9 +32,12 @@ - SBML L1 rules were not correctly written: the wrong XML element name was used. Now it uses the correct L1 names and attributes. - - The clone constructor for the Species class did not copy the speciesType - attribute. Thanks to Olivier Martin who reported the problem. + - The clone constructor for the Species class did not copy the + speciesType attribute. Thanks to Olivier Martin who reported the + problem. + - The clone constructor for the FunctionDefinition class did not copy the + id attribute. =========================================================================== Version 1.1-beta1 (12-10-2015) Modified: trunk/core/src/org/sbml/jsbml/AbstractSBase.java =================================================================== --- trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -793,7 +793,7 @@ * <i>real</i> check, rather than to indicate potential errors. */ protected boolean checkAndSetPackageNamespaceAndVersion(SBase sbase) { - String expectedPackageNamespace = ""; + String expectedPackageNamespace = null; int expectedPackageVersion = -1; String packageLabel = sbase.getPackageName(); @@ -2116,7 +2116,7 @@ * @param namespace the XML namespace to which this {@link SBase} belong. */ public void setNamespace(String namespace) { - if ((elementNamespace != null) && (!elementNamespace.equals(namespace))) { + if ((elementNamespace != null) && (namespace != null) && (!elementNamespace.equals(namespace))) { // TODO - test if elementNamespace or namespace is empty before throwing the error ! // if we implement proper conversion some days, we need to unset the namespace before changing it. logger.error(MessageFormat.format( resourceBundle.getString("AbstractSBase.setNamespaceExc"), Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -2273,7 +2273,7 @@ throws SBMLException { FunctionDefinition func = model.getFunctionDefinition(functionDefinitionName); if (func == null) { - throw new SBMLException(); + throw new SBMLException("FunctionDefinition with id ' " + functionDefinitionName + "' cannot be found in the model."); } function(func, args); return dummy; Modified: trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/FlatteningTest.java =================================================================== --- trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/FlatteningTest.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/FlatteningTest.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -26,6 +26,7 @@ import javax.xml.stream.XMLStreamException; +import org.apache.log4j.Logger; import org.junit.Test; import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.AssignmentRule; @@ -60,6 +61,7 @@ */ public class FlatteningTest { + private static Logger logger = Logger.getLogger(FlatteningTest.class); @Test public void sizeZeroTest() { @@ -218,11 +220,23 @@ ASTNode ruleMath = ASTNode.parseFormula("selector(X, i)"); rule.setMath(ruleMath); - SBMLWriter.write(doc, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testFlatteningRule, document before convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testFlatteningRule, document after convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + assertTrue(flattened.getModel().getParameterCount() == 21); assertTrue(flattened.getModel().getRuleCount() == 10); } catch (SBMLException e) { @@ -284,11 +298,23 @@ Dimension dim = reactPlugin.createDimension("i"); dim.setSize(n.getId()); dim.setArrayDimension(0); - SBMLWriter.write(doc, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testReaction, document before convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testReaction, document after convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + assertTrue(flattened.getModel().getParameterCount() == 3); assertTrue(flattened.getModel().getReactionCount() == 2); } catch (SBMLException e) { @@ -348,12 +374,22 @@ dim.setSize(n.getId()); dim.setArrayDimension(0); + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testEvent, document before convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(doc, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); - SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testEvent, document after convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + assertTrue(flattened.getModel().getEventCount() == 3); assertTrue(flattened.getModel().getEvent(0).getEventAssignmentCount() == 3); } catch (SBMLException e) { @@ -413,11 +449,22 @@ - SBMLWriter.write(doc, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testEventAssignmentWithParentDimension, document before convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testEventAssignmentWithParentDimension, document after convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + assertTrue(flattened.getModel().getEventCount() == 3); assertTrue(flattened.getModel().getEvent(0).getEventAssignmentCount() == 1); } catch (SBMLException e) { @@ -439,7 +486,11 @@ doc = SBMLReader.read(ArraysWriteTest.class.getResourceAsStream("/org/sbml/jsbml/xml/test/data/arrays/BIOMD0000000012.xml")); SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); + String docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testBioModelFlattening, document after convert:\n" + docStr); + } assertTrue(doc.getModel().getCompartmentCount() == flattened.getModel().getCompartmentCount()); assertTrue(doc.getModel().getSpeciesCount() == flattened.getModel().getSpeciesCount()); @@ -505,11 +556,23 @@ Dimension dim = reactPlugin.createDimension("i"); dim.setSize(n.getId()); dim.setArrayDimension(0); - SBMLWriter.write(doc, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testSpeciesReference, document before convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testSpeciesReference, document after convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + assertTrue(flattened.getModel().getSpeciesCount() == 4); assertTrue(flattened.getModel().findNamedSBase(flattened.getModel().getReaction(0).getReactant(0).getSpecies()) != null); assertTrue(flattened.getModel().findNamedSBase(flattened.getModel().getReaction(0).getProduct(0).getSpecies()) != null); @@ -596,12 +659,22 @@ impb.setArrayDimension(0); impb.setMath(ASTNode.parseFormula("j")); - SBMLWriter.write(doc, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testSpeciesReferenceImplicitDim, document before convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testSpeciesReferenceImplicitDim, document after convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + assertTrue(flattened.getModel().findNamedSBase(flattened.getModel().getReaction(0).getReactant(0).getSpecies()) != null); assertTrue(flattened.getModel().findNamedSBase(flattened.getModel().getReaction(0).getReactant(1).getSpecies()) != null); assertTrue(flattened.getModel().findNamedSBase(flattened.getModel().getReaction(0).getProduct(0).getSpecies()) != null); @@ -694,12 +767,23 @@ ASTNode ruleMath = ASTNode.parseFormula("selector(X, i)"); rule.setMath(ruleMath); - SBMLWriter.write(doc, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testUniqueID, document before convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testUniqueID, document after convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + assertTrue(flattened.getModel().findNamedSBase("X_0") != null); assertTrue(flattened.getModel().findNamedSBase("X__0") != null); assertTrue(flattened.getModel().findNamedSBase("X___0") != null); @@ -723,17 +807,37 @@ SBMLDocument doc; try { doc = SBMLReader.read(ArraysWriteTest.class.getResourceAsStream("/org/sbml/jsbml/xml/test/data/arrays/SubModel.xml")); - SBMLWriter.write(doc, System.out, ' ', (short) 2); + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("SubModel, document before convert:\n" + docStr); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - System.out.println("\n-------------------------------------------"); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); - System.out.println("\n-------------------------------------------"); + + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("SubModel, document after convert:\n" + docStr); + System.out.println("\n-------------------------------------------"); + } + doc = SBMLReader.read(ArraysWriteTest.class.getResourceAsStream("/org/sbml/jsbml/xml/test/data/arrays/SubSubModel.xml")); - SBMLWriter.write(doc, System.out, ' ', (short) 2); + + docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("SubSubModel, document before convert:\n" + docStr); + } + flattened = ArraysFlattening.convert(doc); - System.out.println("\n-------------------------------------------"); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("SubSubModel, document after convert:\n" + docStr); + } + } catch (XMLStreamException e) { assertTrue(false); } @@ -748,11 +852,21 @@ SBMLDocument doc; try { doc = SBMLReader.read(ArraysWriteTest.class.getResourceAsStream("/org/sbml/jsbml/xml/test/data/arrays/VoteModel.xml")); - //SBMLWriter.write(doc, System.out, ' ', (short) 2); - //SBMLDocument flattened = ArraysFlattening.convert(doc); - //SBMLWriter.write(flattened, System.out, ' ', (short) 2); - ArraysFlattening.convert(doc); + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testFBC, document before convert:\n" + docStr); + } + + SBMLDocument flattened = ArraysFlattening.convert(doc); + + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testFBC, document after convert:\n" + docStr); + } + } catch (XMLStreamException e) { assertTrue(false); } @@ -767,11 +881,21 @@ SBMLDocument doc; try { doc = SBMLReader.read(ArraysWriteTest.class.getResourceAsStream("/org/sbml/jsbml/xml/test/data/arrays/NEWFBC.xml")); - SBMLWriter.write(doc, System.out, ' ', (short) 2); + + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testFBC, document before convert:\n" + docStr); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - - SBMLWriter.write(flattened, System.out, ' ', (short) 2); - + + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testFBC, document after convert:\n" + docStr); + } + } catch (XMLStreamException e) { assertTrue(false); } @@ -783,10 +907,20 @@ SBMLDocument doc; try { doc = SBMLReader.read(ArraysWriteTest.class.getResourceAsStream("/org/sbml/jsbml/xml/test/data/arrays/layoutTest.xml")); - SBMLWriter.write(doc, System.out, ' ', (short) 2); + + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testLayout, document before convert:\n" + docStr); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testLayout, document after convert:\n" + docStr); + } } catch (XMLStreamException e) { assertTrue(false); @@ -815,10 +949,20 @@ SBMLDocument doc; try { doc = SBMLReader.read(ArraysWriteTest.class.getResourceAsStream("/org/sbml/jsbml/xml/test/data/arrays/example04.xml")); - SBMLWriter.write(doc, System.out, ' ', (short) 2); + + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("getmodel, document before convert:\n" + docStr); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("getmodel, document after convert:\n" + docStr); + } } catch (XMLStreamException e) { assertTrue(false); @@ -850,10 +994,20 @@ SBMLDocument doc; try { doc = SBMLReader.read(ArraysWriteTest.class.getResourceAsStream("/org/sbml/jsbml/xml/test/data/arrays/and.xml")); - SBMLWriter.write(doc, System.out, ' ', (short) 2); + + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("testTime, document before convert:\n" + docStr); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("testTime, document after convert:\n" + docStr); + } } catch (XMLStreamException e) { assertTrue(false); @@ -866,10 +1020,20 @@ SBMLDocument doc; try { doc = SBMLReader.read(ArraysWriteTest.class.getResourceAsStream("/org/sbml/jsbml/xml/test/data/arrays/toggleSwitch.xml")); - SBMLWriter.write(doc, System.out, ' ', (short) 2); + + String docStr = new SBMLWriter().writeSBMLToString(doc); + + if (logger.isDebugEnabled()) { + logger.debug("toggleTime, document before convert:\n" + docStr); + } + SBMLDocument flattened = ArraysFlattening.convert(doc); - SBMLWriter.write(flattened, System.out, ' ', (short) 2); + docStr = new SBMLWriter().writeSBMLToString(flattened); + + if (logger.isDebugEnabled()) { + logger.debug("toggleTime, document after convert:\n" + docStr); + } } catch (XMLStreamException e) { assertTrue(false); Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Deletion.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Deletion.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Deletion.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -120,6 +120,8 @@ * Initializes the default values using the namespace. */ public void initDefaults() { + setPackageVersion(-1); + packageName = CompConstants.shortLabel; } /* (non-Javadoc) Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ExternalModelDefinition.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ExternalModelDefinition.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ExternalModelDefinition.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -139,7 +139,8 @@ * Initializes the default values using the namespace. */ public void initDefaults() { - setNamespace(CompConstants.namespaceURI); + setPackageVersion(-1); + packageName = CompConstants.shortLabel; } Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedBy.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedBy.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedBy.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -89,6 +89,8 @@ * Initializes the default values using the namespace. */ public void initDefaults() { + setPackageVersion(-1); + packageName = CompConstants.shortLabel; } Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedElement.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedElement.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedElement.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -109,6 +109,8 @@ * Initializes the default values using the namespace. */ public void initDefaults() { + setPackageVersion(-1); + packageName = CompConstants.shortLabel; } Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -327,8 +327,12 @@ public ListOf<FluxObjective> getListOfFluxObjectives() { if (!isSetListOfFluxObjectives()) { listOfFluxObjectives = new ListOf<FluxObjective>(getLevel(), getVersion()); - listOfFluxObjectives.setNamespace(FBCConstants.namespaceURI); + listOfFluxObjectives.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'fbc' + listOfFluxObjectives.setPackageName(null); + listOfFluxObjectives.setPackageName(FBCConstants.shortLabel); listOfFluxObjectives.setSBaseListType(ListOf.Type.other); + registerChild(listOfFluxObjectives); } return listOfFluxObjectives; @@ -471,7 +475,15 @@ public void setListOfFluxObjectives(ListOf<FluxObjective> listOfFluxObjectives) { unsetListOfFluxObjectives(); this.listOfFluxObjectives = listOfFluxObjectives; - registerChild(this.listOfFluxObjectives); + + if (listOfFluxObjectives != null) { + listOfFluxObjectives.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'fbc' + listOfFluxObjectives.setPackageName(null); + listOfFluxObjectives.setPackageName(FBCConstants.shortLabel); + + registerChild(this.listOfFluxObjectives); + } } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -58,6 +58,7 @@ */ public CompartmentGlyph() { super(); + initDefaults(); } /** @@ -66,6 +67,7 @@ */ public CompartmentGlyph(CompartmentGlyph compartmentGlyph) { super(compartmentGlyph); + initDefaults(); } /** @@ -75,6 +77,7 @@ */ public CompartmentGlyph(int level, int version) { super(level, version); + initDefaults(); } /** @@ -83,6 +86,7 @@ */ public CompartmentGlyph(String id) { super(id); + initDefaults(); } /** @@ -93,6 +97,7 @@ */ public CompartmentGlyph(String id, int level, int version) { super(id, level, version); + initDefaults(); } /* (non-Javadoc) @@ -103,6 +108,14 @@ return new CompartmentGlyph(this); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + } + /* (non-Javadoc) * @see org.sbml.jsbml.CompartmentalizedSBase#getCompartment() */ Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GeneralGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GeneralGlyph.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GeneralGlyph.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -75,6 +75,7 @@ */ public GeneralGlyph() { super(); + initDefaults(); } /** @@ -84,6 +85,7 @@ */ public GeneralGlyph(int level, int version) { super(level, version); + initDefaults(); } /** @@ -110,6 +112,7 @@ */ public GeneralGlyph(String id) { super(id); + initDefaults(); } /** @@ -120,8 +123,16 @@ */ public GeneralGlyph(String id, int level, int version) { super(id, level, version); + initDefaults(); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + } /** * Returns {@code true}, if listOfSubGlyphs contains at least one element. Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -71,6 +71,7 @@ */ public ReactionGlyph() { super(); + initDefaults(); } /** @@ -80,6 +81,7 @@ */ public ReactionGlyph(int level, int version) { super(level, version); + initDefaults(); } /** @@ -103,6 +105,7 @@ */ public ReactionGlyph(String id) { super(id); + initDefaults(); } /** @@ -113,7 +116,16 @@ */ public ReactionGlyph(String id, int level, int version) { super(id, level, version); + initDefaults(); } + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + } /** * Appends the specified element to the end of the Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -71,6 +71,7 @@ */ public ReferenceGlyph() { super(); + initDefaults(); } /** @@ -80,6 +81,7 @@ */ public ReferenceGlyph(int level, int version) { super(level, version); + initDefaults(); } /** @@ -105,6 +107,7 @@ */ public ReferenceGlyph(String id) { super(id); + initDefaults(); } /** @@ -115,8 +118,17 @@ */ public ReferenceGlyph(String id, int level, int version) { super(id, level, version); + initDefaults(); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + } + /* (non-Javadoc) * @see org.sbml.jsbml.ext.layout.GraphicalObject#clone() */ Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesGlyph.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesGlyph.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -51,6 +51,7 @@ */ public SpeciesGlyph() { super(); + initDefaults(); } /** @@ -60,6 +61,7 @@ */ public SpeciesGlyph(int level, int version) { super(level, version); + initDefaults(); } /** @@ -68,6 +70,7 @@ */ public SpeciesGlyph(SpeciesGlyph speciesGlyph) { super(speciesGlyph); + initDefaults(); } /** @@ -76,6 +79,7 @@ */ public SpeciesGlyph(String id) { super(id); + initDefaults(); } /** @@ -86,6 +90,7 @@ */ public SpeciesGlyph(String id, int level, int version) { super(id, level, version); + initDefaults(); } /* (non-Javadoc) @@ -97,6 +102,14 @@ } /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + } + + /** * * @return */ Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -70,6 +70,7 @@ */ public SpeciesReferenceGlyph() { super(); + initDefaults(); } /** @@ -79,6 +80,7 @@ */ public SpeciesReferenceGlyph(int level, int version) { super(level, version); + initDefaults(); } /** @@ -96,6 +98,7 @@ if (speciesReferenceGlyph.isSetSpeciesGlyph()) { setSpeciesGlyph(new String(speciesReferenceGlyph.getSpeciesGlyph())); } + initDefaults(); } /** @@ -104,6 +107,7 @@ */ public SpeciesReferenceGlyph(String id) { super(id); + initDefaults(); } /** @@ -114,6 +118,7 @@ */ public SpeciesReferenceGlyph(String id, int level, int version) { super(id, level, version); + initDefaults(); } /* (non-Javadoc) @@ -125,6 +130,14 @@ } /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + } + + /** * * @return */ Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/TextGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/TextGlyph.java 2015-12-03 16:40:35 UTC (rev 2431) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/TextGlyph.java 2015-12-03 17:04:05 UTC (rev 2432) @@ -60,7 +60,7 @@ */ public TextGlyph() { super(); - setNamespace(LayoutConstants.namespaceURI); + initDefaults(); } /** @@ -70,7 +70,7 @@ */ public TextGlyph(int level, int version) { super(level, version); - setNamespace(LayoutConstants.namespaceURI); + initDefaults(); } /** @@ -79,7 +79,7 @@ */ public TextGlyph(String id) { super(id); - setNamespace(LayoutConstants.namespaceURI); + initDefaults(); } /** @@ -90,7 +90,7 @@ */ public TextGlyph(String id, int level, int version) { super(id, level, version); - setNamespace(LayoutConstants.namespaceURI); + initDefaults(); } /** @@ -115,6 +115,14 @@ return new TextGlyph(this); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + } + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractNamedSBase#equals(java.lang.Object) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |