You can subscribe to this list here.
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(27) |
Jun
(63) |
Jul
(17) |
Aug
(58) |
Sep
(7) |
Oct
(9) |
Nov
(3) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2013 |
Jan
(16) |
Feb
(5) |
Mar
(8) |
Apr
(3) |
May
(9) |
Jun
(7) |
Jul
(11) |
Aug
(1) |
Sep
(5) |
Oct
(33) |
Nov
(21) |
Dec
(32) |
2014 |
Jan
(8) |
Feb
(43) |
Mar
(36) |
Apr
(22) |
May
(69) |
Jun
(76) |
Jul
(66) |
Aug
(53) |
Sep
(39) |
Oct
(62) |
Nov
(28) |
Dec
(16) |
2015 |
Jan
(7) |
Feb
(2) |
Mar
(51) |
Apr
(97) |
May
(58) |
Jun
(20) |
Jul
(8) |
Aug
(5) |
Sep
(5) |
Oct
(27) |
Nov
(28) |
Dec
(43) |
2016 |
Jan
(17) |
Feb
(4) |
Mar
(12) |
Apr
(5) |
May
(15) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ko...@us...> - 2015-04-20 14:09:02
|
Revision: 2188 http://sourceforge.net/p/jsbml/code/2188 Author: kofiav Date: 2015-04-20 14:08:25 +0000 (Mon, 20 Apr 2015) Log Message: ----------- Added new branch Added Paths: ----------- branches/astnode2-merging-alternate/ branches/astnode2-merging-alternate/AUTHORS.txt branches/astnode2-merging-alternate/FUNDING.txt branches/astnode2-merging-alternate/LICENSE.txt branches/astnode2-merging-alternate/NEWS.txt branches/astnode2-merging-alternate/README.txt branches/astnode2-merging-alternate/bin/ branches/astnode2-merging-alternate/bin/META-INF/ branches/astnode2-merging-alternate/bin/META-INF/services/ branches/astnode2-merging-alternate/bin/META-INF/services/org.sbml.jsbml.xml.parsers.ReadingParser branches/astnode2-merging-alternate/bin/application-icon/ branches/astnode2-merging-alternate/bin/application-icon/README.txt branches/astnode2-merging-alternate/bin/application-icon/SBML-Bar-Graph-application-icon-MacOSX.icns branches/astnode2-merging-alternate/bin/application-icon/SBML-Bar-Graph-application-icon-Windows.ico branches/astnode2-merging-alternate/bin/application-icon/original-artwork/ branches/astnode2-merging-alternate/bin/application-icon/original-artwork/sbml-bar-graph-application-icon.ai branches/astnode2-merging-alternate/bin/application-icon/original-artwork/sbml-bar-graph-application-icon.psd branches/astnode2-merging-alternate/bin/application-icon/original-artwork/sbml-sb-only.psd branches/astnode2-merging-alternate/bin/application-icon/sbml-bar-graph-application-icon-128x128.png branches/astnode2-merging-alternate/bin/application-icon/sbml-bar-graph-application-icon-256x256.png branches/astnode2-merging-alternate/bin/application-icon/sbml-bar-graph-application-icon-32x32.png branches/astnode2-merging-alternate/bin/application-icon/sbml-bar-graph-application-icon-48x48.png branches/astnode2-merging-alternate/bin/application-icon/sbml-bar-graph-application-icon-512x512.png branches/astnode2-merging-alternate/bin/application-icon/sbml-bar-graph-application-icon-64x64.png branches/astnode2-merging-alternate/bin/application-icon/sbml-sb-only-16x16.png branches/astnode2-merging-alternate/bin/application-icon/sbml-sb-only-24x24.png branches/astnode2-merging-alternate/bin/javax/ branches/astnode2-merging-alternate/bin/javax/swing/ branches/astnode2-merging-alternate/bin/javax/swing/tree/ branches/astnode2-merging-alternate/bin/javax/swing/tree/TreeNode.class branches/astnode2-merging-alternate/bin/log4j.properties branches/astnode2-merging-alternate/bin/org/ branches/astnode2-merging-alternate/bin/org/sbml/ branches/astnode2-merging-alternate/bin/org/sbml/bargraph/ branches/astnode2-merging-alternate/bin/org/sbml/bargraph/AboutPane$1.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/AboutPane$2.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/AboutPane$3.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/AboutPane.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/Config.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/Dialog.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/Log.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/LogFormatter.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/Main.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/MainWindow$1.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/MainWindow$2.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/MainWindow$3.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/MainWindow$4.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/MainWindow.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/OSXAdapter$1.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/OSXAdapter.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/SBMLStats.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/VerifiableFile.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/Version.class branches/astnode2-merging-alternate/bin/org/sbml/bargraph/resources/ branches/astnode2-merging-alternate/bin/org/sbml/bargraph/resources/icons/ branches/astnode2-merging-alternate/bin/org/sbml/bargraph/resources/icons/SBML.png branches/astnode2-merging-alternate/bin/org/sbml/bargraph/resources/icons/Thumbs.db branches/astnode2-merging-alternate/bin/org/sbml/bargraph/resources/icons/error.png branches/astnode2-merging-alternate/bin/org/sbml/bargraph/resources/icons/question.png branches/astnode2-merging-alternate/bin/org/sbml/bargraph/resources/icons/sbml-bar-graph-icon.png branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ASTNode$Type.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ASTNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ASTNode.java.mine branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ASTNode.java.r2147 branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ASTNode.java.r2184 branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AbstractMathContainer.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AbstractNamedSBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AbstractNamedSBaseWithUnit.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AbstractSBase$NOTES_TYPE.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AbstractSBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AbstractTreeNode$1.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AbstractTreeNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AlgebraicRule.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Annotation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AnnotationElement.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Assignment.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/AssignmentRule.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/CVTerm$Qualifier.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/CVTerm$Type.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/CVTerm.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/CallableSBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Compartment.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/CompartmentType.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Constraint.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Creator.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Delay.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Event.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/EventAssignment.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ExplicitRule.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/FunctionDefinition.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/History.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/IdentifierException.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/InitialAssignment.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/JSBML.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/KineticLaw.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/LevelVersionError.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ListOf$Type.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ListOf.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/LocalParameter.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/MathContainer.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Model.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ModifierSpeciesReference.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/NamedSBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/NamedSBaseWithDerivedUnit.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Parameter.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Priority.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/PropertyException.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/PropertyNotAvailableException.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/PropertyUndefinedError.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Quantity.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/QuantityWithUnit.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/RateRule.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Reaction.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Rule.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLDocument.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLError$SEVERITY.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLError.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLErrorLog.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLException$Category.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLException$Code.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLException$Type.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLException.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLInputConverter.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLOutputConverter.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLReader.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLTypeUndefinedException.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBMLWriter.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBO.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBaseWithDerivedUnit.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SBaseWithUnit.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SimpleSpeciesReference.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Species.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SpeciesReference.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/SpeciesType.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/StoichiometryMath.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Symbol.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Trigger.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/UniqueNamedSBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Unit$Kind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Unit.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/UnitDefinition.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/Variable.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/AbstractSBasePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/SBasePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/ArraysConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/ArraysSBasePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/Dimension.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/Index.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/compiler/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/compiler/ArraysCompiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/compiler/StaticallyComputableCompiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/compiler/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/flattening/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/flattening/ArraysFlattening.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/flattening/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/test/ArrayExtensionTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/test/ArraysJUnitTests.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/test/ArraysValidationTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/test/ArraysWriteTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/test/CompilerTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/test/FlatteningTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/test/MathTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/test/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/util/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/util/ArraysMath.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/util/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/ArraysMathValidator.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/ArraysValidator.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/DimensionValidator.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/ExtendedSBaseValidator.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/IndexValidator.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysConstraint.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysMathCheck.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionArrayDimCheck.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionIDCheck.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionSizeCheck.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/IndexArrayDimCheck.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/IndexAttributesCheck.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/SBaseWithDimensionCheck.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/constraints/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/arrays/validator/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/AbstractNamedSBaseRef.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/CompConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/CompModelPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/CompSBMLDocumentPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/CompSBasePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/Deletion.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/ExternalModelDefinition.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/ModelDefinition.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/Port.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/ReplacedBy.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/ReplacedElement.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/SBaseRef.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/Submodel.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/comp/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/CBO.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/CBO_OBO.obo branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/DynConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/DynElement.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/DynEventPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/DynSBasePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/Messages.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/SpatialComponent.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/SpatialKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/dyn/test/TestL3Dyn.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/AbstractFBCSBasePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/And.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/Association.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/FBCConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/FBCList.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/FBCModelPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/FBCReactionPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/FluxBound$Operation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/FluxBound.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/FluxObjective.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/GeneProduct.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/GeneProductRef.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/GeneProteinAssociation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/ListOfObjectives.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/LogicalOperator.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/Objective$Type.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/Objective.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/Or.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/test/FBCWritingTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/fbc/test/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/Group.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/GroupKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/GroupsConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/GroupsModelPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/ListOfMemberConstraint.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/Member.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/MemberConstraint.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/groups/test/TestL3groups.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/BoundingBox.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/CompartmentGlyph.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/CubicBezier.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/Curve.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/CurveSegment$Type.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/CurveSegment.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/Dimensions.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/GeneralGlyph.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/GraphicalObject.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/Layout.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/LayoutConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/LayoutModelPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/LineSegment.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/NamedSBaseReferenceFilter.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/Point.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/ReactionGlyph.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/ReferenceGlyph.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/SpeciesGlyph.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/SpeciesReferenceRole.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/TextGlyph.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/test/LayoutExtentionTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/test/LayoutJUnitTests.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/test/LayoutTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/test/SpeciesReferenceGlyphTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/test/TestL3Layout.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/test/TestSpeciesReferenceGlyphCurve.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/layout/test/TextGlyphTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/BindingStatus.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/CompartmentReference.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/DenotedSpeciesTypeComponentIndex.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/InSpeciesTypeBond.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/MultiConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/MultiModelPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/MultiSimpleSpeciesReferencePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/OutwardBindingSite.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/PossibleSpeciesFeatureValue.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/SpeciesFeature.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/SpeciesFeatureChange.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/SpeciesFeatureType.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/SpeciesFeatureValue.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/SpeciesType.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/SpeciesTypeComponentIndex.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/SpeciesTypeComponentMapInProduct.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/SpeciesTypeInstance.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/multi/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/FunctionTerm.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/Input.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/InputTransitionEffect.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/Output.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/OutputTransitionEffect.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/QualConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/QualList.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/QualModelPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/QualitativeModel.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/QualitativeSpecies.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/Sign.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/Transition.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/test/BuildToyModelTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/qual/test/QualExample.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/AbstractRenderPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/ColorDefinition.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/Ellipse.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/FontFamily.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/FontRenderStyle.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/GlobalRenderInformation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/GradientBase$Spread.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/GradientBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/GradientStop.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/GraphicalPrimitive1D.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/GraphicalPrimitive2D$FillRule.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/GraphicalPrimitive2D.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/Image.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/LineEnding.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/LinearGradient.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/LocalRenderInformation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/LocalStyle.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/Point3D.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/Polygon.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/RadialGradient.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/Rectangle.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/RenderConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/RenderCubicBezier.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/RenderCurve.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/RenderGroup.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/RenderInformationBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/RenderLayoutPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/RenderListOfLayoutsPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/RenderPoint.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/Style.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/Text.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/TextAnchor.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/Transformation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/Transformation2D.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/VTextAnchor.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/XMLTools.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/ColorDefinitionTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/CurveTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/EllipseTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/GraphicalPrimitive1DTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/GraphicalPrimitive2DTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/GroupTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/ImageTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/LinearGradientTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/PolygonTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/RectangleTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/RenderCubicBezierTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/RenderJUnitTests.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/RenderWriteTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/render/test/TextTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/req/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/req/ChangedMath.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/req/ReqConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/req/ReqSBasePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/AdjacentDomains.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/AnalyticGeometry.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/AnalyticVolume$FunctionKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/AnalyticVolume.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/Boundary.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/BoundaryCondition$BoundaryKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/BoundaryCondition.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGHomogeneousTransformation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGObject.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGPrimitive$PrimitiveKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGPrimitive.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGPseudoPrimitive.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGRotation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGScale.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGSetOperator$SetOperation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGSetOperator.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGTransformation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGTranslation.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CSGeometry.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CompartmentMapping.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CoordinateComponent.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CoordinateKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/CoordinateReference.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/DiffusionCoefficient$DiffusionKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/Domain.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/DomainType.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/Geometry$GeometryKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/Geometry.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/GeometryDefinition.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/ImageData.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/InteriorPoint.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/Messages.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/MixedGeometry.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/OrdinalMapping.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/ParameterType.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/ParametricGeometry.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/ParametricObject$PolygonKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/ParametricObject.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/PolygonObject.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SampledField$CompressionKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SampledField$DataKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SampledField$InterpolationKind.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SampledField.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SampledVolume.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialCompartmentPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialNamedSBase.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialParameterPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialPoint.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialSpeciesPlugin.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialSymbolReference.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/SpatialTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/TransformationComponent.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ext/spatial/test/SpatialTestModelWriter.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/gui/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/gui/JSBMLvisualizer.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/gui/JTreeOfSBML.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/gui/SBMLFileFilter.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/gui/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTArithmeticOperatorNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTBinaryFunctionNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTBoolean.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCSymbolAvogadroNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCSymbolBaseNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCSymbolDelayNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCSymbolNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCSymbolTimeNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCiFunctionNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCiNumberNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCnExponentialNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCnIntegerNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCnNumberNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCnRationalNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTCnRealNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTConstantNumber.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTDivideNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTFactory.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTFunction.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTHyperbolicNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTLambdaFunctionNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTLogarithmNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTLogicalOperatorNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTMinusNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTNode2.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTNumber.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTPiecewiseFunctionNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTPlusNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTPowerNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTQualifierNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTRelationalOperatorNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTRootNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTTimesNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTTrigonometricNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTUnaryFunctionNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/ASTUnknown.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/AbstractASTNode.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/ASTNode2Compiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/ASTNode2Value.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/FindUnitsCompiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/FormulaCompiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/HTMLFormula.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/LaTeXCompiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/LibSBMLFormulaCompiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/MathMLXMLStreamCompiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/UnitException.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/UnitsCompiler.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/NaN.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/abs.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/and.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/apply.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arccos.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arccosh.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arccsc.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arccsch.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arcsec.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arcsech.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arcsin.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arcsinh.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arctan.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/arctanh.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/boolean-false.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/boolean-true.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/ceil.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/ci-number.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/cos.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/cosh.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/csc.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/csch.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/csymbol-avogadro.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/csymbol-delay.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/csymbol-time.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/divide.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/e.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/eq.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/exp.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/exponential.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/factorial.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/floor.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/geq.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/gt.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/infinity.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/integer.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/lambda.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/leq.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/ln.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/log.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/lt.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/minus-infinity.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/minus.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/neq.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/not.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/or.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/pi.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/piecewise.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/plus.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/power.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/rational.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/real.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/root.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/sec.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/sech.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/sin.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/sinh.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/tan.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/tanh.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/times.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/compiler/resources/xor.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParser$JJCalls.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParser$LookaheadSuccess.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParser.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParser.jj branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserASTNode2$JJCalls.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserASTNode2$LookaheadSuccess.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserASTNode2.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserASTNode2.jj branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserASTNode2Constants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserASTNode2TokenManager.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserConstants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3$JJCalls.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3$LookaheadSuccess.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3.jj branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3ASTNode2$JJCalls.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3ASTNode2$LookaheadSuccess.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3ASTNode2.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3ASTNode2.jj branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3ASTNode2Constants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3ASTNode2TokenManager.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3Constants.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserLL3TokenManager.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/FormulaParserTokenManager.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/IFormulaParser.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/ParseException.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/SimpleCharStream.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/Token.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/TokenMgrError.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/parser/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTArithmeticOperatorNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTBinaryFunctionNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTBooleanTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCSymbolAvogadroNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCSymbolDelayNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCSymbolTimeNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCiFunctionNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCiNumberNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCnExponentialNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCnIntegerNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCnNumberNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCnRationalNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTCnRealNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTConstantNumberTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTDivideNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTFactoryTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTFunctionTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTHyperbolicNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTLambdaFunctionTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTLogarithmNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTLogicalOperatorNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTMinusNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTNodeFormulaToStringTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTPiecewiseFunctionNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTPlusNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTPowerNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTQualifierNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTRelationalOperatorNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTRootNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTTimesNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTTrigonometricNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/ASTUnaryFunctionNodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/RecursionTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/TestInfixOperatorPrecedence.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/math/test/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ontology/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ontology/Term.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/ontology/Triple.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/Resource.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/ASTNodeTokens.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/Alias2SBO.cfg branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/HTML_CharEncodingTable.txt branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/Messages.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/SBMLCoreElements.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/SBMLElementsLevel1Version1.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/SBMLLayoutElements.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/SBO_OBO.obo branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/cfg/annotationParsers.xml branches/astnode2-merging-alternate/bin/org/sbml/jsbml/resources/package-info.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/ branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/AddNamespace.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/AllTests.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/AllTests.java.mine branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/AllTests.java.r2147 branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/AllTests.java.r2184 branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/CharsetTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/DisablePackageTests.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/EventTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/FilterTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/FormulaTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/HashCodeTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/IdRegistrationTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/ListTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/ListenerTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/MathMLSpecialTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/MathMLTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/PackageVersionTests.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/PerformanceTest$1.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/PerformanceTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/PerformanceTestPureStax$1.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/PerformanceTestPureStax.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/PriorityTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/RemoveFromModelTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/RemoveFromParentTest.class branches/astnode2-merging-alternate/bin/org/sbml/jsbml/test/SBMLWriterTest.class branches/astnode2-merging-alter... [truncated message content] |
From: <and...@us...> - 2015-04-20 12:48:25
|
Revision: 2187 http://sourceforge.net/p/jsbml/code/2187 Author: andreas-draeger Date: 2015-04-20 12:48:23 +0000 (Mon, 20 Apr 2015) Log Message: ----------- Improved localization support for arrays validation check. Modified Paths: -------------- trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysMathCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionArrayDimCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionIDCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionSizeCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexArrayDimCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexAttributesCheck.java Property Changed: ---------------- trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml Modified: trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml =================================================================== --- trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml 2015-04-20 11:37:47 UTC (rev 2186) +++ trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml 2015-04-20 12:48:23 UTC (rev 2187) @@ -2,8 +2,8 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment> - $Id: Messages.xml 2109 2015-01-05 04:50:45Z andreas-draeger $ - $URL: https://svn.code.sf.net/p/jsbml/code/trunk/extensions/spatial/resources/org/sbml/jsbml/ext/spatial/Messages.xml $ + $Id$ + $URL$ ---------------------------------------------------------------------------- This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. @@ -26,10 +26,29 @@ A collection of text messages to be presented to uses upon certain events. Author: Andreas Dräger - Version: $Rev: 2109 $ + Version: $Rev$ Since: 1.1 </comment> + <entry key="ArraysMathCheck.logMathVectorIrregular">For MathML operations with two or more operands involving MathML vectors or SBase objects with a list of Dimension objects, the number of dimensions and their size must agree for all operands unless the operand is a scalar type (i.e., it does not have a list of Dimension 31 objects). (Reference: SBML Level 3 Package Specification for" Arrays, Version 1, Section 3.5 on page 10.)</entry> + <entry key="ArraysMathCheck.logSelectorInconsistency">The first argument of a MathML selector must be a MathML vector object or a valid identifier to an SBase object extended with a list of Dimension objects. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.5 on page 10.)</entry> + + <entry key="DimensionArrayDimCheck.logArrayDimensionUniqueness">The ListOfDimensions associated with an SBase object must not have multiple Dimension objects with the same arrays:arrayDimension attribute. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.3 on page 6.)</entry> + <entry key="DimensionArrayDimCheck.logArrayDimensionMissing">The ListOfDimensions associated with an SBase object must have a Dimension object with arrays:arrayDimension attribute set to 0 before adding a Dimension object with arrays:arrayDimension attribute set to 1. Similarly, the ListOfDimensions in an SBase object must have Dimension objects, where one of them has arrays:arrayDimension attribute set to 0 and the other set to 1 before adding a Dimension object with arrays:arrayDimension attribute set to 2. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.3 on page 6.)</entry> + + <entry key="DimensionSizeCheck.logMissingDimensionAttribute">A Dimension object must have a value for the attributes arrays:arrayDimension and arrays:size, and may additionally have the attributes arrays:id and arrays:name. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.3 on page 6.)</entry> + <entry key="DimensionSizeCheck.logDimensionSizeInvalid">The value of the arrays:size attribute, if set on a given Dimension object, must be a valid SIdRef to an object of type Parameter. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.3 on page 6.)</entry> + <entry key="DimensionSizeCheck.logDimensionSizeValueInconsistency">The value of the Parameter referenced by the arrays:size attribute must be a non-negative scalar constant integer. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.3 on page 6.)</entry> + + <entry key="IndexArrayDimCheck.logArrayDimensionUniqueness">The ListOfIndices associated with an SBase object must not have multiple Index objects with the same arrays:arrayDimension attribute. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.3 on page 6.)</entry> + <entry key="IndexArrayDimCheck.logArrayDimensionMissing">The ListOfIndices associated with an SBase object must have a Index object with arrays:arrayDimension attribute set to 0 before adding a Index object with arrays:arrayDimension attribute set to 1. Similarly, the ListOfIndices in an SBase object must have Index objects, where one of them has arrays:arrayDimension attribute set to 0 and the other set to 1 before adding a Index object with arrays:arrayDimension attribute set to 2. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.3 on page 6.)</entry> + + <entry key="IndexAttributesCheck.logDimensionMismatch">The object referenced by the SIdRef indicated by the arrays:referencedAttribute attribute must include an arrays:arrayDimension matching the arrays:arrayDimension for the Index. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.4 on 37 page 8.)</entry> + <entry key="IndexAttributesCheck.logNotBounded">For each possible value of each Dimension id (i.e., 0 to size-1 of the Dimension referred to) that appears in the MathML math element, there should be no array out-of-bounds problems. Namely, it must evaluate to a non-negative integer that is less than the size of the corresponding Dimension for the object being indexed.</entry> + <entry key="IndexAttributesCheck.logNotStaticComp">The MathML math element in an Index object must be statically computable. In other words, any identifier that appears in the math element, other than a Dimension id for the object with this Index , must be a constant. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.4 on page 8.)</entry> + <entry key="IndexAttributesCheck.logIndexMissingAttribute">An Index object must have a value for the attributes arrays:arrayDimension, and arrays:referencedAttribute . (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.4 on page 8.)</entry> + <entry key="IndexAttributesCheck.logInvalidRefAttribute">The value of the arrays:referencedAttribute attribute, if set on a given Index object, must be an existing attribute of type SIdRef with a value that references a valid SId. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.4 on page 8.)</entry> + <entry key="SBaseWithDimensionCheck.check">The object {0} cannot have a listOfDimensions.</entry> <entry key="SBaseWithDimensionCheck.logDimensionError">In SBML Level~3 Core, Models, FunctionDefinitions, Units, UnitDefinitions, KineticLaws, LocalParameters, Triggers, Priorities, and Delays are not permitted to have a ListOfDimensions. (Reference: SBML Level 3 11 Package Specification for Arrays, Version 1, Section 3.3 on page 7.)</entry> Property changes on: trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id URL Rev \ No newline at end of property Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysMathCheck.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysMathCheck.java 2015-04-20 11:37:47 UTC (rev 2186) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysMathCheck.java 2015-04-20 12:48:23 UTC (rev 2187) @@ -22,8 +22,10 @@ */ package org.sbml.jsbml.ext.arrays.validator.constraints; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; +import java.util.ResourceBundle; import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.MathContainer; @@ -32,6 +34,7 @@ import org.sbml.jsbml.ext.arrays.ArraysConstants; import org.sbml.jsbml.ext.arrays.ArraysSBasePlugin; import org.sbml.jsbml.ext.arrays.util.ArraysMath; +import org.sbml.jsbml.util.ResourceManager; /** * @author Leandro Watanabe @@ -39,8 +42,13 @@ * @since 1.0 * @date Jun 29, 2014 */ -public class ArraysMathCheck extends ArraysConstraint{ +public class ArraysMathCheck extends ArraysConstraint { + /** + * Localization support. + */ + private static final transient ResourceBundle bundle = ResourceManager.getBundle("org.sbml.jsbml.ext.arrays.validator.constraints.Messages"); + //TODO: get right messages /** * @@ -61,24 +69,24 @@ */ @Override public void check() { - if (model == null || mathContainer == null || !mathContainer.isSetMath()) { + if ((model == null) || (mathContainer == null) || !mathContainer.isSetMath()) { return; } -// if (!ArraysMath.isVectorBalanced(model, mathContainer)) { -// String shortMsg = "Vectors should not be ragged."; -// logVectorInconsistency(shortMsg); -// return; -// } -// if (!ArraysMath.checkVectorMath(model, mathContainer)) { -// String shortMsg = "If vectors appears in mathematical operations, then the vector dimensions should match in" -// + " size unless it is a scalar." + mathContainer.toString() + " has invalid vector operation."; -// logMathVectorIrregular(shortMsg); -// } -// if (!ArraysMath.checkVectorAssignment(model, mathContainer)) { -// String shortMsg = "When there is an assignment, then it must the the case that the left-hand matches the" -// + " right-hand size in dimension sizes but " + mathContainer.toString() + " doesn't."; -// logMathVectorIrregular(shortMsg); -// } + // if (!ArraysMath.isVectorBalanced(model, mathContainer)) { + // String shortMsg = "Vectors should not be ragged."; + // logVectorInconsistency(shortMsg); + // return; + // } + // if (!ArraysMath.checkVectorMath(model, mathContainer)) { + // String shortMsg = "If vectors appears in mathematical operations, then the vector dimensions should match in" + // + " size unless it is a scalar." + mathContainer.toString() + " has invalid vector operation."; + // logMathVectorIrregular(shortMsg); + // } + // if (!ArraysMath.checkVectorAssignment(model, mathContainer)) { + // String shortMsg = "When there is an assignment, then it must the the case that the left-hand matches the" + // + " right-hand size in dimension sizes but " + mathContainer.toString() + " doesn't."; + // logMathVectorIrregular(shortMsg); + // } List<ASTNode> selectorNodes = getSelectorNodes(mathContainer); for (ASTNode selectorNode : selectorNodes) { @@ -104,8 +112,7 @@ if (sbase == null) { - String shortMsg = "The first argument of " + - math.toString() + " does not have a valid SIdRef."; + String shortMsg = MessageFormat.format("The first argument of {0} does not have a valid SIdRef.", math.toString()); logSelectorInconsistency(shortMsg); return; } @@ -114,8 +121,7 @@ if (arraysSBasePlugin.getDimensionCount() < math.getChildCount()-1) { - String shortMsg = "Selector number of arguments of " + - math.toString() + " is inconsistency ."; + String shortMsg = MessageFormat.format("Selector number of arguments of {0} is inconsistency .", math.toString()); logSelectorInconsistency(shortMsg); } @@ -124,16 +130,14 @@ } else if (!obj.isVector()) { - String shortMsg = "The first argument of a selector object should be a vector or an arrayed object and " + - math.toString() + " violates this condition."; + String shortMsg = MessageFormat.format("The first argument of a selector object should be a vector or an arrayed object and {0} violates this condition.", math.toString()); logSelectorInconsistency(shortMsg); } boolean isStaticComp = ArraysMath.isStaticallyComputable(model, mathContainer); if (!isStaticComp) { - String shortMsg = "Selector arguments other than first should either be dimensions id or constant but " + - math.toString() + " violates this condition."; + String shortMsg = MessageFormat.format("Selector arguments other than first should either be dimensions id or constant but {0} violates this condition.", math.toString()); logSelectorInconsistency(shortMsg); return; } @@ -141,8 +145,7 @@ boolean isBounded = ArraysMath.evaluateSelectorBounds(model, mathContainer); if (!isBounded) { - String shortMsg = "Selector arguments other than first should not go out of bounds but " + - math.toString() + " violates this condition."; + String shortMsg = MessageFormat.format("Selector arguments other than first should not go out of bounds but {0} violates this condition.", math.toString()); logSelectorInconsistency(shortMsg); } @@ -185,13 +188,9 @@ private void logMathVectorIrregular(String shortMsg) { int code = 10211, severity = 0, category = 0, line = 0, column = 0; - String pkg = "arrays"; - String msg = "For MathML operations with two or more operands involving MathML vectors or SBase objects with a list of Dimension"+ - "objects, the number of dimensions and their size must agree for all operands unless the operand is a scalar type"+ - "(i.e., it does not have a list of Dimension 31 objects). (Reference: SBML Level 3 Package Specification for"+ - "Arrays, Version 1, Section 3.5 on page 10.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("ArraysMathCheck.logMathVectorIrregular"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -204,11 +203,10 @@ private void logSelectorInconsistency(String shortMsg) { int code = 10207, severity = 0, category = 0, line = 0, column = 0; - String pkg = "arrays"; - String msg = "The first argument of a MathML selector must be a MathML vector object or a valid identifier" + - "to an SBase object extended with a list of Dimension objects. (Reference: SBML Level 3 Package" + - "Specification for Arrays, Version 1, Section 3.5 on page 10.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("ArraysMathCheck.logSelectorInconsistency"); logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } + } Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionArrayDimCheck.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionArrayDimCheck.java 2015-04-20 11:37:47 UTC (rev 2186) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionArrayDimCheck.java 2015-04-20 12:48:23 UTC (rev 2187) @@ -22,11 +22,15 @@ */ package org.sbml.jsbml.ext.arrays.validator.constraints; +import java.text.MessageFormat; +import java.util.ResourceBundle; + import org.sbml.jsbml.Model; import org.sbml.jsbml.SBase; import org.sbml.jsbml.ext.arrays.ArraysConstants; import org.sbml.jsbml.ext.arrays.ArraysSBasePlugin; import org.sbml.jsbml.ext.arrays.Dimension; +import org.sbml.jsbml.util.ResourceManager; /** * This checks if the {@link Dimension} objects of a given {@link SBase} have valid array dimension. @@ -39,6 +43,11 @@ public class DimensionArrayDimCheck extends ArraysConstraint { /** + * Localization support. + */ + private static final transient ResourceBundle bundle = ResourceManager.getBundle("org.sbml.jsbml.ext.arrays.validator.constraints.Messages"); + + /** * */ private final SBase sbase; @@ -60,7 +69,7 @@ @Override public void check() { - if (model == null || sbase == null) { + if ((model == null) || (sbase == null)) { return; } @@ -91,17 +100,14 @@ } else { - String shortMsg = "A listOfDimensions should have Dimension objects with" - + " unique attribute arrays:arrayDimension, but the value " + arrayDim + - " is used multiple times."; + String shortMsg = MessageFormat.format("A listOfDimensions should have Dimension objects with unique attribute arrays:arrayDimension, but the value {0,number,integer} is used multiple times.", arrayDim); logArrayDimensionUniqueness(shortMsg); } } for (int i = 0; i <= max; i++) { if (!isSetArrayDimAt[i]) { - String shortMsg = "A listOfDimensions should have a Dimension with arrays:arrayDimension " - + i + "before adding a Dimension object with arrays:arrayDimension " + max; + String shortMsg = MessageFormat.format("A listOfDimensions should have a Dimension with arrays:arrayDimension {0,number,integer} before adding a Dimension object with arrays:arrayDimension {1,number,integer}", i, max); logArrayDimensionMissing(shortMsg); return; } @@ -117,12 +123,9 @@ private void logArrayDimensionUniqueness(String shortMsg) { int code = 20104, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "The ListOfDimensions associated with an SBase object must not have multiple Dimension"+ - "objects with the same arrays:arrayDimension attribute. (Reference: SBML Level 3 Package"+ - "Specification for Arrays, Version 1, Section 3.3 on page 6.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("DimensionArrayDimCheck.logArrayDimensionUniqueness"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -136,16 +139,9 @@ private void logArrayDimensionMissing(String shortMsg) { int code = 20103, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "The ListOfDimensions associated with an SBase object must have a Dimension object"+ - "with arrays:arrayDimension attribute set to 0 before adding a Dimension object with"+ - "arrays:arrayDimension attribute set to 1. Similarly, the ListOfDimensions in an SBase"+ - "object must have Dimension objects, where one of them has arrays:arrayDimension attribute"+ - "set to 0 and the other set to 1 before adding a Dimension object with arrays:arrayDimension"+ - "attribute set to 2. (Reference: SBML Level 3 Package Specification for Arrays, Version 1,"+ - "Section 3.3 on page 6.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("DimensionArrayDimCheck.logArrayDimensionMissing"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionIDCheck.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionIDCheck.java 2015-04-20 11:37:47 UTC (rev 2186) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionIDCheck.java 2015-04-20 12:48:23 UTC (rev 2187) @@ -37,8 +37,7 @@ * @since 1.0 * @date Dec 29, 2014 */ -public class DimensionIDCheck extends ArraysConstraint -{ +public class DimensionIDCheck extends ArraysConstraint { /** * @@ -101,7 +100,7 @@ private void logDuplicatedDimensionId(String shortMsg) { int code = 20103, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; + String pkg = ArraysConstants.packageName; String msg = ""; logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionSizeCheck.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionSizeCheck.java 2015-04-20 11:37:47 UTC (rev 2186) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionSizeCheck.java 2015-04-20 12:48:23 UTC (rev 2187) @@ -22,11 +22,15 @@ */ package org.sbml.jsbml.ext.arrays.validator.constraints; +import java.text.MessageFormat; +import java.util.ResourceBundle; + import org.sbml.jsbml.Model; import org.sbml.jsbml.Parameter; import org.sbml.jsbml.ext.arrays.ArraysConstants; import org.sbml.jsbml.ext.arrays.ArraysSBasePlugin; import org.sbml.jsbml.ext.arrays.Dimension; +import org.sbml.jsbml.util.ResourceManager; /** * Checks if the given {@link Dimension} object has size that is both @@ -37,9 +41,14 @@ * @since 1.0 * @date Jun 10, 2014 */ -public class DimensionSizeCheck extends ArraysConstraint{ +public class DimensionSizeCheck extends ArraysConstraint { /** + * Localization support. + */ + private static final transient ResourceBundle bundle = ResourceManager.getBundle("org.sbml.jsbml.ext.arrays.validator.constraints.Messages"); + + /** * */ private final Dimension dim; @@ -66,8 +75,7 @@ } if (!dim.isSetSize()) { - String shortMsg = "Dimension objects shoud have a value for the attribute arrays:size but " - + dim.toString() + "does not have one."; + String shortMsg = MessageFormat.format("Dimension objects shoud have a value for the attribute arrays:size but {0} does not have one.", dim.toString()); logMissingDimensionAttribute(shortMsg); } else { @@ -87,29 +95,25 @@ Parameter param = model.getParameter(id); if (param == null) { - String shortMsg = "The attribute arrays:size of a Dimension object should point to an existing parameter " - + "but " + dim.toString() + "points to a non-existing parameter"; + String shortMsg = MessageFormat.format("The attribute arrays:size of a Dimension object should point to an existing parameter but {0} points to a non-existing parameter", dim.toString()); logDimensionSizeInvalid(shortMsg); return; } if (!param.isConstant()) { - String shortMsg = "The attribute arrays:size of a Dimension object should point to a constant parameter but " - + dim.toString() + "has a non-constant value."; + String shortMsg = MessageFormat.format("The attribute arrays:size of a Dimension object should point to a constant parameter but {0} has a non-constant value.", dim.toString()); logDimensionSizeValueInconsistency(shortMsg); } // Test if it is an integer if (param.getValue() % 1 != 0) { - String shortMsg = "The attribute arrays:size of a Dimension object should point to a parameter containing" - + "an integer value."; + String shortMsg = "The attribute arrays:size of a Dimension object should point to a parameter containing an integer value."; logDimensionSizeValueInconsistency(shortMsg); } if (param.getValue() < 0) { - String shortMsg = "The attribute arrays:size of a Dimension object should point to a parameter that has a non-negative" - + "integer value but " + dim.toString() + "has a negative value."; + String shortMsg = MessageFormat.format("The attribute arrays:size of a Dimension object should point to a parameter that has a non-negative integer value but {0} has a negative value.", dim.toString()); logDimensionSizeValueInconsistency(shortMsg); } @@ -117,8 +121,7 @@ if (arraysSBasePlugin != null) { if (arraysSBasePlugin.getDimensionCount() > 0) { - String shortMsg = "The attribute arrays:size of a Dimension object should point to a scalar parameter but " - + dim.toString() + "has a non-scalar value."; + String shortMsg = MessageFormat.format("The attribute arrays:size of a Dimension object should point to a scalar parameter but {0} has a non-scalar value.", dim.toString()); logDimensionSizeInvalid(shortMsg); } } @@ -132,13 +135,9 @@ private void logMissingDimensionAttribute(String shortMsg) { int code = 20202, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "A Dimension object must have a value for the attributes"+ - "arrays:arrayDimension and arrays:size, and may additionally" + - "have the attributes arrays:id and arrays:name. (Reference:"+ - "SBML Level 3 Package Specification for Arrays, Version 1, Section 3.3 on page 6.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("DimensionSizeCheck.logMissingDimensionAttribute"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -151,12 +150,9 @@ private void logDimensionSizeInvalid(String shortMsg) { int code = 20204, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "The value of the arrays:size attribute, if set on a given Dimension object,"+ - "must be a valid SIdRef to an object of type Parameter. (Reference: " + - "SBML Level 3 Package Specification for Arrays, Version 1, Section 3.3 on page 6.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("DimensionSizeCheck.logDimensionSizeInvalid"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -169,12 +165,9 @@ private void logDimensionSizeValueInconsistency(String shortMsg) { int code = 20205, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "The value of the Parameter referenced by the arrays:size attribute"+ - "must be a non-negative scalar constant integer. (Reference: SBML Level 3 Package"+ - "Specification for Arrays, Version 1, Section 3.3 on page 6.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("DimensionSizeCheck.logDimensionSizeValueInconsistency"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexArrayDimCheck.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexArrayDimCheck.java 2015-04-20 11:37:47 UTC (rev 2186) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexArrayDimCheck.java 2015-04-20 12:48:23 UTC (rev 2187) @@ -22,14 +22,17 @@ */ package org.sbml.jsbml.ext.arrays.validator.constraints; +import java.text.MessageFormat; import java.util.HashMap; import java.util.Map; +import java.util.ResourceBundle; import org.sbml.jsbml.Model; import org.sbml.jsbml.SBase; import org.sbml.jsbml.ext.arrays.ArraysConstants; import org.sbml.jsbml.ext.arrays.ArraysSBasePlugin; import org.sbml.jsbml.ext.arrays.Index; +import org.sbml.jsbml.util.ResourceManager; /** * This checks if the {@link Index} objects of a given {@link SBase} have valid array dimension. @@ -42,6 +45,11 @@ public class IndexArrayDimCheck extends ArraysConstraint { /** + * Localization support. + */ + private static final transient ResourceBundle bundle = ResourceManager.getBundle("org.sbml.jsbml.ext.arrays.validator.constraints.Messages"); + + /** * */ private final SBase sbase; @@ -64,7 +72,7 @@ @Override public void check() { - if (model == null || sbase == null) { + if ((model == null) || (sbase == null)) { return; } @@ -72,7 +80,7 @@ Map<String, Integer> attributeToMaxDim = new HashMap<String, Integer>(); - if (arraysSBasePlugin == null || arraysSBasePlugin.getIndexCount() == 0) { + if ((arraysSBasePlugin == null) || (arraysSBasePlugin.getIndexCount() == 0)) { return; } @@ -106,17 +114,14 @@ } else { - String shortMsg = "A listOfIndices should have Index objects with" - + "unique attribute arrays:arrayDimension, but the value " + arrayDim + - "is used multiple times."; + String shortMsg = MessageFormat.format("A listOfIndices should have Index objects with unique attribute arrays:arrayDimension, but the value {0,number,integer} is used multiple times.", arrayDim); logArrayDimensionUniqueness(shortMsg); } } for (int i = 0; i <= max; i++) { if (!isSetArrayDimAt[i]) { - String shortMsg = "A listOfIndices should have an Index with arrays:arrayDimension " - + i + " before adding an Index object with arrays:arrayDimension " + max; + String shortMsg = MessageFormat.format("A listOfIndices should have an Index with arrays:arrayDimension {0,number,integer} before adding an Index object with arrays:arrayDimension {1,number,integer}", i, max); logArrayDimensionMissing(shortMsg); return; } @@ -134,12 +139,9 @@ private void logArrayDimensionUniqueness(String shortMsg) { int code = 20111, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "The ListOfIndices associated with an SBase object must not have multiple Index"+ - "objects with the same arrays:arrayDimension attribute. (Reference: SBML Level 3 Package"+ - "Specification for Arrays, Version 1, Section 3.3 on page 6.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("IndexArrayDimCheck.logArrayDimensionUniqueness"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -153,16 +155,9 @@ private void logArrayDimensionMissing(String shortMsg) { int code = 20110, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "The ListOfIndices associated with an SBase object must have a Index object"+ - "with arrays:arrayDimension attribute set to 0 before adding a Index object with"+ - "arrays:arrayDimension attribute set to 1. Similarly, the ListOfIndices in an SBase"+ - "object must have Index objects, where one of them has arrays:arrayDimension attribute"+ - "set to 0 and the other set to 1 before adding a Index object with arrays:arrayDimension"+ - "attribute set to 2. (Reference: SBML Level 3 Package Specification for Arrays, Version 1,"+ - "Section 3.3 on page 6.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("IndexArrayDimCheck.logArrayDimensionMissing"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexAttributesCheck.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexAttributesCheck.java 2015-04-20 11:37:47 UTC (rev 2186) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexAttributesCheck.java 2015-04-20 12:48:23 UTC (rev 2187) @@ -23,6 +23,7 @@ package org.sbml.jsbml.ext.arrays.validator.constraints; import java.text.MessageFormat; +import java.util.ResourceBundle; import org.apache.log4j.Logger; import org.sbml.jsbml.Model; @@ -32,6 +33,7 @@ import org.sbml.jsbml.ext.arrays.Dimension; import org.sbml.jsbml.ext.arrays.Index; import org.sbml.jsbml.ext.arrays.util.ArraysMath; +import org.sbml.jsbml.util.ResourceManager; /** @@ -46,6 +48,11 @@ public class IndexAttributesCheck extends ArraysConstraint { /** + * Localization support. + */ + private static final transient ResourceBundle bundle = ResourceManager.getBundle("org.sbml.jsbml.ext.arrays.validator.constraints.Messages"); + + /** * */ private final Index index; @@ -72,26 +79,24 @@ public void check() { boolean isComp = false; - if (model == null || index == null) { + if ((model == null) || (index == null)) { return; } String refAttribute = index.getReferencedAttribute(); - if (index.getParentSBMLObject() == null || index.getParentSBMLObject().getParentSBMLObject() == null) + if ((index.getParentSBMLObject() == null) || (index.getParentSBMLObject().getParentSBMLObject() == null)) { logger.debug(MessageFormat.format( - "WARNING: Index objects must be associated with a parent but {0} does not have a parent." - + "Therefore, validation on Index {0} cannot be performed.", - index)); + "WARNING: Index objects must be associated with a parent but {0} does not have a parent. Therefore, validation on Index {0} cannot be performed.", + index)); return; } SBase parent = index.getParentSBMLObject().getParentSBMLObject(); if (refAttribute == null) { - String msg = "Index objects should have a value for attribute arrays:referencedAttribute. However, the referenced attribute" - + "of Index" + index.toString() + " for object " + parent.toString() + " doesn't have a value."; + String msg = MessageFormat.format("Index objects should have a value for attribute arrays:referencedAttribute. However, the referenced attribute of Index {0} for object {1} doesn't have a value.", index.toString(), parent.toString()); logIndexMissingAttribute(msg); return; } @@ -109,15 +114,13 @@ if (refValue == null) { if (isComp) { - String shortMsg ="Array validation has encountered indices for references to variables defined outside this SBML document," - + "so it currently cannot validate whether these indices are valid."; + String shortMsg ="Array validation has encountered indices for references to variables defined outside this SBML document, so it currently cannot validate whether these indices are valid."; String msg = ""; logWarning(msg, shortMsg); } else { - String msg = "Index objects attribute arrays:referencedAttribute should reference a valid attribute but " - + index.toString() + " of object " + parent.toString() + " references an attribute that doesn't exist."; + String msg = MessageFormat.format("Index objects attribute arrays:referencedAttribute should reference a valid attribute but {0} of object {1} references an attribute that doesn't exist.", index.toString(), parent.toString()); logInvalidRefAttribute(msg); } return; @@ -128,15 +131,13 @@ if (refSBase == null) { if (isComp) { - String shortMsg ="Array validation has encountered indices for references to variables defined outside this SBML document," - + "so it currently cannot validate whether these indices are valid."; + String shortMsg ="Array validation has encountered indices for references to variables defined outside this SBML document, so it currently cannot validate whether these indices are valid."; String msg = ""; logWarning(msg, shortMsg); } else { - String msg = "Index objects should reference a valid SIdRef but " - + index.toString() + " of object " + parent.toString() + " references an unknown SBase."; + String msg = MessageFormat.format("Index objects should reference a valid SIdRef but {0} of object {1} references an unknown SBase.", index.toString(), parent.toString()); logInvalidRefAttribute(msg); } return; @@ -144,9 +145,7 @@ ArraysSBasePlugin arraysSBasePlugin = (ArraysSBasePlugin) refSBase.getExtension(ArraysConstants.shortLabel); if (!index.isSetArrayDimension()) { - String msg = "Index objects should have a value for attribute arrays:arrayDimension but SBase " - + parent.toString() + " has index " - + index.toString() + " without a value for arrays:arrayDimension."; + String msg = MessageFormat.format("Index objects should have a value for attribute arrays:arrayDimension but SBase {0} has index {1} without a value for arrays:arrayDimension.", parent.toString(), index.toString()); logIndexMissingAttribute(msg); } @@ -154,17 +153,14 @@ Dimension dim = arraysSBasePlugin.getDimensionByArrayDimension(arrayDimension); if (dim == null) { - String msg = "The SIdRef of an Index object should have arrays:arrayDimension of same value of the Index object." - + "Index " + index.toString() + " is referring to arrays:arrayDimension " + arrayDimension + " but " - + refSBase.toString() + " doesn't have a Dimension object with arrays:arrayDimension " + arrayDimension + "."; + String msg = MessageFormat.format("The SIdRef of an Index object should have arrays:arrayDimension of same value of the Index object. Index {0} is referring to arrays:arrayDimension {1,number,integer} but {2} doesn't have a Dimension object with arrays:arrayDimension {1,number,integer}.", index.toString(), arrayDimension, refSBase.toString()); logDimensionMismatch(msg); } boolean isStaticComp = ArraysMath.isStaticallyComputable(model, index); if (!isStaticComp) { - String msg = "Index math should be statically computable, meaning that it should only contain dimension ids or constant values but index " - + index.toString() + " of object " + parent.toString() + " is not statically computable."; + String msg = MessageFormat.format("Index math should be statically computable, meaning that it should only contain dimension ids or constant values but index {0} of object {1} is not statically computable.", index.toString(), parent.toString()); logNotStaticComp(msg); } @@ -174,15 +170,13 @@ if (!isBounded) { if (isComp) { - String shortMsg ="Array validation has encountered indices for references to variables defined outside this SBML document," - + "so it currently cannot validate whether these indices are valid."; + String shortMsg ="Array validation has encountered indices for references to variables defined outside this SBML document, so it currently cannot validate whether these indices are valid."; String msg = ""; logWarning(msg, shortMsg); } else { - String msg = "Index math should not go out-of-bounds but index " - + index.toString() + " of object " + parent.toString() + " goes out-of-bounds."; + String msg = MessageFormat.format("Index math should not go out-of-bounds but index {0} of object {1} goes out-of-bounds.", index.toString(), parent.toString()); logNotBounded(msg); } @@ -196,7 +190,7 @@ private void logWarning(String msg, String shortMsg) { int code = -1, severity = 1, category = 0, line = -1, column = -1; - String pkg = "arrays"; + String pkg = ArraysConstants.packageName; logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -207,12 +201,9 @@ private void logDimensionMismatch(String shortMsg) { int code = 20305, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "The object referenced by the SIdRef indicated by the arrays:referencedAttribute attribute"+ - "must include an arrays:arrayDimension matching the arrays:arrayDimension for"+ - "the Index. (Reference: SBML Level 3 Package Specification for Arrays, Version 1, Section 3.4 on 37 page 8.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("IndexAttributesCheck.logDimensionMismatch"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -222,14 +213,9 @@ private void logNotBounded(String shortMsg) { int code = 20308, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "For each possible value of each Dimension id (i.e., 0 to size-1 of the Dimension referred to)"+ - "that appears in the MathML math element, there should be no array out-of-bounds problems. Namely," + - "it must evaluate to a non-negative integer that is less than the size of the corresponding" - + " Dimension for the object being indexed."; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("IndexAttributesCheck.logNotBounded"); - - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -239,14 +225,9 @@ private void logNotStaticComp(String shortMsg) { int code = 20307, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "The MathML math element in an Index object must be statically computable. In other words,"+ - "any identifier that appears in the math element, other than a Dimension id for the object with" + - "this Index , must be a constant. (Reference: SBML Level 3 Package Specification for Arrays,"+ - "Version 1, Section 3.4 on page 8.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("IndexAttributesCheck.logNotStaticComp"); - - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -256,12 +237,9 @@ private void logIndexMissingAttribute(String shortMsg) { int code = 20302, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "An Index object must have a value for the attributes arrays:arrayDimension," + - "and arrays:referencedAttribute . (Reference: SBML Level 3 Package Specification"+ - "for Arrays, Version 1, Section 3.4 on page 8.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("IndexAttributesCheck.logIndexMissingAttribute"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } @@ -271,12 +249,9 @@ private void logInvalidRefAttribute(String shortMsg) { int code = 20303, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "The value of the arrays:referencedAttribute attribute, if set on a given Index object, must"+ - "be an existing attribute of type SIdRef with a value that references a valid SId. (Reference:"+ - "SBML Level 3 Package Specification for Arrays, Version 1, Section 3.4 on page 8.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("IndexAttributesCheck.logInvalidRefAttribute"); - logFailure(code, severity, category, line, column, pkg, msg, shortMsg); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-04-20 11:37:58
|
Revision: 2186 http://sourceforge.net/p/jsbml/code/2186 Author: andreas-draeger Date: 2015-04-20 11:37:47 +0000 (Mon, 20 Apr 2015) Log Message: ----------- * Solved JavaDoc compile errors. * Started an XML file that allows us to extract all the error messages from the Arrays validation. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysConstraint.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/SBaseWithDimensionCheck.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeComponentIndex.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java trunk/test/org/sbml/jsbml/test/PackageVersionTests.java Added Paths: ----------- trunk/extensions/arrays/resources/org/ trunk/extensions/arrays/resources/org/sbml/ trunk/extensions/arrays/resources/org/sbml/jsbml/ trunk/extensions/arrays/resources/org/sbml/jsbml/ext/ trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/ trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/ trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/ trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java 2015-04-20 05:40:14 UTC (rev 2185) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java 2015-04-20 11:37:47 UTC (rev 2186) @@ -48,25 +48,25 @@ */ private static final transient Logger logger = Logger.getLogger(PackageUtil.class); - + /** * Checks the whole {@link SBMLDocument}, including all siblings, to make sure * that the package version and namespace is set properly. * - * <p>It will print warnings or errors when problems are found, nothing will be changed. + * <p>It will print warnings or errors when problems are found, nothing will be changed. * * @param doc the {@link SBMLDocument} to check. */ public static void checkPackages(SBMLDocument doc) { checkPackages(doc, false, false); } - + /** * Checks the whole {@link SBMLDocument}, including all siblings, to make sure * that the package version and namespace is set properly. * * <p>The given boolean parameters will indicate if the method will print warnings - * or errors when problems are found, and if it will try to fix problems. + * or errors when problems are found, and if it will try to fix problems. * * @param doc the {@link SBMLDocument} to check. * @param silent boolean to indicate if errors and warnings should be shown. @@ -76,24 +76,24 @@ if (doc == null) { return; } - + // getting the list of declared L3 packages from the declared namespaces // TODO - add a proper method to get this list directly from SBMLdocument? Map<String, String> declaredNamespaces = doc.getDeclaredNamespaces(); - List<String> packageNamespaces = new ArrayList<String>(); - + List<String> packageNamespaces = new ArrayList<String>(); + if (declaredNamespaces != null && declaredNamespaces.size() > 0) { for (String xmlns : declaredNamespaces.keySet()) { if (xmlns.startsWith("xmlns:")) { String namespace = declaredNamespaces.get(xmlns); - + if (doc.isPackageEnabled(namespace)) { packageNamespaces.add(namespace); } } } } - + checkPackages(doc, packageNamespaces, silent, fix); } @@ -102,7 +102,7 @@ * that the package version and namespace is set properly. * * <p>The given boolean parameters will indicate if the method will print warnings - * or errors when problems are found, and if it will try to fix problems. + * or errors when problems are found, and if it will try to fix problems. * * @param sbase the {@link SBase} to check. * @param packageNamespaces the {@link List} of namespaces that are expected to be found SBML L3 packages. @@ -112,28 +112,28 @@ public static void checkPackages(SBase sbase, List<String> packageNamespaces, boolean silent, boolean fix) { if (sbase == null) { return; - } + } if (packageNamespaces == null) { packageNamespaces = new ArrayList<String>(); } - + Map<String, PackageInfo> prefixMap = new HashMap<String, PackageInfo>(); Map<String, PackageInfo> namespaceMap = new HashMap<String, PackageInfo>(); - + for (String namespace : packageNamespaces) { // Get the package parser PackageParser packageParser = ParserManager.getManager().getPackageParser(namespace); - + if (packageParser != null) { PackageInfo pi = new PackageInfo(); pi.prefix = packageParser.getPackageName(); pi.namespace = namespace; pi.version = extractPackageVersion(namespace); - + prefixMap.put(pi.prefix, pi); namespaceMap.put(namespace, pi); - + if (logger.isDebugEnabled()) { logger.debug(pi); } @@ -142,10 +142,10 @@ logger.warn("Package namespace unknow: '" + namespace + "'"); } } - + // recursive test for all children if prefix is not "core" checkPackages(sbase, prefixMap, namespaceMap, silent, fix); - + } /** @@ -153,7 +153,7 @@ * that the package version and namespace is set properly. * * <p>The given boolean parameters will indicate if the method will print warnings - * or errors when problems are found, and if it will try to fix problems. + * or errors when problems are found, and if it will try to fix problems. * * @param sbase the {@link SBase} to check. * @param prefixMap map between package name (or prefix or label) and a {@link PackageInfo} object, @@ -163,17 +163,17 @@ * @param silent boolean to indicate if errors and warnings should be shown. * @param fix boolean to indicate if encountered problems should be fixed. */ - private static void checkPackages(SBase sbase, Map<String, PackageInfo> prefixMap, + private static void checkPackages(SBase sbase, Map<String, PackageInfo> prefixMap, Map<String, PackageInfo> namespaceMap, boolean silent, boolean fix) { if (sbase == null) { return; } - + String packageName = sbase.getPackageName(); String elementNamespace = sbase.getNamespace(); int packageVersion = sbase.getPackageVersion(); - + if (packageName.equals("core") && packageVersion != 0) { if (!silent) { logger.warn("The element '" + sbase.getElementName() + "' seems to be part of SBML core but it's package version is not '0'!"); @@ -183,18 +183,18 @@ } } // TODO - do we want to check and set the namespace for core elements ? namespace not set at the moment for them -// if (packageName.equals("core") && elementNamespace == null) { -// logger.warn("The element '" + sbase.getElementName() + "' seems to be part of SBML core but it's package namespace is not set!"); -// } - + // if (packageName.equals("core") && elementNamespace == null) { + // logger.warn("The element '" + sbase.getElementName() + "' seems to be part of SBML core but it's package namespace is not set!"); + // } + // check package name != core if (!packageName.equals("core")) { PackageInfo pi = getPackageInfo(sbase, packageName, packageVersion, elementNamespace, prefixMap, namespaceMap, silent, fix); - + if (pi == null) { return; } - + // checking package version if (packageVersion != -1 && packageVersion != pi.version) { if (!silent) { @@ -204,17 +204,17 @@ if (fix) { sbase.setPackageVersion(pi.version); } - } - else if (packageVersion == -1) + } + else if (packageVersion == -1) { if (!silent) { - logger.warn("The element '" + sbase.getElementName() + "' does not have a package version set!"); + logger.warn("The element '" + sbase.getElementName() + "' does not have a package version set!"); } if (fix) { sbase.setPackageVersion(pi.version); } } - + // checking package namespace if ((elementNamespace == null) || (!elementNamespace.equals(pi.namespace))) { if (!silent) { @@ -227,7 +227,7 @@ } } } - + // check all SBasePlugin int nbPlugins = sbase.getNumPlugins(); @@ -239,20 +239,20 @@ packageName = sbasePlugin.getPackageName(); elementNamespace = sbasePlugin.getElementNamespace(); packageVersion = sbasePlugin.getPackageVersion(); - + if (packageName.equals("core")) { if (!silent) { logger.error("The element '" + sbasePlugin.getClass().getSimpleName() + "' has it's package version set to 'core'!"); } continue; } - + PackageInfo pi = getPackageInfo(sbase, packageName, packageVersion, elementNamespace, prefixMap, namespaceMap, silent, fix); - + if (pi == null) { continue; } - + // checking package version if (packageVersion != -1 && packageVersion != pi.version) { if (!silent) { @@ -262,8 +262,8 @@ if (fix) { sbasePlugin.setPackageVersion(pi.version); } - } - else if (packageVersion == -1) + } + else if (packageVersion == -1) { if (!silent) { logger.warn("The element '" + sbasePlugin.getClass().getSimpleName() + "' does not have a package version set!"); @@ -272,14 +272,14 @@ sbasePlugin.setPackageVersion(pi.version); } } - + // checking package namespace if ((elementNamespace == null) || (!elementNamespace.equals(pi.namespace))) { if (!silent) { logger.warn("The element '" + sbasePlugin.getClass().getSimpleName() + "' does not seems to have" + " the expected package namespace. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); } - + if (sbasePlugin instanceof AbstractSBasePlugin) { ((AbstractSBasePlugin) sbasePlugin).setNamespace(null); ((AbstractSBasePlugin) sbasePlugin).setNamespace(pi.namespace); @@ -290,19 +290,19 @@ } - + // check all children int childCount = sbase.getChildCount(); - + for (int i = 0; i < childCount; i++) { Object childObj = sbase.getChildAt(i); - + if (childObj instanceof SBase) { checkPackages((SBase) childObj, prefixMap, namespaceMap, silent, fix); } } } - + /** * * @param namespace @@ -310,24 +310,24 @@ */ private static int extractPackageVersion(String namespace) { int versionIndex = namespace.lastIndexOf("version"); - + if (versionIndex == -1) { return -1; } - + String versionStr = namespace.substring(versionIndex + 7); - + int version = -1; - + try { version = Integer.parseInt(versionStr); } catch (NumberFormatException e) { e.printStackTrace(); } - + return version; } - + /** * @param sbase * @param packageName @@ -339,34 +339,34 @@ * @param fix * @return */ - private static PackageInfo getPackageInfo(SBase sbase, String packageName, int packageVersion, String elementNamespace, Map<String, PackageInfo> prefixMap, + private static PackageInfo getPackageInfo(SBase sbase, String packageName, int packageVersion, String elementNamespace, Map<String, PackageInfo> prefixMap, Map<String, PackageInfo> namespaceMap, boolean silent, boolean fix) { - + PackageInfo pi = prefixMap.get(packageName); if (pi == null) { pi = namespaceMap.get(elementNamespace); } - + if (pi == null) { // The package might not be enabled on the SBMLDocument. Can happen when cloning part of a model. if (!silent) { logger.warn("The package '" + packageName + "' does not seem to be enabled."); } SBMLDocument doc = sbase.getSBMLDocument(); - + if (doc != null) { // Get the package parser - PackageParser packageParser = ParserManager.getManager().getPackageParser(packageName); + PackageParser packageParser = ParserManager.getManager().getPackageParser(packageName); if (packageParser == null) { return null; // There is something wrong with the packageName or the ParserManager } - + if (packageVersion != -1) { elementNamespace = packageParser.getNamespaceFor(doc.getLevel(), doc.getVersion(), packageVersion); - } - // if elementNamespace is null there, there is a problem, getting the default namespace. + } + // if elementNamespace is null there, there is a problem, getting the default namespace. if (elementNamespace == null) { if (!silent) { logger.warn("Could not find a namespace for the package '" + packageName + "' using SBML level '" @@ -396,7 +396,7 @@ logger.info("Can not found SBMLDocument on the element '" + sbase.getElementName() + "'. Stopping the check"); } } - + return pi; } @@ -410,16 +410,26 @@ */ final class PackageInfo { + /** + * + */ String prefix; + /** + * + */ String namespace; + /** + * + */ int version; - + /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString() { - return "PackageInfo [prefix=" + prefix + ", namespace=" + namespace - + ", version=" + version + "]"; + return getClass().getSimpleName() + " [prefix=" + prefix + ", namespace=" + + namespace + ", version=" + version + "]"; } + } Added: trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml =================================================================== --- trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml (rev 0) +++ trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml 2015-04-20 11:37:47 UTC (rev 2186) @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> + <comment> + $Id: Messages.xml 2109 2015-01-05 04:50:45Z andreas-draeger $ + $URL: https://svn.code.sf.net/p/jsbml/code/trunk/extensions/spatial/resources/org/sbml/jsbml/ext/spatial/Messages.xml $ + ---------------------------------------------------------------------------- + This file is part of JSBML. Please visit http://sbml.org/Software/JSBML + for the latest version of JSBML and more information about SBML. + + Copyright (C) 2009-2015 jointly by the following organizations: + 1. The University of Tuebingen, Germany + 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + 3. The California Institute of Technology, Pasadena, CA, USA + 4. The University of California, San Diego, La Jolla, CA, USA + 5. The Babraham Institute, Cambridge, UK + 6. The University of Utah, Salt Lake City, UT, USA + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation. A copy of the license agreement is provided + in the file named "LICENSE.txt" included with this software distribution + and also available online as http://sbml.org/Software/JSBML/License. + ---------------------------------------------------------------------------- + + A collection of text messages to be presented to uses upon certain events. + + Author: Andreas Dräger + Version: $Rev: 2109 $ + Since: 1.1 + </comment> + + <entry key="SBaseWithDimensionCheck.check">The object {0} cannot have a listOfDimensions.</entry> + <entry key="SBaseWithDimensionCheck.logDimensionError">In SBML Level~3 Core, Models, FunctionDefinitions, Units, UnitDefinitions, KineticLaws, LocalParameters, Triggers, Priorities, and Delays are not permitted to have a ListOfDimensions. (Reference: SBML Level 3 11 Package Specification for Arrays, Version 1, Section 3.3 on page 7.)</entry> + +</properties> Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysConstraint.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysConstraint.java 2015-04-20 05:40:14 UTC (rev 2185) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysConstraint.java 2015-04-20 11:37:47 UTC (rev 2186) @@ -111,6 +111,6 @@ message.setMessage(shortMsg); error.setShortMessage(shortMessage); listOfErrors.add(error); + } - } } Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/SBaseWithDimensionCheck.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/SBaseWithDimensionCheck.java 2015-04-20 05:40:14 UTC (rev 2185) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/SBaseWithDimensionCheck.java 2015-04-20 11:37:47 UTC (rev 2186) @@ -22,10 +22,14 @@ */ package org.sbml.jsbml.ext.arrays.validator.constraints; +import java.text.MessageFormat; +import java.util.ResourceBundle; + import org.sbml.jsbml.Model; import org.sbml.jsbml.SBase; import org.sbml.jsbml.ext.arrays.ArraysConstants; import org.sbml.jsbml.ext.arrays.ArraysSBasePlugin; +import org.sbml.jsbml.util.ResourceManager; /** * This checks if the given {@link SBase} is allowed to have a listOfDimensions. @@ -38,6 +42,11 @@ public class SBaseWithDimensionCheck extends ArraysConstraint { /** + * Localization support. + */ + private static final transient ResourceBundle bundle = ResourceManager.getBundle("org.sbml.jsbml.ext.arrays.validator.constraints.Messages"); + + /** * */ private final SBase sbase; @@ -63,7 +72,7 @@ if (arraysSBasePlugin != null) { if (arraysSBasePlugin.isSetListOfDimensions()) { - String shortMsg = "The object " + sbase.toString() + " cannot have a listOfDimensions."; + String shortMsg = MessageFormat.format(bundle.getString("SBaseWithDimensionCheck.check"), sbase.getElementName()); logDimensionError(shortMsg); } } @@ -77,11 +86,8 @@ private void logDimensionError(String shortMsg) { int code = 20107, severity = 2, category = 0, line = -1, column = -1; - String pkg = "arrays"; - String msg = "In SBML Level~3 Core, Models, FunctionDefinitions, Units," + - "UnitDefinitions, KineticLaws, LocalParameters, Triggers,"+ - "Priorities, and Delays are not permitted to have a ListOfDimensions."+ - " (Reference: SBML Level 3 11 Package Specification for Arrays, Version 1, Section 3.3 on page 7.)"; + String pkg = ArraysConstants.packageName; + String msg = bundle.getString("SBaseWithDimensionCheck.logDimensionError"); logFailure(code, severity, category, line, column, pkg, msg, shortMsg); Modified: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java 2015-04-20 05:40:14 UTC (rev 2185) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java 2015-04-20 11:37:47 UTC (rev 2186) @@ -136,8 +136,8 @@ * @param group * @return {@code true} (as specified by {@link Collection#add}) */ - public void addGroup(Group group) { - getListOfGroups().add(group); + public boolean addGroup(Group group) { + return getListOfGroups().add(group); } /** @@ -163,14 +163,14 @@ public ListOf<Group> getListOfGroups() { if (!isSetListOfGroups()) { listOfGroups = new ListOf<Group>(); - + listOfGroups.setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace listOfGroups.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'groups' listOfGroups.setPackageName(null); - listOfGroups.setPackageName(GroupsConstants.shortLabel); + listOfGroups.setPackageName(GroupsConstants.shortLabel); listOfGroups.setSBaseListType(ListOf.Type.other); - + if (extendedSBase != null) { extendedSBase.registerChild(listOfGroups); } @@ -220,9 +220,9 @@ listOfGroups.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'groups' listOfGroups.setPackageName(null); - listOfGroups.setPackageName(GroupsConstants.shortLabel); + listOfGroups.setPackageName(GroupsConstants.shortLabel); listOfGroups.setSBaseListType(ListOf.Type.other); - + if (isSetExtendedSBase()) { extendedSBase.registerChild(listOfGroups); } Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java 2015-04-20 05:40:14 UTC (rev 2185) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java 2015-04-20 11:37:47 UTC (rev 2186) @@ -50,19 +50,19 @@ * */ private String compartmentType; - + /** * */ private Boolean isType; - + /** * */ - private ListOf<CompartmentReference> listOfCompartmentReferences; - + private ListOf<CompartmentReference> listOfCompartmentReferences; + /** - * Creates an MultiCompartmentPlugin instance + * Creates an MultiCompartmentPlugin instance */ public MultiCompartmentPlugin() { super(); @@ -71,9 +71,11 @@ /** - * Creates a MultiCompartmentPlugin instance associated with the given {@link Compartment}. + * Creates a {@link MultiCompartmentPlugin} instance associated with the given + * {@link Compartment}. * - * @param id the compartment to extend. + * @param compartment + * the compartment to extend. */ public MultiCompartmentPlugin(Compartment compartment) { super(compartment); @@ -83,6 +85,7 @@ /** * Clone constructor + * @param obj */ public MultiCompartmentPlugin(MultiCompartmentPlugin obj) { super(obj); @@ -106,8 +109,8 @@ public void initDefaults() { setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace } - + /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() */ @@ -152,7 +155,7 @@ return getParent(); } - + /** * Returns {@code true} if {@link #listOfCompartmentReferences} contains at least * one element. @@ -181,14 +184,14 @@ listOfCompartmentReferences.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'multi' listOfCompartmentReferences.setPackageName(null); - listOfCompartmentReferences.setPackageName(MultiConstants.shortLabel); + listOfCompartmentReferences.setPackageName(MultiConstants.shortLabel); listOfCompartmentReferences.setSBaseListType(ListOf.Type.other); if (isSetExtendedSBase()) { extendedSBase.registerChild(listOfCompartmentReferences); } } - + return listOfCompartmentReferences; } @@ -203,14 +206,14 @@ public void setListOfCompartmentReferences(ListOf<CompartmentReference> listOfCompartmentReferences) { unsetListOfCompartmentReferences(); this.listOfCompartmentReferences = listOfCompartmentReferences; - + if (listOfCompartmentReferences != null) { listOfCompartmentReferences.unsetNamespace(); listOfCompartmentReferences.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace listOfCompartmentReferences.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'multi' listOfCompartmentReferences.setPackageName(null); - listOfCompartmentReferences.setPackageName(MultiConstants.shortLabel); + listOfCompartmentReferences.setPackageName(MultiConstants.shortLabel); listOfCompartmentReferences.setSBaseListType(ListOf.Type.other); if (isSetExtendedSBase()) { @@ -229,8 +232,8 @@ */ public boolean unsetListOfCompartmentReferences() { if (isSetListOfCompartmentReferences()) { - ListOf<CompartmentReference> oldCompartmentReferences = this.listOfCompartmentReferences; - this.listOfCompartmentReferences = null; + ListOf<CompartmentReference> oldCompartmentReferences = listOfCompartmentReferences; + listOfCompartmentReferences = null; oldCompartmentReferences.fireNodeRemovedEvent(); return true; } @@ -380,7 +383,7 @@ return getCompartmentReferenceCount(); } - + /** * Returns the value of {@link #compartmentType}. * @@ -390,7 +393,7 @@ if (isSetCompartmentType()) { return compartmentType; } - + return null; } @@ -424,15 +427,15 @@ */ public boolean unsetCompartmentType() { if (isSetCompartmentType()) { - String oldCompartmentType = this.compartmentType; - this.compartmentType = null; - firePropertyChange(MultiConstants.compartmentType, oldCompartmentType, this.compartmentType); + String oldCompartmentType = compartmentType; + compartmentType = null; + firePropertyChange(MultiConstants.compartmentType, oldCompartmentType, compartmentType); return true; } return false; } - - + + /** * Returns the value of {@link #isType}. * @@ -458,8 +461,8 @@ return false; } - + /** * Returns whether {@link #isType} is set. * @@ -489,14 +492,14 @@ */ public boolean unsetIsType() { if (isSetIsType()) { - Boolean oldIsType = this.isType; - this.isType = null; - firePropertyChange(MultiConstants.isType, oldIsType, this.isType); + Boolean oldIsType = isType; + isType = null; + firePropertyChange(MultiConstants.isType, oldIsType, isType); return true; } return false; } - + @Override public boolean getAllowsChildren() { return true; @@ -506,11 +509,11 @@ public int getChildCount() { int count = 0; - if (isSetListOfCompartmentReferences()) { + if (isSetListOfCompartmentReferences()) { count++; - } + } - return count; + return count; } @Override @@ -519,15 +522,15 @@ throw new IndexOutOfBoundsException(index + " < 0"); } int pos = 0; - - if (isSetListOfCompartmentReferences()) { - if (pos == index) { - return getListOfCompartmentReferences(); - } - pos++; - } - throw new IndexOutOfBoundsException( + if (isSetListOfCompartmentReferences()) { + if (pos == index) { + return getListOfCompartmentReferences(); + } + pos++; + } + + throw new IndexOutOfBoundsException( MessageFormat.format("Index {0,number,integer} >= {1,number,integer}", index, Math.min(pos, 0))); } Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeComponentIndex.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeComponentIndex.java 2015-04-20 05:40:14 UTC (rev 2185) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeComponentIndex.java 2015-04-20 11:37:47 UTC (rev 2186) @@ -38,30 +38,35 @@ * @since 1.1 */ public class SpeciesTypeComponentIndex extends AbstractNamedSBase { - + /** + * Generated serial version identifier. + */ + private static final long serialVersionUID = 8707971676849587247L; + + /** * */ private String component; - + /** * */ private String identifyingParent; - + /** * */ private Integer occur; - + /** * */ private ListOf<DenotedSpeciesTypeComponentIndex> listOfDenotedSpeciesTypeComponentIndexes; - + /** - * Creates an SpeciesTypeComponentIndex instance + * Creates an SpeciesTypeComponentIndex instance */ public SpeciesTypeComponentIndex() { super(); @@ -125,10 +130,11 @@ /** * Clone constructor + * @param obj */ public SpeciesTypeComponentIndex(SpeciesTypeComponentIndex obj) { super(obj); - + // copy all class attributes if (obj.isSetListOfDenotedSpeciesTypeComponentIndexes()) { setListOfDenotedSpeciesTypeComponentIndexes(obj.getListOfDenotedSpeciesTypeComponentIndexes()); @@ -148,6 +154,7 @@ /** * clones this class */ + @Override public SpeciesTypeComponentIndex clone() { return new SpeciesTypeComponentIndex(this); } @@ -163,8 +170,8 @@ } - - + + /* (non-Javadoc) * @see java.lang.Object#hashCode() */ @@ -174,11 +181,11 @@ int result = super.hashCode(); result = prime * result + ((component == null) ? 0 : component.hashCode()); result = prime * result - + ((identifyingParent == null) ? 0 : identifyingParent.hashCode()); + + ((identifyingParent == null) ? 0 : identifyingParent.hashCode()); result = prime - * result - + ((listOfDenotedSpeciesTypeComponentIndexes == null) ? 0 - : listOfDenotedSpeciesTypeComponentIndexes.hashCode()); + * result + + ((listOfDenotedSpeciesTypeComponentIndexes == null) ? 0 + : listOfDenotedSpeciesTypeComponentIndexes.hashCode()); result = prime * result + ((occur == null) ? 0 : occur.hashCode()); return result; } @@ -237,9 +244,9 @@ @Override public String toString() { return "SpeciesTypeComponentIndex [component = " + component - + ", identifyingParent = " + identifyingParent + ", occur = " + occur - + ", listOfDenotedSpeciesTypeComponentIndexes.size = " - + getDenotedSpeciesTypeComponentIndexCount() + ", id = " + getId() + "]"; + + ", identifyingParent = " + identifyingParent + ", occur = " + occur + + ", listOfDenotedSpeciesTypeComponentIndexes.size = " + + getDenotedSpeciesTypeComponentIndexCount() + ", id = " + getId() + "]"; } @@ -247,8 +254,8 @@ public boolean isIdMandatory() { return true; } - - + + /** * Returns {@code true} if {@link #listOfDenotedSpeciesTypeComponentIndexes} is not null. * @@ -289,19 +296,19 @@ * If {@link #listOfDenotedSpeciesTypeComponentIndexes} was defined before and contains some * elements, they are all unset. * - * @param listOfDenotedSpeciesTypeComponentIndexes + * @param listOfDenotedSpeciesTypeComponentIndices */ - public void setListOfDenotedSpeciesTypeComponentIndexes(ListOf<DenotedSpeciesTypeComponentIndex> listOfDenotedSpeciesTypeComponentIndexs) { + public void setListOfDenotedSpeciesTypeComponentIndexes(ListOf<DenotedSpeciesTypeComponentIndex> listOfDenotedSpeciesTypeComponentIndices) { unsetListOfDenotedSpeciesTypeComponentIndexes(); - this.listOfDenotedSpeciesTypeComponentIndexes = listOfDenotedSpeciesTypeComponentIndexs; - if (listOfDenotedSpeciesTypeComponentIndexs != null) { - listOfDenotedSpeciesTypeComponentIndexs.unsetNamespace(); - listOfDenotedSpeciesTypeComponentIndexs.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace - listOfDenotedSpeciesTypeComponentIndexs.setPackageVersion(-1); + listOfDenotedSpeciesTypeComponentIndexes = listOfDenotedSpeciesTypeComponentIndices; + if (listOfDenotedSpeciesTypeComponentIndices != null) { + listOfDenotedSpeciesTypeComponentIndices.unsetNamespace(); + listOfDenotedSpeciesTypeComponentIndices.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDenotedSpeciesTypeComponentIndices.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'multi' - listOfDenotedSpeciesTypeComponentIndexs.setPackageName(null); - listOfDenotedSpeciesTypeComponentIndexs.setPackageName(MultiConstants.shortLabel); - this.listOfDenotedSpeciesTypeComponentIndexes.setSBaseListType(ListOf.Type.other); + listOfDenotedSpeciesTypeComponentIndices.setPackageName(null); + listOfDenotedSpeciesTypeComponentIndices.setPackageName(MultiConstants.shortLabel); + listOfDenotedSpeciesTypeComponentIndexes.setSBaseListType(ListOf.Type.other); registerChild(listOfDenotedSpeciesTypeComponentIndexes); } @@ -317,8 +324,8 @@ */ public boolean unsetListOfDenotedSpeciesTypeComponentIndexes() { if (isSetListOfDenotedSpeciesTypeComponentIndexes()) { - ListOf<DenotedSpeciesTypeComponentIndex> oldDenotedSpeciesTypeComponentIndexs = this.listOfDenotedSpeciesTypeComponentIndexes; - this.listOfDenotedSpeciesTypeComponentIndexes = null; + ListOf<DenotedSpeciesTypeComponentIndex> oldDenotedSpeciesTypeComponentIndexs = listOfDenotedSpeciesTypeComponentIndexes; + listOfDenotedSpeciesTypeComponentIndexes = null; oldDenotedSpeciesTypeComponentIndexs.fireNodeRemovedEvent(); return true; } @@ -423,7 +430,7 @@ return getDenotedSpeciesTypeComponentIndexCount(); } - + /** * Returns the value of {@link #component}. * @@ -467,15 +474,15 @@ */ public boolean unsetComponent() { if (isSetComponent()) { - String oldComponent = this.component; - this.component = null; - firePropertyChange(MultiConstants.component, oldComponent, this.component); + String oldComponent = component; + component = null; + firePropertyChange(MultiConstants.component, oldComponent, component); return true; } return false; } - - + + /** * Returns the value of {@link #identifyingParent}. * @@ -519,15 +526,15 @@ */ public boolean unsetIndentifyingParent() { if (isSetIndentifyingParent()) { - String oldIndentifyingParent = this.identifyingParent; - this.identifyingParent = null; - firePropertyChange(MultiConstants.identifyingParent, oldIndentifyingParent, this.identifyingParent); + String oldIndentifyingParent = identifyingParent; + identifyingParent = null; + firePropertyChange(MultiConstants.identifyingParent, oldIndentifyingParent, identifyingParent); return true; } return false; } - - + + /** * Returns the value of {@link #occur}. * @@ -571,15 +578,15 @@ */ public boolean unsetOccur() { if (isSetOccur()) { - Integer oldOccur = this.occur; - this.occur = null; - firePropertyChange(MultiConstants.occur, oldOccur, this.occur); + Integer oldOccur = occur; + occur = null; + firePropertyChange(MultiConstants.occur, oldOccur, occur); return true; } return false; } - + @Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); @@ -602,7 +609,7 @@ if (isSetOccur()) { attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.occur, occur.toString()); } - + return attributes; } @@ -628,5 +635,5 @@ } return isAttributeRead; } - + } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java 2015-04-20 05:40:14 UTC (rev 2185) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java 2015-04-20 11:37:47 UTC (rev 2186) @@ -486,14 +486,14 @@ public void setListOfColorDefinitions(ListOf<ColorDefinition> listOfColorDefinitions) { unsetListOfColorDefinitions(); this.listOfColorDefinitions = listOfColorDefinitions; - + if (listOfColorDefinitions != null) { listOfColorDefinitions.unsetNamespace(); listOfColorDefinitions.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace listOfColorDefinitions.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'render' listOfColorDefinitions.setPackageName(null); - listOfColorDefinitions.setPackageName(RenderConstants.shortLabel); + listOfColorDefinitions.setPackageName(RenderConstants.shortLabel); listOfColorDefinitions.setSBaseListType(ListOf.Type.other); registerChild(this.listOfColorDefinitions); @@ -581,22 +581,22 @@ } /** - * @param listOfGradientDefinitions + * @param listOfGradientDefintions */ public void setListOfGradientDefinitions(ListOf<GradientBase> listOfGradientDefintions) { unsetListOfGradientDefinitions(); - this.listOfGradientDefinitions = listOfGradientDefintions; - + listOfGradientDefinitions = listOfGradientDefintions; + if (listOfGradientDefintions != null) { listOfGradientDefintions.unsetNamespace(); listOfGradientDefintions.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace listOfGradientDefintions.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'render' listOfGradientDefintions.setPackageName(null); - listOfGradientDefintions.setPackageName(RenderConstants.shortLabel); + listOfGradientDefintions.setPackageName(RenderConstants.shortLabel); listOfGradientDefintions.setSBaseListType(ListOf.Type.other); - registerChild(this.listOfGradientDefinitions); + registerChild(listOfGradientDefinitions); } } @@ -740,14 +740,14 @@ public void setListOfLineEndings(ListOf<LineEnding> listOfLineEndings) { unsetListOfLineEndings(); this.listOfLineEndings = listOfLineEndings; - + if (listOfLineEndings != null) { listOfLineEndings.unsetNamespace(); listOfLineEndings.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace listOfLineEndings.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'render' listOfLineEndings.setPackageName(null); - listOfLineEndings.setPackageName(RenderConstants.shortLabel); + listOfLineEndings.setPackageName(RenderConstants.shortLabel); listOfLineEndings.setSBaseListType(ListOf.Type.other); registerChild(this.listOfLineEndings); Modified: trunk/test/org/sbml/jsbml/test/PackageVersionTests.java =================================================================== --- trunk/test/org/sbml/jsbml/test/PackageVersionTests.java 2015-04-20 05:40:14 UTC (rev 2185) +++ trunk/test/org/sbml/jsbml/test/PackageVersionTests.java 2015-04-20 11:37:47 UTC (rev 2186) @@ -64,13 +64,25 @@ import org.sbml.jsbml.ext.req.ReqConstants; import org.sbml.jsbml.xml.parsers.PackageUtil; - +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.1 + * @date 20.04.2015 + */ @SuppressWarnings("deprecation") public class PackageVersionTests { - + + /** + * + */ private SBMLDocument doc; + /** + * + */ private Model m; - + /** * */ @@ -80,60 +92,60 @@ */ @Before public void setUp() { doc = new SBMLDocument(3, 1); - + doc.enablePackage(ArraysConstants.namespaceURI_L3V1V1); doc.enablePackage(FBCConstants.namespaceURI_L3V1V1); doc.enablePackage(DistribConstants.namespaceURI_L3V1V1); - doc.enablePackage(QualConstants.namespaceURI_L3V1V1); + doc.enablePackage(QualConstants.namespaceURI_L3V1V1); doc.enablePackage(CompConstants.namespaceURI_L3V1V1); doc.enablePackage(ReqConstants.namespaceURI_L3V1V1); - + m = doc.createModel("test"); - + Compartment cell = m.createCompartment("cell"); m.createReaction("R1"); m.createSpecies("S1"); m.createSpecies("S2"); - + Event event = m.createEvent("E1"); - + FBCModelPlugin fbcModel = (FBCModelPlugin) m.getPlugin("fbc"); FluxBound fb1 = fbcModel.createFluxBound("fb1"); fbcModel.createFluxBound("fb2"); fb1.setPackageVersion(1); - + fbcModel.createObjective("fbc_O1"); - - + + fb1.setReaction("R1"); - + FunctionDefinition f = m.createFunctionDefinition("f"); DistribModelBuilder.createDistribution(f, "NormalDistribution", new String[] { "mean", "stddev" }, new String[] {"avg", "sd"}); - + CompSBMLDocumentPlugin compDoc = (CompSBMLDocumentPlugin) doc.getPlugin("comp"); compDoc.createExternalModelDefinition("C_EMD1"); compDoc.createModelDefinition("C_MD1"); - + CompModelPlugin compModel = (CompModelPlugin) m.getPlugin("comp"); Submodel subModel = compModel.createSubmodel("C_SB1"); compModel.createPort("C_P1"); compModel.createReplacedBy(); compModel.createReplacedElement(); - + ArraysSBasePlugin arraySubModel = (ArraysSBasePlugin) subModel.getPlugin("arrays"); arraySubModel.createDimension("A_D1"); arraySubModel.createIndex(); - + DynCompartmentPlugin dynCell = (DynCompartmentPlugin) cell.getPlugin(DynConstants.namespaceURI_L3V1V1); dynCell.createSpatialComponent("Dy_SP1").setSpatialIndex(SpatialKind.cartesianX); dynCell.createSpatialComponent("Dy_SP2"); dynCell.setCBOTerm(CBO.getTerm("CellDeath")); - + DynEventPlugin dynEvent = (DynEventPlugin) event.getPlugin("dyn"); dynEvent.createDynElement("D_cell").setIdRef("cell"); - + GroupsModelPlugin groupModel = (GroupsModelPlugin) m.getPlugin(GroupsConstants.namespaceURI_L3V1V1); groupModel.createGroup("G_G1"); Group g2 = groupModel.createGroup("G_G2", new String[]{"G_M1", "G_M2", "G_M3"}); @@ -141,7 +153,7 @@ g2.getMember(0).setIdRef("S2"); g2.getMember("G_M2").setIdRef(cell); g2.createMemberConstraint("G_MC1").setDistinctAttribute("test"); - + QualModelPlugin qualModel = (QualModelPlugin) m.getPlugin(QualConstants.shortLabel); qualModel.createQualitativeSpecies("Q_QS1"); qualModel.createQualitativeSpecies("Q_QS2"); @@ -149,42 +161,42 @@ tr1.createInput("Q_I1"); tr1.createOutput("Q_O1"); qualModel.createTransition("Q_T2", new Input("Q_I2"), new Output("Q_O2")); - + // check and fix package version and namespaces - // TODO - update when jsbml will be fixed to set properly package version and namespace - + // TODO - update when jsbml will be fixed to set properly package version and namespace - // now the fix is done in SBMLCoreParser#processEndDocument when reading a file PackageUtil.checkPackages(doc, true, true); System.out.println("Checking packages:"); PackageUtil.checkPackages(doc, false, true); } - + /** * Checks that package version and namespace are set properly for FBC version 1. */ @Test public void testFbcPackageVersion() { - + FBCModelPlugin fbcModel = ((FBCModelPlugin) m.getPlugin("fbc")); ListOf<FluxBound> fluxBounds = fbcModel.getListOfFluxBounds(); - + Assert.assertTrue(fbcModel.getPackageVersion() == 1); Assert.assertTrue(fbcModel.getPackageName().equals(FBCConstants.shortLabel)); Assert.assertTrue(fbcModel.getElementNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); - + Assert.assertTrue(fluxBounds.getPackageVersion() == 1); Assert.assertTrue(fluxBounds.getPackageName().equals(FBCConstants.shortLabel)); Assert.assertTrue(fluxBounds.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); - + for (FluxBound fluxBound : fluxBounds) { Assert.assertTrue(fluxBound.getPackageVersion() == 1); Assert.assertTrue(fluxBound.getPackageName().equals(FBCConstants.shortLabel)); - Assert.assertTrue(fluxBound.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); + Assert.assertTrue(fluxBound.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); } - + ListOf<Objective> objectives = fbcModel.getListOfObjectives(); - + Assert.assertTrue(objectives.getPackageVersion() == 1); Assert.assertTrue(objectives.getPackageName().equals(FBCConstants.shortLabel)); Assert.assertTrue(objectives.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); @@ -192,28 +204,28 @@ for (Objective objective : objectives) { Assert.assertTrue(objective.getPackageVersion() == 1); Assert.assertTrue(objective.getPackageName().equals(FBCConstants.shortLabel)); - Assert.assertTrue(objective.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); + Assert.assertTrue(objective.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); } } - + /** * Checks that package version and namespace are set properly after cloning the Model element * only and writing the new SBMLDocument to String or XML. - * + * */ @Test public void testModelCloning() { - + SBMLDocument newDoc = new SBMLDocument(3, 1); Model clonedModel = m.clone(); newDoc.setModel(clonedModel); - + Assert.assertFalse(newDoc.isPackageEnabled("arrays")); Assert.assertFalse(newDoc.isPackageEnabled("comp")); Assert.assertFalse(newDoc.isPackageEnabled("distrib")); Assert.assertFalse(newDoc.isPackageEnabled("fbc")); Assert.assertFalse(newDoc.isPackageEnabled("qual")); Assert.assertFalse(newDoc.isPackageEnabled("req")); - + try { System.out.println(new SBMLWriter().writeSBMLToString(newDoc)); } catch (SBMLException e) { @@ -229,7 +241,7 @@ Assert.assertTrue(newDoc.isPackageEnabled("groups")); Assert.assertTrue(newDoc.isPackageEnabled("dyn")); Assert.assertTrue(newDoc.isPackageEnabled("qual")); - + Assert.assertFalse(newDoc.isPackageEnabled("req")); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-04-20 05:40:16
|
Revision: 2185 http://sourceforge.net/p/jsbml/code/2185 Author: niko-rodrigue Date: 2015-04-20 05:40:14 +0000 (Mon, 20 Apr 2015) Log Message: ----------- creating a new branch based on trunk to merge the AStNode2 branch Added Paths: ----------- branches/astnode2-merging/ Index: branches/astnode2-merging =================================================================== --- trunk 2015-04-14 06:45:39 UTC (rev 2184) +++ branches/astnode2-merging 2015-04-20 05:40:14 UTC (rev 2185) Property changes on: branches/astnode2-merging ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,23 ## +target +*.log +.classpath +.project +.settings +.wtpmodules +.fatjar +*.texlipse +settings.fatjar +.idea +graph.dot +graph.pdf +*.ipr +*.iws +*.iml +bin +build +dist +libsbmlCompatibilityTestResults.txt +jsbmlTestResults.txt +biomd-025.xml +.factorypath +statsvn.jar Added: LicenseHeader ## -0,0 +1,19 ## +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2011 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ \ No newline at end of property Added: svn:mergeinfo ## -0,0 +1 ## +/tags/release-0.8-b1:588 \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-04-14 06:45:46
|
Revision: 2184 http://sourceforge.net/p/jsbml/code/2184 Author: niko-rodrigue Date: 2015-04-14 06:45:39 +0000 (Tue, 14 Apr 2015) Log Message: ----------- remove strange characters Modified Paths: -------------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java 2015-04-10 23:13:25 UTC (rev 2183) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java 2015-04-14 06:45:39 UTC (rev 2184) @@ -25,7 +25,7 @@ /** * The BindingStatus enumeration is used in the definition of the {@link OutwardBindingSite} class. BindingStatus - * is restricted to be one of the following possibilities: “bound”, “unbound”, and “either”. + * is restricted to be one of the following possibilities: bound, unbound, and either. * <p>Attributes of type BindingStatus cannot take on any other values. * * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2015-04-10 23:13:32
|
Revision: 2183 http://sourceforge.net/p/jsbml/code/2183 Author: alex-thomas Date: 2015-04-10 23:13:25 +0000 (Fri, 10 Apr 2015) Log Message: ----------- Fixed the svn:keywords settings. Modified Paths: -------------- trunk/extensions/arrays/doc/img/type_hierarchy.dot trunk/extensions/comp/doc/img/type_hierarchy.dot trunk/extensions/distrib/doc/img/type_hierarchy.dot trunk/extensions/render/doc/img/type_hierarchy.dot trunk/extensions/req/doc/img/type_hierarchy.dot Property Changed: ---------------- trunk/core/doc/user_guide/JSBML_extensions_overview.tex trunk/extensions/arrays/doc/img/type_hierarchy.dot trunk/extensions/comp/doc/img/type_hierarchy.dot trunk/extensions/distrib/doc/img/type_hierarchy.dot trunk/extensions/groups/doc/img/type_hierarchy.dot trunk/extensions/layout/doc/img/type_hierarchy.dot trunk/extensions/qual/doc/img/type_hierarchy.dot trunk/extensions/render/doc/img/type_hierarchy.dot trunk/extensions/req/doc/img/type_hierarchy.dot trunk/extensions/spatial/doc/img/type_hierarchy.dot Index: trunk/core/doc/user_guide/JSBML_extensions_overview.tex =================================================================== --- trunk/core/doc/user_guide/JSBML_extensions_overview.tex 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/core/doc/user_guide/JSBML_extensions_overview.tex 2015-04-10 23:13:25 UTC (rev 2183) Property changes on: trunk/core/doc/user_guide/JSBML_extensions_overview.tex ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Rev Id URL \ No newline at end of property Modified: trunk/extensions/arrays/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/arrays/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/extensions/arrays/doc/img/type_hierarchy.dot 2015-04-10 23:13:25 UTC (rev 2183) @@ -3,9 +3,9 @@ # dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & # dot -Tpng type_hierarchy.dot -otype_hierarchy.png # -# $Id: type_hierarchy.dot 1249 2012-05-08 08:07:37Z andreas-draeger $ -# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/layout/doc/img/type_hierarchy.dot $ -# $Rev: 1249 $ +# $Id$ +# $URL$ +# $Rev$ /* * Overview of the arrays extension type hierarchy Property changes on: trunk/extensions/arrays/doc/img/type_hierarchy.dot ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Rev URL \ No newline at end of property Modified: trunk/extensions/comp/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/comp/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/extensions/comp/doc/img/type_hierarchy.dot 2015-04-10 23:13:25 UTC (rev 2183) @@ -3,9 +3,9 @@ # dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & # dot -Tpng type_hierarchy.dot -otype_hierarchy.png # -# $Id: type_hierarchy.dot 1249 2012-05-08 08:07:37Z andreas-draeger $ -# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/layout/doc/img/type_hierarchy.dot $ -# $Rev: 1249 $ +# $Id$ +# $URL$ +# $Rev$ /* * Overview of the comp extension type hierarchy Property changes on: trunk/extensions/comp/doc/img/type_hierarchy.dot ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Rev URL \ No newline at end of property Modified: trunk/extensions/distrib/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/distrib/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/extensions/distrib/doc/img/type_hierarchy.dot 2015-04-10 23:13:25 UTC (rev 2183) @@ -3,9 +3,9 @@ # dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & # dot -Tpng type_hierarchy.dot -otype_hierarchy.png # -# $Id: type_hierarchy.dot 1249 2012-05-08 08:07:37Z andreas-draeger $ -# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/layout/doc/img/type_hierarchy.dot $ -# $Rev: 1249 $ +# $Id$ +# $URL$ +# $Rev$ /* * Overview of the distrib extension type hierarchy Property changes on: trunk/extensions/distrib/doc/img/type_hierarchy.dot ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Rev URL \ No newline at end of property Index: trunk/extensions/groups/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/groups/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/extensions/groups/doc/img/type_hierarchy.dot 2015-04-10 23:13:25 UTC (rev 2183) Property changes on: trunk/extensions/groups/doc/img/type_hierarchy.dot ___________________________________________________________________ Modified: svn:keywords ## -1 +1 ## -Id Rev URL +Rev URL Id \ No newline at end of property Index: trunk/extensions/layout/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/layout/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/extensions/layout/doc/img/type_hierarchy.dot 2015-04-10 23:13:25 UTC (rev 2183) Property changes on: trunk/extensions/layout/doc/img/type_hierarchy.dot ___________________________________________________________________ Modified: svn:keywords ## -1 +1 ## -Id Rev URL +Rev URL Id \ No newline at end of property Index: trunk/extensions/qual/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/qual/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/extensions/qual/doc/img/type_hierarchy.dot 2015-04-10 23:13:25 UTC (rev 2183) Property changes on: trunk/extensions/qual/doc/img/type_hierarchy.dot ___________________________________________________________________ Modified: svn:keywords ## -1 +1 ## -Id Rev URL +Rev URL Id \ No newline at end of property Modified: trunk/extensions/render/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/render/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/extensions/render/doc/img/type_hierarchy.dot 2015-04-10 23:13:25 UTC (rev 2183) @@ -3,9 +3,9 @@ # dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & # dot -Tpng type_hierarchy.dot -otype_hierarchy.png # -# $Id: type_hierarchy.dot 794 2011-09-09 15:00:45Z andreas-draeger $ -# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/render/doc/img/type_hierarchy.dot $ -# $Rev: 794 $ +# $Id$ +# $URL$ +# $Rev$ /* * Overview of the render extension type hierarchy Property changes on: trunk/extensions/render/doc/img/type_hierarchy.dot ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Rev URL Id \ No newline at end of property Modified: trunk/extensions/req/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/req/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/extensions/req/doc/img/type_hierarchy.dot 2015-04-10 23:13:25 UTC (rev 2183) @@ -3,9 +3,9 @@ # dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & # dot -Tpng type_hierarchy.dot -otype_hierarchy.png # -# $Id: type_hierarchy.dot 794 2011-09-09 15:00:45Z andreas-draeger $ -# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/spatial/doc/img/type_hierarchy.dot $ -# $Rev: 794 $ +# $Id$ +# $URL$ +# $Rev$ /* * Overview of the req extension type hierarchy Property changes on: trunk/extensions/req/doc/img/type_hierarchy.dot ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Rev URL Id \ No newline at end of property Index: trunk/extensions/spatial/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/spatial/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) +++ trunk/extensions/spatial/doc/img/type_hierarchy.dot 2015-04-10 23:13:25 UTC (rev 2183) Property changes on: trunk/extensions/spatial/doc/img/type_hierarchy.dot ___________________________________________________________________ Modified: svn:keywords ## -1 +1 ## -Id Rev URL +Rev URL Id \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2015-04-10 23:01:44
|
Revision: 2182 http://sourceforge.net/p/jsbml/code/2182 Author: alex-thomas Date: 2015-04-10 23:01:33 +0000 (Fri, 10 Apr 2015) Log Message: ----------- Added chapter material for User Guide with class diagrams for all the extensions except multi. Two caveats: 1) this will need to be compiled with a latex compiler and 2) for some reason, I was not able to properly set svn:keywords, so this will need to be fixed. Modified Paths: -------------- trunk/extensions/dyn/doc/img/type_hierarchy.dot trunk/extensions/fbc/doc/img/type_hierarchy.dot trunk/extensions/groups/doc/img/type_hierarchy.dot trunk/extensions/layout/doc/img/type_hierarchy.dot trunk/extensions/layout/doc/img/type_hierarchy.pdf trunk/extensions/qual/doc/img/type_hierarchy.dot trunk/extensions/qual/doc/img/type_hierarchy.pdf trunk/extensions/spatial/doc/img/type_hierarchy.dot trunk/extensions/spatial/doc/img/type_hierarchy.pdf Added Paths: ----------- trunk/core/doc/user_guide/JSBML_extensions_overview.tex trunk/extensions/arrays/doc/img/ trunk/extensions/arrays/doc/img/type_hierarchy.dot trunk/extensions/arrays/doc/img/type_hierarchy.pdf trunk/extensions/comp/doc/img/type_hierarchy.dot trunk/extensions/comp/doc/img/type_hierarchy.pdf trunk/extensions/distrib/doc/ trunk/extensions/distrib/doc/img/ trunk/extensions/distrib/doc/img/type_hierarchy.dot trunk/extensions/distrib/doc/img/type_hierarchy.pdf trunk/extensions/dyn/doc/img/type_hierarchy.pdf trunk/extensions/fbc/doc/img/type_hierarchy.pdf trunk/extensions/groups/doc/img/type_hierarchy.pdf trunk/extensions/render/doc/img/type_hierarchy.dot trunk/extensions/render/doc/img/type_hierarchy.pdf trunk/extensions/req/doc/img/ trunk/extensions/req/doc/img/type_hierarchy.dot trunk/extensions/req/doc/img/type_hierarchy.pdf Property Changed: ---------------- trunk/extensions/dyn/doc/img/type_hierarchy.dot trunk/extensions/fbc/doc/img/type_hierarchy.dot trunk/extensions/groups/doc/img/type_hierarchy.dot trunk/extensions/layout/doc/img/type_hierarchy.dot trunk/extensions/layout/doc/img/type_hierarchy.pdf trunk/extensions/qual/doc/img/type_hierarchy.dot trunk/extensions/qual/doc/img/type_hierarchy.pdf trunk/extensions/spatial/doc/img/type_hierarchy.dot trunk/extensions/spatial/doc/img/type_hierarchy.pdf Added: trunk/core/doc/user_guide/JSBML_extensions_overview.tex =================================================================== --- trunk/core/doc/user_guide/JSBML_extensions_overview.tex (rev 0) +++ trunk/core/doc/user_guide/JSBML_extensions_overview.tex 2015-04-10 23:01:33 UTC (rev 2182) @@ -0,0 +1,212 @@ +% -*- TeX-master: "User_guide"; fill-column: 75 -*- + +\chapter{JSBML Extensions Overview} +\label{sec:extensionsOverview} + +In this chapter, we quickly overview the \SBMLthree packages currently +implemented for JSBML. + +\section{Qualitative Models Package} +\label{sec:qual-overview} + +Qualitative Models package (qual, for short) allows species in a model to +have non-quantitative or non-continuous concentrations (Chaouiya et al., 2013). +This may manifest as Boolean or discrete values, and is primarily employed in +modeling gene regulation, sig-naling pathways, and metabolic networks using +logical/Boolean networks (Schmulevich et al., 2002) or Petri nets +(Breitling et al., 2008), which in turn, do not rely on traditional quantitative +coeffi-cients to encode relationships between biochemical entities. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/qual/doc/img/type_hierarchy.pdf} + \caption[The qualitative models extension]{} + \label{fig:qual} +\end{figure} + +\section{Flux Balance Constraints Package} +\label{sec:fbc-overview} +Constraints based modeling (Lewis et al., 2012) utilizes a class of models in which +the canonical stoichiometric relations between reac-tions and metabolites are specified +as constraints for convex analysis and mathematical optimization. Although species, +reactions, and stoichiometry can be encoded using the SBML L3V1, +Flux Balance Constraints (fbc, Olivier and Bergmann, 2013) enable a constraints +based perspective. For example, the constraints based approach called +Flux Balance Analysis (FBA) often aims to find the maximum growth rate of the +cell given a set of uptake possibilities and the ratio of molecules needed +for cell growth. The mathematical formulation for this optimization problem +has variables of reaction fluxes and constraints of mass balances around the +metabolites and bounds on the variable reaction fluxes. Because this formulation is +underdetermined, an objective, usually one that maximizes a biomass function which +corresponds to growth rate, is supplied which optimizes the reaction fluxes. Therefore, +the fbc package extends the SBML Level 3 core to specifically encode for bounds on +fluxes, constraints, and objective functions, which facilitates a fluid interface to +existing constraints based modeling software and optimization solvers. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/fbc/doc/img/type_hierarchy.pdf} + \caption[The flux balance constraints extension]{} + \label{fig:fbc} +\end{figure} + +\section{Layout Package} +\label{sec:layout-overview} + +SBML encodes a core set of components (species, reactions) that make up +biochemical networks. The layout extension supports specifying graphical +information for these components. The structure for this extension mirrors +the SBML Level 3 core hierarchy by introducing graphical object (glyph) +counterparts to reactions and species. Glyphs can optionally correspond +to elements in standard SBML, and there can be many glyphs for one element. +In addition, layout elements of non-standard model components can be specified +using the generic GraphicalObject class. Although this exten-sion is powerful +enough to encode the position of all biochemically related graph components, +it should be noted that the scope of this package does not include rendering +of these components. This functionality is provided by the Render package. +Ultimately, the layout extension provides a common language that biochemical +graph editors and viewers can utilize to couple a model to a graph layout. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/layout/doc/img/type_hierarchy.pdf} + \caption[The layout extension]{} + \label{fig:layout} +\end{figure} + +\section{Hierarchical Model Composition Package} +\label{sec:comp-overview} +As the amount of information for biochemical networks increases, models tend to +increase in complexity as well. The Hierarchical Model Composition extension (comp; Smith et al., 2013) +attempts to contextualize this complexity by providing a generic framework to encode +models as hierarchical entities in an SBML document. This functionality also allows +for storing multiple instances of a model within an enclosing model or document, which +can be used to build libraries of models within a document or to independently manage +different parts of a large model. Classes allow modelers to access elements within +sub-models and interface with other submodels, and comp provides a standardized approach +to define submodel differences with respect to parent or reference models. Overall, comp +is a powerful exten-sion to the SBML Level 3 core that gives modelers and programmers +options to standardize the encoding of complex, modular modeling frameworks. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/comp/doc/img/type_hierarchy.pdf} + \caption[The hierarchical model composition extension]{} + \label{fig:comp} +\end{figure} + +\section{Spatial Processes Package} +\label{sec:comp-overview} +The Spatial Processes extension (spatial, Schaff et al., 2014) +provides the ability to the SBML Level 3 core to specify subcellular, +geometric locations for components in biochemical +models. Although subcellular locations can be abstractly represented via +compartments in the SBML core specifica-tions, spatial enables the encoding of +a cellular coordinate system which can describe non-uniform molecular distributions, +diffusive transport, and spatially localized reactions. The Geometry class holds +the spatial information and the extended Species, Reaction, Compartment, and +Parameter objects have mappings to the spatial objects that hold information on +molecular transport coefficients, geometric domains, and coordinates. Spatial is +therefore able to store the geometric information commonly used in spatial modeling +tools for the biochemical entities from standard SBML. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/spatial/doc/img/type_hierarchy.pdf} + \caption[The spatial processes extension]{} + \label{fig:spatial} +\end{figure} + + +\section{Groups Package} +\label{sec:groups-overview} +The other draft extension that is fully supported by JSBML is groups. +This a small extension links together elements in an SBML model. Coupling +groups information with annotation and SBO terms (Courtot et al., 2011) +contextualizes these sets of objects for properly conveying roles of groups +for other programmers and modelers. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/groups/doc/img/type_hierarchy.pdf} + \caption[The groups extension]{} + \label{fig:groups} +\end{figure} + + +\section{Arrays Package} +\label{sec:arrays-overview} +Arrays (arrays, Watanabe et al., 2013) extends SBML variables to include arrays of values, +thereby representing repeated or regular model structures more efficiently. +Arrays provides the ability to access sets of values with indices instead of explicit +declaration and creation of sub-data objects. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/arrays/doc/img/type_hierarchy.pdf} + \caption[The arrays extension]{} + \label{fig:arrays} +\end{figure} + +\section{Required Elements Package} +\label{sec:req-overview} +Required Elements (req, Smith and Hucka, 2013) allows a model to indicate which +components have had their mathematical meanings changed by (e.g.) the use of +another SBML package. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/req/doc/img/type_hierarchy.pdf} + \caption[The arrays extension]{} + \label{fig:arrays} +\end{figure} + + +\section{Distributions Package} +\label{sec:distrib-overview} +Distributions (distrib, Moodie and Smith, 2013) encodes +statistical distributions and their sampling. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/distrib/doc/img/type_hierarchy.pdf} + \caption[The distributions extension]{} + \label{fig:distrib} +\end{figure} + + +\section{Dynamic Structures Package} +\label{sec:dyn-overview} +Dynamic Structures (dyn, Gomez et al., 2014), supports the definition +of dynamical behaviors for model entities. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/dyn/doc/img/type_hierarchy.pdf} + \caption[The dynamic structures extension]{} + \label{fig:dyn} +\end{figure} + + +\section{Rendering Package} +\label{sec:render-overview} +Rendering (render, Gauges et al., 2011) couples with Layout to provide +symbol and style information for network diagrams. + +\begin{figure}[hb] + \centering + \vspace*{2ex} + \includegraphics[width=\textwidth]{../../../extensions/render/doc/img/type_hierarchy.pdf} + \caption[The rendering extension]{} + \label{fig:render} +\end{figure} Added: trunk/extensions/arrays/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/arrays/doc/img/type_hierarchy.dot (rev 0) +++ trunk/extensions/arrays/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -0,0 +1,126 @@ +#!/usr/local/bin/dot +# +# dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & +# dot -Tpng type_hierarchy.dot -otype_hierarchy.png +# +# $Id: type_hierarchy.dot 1249 2012-05-08 08:07:37Z andreas-draeger $ +# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/layout/doc/img/type_hierarchy.dot $ +# $Rev: 1249 $ + +/* + * Overview of the arrays extension type hierarchy + */ + +strict digraph G{ + + nodesep=0.25; + ranksep=0.5; + + edge [ + fontname="Helvetica", + fontsize=10, + labelfontname="Helvetica", + labelfontsize=10 + ]; + node [ + fontname="Helvetica", + fontsize=10, + shape=box + ]; + + /* + * Interfaces + */ + + IdManager [label="<<interface>>\nId Manager"]; + CallableSBase [label="<<interface>>\nCallable\nSBase"]; + ASTNodeCompiler [label="<<interface>>\nASTNode\nCompiler"]; + + /* + * Abstract data types + */ + AbstractNamedSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>NamedSBase</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractMathContainer [label=<<font face="Helvetica-Oblique">Abstract<br/>MatchContainer</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractSBasePlugin [label=<<font face="Helvetica-Oblique">Abstract<br/>SBasePlugin</font>>, style="filled", fillcolor="#F0F8FF"]; + + /********************* + * Inheritance graph * + *********************/ + + + subgraph clusterLayout { + fontname="Helvetica"; + fontsize=12; + style="filled"; + fillcolor="#d2ffd2" + color="#ffffff" + label="Arrays extension"; + labelloc=b; + labeljust=r; + + // Interfaces + + // Enums + + // Objects + + ArraysSBasePlugin [label="Arrays\nSBase\nPlugin"]; + Dimension [label="Dimension"]; + Index [label="Index"]; + ArraysCompiler [label="Arrays\nCompiler"]; + StaticallyComputableCompiler [label="Statically Computable\nCompiler"]; + VectorCompiler [label="Vector\nCompiler"]; + ArraysFlattening [label="Arrays\nFlattening"]; + ArraysMath [label="Arrays\nMath"]; + + + } + + subgraph clusterValidators { + fontname="Helvetica"; + fontsize=12; + style="filled"; + fillcolor="#d2ffd2" + color="#ffffff" + label="Arrays validators and checks"; + labelloc=b; + labeljust=r; + + ArraysMathValidator [label="Arrays\nMath Validator"]; + ArraysValidator [label="Arrays\nValidator"]; + DimensionValidator [label="Dimension\nValidator"]; + ExtendedSBaseValidator [label="Extended SBase\nValidator"]; + IndexValidator [label="Index\nValidator"]; + ArraysConstraint [label="Arrays\nConstraint"]; + ArraysMathCheck [label="Arrays\nMath Check"]; + DimensionArrayDimCheck [label="Dimension\nArray\nDim Check"]; + DimensionIDCheck [label="Dimension\nID Check"]; + DimensionSizeCheck [label="Dimension\nSize Check"]; + IndexArrayDimCheck [label="Index Array\nDim Check"]; + IndexAttributesCheck [label="Index Attributes\nCheck"]; + SBaseWithDimensionCheck [label="SBase With Dimension\nCheck"]; + + ArraysConstraint -> ArraysMathCheck [dir=back,arrowtail=empty]; + ArraysConstraint -> DimensionArrayDimCheck [dir=back,arrowtail=empty]; + ArraysConstraint -> DimensionIDCheck [dir=back,arrowtail=empty]; + ArraysConstraint -> DimensionSizeCheck [dir=back,arrowtail=empty]; + ArraysConstraint -> IndexArrayDimCheck [dir=back,arrowtail=empty]; + ArraysConstraint -> IndexAttributesCheck [dir=back,arrowtail=empty]; + ArraysConstraint -> SBaseWithDimensionCheck [dir=back,arrowtail=empty]; + + } + + /********************* + * Inheritance graph * + *********************/ + + AbstractSBasePlugin -> ArraysSBasePlugin [dir=back,arrowtail=empty]; + AbstractNamedSBase -> Dimension [dir=back,arrowtail=empty]; + AbstractMathContainer -> Index [dir=back,arrowtail=empty]; + ASTNodeCompiler -> ArraysCompiler [dir=back,arrowtail=empty]; + ASTNodeCompiler -> StaticallyComputableCompiler [dir=back,arrowtail=empty]; + ASTNodeCompiler -> VectorCompiler [dir=back,arrowtail=empty]; + IdManager -> ArraysSBasePlugin [dir=back,arrowtail=empty]; + CallableSBase -> Dimension [dir=back,arrowtail=empty]; + +} Added: trunk/extensions/arrays/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Index: trunk/extensions/arrays/doc/img/type_hierarchy.pdf =================================================================== --- trunk/extensions/arrays/doc/img/type_hierarchy.pdf 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/arrays/doc/img/type_hierarchy.pdf 2015-04-10 23:01:33 UTC (rev 2182) Property changes on: trunk/extensions/arrays/doc/img/type_hierarchy.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/extensions/comp/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/comp/doc/img/type_hierarchy.dot (rev 0) +++ trunk/extensions/comp/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -0,0 +1,111 @@ +#!/usr/local/bin/dot +# +# dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & +# dot -Tpng type_hierarchy.dot -otype_hierarchy.png +# +# $Id: type_hierarchy.dot 1249 2012-05-08 08:07:37Z andreas-draeger $ +# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/layout/doc/img/type_hierarchy.dot $ +# $Rev: 1249 $ + +/* + * Overview of the comp extension type hierarchy + */ + +strict digraph G{ + + nodesep=0.25; + ranksep=0.5; + + edge [ + fontname="Helvetica", + fontsize=10, + labelfontname="Helvetica", + labelfontsize=10 + ]; + node [ + fontname="Helvetica", + fontsize=10, + shape=box + ]; + + /* + * Abstract data types + */ + AbstractNamedSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>NamedSBase</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>SBase</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractSBasePlugin [label=<<font face="Helvetica-Oblique">Abstract<br/>SBasePlugin</font>>, style="filled", fillcolor="#F0F8FF"]; + Model [label=<<font face="Helvetica-Oblique">Model</font>>, style="filled", fillcolor="#F0F8FF"]; + + /* + * Interfaces + */ + + UniqueNamedSBase [label="<<interface>>\nUnique\nNamed\nSBase"]; + NamedSBase [label="<<interface>>\nNamed\nSBase"]; + IdManager [label="<<interface>>\nId\nManager"]; + + /********************* + * Inheritance graph * + *********************/ + + AbstractSBase -> AbstractNamedSBase [dir=back,arrowtail=empty]; + + + subgraph clusterLayout { + fontname="Helvetica"; + fontsize=12; + style="filled"; + fillcolor="#d2ffd2" + color="#ffffff" + label="Hierarchical model composition extension"; + labelloc=b; + labeljust=r; + + // Interfaces + + // Enums + + // Objects + + AbstractNamedSBaseRef [label="Abstract\nNamed\nSBaseRef"]; + CompModelPlugin [label="Comp\nModel\nPlugin"]; + CompSBasePlugin [label="Comp\nSBase\nPlugin"]; + CompSBMLDocumentPlugin [label="Comp\nSBML Document\nPlugin"]; + Deletion [label="Deletion"]; + ExternalModelDefinition [label="External\nModel\nDefinition"]; + ModelDefinition [label="Model\nDefinition"]; + Port [label="Port"]; + ReplacedBy [label="ReplacedBy"]; + ReplacedElement [label="ReplacedElement"]; + Submodel [label="Submodel"]; + SBaseRef [label="SBaseRef"]; + + /* + * Inheritance graph + */ + CompSBasePlugin -> CompModelPlugin [dir=back,arrowtail=empty]; + CompSBasePlugin -> CompSBMLDocumentPlugin [dir=back,arrowtail=empty]; + AbstractNamedSBaseRef -> Deletion [dir=back,arrowtail=empty]; + AbstractNamedSBaseRef -> Port [dir=back,arrowtail=empty]; + + } + + /********************* + * Inheritance graph * + *********************/ + + SBaseRef -> AbstractNamedSBaseRef [dir=back,arrowtail=empty]; + SBaseRef -> ReplacedBy [dir=back,arrowtail=empty]; + SBaseRef -> ReplacedElement [dir=back,arrowtail=empty]; + AbstractSBase -> SBaseRef [dir=back,arrowtail=empty]; + AbstractSBasePlugin -> CompSBasePlugin [dir=back,arrowtail=empty]; + AbstractNamedSBase -> ExternalModelDefinition [dir=back,arrowtail=empty]; + AbstractNamedSBase -> Submodel [dir=back,arrowtail=empty]; + Model -> ModelDefinition [dir=back,arrowtail=empty]; + NamedSBase -> AbstractNamedSBaseRef [dir=back,arrowtail=empty]; + IdManager -> CompModelPlugin [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Deletion [dir=back,arrowtail=empty]; + UniqueNamedSBase -> ExternalModelDefinition [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Submodel [dir=back,arrowtail=empty]; + +} Added: trunk/extensions/comp/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Index: trunk/extensions/comp/doc/img/type_hierarchy.pdf =================================================================== --- trunk/extensions/comp/doc/img/type_hierarchy.pdf 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/comp/doc/img/type_hierarchy.pdf 2015-04-10 23:01:33 UTC (rev 2182) Property changes on: trunk/extensions/comp/doc/img/type_hierarchy.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/extensions/distrib/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/distrib/doc/img/type_hierarchy.dot (rev 0) +++ trunk/extensions/distrib/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -0,0 +1,88 @@ +#!/usr/local/bin/dot +# +# dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & +# dot -Tpng type_hierarchy.dot -otype_hierarchy.png +# +# $Id: type_hierarchy.dot 1249 2012-05-08 08:07:37Z andreas-draeger $ +# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/layout/doc/img/type_hierarchy.dot $ +# $Rev: 1249 $ + +/* + * Overview of the distrib extension type hierarchy + */ + +strict digraph G{ + + nodesep=0.25; + ranksep=0.5; + + edge [ + fontname="Helvetica", + fontsize=10, + labelfontname="Helvetica", + labelfontsize=10 + ]; + node [ + fontname="Helvetica", + fontsize=10, + shape=box + ]; + + /* + * Abstract data types + */ + AbstractNamedSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>NamedSBase</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>SBase</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractSBasePlugin [label=<<font face="Helvetica-Oblique">Abstract<br/>SBasePlugin</font>>, style="filled", fillcolor="#F0F8FF"]; + + /* + * Interfaces + */ + + IdManager [label="<<interface>>\nId Manager"]; + + /********************* + * Inheritance graph * + *********************/ + + AbstractSBase -> AbstractNamedSBase [dir=back,arrowtail=empty]; + + + subgraph clusterLayout { + fontname="Helvetica"; + fontsize=12; + style="filled"; + fillcolor="#d2ffd2" + color="#ffffff" + label="Distributions extension"; + labelloc=b; + labeljust=r; + + // Interfaces + + // Enums + + // Objects + + DistribFunctionDefinitionPlugin [label="Distrib Function\nDefinition Plugin"]; + DistribInput [label="Distrib\nInput"]; + DistribSBasePlugin [label="Distrib\nSBasePlugin"]; + DrawFromDistribution [label="Draw From \nDistribution"]; + Uncertainty [label="Uncertainty"]; + + + } + + /********************* + * Inheritance graph * + *********************/ + + AbstractSBasePlugin -> DistribFunctionDefinitionPlugin [dir=back,arrowtail=empty]; + AbstractNamedSBase -> DistribInput [dir=back,arrowtail=empty]; + AbstractNamedSBase -> Uncertainty [dir=back,arrowtail=empty]; + AbstractSBasePlugin -> DistribSBasePlugin [dir=back,arrowtail=empty]; + AbstractSBase -> DrawFromDistribution [dir=back,arrowtail=empty]; + IdManager -> DrawFromDistribution [dir=back,arrowtail=empty]; + + +} Added: trunk/extensions/distrib/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Index: trunk/extensions/distrib/doc/img/type_hierarchy.pdf =================================================================== --- trunk/extensions/distrib/doc/img/type_hierarchy.pdf 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/distrib/doc/img/type_hierarchy.pdf 2015-04-10 23:01:33 UTC (rev 2182) Property changes on: trunk/extensions/distrib/doc/img/type_hierarchy.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/extensions/dyn/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/dyn/doc/img/type_hierarchy.dot 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/dyn/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -4,7 +4,7 @@ # dot -Tpng type_hierarchy.dot -otype_hierarchy.png # # $Id: type_hierarchy.dot -# $URL: svn://svn.code.sf.net/p/jsbml/code/trunk/extensions/dyn/doc/img/type_hierarchy.dot $ +# $URL$ /* * Overview of the dynamic structures extension type hierarchy Property changes on: trunk/extensions/dyn/doc/img/type_hierarchy.dot ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Rev URL \ No newline at end of property Added: trunk/extensions/dyn/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Index: trunk/extensions/dyn/doc/img/type_hierarchy.pdf =================================================================== --- trunk/extensions/dyn/doc/img/type_hierarchy.pdf 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/dyn/doc/img/type_hierarchy.pdf 2015-04-10 23:01:33 UTC (rev 2182) Property changes on: trunk/extensions/dyn/doc/img/type_hierarchy.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/extensions/fbc/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/fbc/doc/img/type_hierarchy.dot 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/fbc/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -6,23 +6,105 @@ # $Id$ # $URL$ # $Rev$ +/* + * Overview of the Fbc extension type hierarchy + */ strict digraph G{ - nodesep=0.25; - ranksep=0.5; + nodesep=0.25; + ranksep=0.5; - edge [ - fontname="Helvetica", - fontsize=10, - labelfontname="Helvetica", - labelfontsize=10 - ]; - node [ - fontname="Helvetica", - fontsize=10, - shape=box - ]; + edge [ + fontname="Helvetica", + fontsize=10, + labelfontname="Helvetica", + labelfontsize=10 + ]; + node [ + fontname="Helvetica", + fontsize=10, + shape=box + ]; + + /* + * Abstract data types + */ + AbstractNamedSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>NamedSBase</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>SBase</font>>, style="filled", fillcolor="#F0F8FF"]; + SBase [label=<<font face="Helvetica-Oblique">SBase</font>>, style="filled", fillcolor="#F0F8FF"]; + /* + * Interfaces + */ + + UniqueNamedSBase [label="<<interface>>\nUnique\nNamed\nSBase"]; + + /********************* + * Inheritance graph * + *********************/ + + AbstractSBase -> AbstractNamedSBase [dir=back,arrowtail=empty]; + + + subgraph clusterFbc { + fontname="Helvetica"; + fontsize=12; + style="filled"; + fillcolor="#d2ffd2" + color="#ffffff" + label="Flux Balance Constraints extension"; + labelloc=b; + labeljust=r; + // Interfaces + Association [label="<<interface>>\nAssociation"]; + + // Objects + And [label="And"]; + Or [label="Or"]; + AbstractFBCSBasePlugin [label="Abstract\nFBC\nSBase\nPlugin"]; + LogicalOperator [label="Logical Operator"]; + Association [label="Association"]; + FBCModelPlugin [label="FBC Model Plugin"]; + FBCReactionPlugin [label="FBC Reaction Plugin"]; + FBCSpeciesPlugin [label="FBC Species Plugin"]; + FluxObjective [label="Flux\nObjective"]; + GeneProduct [label="Gene Product"]; + GeneProductRef [label="Gene\nProduct\nRef"]; + GeneProteinAssociation [label="Gene\nProtein\nAssociation"]; + Objective [label="Objective"]; + + /* + * Inheritance graph + */ + LogicalOperator -> And [dir=back,arrowtail=empty]; + LogicalOperator -> Or [dir=back,arrowtail=empty]; + Association -> GeneProductRef [dir=back,arrowtail=empty]; + Association -> LogicalOperator [dir=back,arrowtail=empty]; + AbstractFBCSBasePlugin -> FBCModelPlugin [dir=back,arrowtail=empty]; + AbstractFBCSBasePlugin -> FBCReactionPlugin [dir=back,arrowtail=empty]; + AbstractFBCSBasePlugin -> FBCSpeciesPlugin [dir=back,arrowtail=empty]; + } + + /********************* + * Inheritance graph * + *********************/ + + AbstractNamedSBase -> Objective [dir=back,arrowtail=empty]; + AbstractSBase -> LogicalOperator [dir=back,arrowtail=empty]; + AbstractNamedSBase -> GeneProteinAssociation [dir=back,arrowtail=empty]; + AbstractNamedSBase -> GeneProductRef [dir=back,arrowtail=empty]; + AbstractNamedSBase -> GeneProduct [dir=back,arrowtail=empty]; + AbstractNamedSBase -> FluxObjective [dir=back,arrowtail=empty]; + SBase -> Association [dir=back,arrowtail=empty]; + AbstractSBase -> LogicalOperator [dir=back,arrowtail=empty]; + AbstractSBasePlugin -> AbstractFBCSBasePlugin [dir=back,arrowtail=empty]; + UniqueNamedSBase -> FluxObjective [dir=back,arrowtail=empty]; + UniqueNamedSBase -> GeneProduct [dir=back,arrowtail=empty]; + Association -> GeneProductRef [dir=back,arrowtail=empty]; + Association -> LogicalOperator [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Objective [dir=back,arrowtail=empty]; + + } Property changes on: trunk/extensions/fbc/doc/img/type_hierarchy.dot ___________________________________________________________________ Modified: svn:keywords ## -1 +1 ## -Id URL Rev +Id Rev URL \ No newline at end of property Added: trunk/extensions/fbc/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Index: trunk/extensions/fbc/doc/img/type_hierarchy.pdf =================================================================== --- trunk/extensions/fbc/doc/img/type_hierarchy.pdf 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/fbc/doc/img/type_hierarchy.pdf 2015-04-10 23:01:33 UTC (rev 2182) Property changes on: trunk/extensions/fbc/doc/img/type_hierarchy.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/extensions/groups/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/groups/doc/img/type_hierarchy.dot 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/groups/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -6,23 +6,82 @@ # $Id$ # $URL$ # $Rev$ +/* + * Overview of the groups extension type hierarchy + */ strict digraph G{ - nodesep=0.25; - ranksep=0.5; + nodesep=0.25; + ranksep=0.5; - edge [ - fontname="Helvetica", - fontsize=10, - labelfontname="Helvetica", - labelfontsize=10 - ]; - node [ - fontname="Helvetica", - fontsize=10, - shape=box - ]; + edge [ + fontname="Helvetica", + fontsize=10, + labelfontname="Helvetica", + labelfontsize=10 + ]; + node [ + fontname="Helvetica", + fontsize=10, + shape=box + ]; + + /* + * Abstract data types + */ + AbstractNamedSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>NamedSBase</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractSBasePlugin [label=<<font face="Helvetica-Oblique">Abstract<br/>SBasePlugin</font>>, style="filled", fillcolor="#F0F8FF"]; + ListOf [label=<<font face="Helvetica-Oblique">List Of</font>>, style="filled", fillcolor="#F0F8FF"]; + + UniqueNamedSBase [label="<<interface>>\nUnique\nNamed\nSBase"]; + NamedSBase [label="<<interface>>\nNamed\nSBase"]; + + /********************* + * Inheritance graph * + *********************/ + + AbstractSBase -> AbstractNamedSBase [dir=back,arrowtail=empty]; + + + subgraph clusterGroups { + fontname="Helvetica"; + fontsize=12; + style="filled"; + fillcolor="#d2ffd2" + color="#ffffff" + label="Groups extension"; + labelloc=b; + labeljust=r; + // Interfaces + // Enums + GroupKind [label=<<font face="Helvetica-Oblique">Group<br/>Kind</font>>]; + + // Objects + Group [label="Group"]; + GroupsModelPlugin [label="Groups\nModel\nPlugin"]; + MemberConstraint [label="Member\nConstraint"]; + Member [label="Member"]; + ListOfMemberConstraint [label="List Of\nMember Constraint"]; + + Group -> GroupKind [dir=back,arrowtail=empty]; + } + + /********************* + * Inheritance graph * + *********************/ + + AbstractNamedSBase -> Group [dir=back,arrowtail=empty]; + AbstractNamedSBase -> MemberConstraint [dir=back,arrowtail=empty]; + AbstractNamedSBase -> Member [dir=back,arrowtail=empty]; + AbstractSBasePlugin -> GroupsModelPlugin [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Group [dir=back,arrowtail=empty]; + UniqueNamedSBase -> ListOfMemberConstraint [dir=back,arrowtail=empty]; + NamedSBase -> ListOfMemberConstraint [dir=back,arrowtail=empty]; + ListOf -> ListOfMemberConstraint [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Member [dir=back,arrowtail=empty]; + UniqueNamedSBase -> MemberConstraint [dir=back,arrowtail=empty]; + } Property changes on: trunk/extensions/groups/doc/img/type_hierarchy.dot ___________________________________________________________________ Modified: svn:keywords ## -1 +1 ## -URL Id Rev +Id Rev URL \ No newline at end of property Added: trunk/extensions/groups/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Index: trunk/extensions/groups/doc/img/type_hierarchy.pdf =================================================================== --- trunk/extensions/groups/doc/img/type_hierarchy.pdf 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/groups/doc/img/type_hierarchy.pdf 2015-04-10 23:01:33 UTC (rev 2182) Property changes on: trunk/extensions/groups/doc/img/type_hierarchy.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/extensions/layout/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/layout/doc/img/type_hierarchy.dot 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/layout/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -27,19 +27,28 @@ fontsize=10, shape=box ]; + + /* + * Interfaces + */ + + UniqueNamedSBase [label="<<interface>>\nUnique\nNamed\nSBase"]; + - /* + /* * Abstract data types */ AbstractNamedSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>NamedSBase</font>>, style="filled", fillcolor="#F0F8FF"]; AbstractSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>SBase</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractSBasePlugin [label=<<font face="Helvetica-Oblique">Abstract<br/>SBase<br/>Plugin</font>>, style="filled", fillcolor="#F0F8FF"]; + NameFilter [label=<<font face="Helvetica-Oblique">Name<br/>Filter</font>>, style="filled", fillcolor="#F0F8FF"]; /********************* * Inheritance graph * *********************/ - AbstractSBase -> AbstractNamedSBase [dir=back,arrowtail=empty]; + AbstractSBase -> AbstractNamedSBase [dir=back,arrowtail=empty]; subgraph clusterLayout { @@ -55,33 +64,44 @@ // Interfaces // Enums - //SpeciesReferenceRole [label="SpeciesReference\nRole"]; + SpeciesReferenceRole [label=<<font face="Helvetica-Oblique">Species Reference<br/>Role</font>>]; // Objects BoundingBox [label="Bounding\nBox"]; CompartmentGlyph [label="Compartment\nGlyph"]; CubicBezier [label="Cubic\nBezier"]; Curve [label="Curve"]; + CurveSegment [label="Curve\nSegment"]; Dimensions [label="Dimensions"]; - ExtendedLayoutModel [label="Extended\nLayoutModel"]; + LayoutModelPlugin [label="Layout\nModel\nPlugin"]; GraphicalObject [label="Graphical\nObject"]; Layout [label="Layout"]; - // LayoutParser [label="Layout\nParser"]; LineSegment [label="Line\nSegment"]; Point [label="Point"]; ReactionGlyph [label="Reaction\nGlyph"]; SpeciesReferencesGlyph [label="SpeciesReferences\nGlyph"]; TextGlyph [label="Text\nGlyph"]; - + AbstractReferenceGlyph [label="Abstract\nReference\nGlyph"]; + GeneralGlyph [label="General\nGlyph"]; + ReferenceGlyph [label="Reference\nGlyph"]; + SpeciesGlyph [label="Species\nGlyph"]; + NamedSBaseReferenceFilter [label="Named SBase\nReference Filter"]; + /* * Inheritance graph */ - GraphicalObject -> CompartmentGlyph [dir=back,arrowtail=empty]; - GraphicalObject -> ReactionGlyph [dir=back,arrowtail=empty]; - GraphicalObject -> SpeciesGlyph [dir=back,arrowtail=empty]; - GraphicalObject -> SpeciesReferencesGlyph [dir=back,arrowtail=empty]; - GraphicalObject -> TextGlyph [dir=back,arrowtail=empty]; - LineSegment -> CubicBezier [dir=back,arrowtail=empty]; + AbstractReferenceGlyph -> CompartmentGlyph [dir=back,arrowtail=empty]; + AbstractReferenceGlyph -> GeneralGlyph [dir=back,arrowtail=empty]; + AbstractReferenceGlyph -> ReactionGlyph [dir=back,arrowtail=empty]; + AbstractReferenceGlyph -> ReferenceGlyph [dir=back,arrowtail=empty]; + AbstractReferenceGlyph -> SpeciesGlyph [dir=back,arrowtail=empty]; + AbstractReferenceGlyph -> SpeciesReferencesGlyph [dir=back,arrowtail=empty]; + AbstractReferenceGlyph -> TextGlyph [dir=back,arrowtail=empty]; + GraphicalObject -> AbstractReferenceGlyph [dir=back,arrowtail=empty]; + LineSegment -> CubicBezier [dir=back,arrowtail=empty]; + CurveSegment -> LineSegment [dir=back,arrowtail=empty]; + SpeciesReferencesGlyph -> SpeciesReferenceRole [dir=back,arrowtail=empty]; + } /********************* @@ -90,11 +110,18 @@ AbstractNamedSBase -> BoundingBox [dir=back,arrowtail=empty]; AbstractNamedSBase -> Curve [dir=back,arrowtail=empty]; + AbstractSBase -> CurveSegment [dir=back,arrowtail=empty]; AbstractNamedSBase -> Dimensions [dir=back,arrowtail=empty]; AbstractNamedSBase -> GraphicalObject [dir=back,arrowtail=empty]; AbstractNamedSBase -> Layout [dir=back,arrowtail=empty]; - AbstractNamedSBase -> LineSegment [dir=back,arrowtail=empty]; AbstractNamedSBase -> Point [dir=back,arrowtail=empty]; - AbstractSBase -> ExtendedLayoutModel [dir=back,arrowtail=empty]; + AbstractSBasePlugin -> LayoutModelPlugin [dir=back,arrowtail=empty]; + UniqueNamedSBase -> BoundingBox [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Dimensions [dir=back,arrowtail=empty]; + UniqueNamedSBase -> GraphicalObject [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Layout [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Point [dir=back,arrowtail=empty]; + NameFilter -> NamedSBaseReferenceFilter [dir=back,arrowtail=empty]; + } Property changes on: trunk/extensions/layout/doc/img/type_hierarchy.dot ___________________________________________________________________ Modified: svn:keywords ## -1 +1 ## -URL Id Rev +Id Rev URL \ No newline at end of property Modified: trunk/extensions/layout/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Index: trunk/extensions/layout/doc/img/type_hierarchy.pdf =================================================================== --- trunk/extensions/layout/doc/img/type_hierarchy.pdf 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/layout/doc/img/type_hierarchy.pdf 2015-04-10 23:01:33 UTC (rev 2182) Property changes on: trunk/extensions/layout/doc/img/type_hierarchy.pdf ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Rev URL \ No newline at end of property Modified: trunk/extensions/qual/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/qual/doc/img/type_hierarchy.dot 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/qual/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -30,35 +30,73 @@ AbstractNamedSBase [label=<<font><I>Abstract<br/>NamedSBase</I></font>>, style="filled", fillcolor="#F0F8FF"]; AbstractSBase [label=<<font><I>Abstract<br/>SBase</I></font>>, style="filled", fillcolor="#F0F8FF"]; AbstractSBasePlugin [label=<<font><I>AbstractSBase<br/>Plugin</I></font>>, style="filled", fillcolor="#F0F8FF"]; - - /* - * Objects - */ - FunctionTerm [label="Function\nTerm"]; - Input [label="Input"]; - Output [label="Output"]; - QualitativeSpecies [label="Qualitative\nSpecies"]; - QualitativeModel [label="Qualitative\nModel"]; - SymbolValue [label="Symbol\nValue"]; - TemporisationMath [label="Temporisation\nMath"]; - Transition [label="Transition"]; + /* + * Interfaces + */ + + UniqueNamedSBase [label="<<interface>>\nUnique Named SBase"]; + CallableSBase [label="<<interface>>\nCallable SBase"]; + + subgraph clusterQual { + fontname="Helvetica"; + fontsize=12; + style="filled"; + fillcolor="#d2ffd2" + color="#ffffff" + label="Qualitative Models Extension"; + labelloc=b; + labeljust=r; + + // Abstract data types + InputTransitionEffect [label=<<font face="Helvetica-Oblique">Input<br/>Transition<br/>Effect</font>>]; + OutputTransitionEffect [label=<<font face="Helvetica-Oblique">Output<br/>Transition<br/>Effect</font>>]; + Sign [label=<<font face="Helvetica-Oblique">Sign</font>>]; + + /* + * Objects + */ + FunctionTerm [label="Function\nTerm"]; + Input [label="Input"]; + Output [label="Output"]; + QualitativeSpecies [label="Qualitative\nSpecies"]; + QualModelPlugin [label="Qual Model\nPlugin"]; + Transition [label="Transition"]; + + /* + * inheritance graph + */ + Input -> InputTransitionEffect [dir=back,arrowtail=empty]; + Transition -> InputTransitionEffect [dir=back,arrowtail=empty]; + Output -> OutputTransitionEffect [dir=back,arrowtail=empty]; + Transition -> OutputTransitionEffect [dir=back,arrowtail=empty]; + Input -> Sign [dir=back,arrowtail=empty]; + + } + /* * inheritance graph */ AbstractMathContainer -> FunctionTerm [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Input [dir=back,arrowtail=empty]; + CallableSBase -> Input [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Output [dir=back,arrowtail=empty]; + CallableSBase -> Output [dir=back,arrowtail=empty]; + + UniqueNamedSBase -> QualitativeSpecies [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Transition [dir=back,arrowtail=empty]; + + AbstractNamedSBase -> QualitativeSpecies [dir=back,arrowtail=empty]; AbstractNamedSBase -> Transition [dir=back,arrowtail=empty]; AbstractNamedSBase -> Input [dir=back,arrowtail=empty]; AbstractNamedSBase -> Output [dir=back,arrowtail=empty]; - AbstractNamedSBase -> SymbolValue [dir=back,arrowtail=empty]; AbstractSBase -> AbstractNamedSBase [dir=back,arrowtail=empty]; AbstractSBase -> AbstractMathContainer [dir=back,arrowtail=empty]; AbstractSBase -> AbstractSBasePlugin [dir=back,arrowtail=empty,style=dashed]; - AbstractSBasePlugin -> QualitativeModel [dir=back,arrowtail=empty]; + AbstractSBasePlugin -> QualModelPlugin [dir=back,arrowtail=empty]; - AbstractMathContainer -> TemporisationMath [dir=back,arrowtail=empty] } Property changes on: trunk/extensions/qual/doc/img/type_hierarchy.dot ___________________________________________________________________ Modified: svn:keywords ## -1 +1 ## -Id Date Author Rev URL +Id Rev URL \ No newline at end of property Modified: trunk/extensions/qual/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Index: trunk/extensions/qual/doc/img/type_hierarchy.pdf =================================================================== --- trunk/extensions/qual/doc/img/type_hierarchy.pdf 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/qual/doc/img/type_hierarchy.pdf 2015-04-10 23:01:33 UTC (rev 2182) Property changes on: trunk/extensions/qual/doc/img/type_hierarchy.pdf ___________________________________________________________________ Modified: svn:keywords ## -1 +1 ## -Id Date Author Rev URL +Id Rev URL \ No newline at end of property Added: trunk/extensions/render/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/render/doc/img/type_hierarchy.dot (rev 0) +++ trunk/extensions/render/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -0,0 +1,149 @@ +#!/usr/local/bin/dot +# +# dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & +# dot -Tpng type_hierarchy.dot -otype_hierarchy.png +# +# $Id: type_hierarchy.dot 794 2011-09-09 15:00:45Z andreas-draeger $ +# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/render/doc/img/type_hierarchy.dot $ +# $Rev: 794 $ + +/* + * Overview of the render extension type hierarchy + */ + +strict digraph G{ + + nodesep=0.25; + ranksep=0.5; + + edge [ + fontname="Helvetica", + fontsize=10, + labelfontname="Helvetica", + labelfontsize=10 + ]; + node [ + fontname="Helvetica", + fontsize=10, + shape=box + ]; + + /* + * Interfaces + */ + UniqueNamedSBase [label="<<interface>>\nUniqueNamedSBase"]; + + /* + * Abstract data types + */ + AbstractSBasePlugin [label=<<font face="Helvetica-Oblique">Abstract<br/>SBase Plugin</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>SBase</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractNamedSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>Named<br/>SBase</font>>, style="filled", fillcolor="#F0F8FF"]; + + /* + * The render extension + */ + + subgraph clusterRender { + fontname="Helvetica"; + fontsize=12; + style="filled"; + fillcolor="#d2ffd2" + color="#ffffff" + label="Rendering elements extension"; + labelloc=b; + labeljust=r; + + // Interfaces + FontRenderStyle [label="<<interface>>\nFont\nRender\nStyle"]; + Point3D [label="<<interface>>\nPoint3D"]; + + // Enums + + // Abstract data types + FontFamily [label=<<font face="Helvetica-Oblique">Font<br/>Family</font>>]; + TextAnchor [label=<<font face="Helvetica-Oblique">Text<br/>Anchor</font>>]; + VTextAnchor [label=<<font face="Helvetica-Oblique">VText<br/>Anchor</font>>]; + + // Objects + AbstractRenderPlugin [label="Abstract\nRender\nPlugin"]; + ColorDefinition [label="Color\nDefinition"]; + GraphicalPrimitive2D [label="Graphical\nPrimitive2D"]; + GraphicalPrimitive1D [label="Graphical\nPrimitive1D"]; + Transformation2D [label="Transformation2D"]; + Transformation [label="Transformation"]; + Ellipse [label="Ellipse"]; + RenderInformationBase [label="Render\nInformation\nBase"]; + GlobalRenderInformation [label="Global\nRender\nInformation"]; + GradientBase [label="Gradient\nBase"]; + GradientStop [label="Gradient\nStop"]; + Image [label="Image"]; + LinearGradient [label="Linear\nGradient"]; + LineEnding [label="Line\nEnding"]; + LocalRenderInformation [label="Local Render\nInformation"]; + LocalStyle [label="Local\nStyle"]; + Style [label="Style"]; + Polygon [label="Polygon"]; + RadialGradient [label="RadialGradient"]; + Rectangle [label="Rectangle"]; + RenderPoint [label="Render\nPoint"]; + RenderCubicBezier [label="Render\nCubic\nBezier"]; + RenderCurve [label="Render\nCurve"]; + RenderGroup [label="Render\nGroup"]; + RenderLayoutPlugin [label="Render\nLayout\nPlugin"]; + RenderListOfLayoutsPlugin [label="Render\nList Of\nLayouts Plugin"]; + Text [label="Text"]; + XMLTools [label="X\nTools"]; + + /* + * Inheritance graph + */ + Transformation -> Transformation2D [dir=back,arrowtail=empty]; + Transformation2D -> GraphicalPrimitive1D [dir=back,arrowtail=empty]; + GraphicalPrimitive1D -> GraphicalPrimitive2D [dir=back,arrowtail=empty]; + GraphicalPrimitive2D -> Ellipse [dir=back,arrowtail=empty]; + FontRenderStyle -> FontFamily [dir=back,arrowtail=empty]; + RenderInformationBase -> GlobalRenderInformation [dir=back,arrowtail=empty]; + Transformation2D -> Image [dir=back,arrowtail=empty]; + GradientBase -> LinearGradient [dir=back,arrowtail=empty]; + GraphicalPrimitive2D -> LineEnding [dir=back,arrowtail=empty]; + RenderInformationBase -> LocalRenderInformation [dir=back,arrowtail=empty]; + Style -> LocalStyle [dir=back,arrowtail=empty]; + GraphicalPrimitive2D -> Polygon [dir=back,arrowtail=empty]; + GradientBase -> RadialGradient [dir=back,arrowtail=empty]; + GraphicalPrimitive2D -> Rectangle [dir=back,arrowtail=empty]; + Point3D -> Rectangle [dir=back,arrowtail=empty]; + Point3D -> RenderPoint [dir=back,arrowtail=empty]; + RenderPoint -> RenderCubicBezier [dir=back,arrowtail=empty]; + GraphicalPrimitive1D -> RenderCurve [dir=back,arrowtail=empty]; + GraphicalPrimitive2D -> RenderGroup [dir=back,arrowtail=empty]; + AbstractRenderPlugin -> RenderLayoutPlugin [dir=back,arrowtail=empty]; + AbstractRenderPlugin -> RenderListOfLayoutsPlugin [dir=back,arrowtail=empty]; + GraphicalPrimitive1D -> Text [dir=back,arrowtail=empty]; + FontRenderStyle -> Text [dir=back,arrowtail=empty]; + Point3D -> Text [dir=back,arrowtail=empty]; + FontRenderStyle -> TextAnchor [dir=back,arrowtail=empty]; + FontRenderStyle -> VTextAnchor [dir=back,arrowtail=empty]; + + + + } + + /********************* + * Inheritance graph * + *********************/ + AbstractSBase -> AbstractNamedSBase [dir=back,arrowtail=empty]; + AbstractSBasePlugin -> AbstractRenderPlugin [dir=back,arrowtail=empty]; + AbstractNamedSBase -> ColorDefinition [dir=back,arrowtail=empty]; + AbstractSBase -> Transformation [dir=back,arrowtail=empty]; + AbstractNamedSBase -> RenderInformationBase [dir=back,arrowtail=empty]; + UniqueNamedSBase -> RenderInformationBase [dir=back,arrowtail=empty]; + AbstractNamedSBase -> GradientBase [dir=back,arrowtail=empty]; + UniqueNamedSBase -> GradientBase [dir=back,arrowtail=empty]; + AbstractSBase -> GradientStop [dir=back,arrowtail=empty]; + UniqueNamedSBase -> Style [dir=back,arrowtail=empty]; + AbstractSBase -> Style [dir=back,arrowtail=empty]; + AbstractSBase -> RenderPoint [dir=back,arrowtail=empty]; + UniqueNamedSBase -> RenderGroup [dir=back,arrowtail=empty]; + +} Added: trunk/extensions/render/doc/img/type_hierarchy.pdf =================================================================== (Binary files differ) Index: trunk/extensions/render/doc/img/type_hierarchy.pdf =================================================================== --- trunk/extensions/render/doc/img/type_hierarchy.pdf 2015-04-09 13:44:21 UTC (rev 2181) +++ trunk/extensions/render/doc/img/type_hierarchy.pdf 2015-04-10 23:01:33 UTC (rev 2182) Property changes on: trunk/extensions/render/doc/img/type_hierarchy.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/extensions/req/doc/img/type_hierarchy.dot =================================================================== --- trunk/extensions/req/doc/img/type_hierarchy.dot (rev 0) +++ trunk/extensions/req/doc/img/type_hierarchy.dot 2015-04-10 23:01:33 UTC (rev 2182) @@ -0,0 +1,80 @@ +#!/usr/local/bin/dot +# +# dot -Tpdf type_hierarchy.dot -otype_hierarchy.pdf && acroread type_hierarchy.pdf & +# dot -Tpng type_hierarchy.dot -otype_hierarchy.png +# +# $Id: type_hierarchy.dot 794 2011-09-09 15:00:45Z andreas-draeger $ +# $URL: svn+ssh://svn.code.sf.net/p/jsbml/code/trunk/extensions/spatial/doc/img/type_hierarchy.dot $ +# $Rev: 794 $ + +/* + * Overview of the req extension type hierarchy + */ + +strict digraph G{ + + nodesep=0.25; + ranksep=0.5; + + edge [ + fontname="Helvetica", + fontsize=10, + labelfontname="Helvetica", + labelfontsize=10 + ]; + node [ + fontname="Helvetica", + fontsize=10, + shape=box + ]; + + /* + * Interfaces + */ + + + /* + * Abstract data types + */ + AbstractSBasePlugin [label=<<font face="Helvetica-Oblique">Abstract<br/>SBase Plugin</font>>, style="filled", fillcolor="#F0F8FF"]; + AbstractNamedSBase [label=<<font face="Helvetica-Oblique">Abstract<br/>SBase</font>>, style="filled", fillcolor="#F0F8FF"]; + + /* + * The required elements extension + */ + + subgraph clusterReq { + fontname="Helvetica"; + fontsize=12; + style="filled"; + fillcolor="#d2ffd2" + color="#ffffff" + label="Required Elements extension"; + labelloc=b; + labeljust=r; + + // Interfaces + + // Enums + + // Abstract data types + + // Objects + ReqSBasePlugin [label="Req\nSBase\nPlugin"]; + ChangedMath [label="Changed\nMath"]; + + + /* + * Inheritance graph + */ + + } + + /*******************... [truncated message content] |
From: <nik...@us...> - 2015-04-09 13:44:31
|
Revision: 2181 http://sourceforge.net/p/jsbml/code/2181 Author: niko-rodrigue Date: 2015-04-09 13:44:21 +0000 (Thu, 09 Apr 2015) Log Message: ----------- started to modify the spatial packages to be able to set properly the package version + corrected the cloning method in AbstractSBasePlugin to copy correctly the namespace Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ext/AbstractSBasePlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ImageData.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/MixedGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonObject.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java Modified: trunk/core/src/org/sbml/jsbml/ext/AbstractSBasePlugin.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ext/AbstractSBasePlugin.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/core/src/org/sbml/jsbml/ext/AbstractSBasePlugin.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -90,6 +90,8 @@ public AbstractSBasePlugin(SBasePlugin plugin) { super(plugin); setPackageVersion(plugin.getPackageVersion()); + setNamespace(plugin.getElementNamespace()); + // the extendedSBase will be set when the cloned SBasePlugin is added inside an SBase // then the ids of is children will be registered in the correct maps. extendedSBase = null; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -59,6 +59,7 @@ */ public AbstractSpatialNamedSBase() { super(); + initDefaults(); } /** @@ -67,6 +68,7 @@ */ public AbstractSpatialNamedSBase(int level, int version) { super(level, version); + initDefaults(); } /** @@ -87,6 +89,7 @@ */ public AbstractSpatialNamedSBase(String spatialId, int level, int version) { super(level,version); + initDefaults(); this.spatialId = spatialId; } @@ -96,9 +99,20 @@ */ public AbstractSpatialNamedSBase(String spatialId) { super(); + initDefaults(); this.spatialId = spatialId; } - + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = SpatialConstants.shortLabel; + } + + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractSBase#equals(java.lang.Object) */ @@ -159,7 +173,7 @@ */ @Override public void setSpatialId(String spatialId) { - String oldSpatialId = this.spatialId; + String oldSpatialId = this.spatialId; // TODO - the IdManager need to be updated this.spatialId = spatialId; firePropertyChange(SpatialConstants.spatialId, oldSpatialId, this.spatialId); } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -47,6 +47,7 @@ */ public AbstractSpatialSBasePlugin() { super(); + initDefaults(); } /** @@ -61,8 +62,16 @@ */ public AbstractSpatialSBasePlugin(SBase extendedSBase) { super(extendedSBase); + initDefaults(); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + } + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractTreeNode#getParent() */ @@ -84,19 +93,11 @@ } /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return SpatialConstants.getNamespaceURI(getLevel(), getVersion()); - } - - /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() */ @Override public String getPackageName() { - return SpatialConstants.packageName; + return SpatialConstants.shortLabel; } /* (non-Javadoc) Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -75,17 +75,6 @@ } - /** - * - * @param id - * @param level - * @param version - */ - public AdvectionCoefficient(String id, int level, int version) { - super(level, version); - } - - @Override public AdvectionCoefficient clone() { return new AdvectionCoefficient(this); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -92,7 +92,8 @@ * */ public AnalyticVolume() { - super(); + super(); + initDefaults(); } /** @@ -119,9 +120,20 @@ public AnalyticVolume(String id, int level, int version) { super(level,version); + initDefaults(); spatialId = id; - } + } + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = SpatialConstants.shortLabel; + } + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractTreeNode#clone() */ @@ -330,7 +342,7 @@ */ @Override public void setSpatialId(String spatialId) { - String oldSpatialId = this.spatialId; + String oldSpatialId = this.spatialId; // TODO - the IdManager need to be updated this.spatialId = spatialId; firePropertyChange(SpatialConstants.spatialId, oldSpatialId, this.spatialId); } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -353,7 +353,11 @@ if (!isSetListOfCSGNodes()) { listOfCSGNodes = new ListOf<CSGNode>(getLevel(), getVersion()); - listOfCSGNodes.setNamespace(SpatialConstants.namespaceURI); + listOfCSGNodes.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCSGNodes.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfCSGNodes.setPackageName(null); + listOfCSGNodes.setPackageName(SpatialConstants.shortLabel); listOfCSGNodes.setSBaseListType(ListOf.Type.other); registerChild(listOfCSGNodes); } @@ -370,7 +374,17 @@ public void setListOfCSGNodes(ListOf<CSGNode> listOfCSGNodes) { unsetListOfCSGNodes(); this.listOfCSGNodes = listOfCSGNodes; - registerChild(this.listOfCSGNodes); + + if (listOfCSGNodes != null) { + listOfCSGNodes.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCSGNodes.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfCSGNodes.setPackageName(null); + listOfCSGNodes.setPackageName(SpatialConstants.shortLabel); + listOfCSGNodes.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfCSGNodes); + } } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGeometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGeometry.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGeometry.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -127,7 +127,11 @@ if (!isSetListOfCSGObjects()) { listOfCSGObjects = new ListOf<CSGObject>(getLevel(), getVersion()); - listOfCSGObjects.setNamespace(SpatialConstants.namespaceURI); + listOfCSGObjects.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCSGObjects.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfCSGObjects.setPackageName(null); + listOfCSGObjects.setPackageName(SpatialConstants.shortLabel); listOfCSGObjects.setSBaseListType(ListOf.Type.other); registerChild(listOfCSGObjects); } @@ -144,7 +148,18 @@ public void setListOfCSGObjects(ListOf<CSGObject> listOfCSGObjects) { unsetListOfCSGObjects(); this.listOfCSGObjects = listOfCSGObjects; - registerChild(this.listOfCSGObjects); + + if (listOfCSGObjects != null) { + listOfCSGObjects.unsetNamespace(); + listOfCSGObjects.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCSGObjects.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfCSGObjects.setPackageName(null); + listOfCSGObjects.setPackageName(SpatialConstants.shortLabel); + listOfCSGObjects.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfCSGObjects); + } } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -53,6 +53,7 @@ */ public CoordinateReference() { super(); + initDefaults(); } /** @@ -66,6 +67,14 @@ } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = SpatialConstants.shortLabel; + } /* (non-Javadoc) * @see org.sbml.jsbml.AbstractSBase#clone() Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -83,7 +83,7 @@ * @param level * @param version */ - public Domain(String id,int level, int version) { + public Domain(String id, int level, int version) { super(id,level,version); } @@ -187,7 +187,11 @@ public ListOf<InteriorPoint> getListOfInteriorPoints() { if (!isSetListOfInteriorPoints()) { listOfInteriorPoints = new ListOf<InteriorPoint>(); - listOfInteriorPoints.setNamespace(SpatialConstants.namespaceURI); + listOfInteriorPoints.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfInteriorPoints.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfInteriorPoints.setPackageName(null); + listOfInteriorPoints.setPackageName(SpatialConstants.shortLabel); listOfInteriorPoints.setSBaseListType(ListOf.Type.other); registerChild(listOfInteriorPoints); } @@ -204,7 +208,18 @@ public void setListOfInteriorPoints(ListOf<InteriorPoint> listOfInteriorPoints) { unsetListOfInteriorPoints(); this.listOfInteriorPoints = listOfInteriorPoints; - registerChild(this.listOfInteriorPoints); + + if (listOfInteriorPoints != null) { + listOfInteriorPoints.unsetNamespace(); + listOfInteriorPoints.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfInteriorPoints.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfInteriorPoints.setPackageName(null); + listOfInteriorPoints.setPackageName(SpatialConstants.shortLabel); + listOfInteriorPoints.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfInteriorPoints); + } } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -277,7 +277,11 @@ if (!isSetListOfSampledFields()) { listOfSampledFields = new ListOf<SampledField>(getLevel(), getVersion()); - listOfSampledFields.setNamespace(SpatialConstants.namespaceURI); + listOfSampledFields.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSampledFields.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfSampledFields.setPackageName(null); + listOfSampledFields.setPackageName(SpatialConstants.shortLabel); listOfSampledFields.setSBaseListType(ListOf.Type.other); registerChild(listOfSampledFields); } @@ -294,7 +298,18 @@ public void setListOfSampledFields(ListOf<SampledField> listOfSampledFields) { unsetListOfSampledFields(); this.listOfSampledFields = listOfSampledFields; - registerChild(this.listOfSampledFields); + + if (listOfSampledFields != null) { + listOfSampledFields.unsetNamespace(); + listOfSampledFields.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSampledFields.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfSampledFields.setPackageName(null); + listOfSampledFields.setPackageName(SpatialConstants.shortLabel); + listOfSampledFields.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfSampledFields); + } } @@ -408,7 +423,11 @@ public ListOf<GeometryDefinition> getListOfGeometryDefinitions() { if (!isSetListOfGeometryDefinitions()) { listOfGeometryDefinitions = new ListOf<GeometryDefinition>(); - listOfGeometryDefinitions.setNamespace(SpatialConstants.namespaceURI); + listOfGeometryDefinitions.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGeometryDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfGeometryDefinitions.setPackageName(null); + listOfGeometryDefinitions.setPackageName(SpatialConstants.shortLabel); listOfGeometryDefinitions.setSBaseListType(ListOf.Type.other); registerChild(listOfGeometryDefinitions); } @@ -425,7 +444,18 @@ public void setListOfGeometryDefinitions(ListOf<GeometryDefinition> listOfGeometryDefinitions) { unsetListOfGeometryDefinitions(); this.listOfGeometryDefinitions = listOfGeometryDefinitions; - registerChild(this.listOfGeometryDefinitions); + + if (listOfGeometryDefinitions != null) { + listOfGeometryDefinitions.unsetNamespace(); + listOfGeometryDefinitions.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGeometryDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfGeometryDefinitions.setPackageName(null); + listOfGeometryDefinitions.setPackageName(SpatialConstants.shortLabel); + listOfGeometryDefinitions.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfGeometryDefinitions); + } } @@ -607,7 +637,11 @@ public ListOf<AdjacentDomains> getListOfAdjacentDomains() { if (!isSetListOfAdjacentDomains()) { listOfAdjacentDomains = new ListOf<AdjacentDomains>(); - listOfAdjacentDomains.setNamespace(SpatialConstants.namespaceURI); + listOfAdjacentDomains.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfAdjacentDomains.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfAdjacentDomains.setPackageName(null); + listOfAdjacentDomains.setPackageName(SpatialConstants.shortLabel); listOfAdjacentDomains.setSBaseListType(ListOf.Type.other); registerChild(listOfAdjacentDomains); } @@ -624,7 +658,18 @@ public void setListOfAdjacentDomains(ListOf<AdjacentDomains> listOfAdjacentDomains) { unsetListOfAdjacentDomains(); this.listOfAdjacentDomains = listOfAdjacentDomains; - registerChild(this.listOfAdjacentDomains); + + if (listOfAdjacentDomains != null) { + listOfAdjacentDomains.unsetNamespace(); + listOfAdjacentDomains.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfAdjacentDomains.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfAdjacentDomains.setPackageName(null); + listOfAdjacentDomains.setPackageName(SpatialConstants.shortLabel); + listOfAdjacentDomains.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfAdjacentDomains); + } } @@ -738,7 +783,11 @@ public ListOf<DomainType> getListOfDomainTypes() { if (!isSetListOfDomainTypes()) { listOfDomainTypes = new ListOf<DomainType>(); - listOfDomainTypes.setNamespace(SpatialConstants.namespaceURI); + listOfDomainTypes.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDomainTypes.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfDomainTypes.setPackageName(null); + listOfDomainTypes.setPackageName(SpatialConstants.shortLabel); listOfDomainTypes.setSBaseListType(ListOf.Type.other); registerChild(listOfDomainTypes); } @@ -755,7 +804,18 @@ public void setListOfDomainTypes(ListOf<DomainType> listOfDomainTypes) { unsetListOfDomainTypes(); this.listOfDomainTypes = listOfDomainTypes; - registerChild(this.listOfDomainTypes); + + if (listOfDomainTypes != null) { + listOfDomainTypes.unsetNamespace(); + listOfDomainTypes.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDomainTypes.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfDomainTypes.setPackageName(null); + listOfDomainTypes.setPackageName(SpatialConstants.shortLabel); + listOfDomainTypes.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfDomainTypes); + } } @@ -868,7 +928,11 @@ public ListOf<Domain> getListOfDomains() { if (!isSetListOfDomains()) { listOfDomains = new ListOf<Domain>(); - listOfDomains.setNamespace(SpatialConstants.namespaceURI); + listOfDomains.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDomains.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfDomains.setPackageName(null); + listOfDomains.setPackageName(SpatialConstants.shortLabel); listOfDomains.setSBaseListType(ListOf.Type.other); registerChild(listOfDomains); } @@ -885,7 +949,18 @@ public void setListOfDomains(ListOf<Domain> listOfDomains) { unsetListOfDomains(); this.listOfDomains = listOfDomains; - registerChild(this.listOfDomains); + + if (listOfDomains != null) { + listOfDomains.unsetNamespace(); + listOfDomains.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDomains.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfDomains.setPackageName(null); + listOfDomains.setPackageName(SpatialConstants.shortLabel); + listOfDomains.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfDomains); + } } @@ -998,7 +1073,11 @@ public ListOf<CoordinateComponent> getListOfCoordinateComponents() { if (!isSetListOfCoordinateComponents()) { listOfCoordinateComponents = new ListOf<CoordinateComponent>(); - listOfCoordinateComponents.setNamespace(SpatialConstants.namespaceURI); + listOfCoordinateComponents.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCoordinateComponents.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfCoordinateComponents.setPackageName(null); + listOfCoordinateComponents.setPackageName(SpatialConstants.shortLabel); listOfCoordinateComponents.setSBaseListType(ListOf.Type.other); registerChild(listOfCoordinateComponents); } @@ -1015,7 +1094,18 @@ public void setListOfCoordinateComponents(ListOf<CoordinateComponent> listOfCoordinateComponents) { unsetListOfCoordinateComponents(); this.listOfCoordinateComponents = listOfCoordinateComponents; - registerChild(this.listOfCoordinateComponents); + + if (listOfCoordinateComponents != null) { + listOfCoordinateComponents.unsetNamespace(); + listOfCoordinateComponents.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCoordinateComponents.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfCoordinateComponents.setPackageName(null); + listOfCoordinateComponents.setPackageName(SpatialConstants.shortLabel); + listOfCoordinateComponents.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfCoordinateComponents); + } } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ImageData.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ImageData.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ImageData.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -62,6 +62,7 @@ */ public ImageData() { super(); + initDefaults(); } /** @@ -84,6 +85,7 @@ */ public ImageData(int level, int version) { super(level, version); + initDefaults(); } /* (non-Javadoc) @@ -94,6 +96,15 @@ return new ImageData(this); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = SpatialConstants.shortLabel; + } + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractSBase#equals(java.lang.Object) */ @@ -339,7 +350,7 @@ builder.append(", dataType="); builder.append(dataType); builder.append(", samples="); - builder.append(Arrays.toString(samples)); + builder.append(Arrays.toString(samples)); // TODO - Should we really print the whole content of the array here? builder.append("]"); return builder.toString(); } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -71,7 +71,8 @@ * */ public InteriorPoint() { - super(); + super(); + initDefaults(); } /** @@ -79,7 +80,17 @@ * @param interiorPoint */ public InteriorPoint(InteriorPoint interiorPoint) { - super(interiorPoint); + super(interiorPoint); + + if (interiorPoint.isSetCoord1()) { + setCoord1(interiorPoint.getCoord1()); + } + if (interiorPoint.isSetCoord2()) { + setCoord2(interiorPoint.getCoord2()); + } + if (interiorPoint.isSetCoord3()) { + setCoord3(interiorPoint.getCoord3()); + } } /** @@ -88,6 +99,7 @@ */ public InteriorPoint(int level, int version) { super(level,version); + initDefaults(); } /* (non-Javadoc) @@ -98,6 +110,15 @@ return new InteriorPoint(this); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = SpatialConstants.shortLabel; + } + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractSBase#equals(java.lang.Object) */ Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/MixedGeometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/MixedGeometry.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/MixedGeometry.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -144,7 +144,11 @@ if (!isSetListOfGeometryDefinitions()) { listOfGeometryDefinitions = new ListOf<GeometryDefinition>(getLevel(), getVersion()); - listOfGeometryDefinitions.setNamespace(SpatialConstants.namespaceURI); + listOfGeometryDefinitions.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGeometryDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfGeometryDefinitions.setPackageName(null); + listOfGeometryDefinitions.setPackageName(SpatialConstants.shortLabel); listOfGeometryDefinitions.setSBaseListType(ListOf.Type.other); registerChild(listOfGeometryDefinitions); } @@ -161,7 +165,18 @@ public void setListOfGeometryDefinitions(ListOf<GeometryDefinition> listOfGeometryDefinitions) { unsetListOfGeometryDefinitions(); this.listOfGeometryDefinitions = listOfGeometryDefinitions; - registerChild(this.listOfGeometryDefinitions); + + if (listOfGeometryDefinitions != null) { + listOfGeometryDefinitions.unsetNamespace(); + listOfGeometryDefinitions.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGeometryDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfGeometryDefinitions.setPackageName(null); + listOfGeometryDefinitions.setPackageName(SpatialConstants.shortLabel); + listOfGeometryDefinitions.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfGeometryDefinitions); + } } @@ -340,7 +355,11 @@ if (!isSetListOfOrdinalMappings()) { listOfOrdinalMappings = new ListOf<OrdinalMapping>(getLevel(), getVersion()); - listOfOrdinalMappings.setNamespace(SpatialConstants.namespaceURI); + listOfOrdinalMappings.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfOrdinalMappings.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfOrdinalMappings.setPackageName(null); + listOfOrdinalMappings.setPackageName(SpatialConstants.shortLabel); listOfOrdinalMappings.setSBaseListType(ListOf.Type.other); registerChild(listOfOrdinalMappings); } @@ -357,7 +376,18 @@ public void setListOfOrdinalMappings(ListOf<OrdinalMapping> listOfOrdinalMappings) { unsetListOfOrdinalMappings(); this.listOfOrdinalMappings = listOfOrdinalMappings; - registerChild(this.listOfOrdinalMappings); + + if (listOfOrdinalMappings != null) { + listOfOrdinalMappings.unsetNamespace(); + listOfOrdinalMappings.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfOrdinalMappings.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfOrdinalMappings.setPackageName(null); + listOfOrdinalMappings.setPackageName(SpatialConstants.shortLabel); + listOfOrdinalMappings.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfOrdinalMappings); + } } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -57,6 +57,7 @@ */ public OrdinalMapping() { super(); + initDefaults(); } /** @@ -80,6 +81,7 @@ */ public OrdinalMapping(int level, int version) { super(level, version); + initDefaults(); } /* (non-Javadoc) @@ -89,7 +91,17 @@ public OrdinalMapping clone() { return new OrdinalMapping(this); } + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = SpatialConstants.shortLabel; + } + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractSBase#equals(java.lang.Object) */ Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -67,6 +67,7 @@ */ public ParameterType() { super(); + initDefaults(); } /** @@ -76,6 +77,7 @@ */ public ParameterType(int level, int version) { super(level,version); + initDefaults(); } @@ -91,7 +93,17 @@ speciesRef = new String(ref.getSpeciesReference()); } } + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = SpatialConstants.shortLabel; + } + /** * * @return Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonObject.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonObject.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -53,6 +53,7 @@ */ public PolygonObject() { super(); + initDefaults(); } /** @@ -72,6 +73,7 @@ */ public PolygonObject(int level, int version) { super(level, version); + initDefaults(); } @@ -80,7 +82,16 @@ return new PolygonObject(this); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = SpatialConstants.shortLabel; + } + @Override public boolean equals(Object object) { boolean equal = super.equals(object); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -168,6 +168,7 @@ setInterpolation(sf.getInterpolation()); } + // TODO - data ? } /** Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -192,7 +192,11 @@ if (!isSetListOfSampledVolumes()) { listOfSampledVolumes = new ListOf<SampledVolume>(getLevel(), getVersion()); - listOfSampledVolumes.setNamespace(SpatialConstants.namespaceURI); + listOfSampledVolumes.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSampledVolumes.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfSampledVolumes.setPackageName(null); + listOfSampledVolumes.setPackageName(SpatialConstants.shortLabel); listOfSampledVolumes.setSBaseListType(ListOf.Type.other); registerChild(listOfSampledVolumes); } @@ -209,7 +213,19 @@ public void setListOfSampledVolumes(ListOf<SampledVolume> listOfSampledVolumes) { unsetListOfSampledVolumes(); this.listOfSampledVolumes = listOfSampledVolumes; - registerChild(this.listOfSampledVolumes); + + if (listOfSampledVolumes != null) { + listOfSampledVolumes.unsetNamespace(); + listOfSampledVolumes.setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSampledVolumes.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'spatial' + listOfSampledVolumes.setPackageName(null); + listOfSampledVolumes.setPackageName(SpatialConstants.shortLabel); + listOfSampledVolumes.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfSampledVolumes); + } + } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java 2015-04-08 15:48:28 UTC (rev 2180) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java 2015-04-09 13:44:21 UTC (rev 2181) @@ -58,6 +58,7 @@ */ public TransformationComponent() { super(); + initDefaults(); } /** @@ -78,6 +79,7 @@ */ public TransformationComponent(int level, int version) { super(level, version); + initDefaults(); } /* (non-Javadoc) @@ -88,6 +90,16 @@ return new TransformationComponent(this); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = SpatialConstants.shortLabel; + } + + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractSBase#equals(java.lang.Object) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-04-08 15:48:43
|
Revision: 2180 http://sourceforge.net/p/jsbml/code/2180 Author: niko-rodrigue Date: 2015-04-08 15:48:28 +0000 (Wed, 08 Apr 2015) Log Message: ----------- started to modify the qual, render and req packages to be able to set properly the package version + corrected the cloning methods in dyn Modified Paths: -------------- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynEventPlugin.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynSBasePlugin.java trunk/extensions/dyn/test/org/sbml/jsbml/ext/dyn/test/TestL3Dyn.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/FunctionTerm.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Input.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Output.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualModelPlugin.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualitativeSpecies.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Transition.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/AbstractRenderPlugin.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/ColorDefinition.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Ellipse.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GlobalRenderInformation.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientBase.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientStop.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive1D.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive2D.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Image.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/LineEnding.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/LinearGradient.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/LocalRenderInformation.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Polygon.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RadialGradient.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Rectangle.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCubicBezier.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCurve.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderGroup.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderLayoutPlugin.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderListOfLayoutsPlugin.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderPoint.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Style.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Text.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Transformation.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Transformation2D.java trunk/extensions/render/src/org/sbml/jsbml/xml/parsers/RenderParser.java trunk/extensions/req/src/org/sbml/jsbml/ext/req/ChangedMath.java trunk/extensions/req/src/org/sbml/jsbml/ext/req/ReqSBasePlugin.java trunk/test/org/sbml/jsbml/test/PackageVersionTests.java Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -344,7 +344,7 @@ } else { listOfReplacedElements = new ListOf<ReplacedElement>(); } - listOfReplacedElements.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfReplacedElements.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace listOfReplacedElements.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'comp' listOfReplacedElements.setPackageName(null); @@ -380,7 +380,7 @@ if (listOfReplacedElements != null) { listOfReplacedElements.unsetNamespace(); - listOfReplacedElements.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfReplacedElements.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace listOfReplacedElements.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'comp' listOfReplacedElements.setPackageName(null); Modified: trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -73,9 +73,9 @@ */ public DynCompartmentPlugin(DynCompartmentPlugin dynCompartmentPlugin) { super(dynCompartmentPlugin); - if (isSetListOfSpatialComponents()) { - setListOfSpatialComponents(dynCompartmentPlugin - .getListOfSpatialComponents().clone()); + + if (dynCompartmentPlugin.isSetListOfSpatialComponents()) { + setListOfSpatialComponents(dynCompartmentPlugin.getListOfSpatialComponents().clone()); } } Modified: trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynEventPlugin.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynEventPlugin.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynEventPlugin.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -80,7 +80,8 @@ */ public DynEventPlugin(DynEventPlugin dynEventPlugin) { super(dynEventPlugin); - if (isSetListOfDynElements()) { + + if (dynEventPlugin.isSetListOfDynElements()) { setListOfDynElements(dynEventPlugin.getListOfDynElements().clone()); } if (dynEventPlugin.isSetApplyToAll()) { Modified: trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynSBasePlugin.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynSBasePlugin.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynSBasePlugin.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -64,7 +64,8 @@ */ public DynSBasePlugin(DynSBasePlugin plugin) { super(plugin); - if (isSetCBOTerm()) { + + if (plugin.isSetCBOTerm()) { setCBOTerm(plugin.getCBOTerm()); } } Modified: trunk/extensions/dyn/test/org/sbml/jsbml/ext/dyn/test/TestL3Dyn.java =================================================================== --- trunk/extensions/dyn/test/org/sbml/jsbml/ext/dyn/test/TestL3Dyn.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/dyn/test/org/sbml/jsbml/ext/dyn/test/TestL3Dyn.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -48,7 +48,6 @@ * @since 1.0 * @version $Rev$ */ -@SuppressWarnings("deprecation") public class TestL3Dyn { // TODO - replace the println by assertion to be able to do the test automatically Modified: trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/FunctionTerm.java =================================================================== --- trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/FunctionTerm.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/FunctionTerm.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -62,7 +62,7 @@ */ public FunctionTerm() { super(); - setNamespace(QualConstants.namespaceURI); + initDefaults(); } /** @@ -72,7 +72,7 @@ */ public FunctionTerm(int level, int version) { super(level, version); - setNamespace(QualConstants.namespaceURI); + initDefaults(); } /** @@ -83,7 +83,7 @@ */ public FunctionTerm(ASTNode math, int level, int version) { super(math, level, version); - setNamespace(QualConstants.namespaceURI); + initDefaults(); } /** @@ -109,6 +109,15 @@ } /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = QualConstants.shortLabel; + } + + /** * Return false, resultLevel is not mandatory. * * @return false @@ -230,14 +239,12 @@ } /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#toString() + * @see java.lang.Object#toString() */ @Override public String toString() { - if (isDefaultTerm()) { - return "defaultTerm"; - } - return super.toString(); + return "FunctionTerm [resultLevel = " + resultLevel + ", isDefaultTerm = " + + defaultTerm + ", isSetMath = " + isSetMath() + "]"; } /* (non-Javadoc) @@ -275,4 +282,5 @@ return attributes; } + } Modified: trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Input.java =================================================================== --- trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Input.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Input.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -128,7 +128,7 @@ */ public Input(String id, String name, int level, int version) { super(id, name, level, version); - // TODO: replace level/version check with call to helper method + if (getLevelAndVersion().compareTo(Integer.valueOf(3), Integer.valueOf(1)) < 0) { throw new LevelVersionError(getElementName(), level, version); } @@ -159,7 +159,9 @@ * */ public void initDefaults() { - setNamespace(QualConstants.namespaceURI); + setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = QualConstants.shortLabel; qualitativeSpecies = null; transitionEffect = null; thresholdLevel = null; @@ -572,4 +574,17 @@ return null; // see comment above } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Input [qualitativeSpecies = " + qualitativeSpecies + + ", transitionEffect = " + transitionEffect + ", thresholdLevel = " + + thresholdLevel + ", sign = " + sign + ", id = " + getId() + + ", name = " + getName() + "]"; + } + + + } Modified: trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Output.java =================================================================== --- trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Output.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Output.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -132,7 +132,7 @@ */ public Output(String id, String name, int level, int version) { super(id, name, level, version); - // TODO: replace level/version check with call to helper method + if (getLevelAndVersion().compareTo(Integer.valueOf(3), Integer.valueOf(1)) < 0) { throw new LevelVersionError(getElementName(), level, version); } @@ -160,7 +160,9 @@ * */ public void initDefaults() { - setNamespace(QualConstants.namespaceURI); + setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = QualConstants.shortLabel; qualitativeSpecies = null; transitionEffect = null; outputLevel = null; @@ -208,7 +210,7 @@ if (isSetQualitativeSpecies()) { return qualitativeSpecies; } else { - throw new PropertyUndefinedError(QualConstants.qualitativeSpecies, this); // TODO - we could return null instead + throw new PropertyUndefinedError(QualConstants.qualitativeSpecies, this); } } @@ -510,4 +512,16 @@ return null; // see comment above } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Output [qualitativeSpecies = " + qualitativeSpecies + + ", transitionEffect = " + transitionEffect + ", outputLevel = " + + outputLevel + ", id = " + getId() + ", name = " + getName() + "]"; + } + + + } Modified: trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualModelPlugin.java =================================================================== --- trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualModelPlugin.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualModelPlugin.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -49,19 +49,11 @@ public class QualModelPlugin extends AbstractSBasePlugin { /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return QualConstants.getNamespaceURI(getLevel(), getVersion()); - } - - /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() */ @Override public String getPackageName() { - return QualConstants.packageName; + return QualConstants.shortLabel; } /* (non-Javadoc) @@ -114,15 +106,19 @@ private ListOf<Transition> listOfTransitions; /** + * Creates a new {@link QualModelPlugin} instance * - * @param model + * @param model the {@link Model} to extends */ public QualModelPlugin(Model model) { super(model); + setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace } /** - * @param qualitativeModel + * Clone constructor + * + * @param qualitativeModel the {@link QualModelPlugin} to be cloned */ public QualModelPlugin(QualModelPlugin qualitativeModel) { super(qualitativeModel); @@ -240,11 +236,13 @@ } /** + * Creates a new {@link Transition} inside this {@link QualModelPlugin} and returns it. * * @param id + * the id of the new element to create * @param in * @param out - * @return + * @return the {@link Transition} object created */ public Transition createTransition(String id, Input in, Output out) { Transition transition = createTransition(id); @@ -298,10 +296,12 @@ } /** - * @param id + * Creates a new {@link QualitativeSpecies} inside this {@link QualModelPlugin} and returns it. + * + * @param id the id of the new element to create * @param compartment * @param constant - * @return + * @return the {@link QualitativeSpecies} object created */ public QualitativeSpecies createQualitativeSpecies(String id, Compartment compartment, boolean constant) { return createQualitativeSpecies(id, compartment.getId(), constant); @@ -354,7 +354,11 @@ public ListOf<QualitativeSpecies> getListOfQualitativeSpecies() { if (!isSetListOfQualitativeSpecies()) { listOfQualitativeSpecies = new ListOf<QualitativeSpecies>(); - listOfQualitativeSpecies.setNamespace(QualConstants.namespaceURI); + listOfQualitativeSpecies.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfQualitativeSpecies.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfQualitativeSpecies.setPackageName(null); + listOfQualitativeSpecies.setPackageName(QualConstants.shortLabel); listOfQualitativeSpecies.setSBaseListType(ListOf.Type.other); if (isSetExtendedSBase()) { @@ -370,7 +374,11 @@ public ListOf<Transition> getListOfTransitions() { if (!isSetListOfTransitions()) { listOfTransitions = new ListOf<Transition>(); - listOfTransitions.setNamespace(QualConstants.namespaceURI); + listOfTransitions.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfTransitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfTransitions.setPackageName(null); + listOfTransitions.setPackageName(QualConstants.shortLabel); listOfTransitions.setSBaseListType(ListOf.Type.other); if (isSetExtendedSBase()) { @@ -573,6 +581,16 @@ unsetListOfQualitativeSpecies(); this.listOfQualitativeSpecies = listOfQualitativeSpecies; + if (listOfQualitativeSpecies != null) { + listOfQualitativeSpecies.unsetNamespace(); + listOfQualitativeSpecies.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfQualitativeSpecies.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfQualitativeSpecies.setPackageName(null); + listOfQualitativeSpecies.setPackageName(QualConstants.shortLabel); + listOfQualitativeSpecies.setSBaseListType(ListOf.Type.other); + } + if (isSetExtendedSBase()) { getModel().registerChild(this.listOfQualitativeSpecies); } @@ -588,6 +606,16 @@ unsetListOfTransitions(); this.listOfTransitions = listOfTransitions; + if (listOfTransitions != null) { + listOfTransitions.unsetNamespace(); + listOfTransitions.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfTransitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfTransitions.setPackageName(null); + listOfTransitions.setPackageName(QualConstants.shortLabel); + listOfTransitions.setSBaseListType(ListOf.Type.other); + } + if (isSetExtendedSBase()) { getModel().registerChild(this.listOfTransitions); } Modified: trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualitativeSpecies.java =================================================================== --- trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualitativeSpecies.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualitativeSpecies.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -114,7 +114,7 @@ */ public QualitativeSpecies(String id, String name, int level, int version) { super(id, name, level, version); - // TODO: replace level/version check with call to helper method + if (getLevelAndVersion().compareTo(Integer.valueOf(3), Integer.valueOf(1)) < 0) { throw new LevelVersionError(getElementName(), level, version); } @@ -171,7 +171,9 @@ * */ public void initDefaults() { - setNamespace(QualConstants.namespaceURI); + setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = QualConstants.shortLabel; compartment = null; constant = null; } @@ -588,4 +590,16 @@ return attributes; } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "QualitativeSpecies [compartment = " + compartment + ", constant = " + + constant + ", initialLevel = " + initialLevel + ", maxLevel = " + maxLevel + + ", id = " + getId() + ", name = " + getName() + "]"; + } + + + } Modified: trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Transition.java =================================================================== --- trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Transition.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Transition.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -117,7 +117,7 @@ */ public Transition(String id, String name, int level, int version) { super(id, name, level, version); - // TODO: replace level/version check with call to helper method + if (getLevelAndVersion().compareTo(Integer.valueOf(3), Integer.valueOf(1)) < 0) { throw new LevelVersionError(getElementName(), level, version); } @@ -435,7 +435,11 @@ if (!isSetListOfFunctionTerms()) { listOfFunctionTerms = new ListOf<FunctionTerm>(getLevel(), getVersion()); listOfFunctionTerms.setSBaseListType(ListOf.Type.other); - listOfFunctionTerms.setNamespace(QualConstants.namespaceURI); + listOfFunctionTerms.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfFunctionTerms.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfFunctionTerms.setPackageName(null); + listOfFunctionTerms.setPackageName(QualConstants.shortLabel); registerChild(listOfFunctionTerms); } return listOfFunctionTerms; @@ -448,7 +452,11 @@ if (!isSetListOfInputs()) { listOfInputs = new ListOf<Input>(getLevel(), getVersion()); listOfInputs.setSBaseListType(ListOf.Type.other); - listOfInputs.setNamespace(QualConstants.namespaceURI); + listOfInputs.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfInputs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfInputs.setPackageName(null); + listOfInputs.setPackageName(QualConstants.shortLabel); registerChild(listOfInputs); } return listOfInputs; @@ -461,7 +469,11 @@ if (!isSetListOfOutputs()) { listOfOutputs = new ListOf<Output>(getLevel(), getVersion()); listOfOutputs.setSBaseListType(ListOf.Type.other); - listOfOutputs.setNamespace(QualConstants.namespaceURI); + listOfOutputs.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfOutputs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfOutputs.setPackageName(null); + listOfOutputs.setPackageName(QualConstants.shortLabel); registerChild(listOfOutputs); } return listOfOutputs; @@ -496,7 +508,9 @@ * */ public void initDefaults() { - setNamespace(QualConstants.namespaceURI); + setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = QualConstants.shortLabel; listOfFunctionTerms = null; listOfInputs = null; listOfOutputs = null; @@ -653,7 +667,17 @@ public void setListOfFunctionTerms(ListOf<FunctionTerm> loft) { unsetListOfFunctionTerms(); listOfFunctionTerms = loft; - registerChild(listOfFunctionTerms); + + if (listOfFunctionTerms != null) { + listOfFunctionTerms.unsetNamespace(); + listOfFunctionTerms.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfFunctionTerms.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfFunctionTerms.setPackageName(null); + listOfFunctionTerms.setPackageName(QualConstants.shortLabel); + listOfFunctionTerms.setSBaseListType(ListOf.Type.other); + registerChild(listOfFunctionTerms); + } } /** @@ -663,7 +687,17 @@ public void setListOfInputs(ListOf<Input> loi) { unsetListOfInputs(); listOfInputs = loi; - registerChild(listOfInputs); + + if (listOfInputs != null) { + listOfInputs.unsetNamespace(); + listOfInputs.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfInputs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfInputs.setPackageName(null); + listOfInputs.setPackageName(QualConstants.shortLabel); + listOfInputs.setSBaseListType(ListOf.Type.other); + registerChild(listOfInputs); + } } /** @@ -674,7 +708,17 @@ public void setListOfOutputs(ListOf<Output> loo) { unsetListOfOutputs(); listOfOutputs = loo; - registerChild(listOfOutputs); + + if (listOfOutputs != null) { + listOfOutputs.unsetNamespace(); + listOfOutputs.setNamespace(QualConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfOutputs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'qual' + listOfOutputs.setPackageName(null); + listOfOutputs.setPackageName(QualConstants.shortLabel); + listOfOutputs.setSBaseListType(ListOf.Type.other); + registerChild(listOfOutputs); + } } /** Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/AbstractRenderPlugin.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/AbstractRenderPlugin.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/AbstractRenderPlugin.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -37,18 +37,11 @@ public abstract class AbstractRenderPlugin extends AbstractSBasePlugin { /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return RenderConstants.getNamespaceURI(getLevel(), getVersion()); - } - /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() */ @Override public String getPackageName() { - return RenderConstants.packageName; + return RenderConstants.shortLabel; } /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() @@ -73,7 +66,7 @@ /** * */ - private Short versionMajor; + private Short versionMajor; // TODO - versionMajor and versionMinor are attributes of ListOf! They are int in the specs! /** * */ @@ -81,7 +74,7 @@ /** * */ - private GlobalRenderInformation renderInformation; + private GlobalRenderInformation renderInformation; // TODO - one or a ListOf GlobalRenderInformation? /** @@ -94,44 +87,15 @@ } /** - * Creates a AbstractRenderPlugin instance with a level and version. + * Creates a AbstractRenderPlugin instance. * - * @param level - * @param version */ - public AbstractRenderPlugin(int level, int version) { - this(null, null, level, version); - } - - /** - * Creates a AbstractRenderPlugin instance with an id, level, and version. - * - * @param id - * @param level - * @param version - */ - public AbstractRenderPlugin(String id, int level, int version) { - this(id, null, level, version); - } - - /** - * Creates a AbstractRenderPlugin instance with an id, name, level, and version. - * - * @param id - * @param name - * @param level - * @param version - */ - public AbstractRenderPlugin(String id, String name, int level, int version) { + public AbstractRenderPlugin() { super(); - // FIXME getLevelAndVersion, getElementName - // if (getLevelAndVersion().compareTo(Integer.valueOf(MIN_SBML_LEVEL), - // Integer.valueOf(MIN_SBML_VERSION)) < 0) { - // throw new LevelVersionError(getElementName(), level, version); - // } initDefaults(); } + /** * Clone constructor * @param obj @@ -155,10 +119,12 @@ * Initializes the default values using the namespace. */ public void initDefaults() { + setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace versionMajor = 0; versionMinor = 0; } + // TODO - return and input values should be int /** * @return the value of versionMinor */ @@ -297,7 +263,7 @@ // @Override @Override public boolean readAttribute(String attributeName, String prefix, String value) { - return false; + return false; // TODO - implement } /* (non-Javadoc) @@ -306,7 +272,7 @@ // @Override @Override public TreeNode getChildAt(int childIndex) { - return null; + return null; // TODO - implement } /* (non-Javadoc) @@ -315,7 +281,7 @@ // @Override @Override public int getChildCount() { - return 0; + return 0; // TODO - implement } /* (non-Javadoc) @@ -324,7 +290,7 @@ // @Override @Override public boolean getAllowsChildren() { - return false; + return false; // TODO - implement } /* (non-Javadoc) @@ -333,7 +299,7 @@ // @Override @Override public Map<String, String> writeXMLAttributes() { - return null; + return null; // TODO - implement } } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/ColorDefinition.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/ColorDefinition.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/ColorDefinition.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -122,8 +122,11 @@ * @param obj */ public ColorDefinition(ColorDefinition obj) { - super(obj); - value = obj.value; + super(obj); + + if (obj.isSetValue()) { + setValue(obj.getValue()); + } } /* (non-Javadoc) @@ -138,7 +141,9 @@ * Initializes the default values using the namespace. */ public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); + setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = RenderConstants.shortLabel; } @@ -235,9 +240,9 @@ */ @Override public Map<String, String> writeXMLAttributes() { - Map<String, String> attributes = super.writeXMLAttributes(); + Map<String, String> attributes = super.writeXMLAttributes(); + if (isSetValue()) { - attributes.remove(RenderConstants.value); attributes.put(RenderConstants.shortLabel + ':' + RenderConstants.value, XMLTools.encodeColorToString(getValue())); } @@ -255,7 +260,6 @@ if (attributeName.equals(RenderConstants.value)) { setValue(XMLTools.decodeStringToColor(value)); } - // END TODO else { isAttributeRead = false; } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/Ellipse.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/Ellipse.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/Ellipse.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -81,10 +81,28 @@ */ protected Boolean absoluteRy; - // TODO - constructors missing + clone + + public Ellipse() { + super(); + } + public Ellipse(Ellipse obj) { + super(obj); + } + public Ellipse(int level, int version) { + super(level, version); + } + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.render.GraphicalPrimitive1D#clone() + */ + @Override + public Ellipse clone() { + return new Ellipse(this); + } + + /** * @return the value of cx Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/GlobalRenderInformation.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/GlobalRenderInformation.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/GlobalRenderInformation.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -128,7 +128,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); } @@ -188,7 +187,11 @@ public ListOf<Style> getListOfStyles() { if (!isSetListOfStyles()) { listOfStyles = new ListOf<Style>(getLevel(), getVersion()); - listOfStyles.setNamespace(RenderConstants.namespaceURI); + listOfStyles.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfStyles.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfStyles.setPackageName(null); + listOfStyles.setPackageName(RenderConstants.shortLabel); listOfStyles.setSBaseListType(ListOf.Type.other); registerChild(listOfStyles); } @@ -201,8 +204,19 @@ */ public void setListOfStyles(ListOf<Style> listOfStyles) { unsetListOfStyles(); - this.listOfStyles = listOfStyles; - registerChild(this.listOfStyles); + this.listOfStyles = listOfStyles; + + if (listOfStyles != null) { + listOfStyles.unsetNamespace(); + listOfStyles.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfStyles.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfStyles.setPackageName(null); + listOfStyles.setPackageName(RenderConstants.shortLabel); + listOfStyles.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfStyles); + } } @@ -278,9 +292,9 @@ } pos++; } - if (isSetListOfGradientDefintions()) { + if (isSetListOfGradientDefinitions()) { if (pos == childIndex) { - return getListOfGradientDefintions(); + return getListOfGradientDefinitions(); } pos++; } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientBase.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientBase.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientBase.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -95,7 +95,8 @@ * @param id * @param stop */ - public GradientBase(String id, GradientStop stop) { + public GradientBase(String id, GradientStop stop) { + super(id); initDefaults(); listOfGradientStops.add(stop); } @@ -109,7 +110,7 @@ * @param version */ public GradientBase(String id, GradientStop stop, int level, int version) { - super(level, version); + super(id, null, level, version); if (getLevelAndVersion().compareTo(Integer.valueOf(RenderConstants.MIN_SBML_LEVEL), Integer.valueOf(RenderConstants.MIN_SBML_VERSION)) < 0) { throw new LevelVersionError(getElementName(), level, version); @@ -166,7 +167,7 @@ super(obj); spreadMethod = obj.spreadMethod; - if (isSetListOfGradientStops()) { + if (obj.isSetListOfGradientStops()) { setListOfGradientStops(obj.listOfGradientStops.clone()); } } @@ -183,7 +184,9 @@ * Initializes the default values using the namespace. */ public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); + setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = RenderConstants.shortLabel; spreadMethod = Spread.PAD; listOfGradientStops = new ListOf<GradientStop>(); } @@ -301,7 +304,11 @@ public ListOf<GradientStop> getListOfGradientStops() { if (!isSetListOfGradientStops()) { listOfGradientStops = new ListOf<GradientStop>(getLevel(), getVersion()); - listOfGradientStops.setNamespace(RenderConstants.namespaceURI); + listOfGradientStops.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGradientStops.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfGradientStops.setPackageName(null); + listOfGradientStops.setPackageName(RenderConstants.shortLabel); listOfGradientStops.setSBaseListType(ListOf.Type.other); registerChild(listOfGradientStops); } @@ -313,8 +320,19 @@ */ public void setListOfGradientStops(ListOf<GradientStop> listOfGradientStops) { unsetListOfGradientStops(); - this.listOfGradientStops = listOfGradientStops; - registerChild(this.listOfGradientStops); + this.listOfGradientStops = listOfGradientStops; + + if (listOfGradientStops != null) { + listOfGradientStops.unsetNamespace(); + listOfGradientStops.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGradientStops.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfGradientStops.setPackageName(null); + listOfGradientStops.setPackageName(RenderConstants.shortLabel); + listOfGradientStops.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfGradientStops); + } } /** Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientStop.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientStop.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientStop.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -61,7 +61,10 @@ * @param offset * @param stopColor */ - public GradientStop(Double offset, String stopColor) { + public GradientStop(Double offset, String stopColor) { + super(); + initDefaults(); + this.offset = offset; this.stopColor = stopColor; } @@ -80,6 +83,7 @@ Integer.valueOf(RenderConstants.MIN_SBML_VERSION)) < 0) { throw new LevelVersionError(getElementName(), level, version); } + initDefaults(); this.offset = offset; this.stopColor = stopColor; } @@ -98,7 +102,8 @@ * */ public GradientStop() { - super(); + super(); + initDefaults(); } /* (non-Javadoc) @@ -109,6 +114,14 @@ return new GradientStop(this); } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = RenderConstants.shortLabel; + } /* (non-Javadoc) Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive1D.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive1D.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive1D.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -222,7 +222,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); } /** Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive2D.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive2D.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive2D.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -94,7 +94,7 @@ public GraphicalPrimitive2D(GraphicalPrimitive2D obj) { super(obj); fill = obj.fill; - fillRule = obj.fillRule; + fillRule = obj.fillRule; // TODO - use setter + clone } /* (non-Javadoc) @@ -110,7 +110,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/Image.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/Image.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/Image.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -136,7 +136,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); z = 0d; } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/LineEnding.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/LineEnding.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/LineEnding.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -67,10 +67,15 @@ * @param obj */ public LineEnding(LineEnding obj) { - super(obj); - setBoundingBox(obj.getBoundingBox().clone()); + super(obj); + + if (obj.isSetBoundingBox()) { + setBoundingBox(obj.getBoundingBox().clone()); + } enableRotationMapping = obj.enableRotationMapping; - setGroup(obj.getGroup().clone()); + if (obj.isSetGroup()) { + setGroup(obj.getGroup().clone()); + } } /* (non-Javadoc) @@ -86,7 +91,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); enableRotationMapping = true; } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/LinearGradient.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/LinearGradient.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/LinearGradient.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -101,7 +101,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); x1 = 0d; y1 = 0d; z1 = 0d; Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/LocalRenderInformation.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/LocalRenderInformation.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/LocalRenderInformation.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -128,7 +128,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); listOfLocalStyles = null; } @@ -188,7 +187,11 @@ public ListOf<LocalStyle> getListOfLocalStyles() { if (!isSetListOfLocalStyles()) { listOfLocalStyles = new ListOf<LocalStyle>(getLevel(), getVersion()); - listOfLocalStyles.setNamespace(RenderConstants.namespaceURI); + listOfLocalStyles.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfLocalStyles.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfLocalStyles.setPackageName(null); + listOfLocalStyles.setPackageName(RenderConstants.shortLabel); listOfLocalStyles.setSBaseListType(ListOf.Type.other); registerChild(listOfLocalStyles); } @@ -201,7 +204,18 @@ public void setListOfLocalStyles(ListOf<LocalStyle> listOfLocalStyles) { unsetListOfLocalStyles(); this.listOfLocalStyles = listOfLocalStyles; - registerChild(this.listOfLocalStyles); + + if (listOfLocalStyles != null) { + listOfLocalStyles.unsetNamespace(); + listOfLocalStyles.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfLocalStyles.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfLocalStyles.setPackageName(null); + listOfLocalStyles.setPackageName(RenderConstants.shortLabel); + listOfLocalStyles.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfLocalStyles); + } } /** @@ -270,9 +284,9 @@ } pos++; } - if (isSetListOfGradientDefintions()) { + if (isSetListOfGradientDefinitions()) { if (pos == childIndex) { - return getListOfGradientDefintions(); + return getListOfGradientDefinitions(); } pos++; } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/Polygon.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/Polygon.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/Polygon.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -24,7 +24,6 @@ import java.text.MessageFormat; import org.sbml.jsbml.ListOf; -import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.SBase; /** @@ -62,7 +61,10 @@ */ public Polygon(Polygon obj) { super(obj); - setListOfElements(obj.getListOfElements().clone()); + + if (obj.isSetListOfElements()) { + setListOfElements(obj.getListOfElements().clone()); + } } /** @@ -125,11 +127,18 @@ * @return the value of listOfElements */ public ListOf<RenderPoint> getListOfElements() { - if (isSetListOfElements()) { - return listOfElements; - } - // This is necessary if we cannot return null here. - throw new PropertyUndefinedError(RenderConstants.listOfElements, this); + if (!isSetListOfElements()) { + listOfElements = new ListOf<RenderPoint>(getLevel(), getVersion()); + listOfElements.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfElements.setPackageName(null); + listOfElements.setPackageName(RenderConstants.shortLabel); + listOfElements.setSBaseListType(ListOf.Type.other); + registerChild(listOfElements); + } + + return listOfElements; } /* (non-Javadoc) @@ -137,7 +146,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); } /** @@ -152,12 +160,19 @@ * @param listOfElements */ public void setListOfElements(ListOf<RenderPoint> listOfElements) { - ListOf<RenderPoint> oldListOfElements = this.listOfElements; + unsetListOfElements(); + this.listOfElements = listOfElements; if (listOfElements != null) { - this.listOfElements = listOfElements; + listOfElements.unsetNamespace(); + listOfElements.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfElements.setPackageName(null); + listOfElements.setPackageName(RenderConstants.shortLabel); + listOfElements.setSBaseListType(ListOf.Type.other); + registerChild(this.listOfElements); - firePropertyChange(RenderConstants.listOfElements, oldListOfElements, this.listOfElements); } } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/RadialGradient.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/RadialGradient.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RadialGradient.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -112,7 +112,7 @@ * @param obj */ public RadialGradient(RadialGradient obj) { - super(obj); + super(obj); cx = obj.cx; cy = obj.cy; cz = obj.cz; @@ -219,7 +219,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); cx = 0.5d; cy = 0.5d; cz = 0.5d; Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/Rectangle.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/Rectangle.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/Rectangle.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -762,7 +762,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); z = 0d; rx = 0d; ry = 0d; Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCubicBezier.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCubicBezier.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCubicBezier.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -228,7 +228,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); z1 = 0d; z2 = 0d; } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCurve.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCurve.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCurve.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -109,7 +109,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); } @@ -272,7 +271,11 @@ public ListOf<RenderPoint> getListOfElements() { if (!isSetListOfElements()) { listOfElements = new ListOf<RenderPoint>(getLevel(), getVersion()); - listOfElements.setNamespace(RenderConstants.namespaceURI); + listOfElements.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfElements.setPackageName(null); + listOfElements.setPackageName(RenderConstants.shortLabel); listOfElements.setSBaseListType(ListOf.Type.other); registerChild(listOfElements); } @@ -285,7 +288,18 @@ public void setListOfElements(ListOf<RenderPoint> listOfElements) { unsetListOfElements(); this.listOfElements = listOfElements; - registerChild(this.listOfElements); + + if (listOfElements != null) { + listOfElements.unsetNamespace(); + listOfElements.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfElements.setPackageName(null); + listOfElements.setPackageName(RenderConstants.shortLabel); + listOfElements.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfElements); + } } /** Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderGroup.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderGroup.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderGroup.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -155,13 +155,8 @@ public RenderGroup(String id, String name, int level, int version) { super(level, version); this.id = id; + // TODO - what about name? - // Removed to potentially support SBML Level 2 Render - // if (getLevelAndVersion().compareTo(Integer.valueOf(RenderConstants.MIN_SBML_LEVEL), - // Integer.valueOf(RenderConstants.MIN_SBML_VERSION)) < 0) { - // throw new LevelVersionError(getElementName(), level, version); - // } - initDefaults(); } @@ -214,7 +209,6 @@ */ @Override public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); } @@ -847,7 +841,11 @@ public ListOf<Transformation2D> getListOfElements() { if (!isSetListOfElements()) { listOfElements = new ListOf<Transformation2D>(); - listOfElements.setNamespace(RenderConstants.namespaceURI); + listOfElements.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfElements.setPackageName(null); + listOfElements.setPackageName(RenderConstants.shortLabel); listOfElements.setSBaseListType(ListOf.Type.other); registerChild(listOfElements); @@ -865,9 +863,18 @@ public void setListOfElements(ListOf<Transformation2D> listOfElements) { unsetListOfElements(); this.listOfElements = listOfElements; - this.listOfElements.setSBaseListType(ListOf.Type.other); + + if (listOfElements != null) { + listOfElements.unsetNamespace(); + listOfElements.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfElements.setPackageName(null); + listOfElements.setPackageName(RenderConstants.shortLabel); + listOfElements.setSBaseListType(ListOf.Type.other); - registerChild(listOfElements); + registerChild(this.listOfElements); + } } Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java 2015-04-07 16:12:08 UTC (rev 2179) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java 2015-04-08 15:48:28 UTC (rev 2180) @@ -72,7 +72,7 @@ /** * */ - protected ListOf<GradientBase> listOfGradientDefintions; + protected ListOf<GradientBase> listOfGradientDefinitions; /** * */ @@ -148,8 +148,8 @@ if (obj.isSetListOfColorDefinitions()) { setListOfColorDefinitions(obj.getListOfColorDefinitions().clone()); } - if (obj.isSetListOfGradientDefintions()) { - setListOfGradientDefintions(obj.getListOfGradientDefintions().clone()); + if (obj.isSetListOfGradientDefinitions()) { + setListOfGradientDefinitions(obj.getListOfGradientDefinitions().clone()); } if (obj.isSetListOfLineEndings()) { setListOfLineEndings(obj.getListOfLineEndings().clone()); @@ -168,13 +168,15 @@ * Initializes the default values using the namespace. */ public void initDefaults() { - setNamespace(RenderConstants.namespaceURI); + setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = RenderConstants.shortLabel; backgroundColor = new Color(0, 0, 0); programName = null; programVersion = null; referenceRenderInformation = null; listOfColorDefinitions = null; - listOfGradientDefintions = null; + listOfGradientDefinitions = null; listOfLineEndings = null; } @@ -196,8 +198,8 @@ : listOfColorDefinitions.hashCode()); result = prime * result - + ((listOfGradientDefintions == null) ? 0 - : listOfGradientDefintions.hashCode()); + + ((listOfGradientDefinitions == null) ? 0 + : listOfGradientDefinitions.hashCode()); result = prime * result + ((listOfLineEndings == null) ? 0 : listOfLineEndings.hashCode()); result = prime * result @@ -240,11 +242,11 @@ } else if (!listOfColorDefinitions.equals(other.listOfColorDefinitions)) { return false; } - if (listOfGradientDefintions == null) { - if (other.listOfGradientDefintions != null) { + if (listOfGradientDefinitions == null) { + if (other.listOfGradientDefinitions != null) { return false; } - } else if (!listOfGradientDefintions.equals(other.listOfGradientDefintions)) { + } else if (!listOfGradientDefinitions.equals(other.listOfGradientDefinitions)) { return false; } if (listOfLineEndings == null) { @@ -467,7 +469,11 @@ public ListOf<ColorDefinition> getListOfColorDefinitions() { if (!isSetListOfColorDefinitions()) { listOfColorDefinitions = new ListOf<ColorDefinition>(getLevel(), getVersion()); - listOfColorDefinitions.setNamespace(RenderConstants.namespaceURI); + listOfColorDefinitions.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfColorDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfColorDefinitions.setPackageName(null); + listOfColorDefinitions.setPackageName(RenderConstants.shortLabel); listOfColorDefinitions.setSBaseListType(ListOf.Type.other); registerChild(listOfColorDefinitions); } @@ -479,8 +485,19 @@ */ public void setListOfColorDefinitions(ListOf<ColorDefinition> listOfColorDefinitions) { unsetListOfColorDefinitions(); - this.listOfColorDefinitions = listOfColorDefinitions; - registerChild(this.listOfColorDefinitions); + this.listOfColorDefinitions = listOfColorDefinitions; + + if (listOfColorDefinitions != null) { + listOfColorDefinitions.unsetNamespace(); + listOfColorDefinitions.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfColorDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfColorDefinitions.setPackageName(null); + listOfColorDefinitions.setPackageName(RenderConstants.shortLabel); + listOfColorDefinitions.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfColorDefinitions); + } } /** @@ -536,46 +553,61 @@ /** - * @return {@code true}, if listOfGradientDefintions contains at least one element, + * @return {@code true}, if listOfGradientDefinitions contains at least one element, * otherwise {@code false} */ - public boolean isSetListOfGradientDefintions() { - if ((listOfGradientDefintions == null) || listOfGradientDefintions.isEmpty()) { + public boolean isSetListOfGradientDefinitions() { + if ((listOfGradientDefinitions == null) || listOfGradientDefinitions.isEmpty()) { return false; } return true; } /** - * @return the listOfGradientDefintions + * @return the listOfGradientDefinitions */ - public ListOf<GradientBase> getListOfGradientDefintions() { - if (!isSetListOfGradientDefintions()) { - listOfGradientDefintions = new ListOf<GradientBase>(getLevel(), getVersion()); - listOfGradientDefintions.setNamespace(RenderConstants.namespaceURI); - listOfGradientDefintions.setSBaseListType(ListOf.Type.other); - registerChild(listOfGradientDefintions); + public ListOf<GradientBase> getListOfGradientDefinitions() { + if (!isSetListOfGradientDefinitions()) { + listOfGradientDefinitions = new ListOf<GradientBase>(getLevel(), getVersion()); + listOfGradientDefinitions.setNamespace(RenderConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGradientDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'render' + listOfGradientDefinitions.setPackageName(null); + listOfGradientDefinitions.setPackageName(RenderConstants.shortLabel); + listOfGradientDefinitions.setSBaseListType(ListOf.Type.other); + registerChild(listOfGradientDefinitions); } - return listOfGradient... [truncated message content] |
From: <nik...@us...> - 2015-04-07 16:12:22
|
Revision: 2179 http://sourceforge.net/p/jsbml/code/2179 Author: niko-rodrigue Date: 2015-04-07 16:12:08 +0000 (Tue, 07 Apr 2015) Log Message: ----------- finished to update the multi package to rev 459 (Nov 2014). Only BindingSiteSpeciesType and IntraSpeciesReaction are missing and the parser need to be updated Revision Links: -------------- http://sourceforge.net/p/jsbml/code/459 Modified Paths: -------------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/OutwardBindingSite.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeature.java trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java Added Paths: ----------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSimpleSpeciesReferencePlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeatureChange.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeatureValue.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeComponentMapInProduct.java Removed Paths: ------------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReactionPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/ Added: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java (rev 0) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java 2015-04-07 16:12:08 UTC (rev 2179) @@ -0,0 +1,50 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2014 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ + +package org.sbml.jsbml.ext.multi; + + +/** + * The BindingStatus enumeration is used in the definition of the {@link OutwardBindingSite} class. BindingStatus + * is restricted to be one of the following possibilities: “bound”, “unbound”, and “either”. + * <p>Attributes of type BindingStatus cannot take on any other values. + * + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.1 + */ +public enum BindingStatus { + + /** + * + */ + bound, + /** + * + */ + unbound, + /** + * + */ + either +} Property changes on: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java 2015-04-03 09:02:45 UTC (rev 2178) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java 2015-04-07 16:12:08 UTC (rev 2179) @@ -47,6 +47,16 @@ /** * */ + public static final String packageDisplayName = "Multistate and Multicomponent Species"; + + /** + * + */ + public static final String packageName = "multi"; + + /** + * + */ public static final String shortLabel = "multi"; /** @@ -66,10 +76,6 @@ /** * */ - public static final String listOfSelectors = "listOfSelectors"; - /** - * - */ public static final String listOfStateFeatures = "listOfStateFeatures"; /** * @@ -87,18 +93,6 @@ * */ public static final String listOfStateFeatureValues = "listOfStateFeatureValues"; - /** - * - */ - public static final String listOfContainedSpeciesTypes = "listOfContainedSpeciesTypes"; - /** - * - */ - public static final String listOfBonds = "listOfBonds"; - /** - * - */ - public static final String listOfUnboundBindingSites = "listOfUnboundBindingSites"; /** @@ -112,121 +106,123 @@ */ public static final String bindingSite = "bindingSite"; - // speciesTypeState /** * */ - public static final String minOccur = "minOccur"; + public static final String compartmentType = "compartmentType"; + /** * */ - public static final String maxOccur = "maxOccur"; + public static final String isType = "isType"; + /** * */ - public static final String connex = "connex"; + public static final int MIN_SBML_LEVEL = 3; + /** * */ - public static final String saturated = "saturated"; + public static final int MIN_SBML_VERSION = 1; - // bond /** * */ - public static final String occurrence = "occurrence"; + public static final String compartment = "compartment"; /** * */ - public static String speciesTypeRestriction = "speciesTypeRestriction"; + public static final String numericValue = "numericValue"; /** * */ - public static final String packageName = "Multistate and Multicomponent Species"; + public static final String compartmentReference = "compartmentReference"; /** * */ - public static final String compartmentType = "compartmentType"; + public static final String occur = "occur"; /** * */ - public static final String isType = "isType"; + public static final String speciesTypeComponentIndex = "speciesTypeComponentIndex"; /** * */ - public static final int MIN_SBML_LEVEL = 3; + public static final String denotedSpeciesTypeComponentIndex = "denotedSpeciesTypeComponentIndex"; /** * */ - public static final int MIN_SBML_VERSION = 1; + public static final String component = "component"; /** * */ - public static final String compartment = "compartment"; + public static final String identifyingParent = "indentifyingParent"; /** * */ - public static final String listOfPossibleSpeciesFeatureValues = "listOfPossibleSpeciesFeatureValues"; + public static final String bindingSite1 = "bindingSite1"; /** * */ - public static final String possibleSpeciesFeatureValue = "possibleSpeciesFeatureValue"; + public static final String bindingSite2 = "bindingSite2"; /** * */ - public static final String numericValue = "numericValue"; + public static final String bindingStatus = "bindingStatus"; /** * */ - public static final String compartmentReference = "compartmentReference"; + public static final String outwardBindingSite = "outwardBindingSite"; /** * */ - public static final String occur = "occur"; + public static final String value = "value"; /** * */ - public static final String speciesTypeComponentIndex = "speciesTypeComponentIndex"; + public static final String speciesFeatureType = "speciesFeatureType"; /** * */ - public static final String denotedSpeciesTypeComponentIndex = "denotedSpeciesTypeComponentIndex"; + public static final String reactantSpeciesFeature = "reactantSpeciesFeature"; /** * */ - public static final String component = "component"; - + public static final String productSpeciesFeature = "productSpeciesFeature"; + /** * */ - public static final String identifyingParent = "indentifyingParent"; + public static final String reactant = "reactant"; /** * */ - public static final String bindingSite1 = "bindingSite1"; + public static final String productComponent = "productComponent"; /** * */ - public static final String bindingSite2 = "bindingSite2"; + public static final String reactantComponent = "reactantComponent"; - + + /** * @param level * @param version @@ -273,7 +269,68 @@ public static final String bindingSiteReference = "bindingSiteReference"; + // speciesTypeState + /** + * + */ + public static final String minOccur = "minOccur"; + /** + * + */ + public static final String maxOccur = "maxOccur"; + /** + * + */ + public static final String connex = "connex"; + /** + * + */ + public static final String saturated = "saturated"; + // bond + /** + * + */ + public static final String occurrence = "occurrence"; + + /** + * + */ + public static String speciesTypeRestriction = "speciesTypeRestriction"; + + /** + * + */ + public static final String listOfSelectors = "listOfSelectors"; + /** + * + */ + public static final String listOfContainedSpeciesTypes = "listOfContainedSpeciesTypes"; + /** + * + */ + public static final String listOfBonds = "listOfBonds"; + /** + * + */ + public static final String listOfUnboundBindingSites = "listOfUnboundBindingSites"; + + /** + * + */ + public static final String listOfPossibleSpeciesFeatureValues = "listOfPossibleSpeciesFeatureValues"; + + /** + * + */ + public static final String possibleSpeciesFeatureValue = "possibleSpeciesFeatureValue"; + + + + + + + Deleted: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReactionPlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReactionPlugin.java 2015-04-03 09:02:45 UTC (rev 2178) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReactionPlugin.java 2015-04-07 16:12:08 UTC (rev 2179) @@ -1,117 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2015 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * 4. The University of California, San Diego, La Jolla, CA, USA - * 5. The Babraham Institute, Cambridge, UK - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.multi; - -import java.util.Map; - -import javax.swing.tree.TreeNode; - -import org.sbml.jsbml.ext.AbstractSBasePlugin; - -/** - * - * @author Nicolas Rodriguez - * @version $Rev$ - * @since 1.0 - * @date 16.10.2013 - */ -public class MultiReactionPlugin extends AbstractSBasePlugin { - - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() - */ - @Override - public String getPackageName() { - return MultiConstants.shortLabel; - } - - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() - */ - @Override - public String getPrefix() { - return MultiConstants.shortLabel; - } - - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getURI() - */ - @Override - public String getURI() { - return getElementNamespace(); - } - - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = 7392764563567861115L; - - // TODO - IntraSpeciesReaction - - /** - * @param multiReaction - */ - public MultiReactionPlugin(MultiReactionPlugin multiReaction) { - super(multiReaction); - } - - - @Override - public boolean readAttribute(String attributeName, String prefix, - String value) { - // TODO Auto-generated method stub - return false; - } - - @Override - public TreeNode getChildAt(int childIndex) { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getChildCount() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public boolean getAllowsChildren() { - // TODO Auto-generated method stub - return false; - } - - @Override - public Map<String, String> writeXMLAttributes() { - // TODO Auto-generated method stub - return null; - } - - @Override - public MultiReactionPlugin clone() { - return new MultiReactionPlugin(this); - } - -} Added: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSimpleSpeciesReferencePlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSimpleSpeciesReferencePlugin.java (rev 0) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSimpleSpeciesReferencePlugin.java 2015-04-07 16:12:08 UTC (rev 2179) @@ -0,0 +1,274 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2014 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ + +package org.sbml.jsbml.ext.multi; + +import java.text.MessageFormat; +import java.util.Map; + +import javax.swing.tree.TreeNode; + +import org.sbml.jsbml.SimpleSpeciesReference; +import org.sbml.jsbml.ext.AbstractSBasePlugin; + + +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.1 + */ +public class MultiSimpleSpeciesReferencePlugin extends AbstractSBasePlugin { + + /** + * Serial version identifier. + */ + private static final long serialVersionUID = 1L; + /** + * + */ + private String compartmentReference; + + /** + * Creates an MultiSimpleSpeciesReferencePlugin instance + */ + public MultiSimpleSpeciesReferencePlugin() { + super(); + initDefaults(); + } + + + /** + * Creates a MultiSimpleSpeciesReferencePlugin instance with a {@link SimpleSpeciesReference}. + * + * @param simpleSpeciesRef the {@link SimpleSpeciesReference} for the new element. + */ + public MultiSimpleSpeciesReferencePlugin(SimpleSpeciesReference simpleSpeciesRef) { + super(simpleSpeciesRef); + initDefaults(); + } + + + /** + * Clone constructor + */ + public MultiSimpleSpeciesReferencePlugin(MultiSimpleSpeciesReferencePlugin obj) { + super(obj); + + // copy all class attributes + if (obj.isSetCompartmentReference()) { + setCompartmentReference(obj.getCompartmentReference()); + } + } + + + /** + * clones this class + */ + public MultiSimpleSpeciesReferencePlugin clone() { + return new MultiSimpleSpeciesReferencePlugin(this); + } + + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + } + + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 6271; + int result = super.hashCode(); + result = prime * result + + ((compartmentReference == null) ? 0 : compartmentReference.hashCode()); + return result; + } + + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + MultiSimpleSpeciesReferencePlugin other = (MultiSimpleSpeciesReferencePlugin) obj; + if (compartmentReference == null) { + if (other.compartmentReference != null) { + return false; + } + } else if (!compartmentReference.equals(other.compartmentReference)) { + return false; + } + return true; + } + + + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "MultiSimpleSpeciesReferencePlugin [compartmentReference=" + + compartmentReference + "]"; + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() + */ + @Override + public String getPackageName() { + return MultiConstants.shortLabel; + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() + */ + @Override + public String getPrefix() { + return MultiConstants.shortLabel; + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getURI() + */ + @Override + public String getURI() { + return getElementNamespace(); + } + + + /** + * Returns the value of {@link #compartmentReference}. + * + * @return the value of {@link #compartmentReference}. + */ + public String getCompartmentReference() { + if (isSetCompartmentReference()) { + return compartmentReference; + } + + return null; + } + + + /** + * Returns whether {@link #compartmentReference} is set. + * + * @return whether {@link #compartmentReference} is set. + */ + public boolean isSetCompartmentReference() { + return compartmentReference != null; + } + + + /** + * Sets the value of compartmentReference + * + * @param compartmentReference the value of compartmentReference to be set. + */ + public void setCompartmentReference(String compartmentReference) { + String oldCompartmentReference = this.compartmentReference; + this.compartmentReference = compartmentReference; + firePropertyChange(MultiConstants.compartmentReference, oldCompartmentReference, this.compartmentReference); + } + + + /** + * Unsets the variable compartmentReference. + * + * @return {@code true} if compartmentReference was set before, otherwise {@code false}. + */ + public boolean unsetCompartmentReference() { + if (isSetCompartmentReference()) { + String oldCompartmentReference = this.compartmentReference; + this.compartmentReference = null; + firePropertyChange(MultiConstants.compartmentReference, oldCompartmentReference, this.compartmentReference); + return true; + } + return false; + } + + + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + + if (isSetCompartmentReference()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.compartmentReference, getCompartmentReference()); + } + + return attributes; + } + + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = true; + + + if (attributeName.equals(MultiConstants.compartmentReference)) { + setCompartmentReference(value); + } + else { + isAttributeRead = false; + } + + return isAttributeRead; + } + + @Override + public boolean getAllowsChildren() { + return false; + } + + + @Override + public int getChildCount() { + return 0; + } + + + @Override + public TreeNode getChildAt(int index) { + throw new IndexOutOfBoundsException( + MessageFormat.format("Index {0,number,integer} >= {1,number,integer}", + index, Math.min(index, 0))); + } +} Property changes on: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSimpleSpeciesReferencePlugin.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java 2015-04-03 09:02:45 UTC (rev 2178) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java 2015-04-07 16:12:08 UTC (rev 2179) @@ -38,6 +38,8 @@ */ public class MultiSpeciesPlugin extends AbstractSBasePlugin { + // TODO - implements IdManager: SpeciesFeature are id unique within one Species + /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java 2015-04-03 09:02:45 UTC (rev 2178) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java 2015-04-07 16:12:08 UTC (rev 2179) @@ -21,13 +21,12 @@ */ package org.sbml.jsbml.ext.multi; -import java.util.Map; +import java.text.MessageFormat; import javax.swing.tree.TreeNode; import org.sbml.jsbml.ListOf; -import org.sbml.jsbml.Species; -import org.sbml.jsbml.ext.AbstractSBasePlugin; +import org.sbml.jsbml.SpeciesReference; /** * @@ -36,111 +35,344 @@ * @since 1.0 * @date 16.10.2013 */ -public class MultiSpeciesReferencePlugin extends AbstractSBasePlugin { +public class MultiSpeciesReferencePlugin extends MultiSimpleSpeciesReferencePlugin { - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() + /** + * Generated serial version identifier. */ - @Override - public String getElementNamespace() { - return MultiConstants.getNamespaceURI(getLevel(), getVersion()); + private static final long serialVersionUID = 2L; + + /** + * + */ + private ListOf<SpeciesTypeComponentMapInProduct> listOfSpeciesTypeComponentMapInProducts; + + + /** + * Creates an MultiSpeciesReferencePlugin instance + */ + public MultiSpeciesReferencePlugin() { + super(); + initDefaults(); } - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() + /** + * Creates a MultiSpeciesReferencePlugin instance with a {@link SpeciesReference}. + * + * @param sp the {@link SpeciesReference} for the new element. */ - @Override - public String getPackageName() { - return MultiConstants.packageName; + public MultiSpeciesReferencePlugin(SpeciesReference sp) { + super(sp); + initDefaults(); } - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() + /** + * Clone constructor */ - @Override - public String getPrefix() { - return MultiConstants.shortLabel; + public MultiSpeciesReferencePlugin(MultiSpeciesReferencePlugin obj) { + super(obj); + + // copy all class attributes + if (obj.isSetListOfSpeciesTypeComponentMapInProducts()) { + setListOfSpeciesTypeComponentMapInProducts(obj.getListOfSpeciesTypeComponentMapInProducts().clone()); + } } + /** + * clones this class + */ + public MultiSpeciesReferencePlugin clone() { + return new MultiSpeciesReferencePlugin(this); + } + + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + } + + /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getURI() + * @see java.lang.Object#hashCode() */ @Override - public String getURI() { - return getElementNamespace(); + public int hashCode() { + final int prime = 6287; + int result = super.hashCode(); + result = prime + * result + + ((listOfSpeciesTypeComponentMapInProducts == null) ? 0 + : listOfSpeciesTypeComponentMapInProducts.hashCode()); + return result; } /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractTreeNode#getParent() + * @see java.lang.Object#equals(java.lang.Object) */ - @SuppressWarnings("unchecked") @Override - public ListOf<Species> getParent() { - return (ListOf<Species>) getExtendedSBase().getParent(); + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + MultiSpeciesReferencePlugin other = (MultiSpeciesReferencePlugin) obj; + if (listOfSpeciesTypeComponentMapInProducts == null) { + if (other.listOfSpeciesTypeComponentMapInProducts != null) { + return false; + } + } else if (!listOfSpeciesTypeComponentMapInProducts.equals(other.listOfSpeciesTypeComponentMapInProducts)) { + return false; + } + return true; } /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() + * @see java.lang.Object#toString() */ @Override - public ListOf<Species> getParentSBMLObject() { - return getParent(); + public String toString() { + return "MultiSpeciesReferencePlugin [listOfSpeciesTypeComponentMapInProducts.size = " + + getSpeciesTypeComponentMapInProductCount() + "]"; } + + /** - * Generated serial version identifier. + * Returns {@code true} if {@link #listOfSpeciesTypeComponentMapInProducts} contains at least + * one element. + * + * @return {@code true} if {@link #listOfSpeciesTypeComponentMapInProducts} contains at least + * one element, otherwise {@code false}. */ - private static final long serialVersionUID = 3171952386462646205L; + public boolean isSetListOfSpeciesTypeComponentMapInProducts() { + if (listOfSpeciesTypeComponentMapInProducts == null) { + return false; + } + return true; + } + /** + * Returns the {@link #listOfSpeciesTypeComponentMapInProducts}. + * Creates it if it does not already exist. + * + * @return the {@link #listOfSpeciesTypeComponentMapInProducts}. + */ + public ListOf<SpeciesTypeComponentMapInProduct> getListOfSpeciesTypeComponentMapInProducts() { + if (listOfSpeciesTypeComponentMapInProducts == null) { + listOfSpeciesTypeComponentMapInProducts = new ListOf<SpeciesTypeComponentMapInProduct>(); + listOfSpeciesTypeComponentMapInProducts.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesTypeComponentMapInProducts.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfSpeciesTypeComponentMapInProducts.setPackageName(null); + listOfSpeciesTypeComponentMapInProducts.setPackageName(MultiConstants.shortLabel); + listOfSpeciesTypeComponentMapInProducts.setSBaseListType(ListOf.Type.other); + if (isSetExtendedSBase()) { + extendedSBase.registerChild(listOfSpeciesTypeComponentMapInProducts); + } + } + return listOfSpeciesTypeComponentMapInProducts; + } + + /** - * @param multiSpeciesReference + * Sets the given {@code ListOf<SpeciesTypeComponentMapInProduct>}. + * If {@link #listOfSpeciesTypeComponentMapInProducts} was defined before and contains some + * elements, they are all unset. + * + * @param listOfSpeciesTypeComponentMapInProducts */ - public MultiSpeciesReferencePlugin(MultiSpeciesReferencePlugin multiSpeciesReference) { - super(multiSpeciesReference); + public void setListOfSpeciesTypeComponentMapInProducts(ListOf<SpeciesTypeComponentMapInProduct> listOfSpeciesTypeComponentMapInProducts) { + unsetListOfSpeciesTypeComponentMapInProducts(); + this.listOfSpeciesTypeComponentMapInProducts = listOfSpeciesTypeComponentMapInProducts; + + if (listOfSpeciesTypeComponentMapInProducts != null) { + listOfSpeciesTypeComponentMapInProducts.unsetNamespace(); + listOfSpeciesTypeComponentMapInProducts.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesTypeComponentMapInProducts.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfSpeciesTypeComponentMapInProducts.setPackageName(null); + listOfSpeciesTypeComponentMapInProducts.setPackageName(MultiConstants.shortLabel); + this.listOfSpeciesTypeComponentMapInProducts.setSBaseListType(ListOf.Type.other); + + if (isSetExtendedSBase()) { + extendedSBase.registerChild(this.listOfSpeciesTypeComponentMapInProducts); + } + } } - @Override - public boolean readAttribute(String attributeName, String prefix, - String value) { - // TODO Auto-generated method stub + /** + * Returns {@code true} if {@link #listOfSpeciesTypeComponentMapInProducts} contains at least + * one element, otherwise {@code false}. + * + * @return {@code true} if {@link #listOfSpeciesTypeComponentMapInProducts} contains at least + * one element, otherwise {@code false}. + */ + public boolean unsetListOfSpeciesTypeComponentMapInProducts() { + if (isSetListOfSpeciesTypeComponentMapInProducts()) { + ListOf<SpeciesTypeComponentMapInProduct> oldSpeciesTypeComponentMapInProducts = this.listOfSpeciesTypeComponentMapInProducts; + this.listOfSpeciesTypeComponentMapInProducts = null; + oldSpeciesTypeComponentMapInProducts.fireNodeRemovedEvent(); + return true; + } return false; } - @Override - public TreeNode getChildAt(int childIndex) { - // TODO Auto-generated method stub - return null; + + /** + * Adds a new {@link SpeciesTypeComponentMapInProduct} to the {@link #listOfSpeciesTypeComponentMapInProducts}. + * <p>The listOfSpeciesTypeComponentMapInProducts is initialized if necessary. + * + * @param speciesTypeComponentMapInProduct the element to add to the list + * @return {@code true} (as specified by {@link java.util.Collection#add}) + * @see java.util.Collection#add(Object) + */ + public boolean addSpeciesTypeComponentMapInProduct(SpeciesTypeComponentMapInProduct speciesTypeComponentMapInProduct) { + return getListOfSpeciesTypeComponentMapInProducts().add(speciesTypeComponentMapInProduct); } - @Override - public int getChildCount() { - // TODO Auto-generated method stub - return 0; + + /** + * Removes an element from the {@link #listOfSpeciesTypeComponentMapInProducts}. + * + * @param speciesTypeComponentMapInProduct the element to be removed from the list. + * @return {@code true} if the list contained the specified element and it was + * removed. + * @see java.util.List#remove(Object) + */ + public boolean removeSpeciesTypeComponentMapInProduct(SpeciesTypeComponentMapInProduct speciesTypeComponentMapInProduct) { + if (isSetListOfSpeciesTypeComponentMapInProducts()) { + return getListOfSpeciesTypeComponentMapInProducts().remove(speciesTypeComponentMapInProduct); + } + return false; } + + /** + * Removes an element from the {@link #listOfSpeciesTypeComponentMapInProducts} at the given index. + * + * @param i the index where to remove the {@link SpeciesTypeComponentMapInProduct}. + * @return the specified element if it was successfully found and removed. + * @throws IndexOutOfBoundsException if the listOf is not set or if the index is + * out of bound ({@code (i < 0) || (i > listOfSpeciesTypeComponentMapInProducts)}). + */ + public SpeciesTypeComponentMapInProduct removeSpeciesTypeComponentMapInProduct(int i) { + if (!isSetListOfSpeciesTypeComponentMapInProducts()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + return getListOfSpeciesTypeComponentMapInProducts().remove(i); + } + + + /** + * Creates a new SpeciesTypeComponentMapInProduct element and adds it to the + * {@link #listOfSpeciesTypeComponentMapInProducts} list. + * + * @return the newly created element, i.e., the last item in the + * {@link #listOfSpeciesTypeComponentMapInProducts} + */ + public SpeciesTypeComponentMapInProduct createSpeciesTypeComponentMapInProduct() { + SpeciesTypeComponentMapInProduct speciesTypeComponentMapInProduct = new SpeciesTypeComponentMapInProduct(); + addSpeciesTypeComponentMapInProduct(speciesTypeComponentMapInProduct); + return speciesTypeComponentMapInProduct; + } + + + /** + * Gets an element from the {@link #listOfSpeciesTypeComponentMapInProducts} at the given index. + * + * @param i the index of the {@link SpeciesTypeComponentMapInProduct} element to get. + * @return an element from the listOfSpeciesTypeComponentMapInProducts at the given index. + * @throws IndexOutOfBoundsException if the listOf is not set or + * if the index is out of bound (index < 0 || index > list.size). + */ + public SpeciesTypeComponentMapInProduct getSpeciesTypeComponentMapInProduct(int i) { + if (!isSetListOfSpeciesTypeComponentMapInProducts()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + return getListOfSpeciesTypeComponentMapInProducts().get(i); + } + + + /** + * Returns the number of {@link SpeciesTypeComponentMapInProduct}s in this + * {@link MultiSpeciesReferencePlugin}. + * + * @return the number of {@link SpeciesTypeComponentMapInProduct}s in this + * {@link MultiSpeciesReferencePlugin}. + */ + public int getSpeciesTypeComponentMapInProductCount() { + return isSetListOfSpeciesTypeComponentMapInProducts() ? getListOfSpeciesTypeComponentMapInProducts().size() : 0; + } + + + /** + * Returns the number of {@link SpeciesTypeComponentMapInProduct}s in this + * {@link MultiSpeciesReferencePlugin}. + * + * @return the number of {@link SpeciesTypeComponentMapInProduct}s in this + * {@link MultiSpeciesReferencePlugin}. + * @libsbml.deprecated same as {@link #getSpeciesTypeComponentMapInProductCount()} + */ + public int getNumSpeciesTypeComponentMapInProducts() { + return getSpeciesTypeComponentMapInProductCount(); + } + + @Override public boolean getAllowsChildren() { - // TODO Auto-generated method stub - return false; + return true; } + @Override - public Map<String, String> writeXMLAttributes() { - // TODO Auto-generated method stub - return null; + public int getChildCount() { + int count = super.getChildCount(); + + if (isSetListOfSpeciesTypeComponentMapInProducts()) { + count++; + } + + return count; } + @Override - public MultiSpeciesReferencePlugin clone() { - return new MultiSpeciesReferencePlugin(this); + public TreeNode getChildAt(int index) { + if (index < 0) { + throw new IndexOutOfBoundsException(index + " < 0"); + } + int count = super.getChildCount(), pos = 0; + if (index < count) { + return super.getChildAt(index); + } else { + index -= count; + } + + if (isSetListOfSpeciesTypeComponentMapInProducts()) { + if (pos == index) { + return getListOfSpeciesTypeComponentMapInProducts(); + } + pos++; + } + + throw new IndexOutOfBoundsException( + MessageFormat.format("Index {0,number,integer} >= {1,number,integer}", + index, Math.min(pos, 0))); } } Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/OutwardBindingSite.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/OutwardBindingSite.java 2015-04-03 09:02:45 UTC (rev 2178) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/OutwardBindingSite.java 2015-04-07 16:12:08 UTC (rev 2179) @@ -22,21 +22,277 @@ package org.sbml.jsbml.ext.multi; +import java.util.Map; + import org.sbml.jsbml.AbstractSBase; +import org.sbml.jsbml.PropertyUndefinedError; +import org.sbml.jsbml.SBMLException; public class OutwardBindingSite extends AbstractSBase { + /** + * + */ + private BindingStatus bindingStatus; + + /** + * + */ + private String component; + + + /** + * Creates an OutwardBindingSite instance + */ + public OutwardBindingSite() { + super(); + initDefaults(); + } + + + /** + * Creates a OutwardBindingSite instance with a level and version. + * + * @param level SBML Level + * @param version SBML Version + */ + public OutwardBindingSite(int level, int version) { + super(level, version); + initDefaults(); + } + + + + /** + * Clone constructor + */ + public OutwardBindingSite(OutwardBindingSite obj) { + super(obj); + + // copy all class attributes + if (obj.isSetBindingStatus()) { + setBindingStatus(obj.getBindingStatus()); + } + if (obj.isSetComponent()) { + setComponent(obj.getComponent()); + } + } + + + /** + * clones this class + */ + public OutwardBindingSite clone() { + return new OutwardBindingSite(this); + } + + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = MultiConstants.shortLabel; + setPackageVersion(-1); + } + + + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ @Override - public AbstractSBase clone() { - // TODO Auto-generated method stub + public int hashCode() { + final int prime = 6089; + int result = super.hashCode(); + result = prime * result + + ((bindingStatus == null) ? 0 : bindingStatus.hashCode()); + result = prime * result + ((component == null) ? 0 : component.hashCode()); + return result; + } + + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + OutwardBindingSite other = (OutwardBindingSite) obj; + if (bindingStatus != other.bindingStatus) { + return false; + } + if (component == null) { + if (other.component != null) { + return false; + } + } else if (!component.equals(other.component)) { + return false; + } + return true; + } + + + /** + * Returns the value of {@link #bindingStatus}. + * + * @return the value of {@link #bindingStatus}. + */ + public BindingStatus getBindingStatus() { + if (isSetBindingStatus()) { + return bindingStatus; + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(MultiConstants.bindingStatus, this); + } + + + /** + * Returns whether {@link #bindingStatus} is set. + * + * @return whether {@link #bindingStatus} is set. + */ + public boolean isSetBindingStatus() { + return bindingStatus != null; + } + + + /** + * Sets the value of bindingStatus + * + * @param bindingStatus the value of bindingStatus to be set. + */ + public void setBindingStatus(BindingStatus bindingStatus) { + BindingStatus oldBindingStatus = this.bindingStatus; + this.bindingStatus = bindingStatus; + firePropertyChange(MultiConstants.bindingStatus, oldBindingStatus, this.bindingStatus); + } + + + /** + * Unsets the variable bindingStatus. + * + * @return {@code true} if bindingStatus was set before, otherwise {@code false}. + */ + public boolean unsetBindingStatus() { + if (isSetBindingStatus()) { + BindingStatus oldBindingStatus = this.bindingStatus; + this.bindingStatus = null; + firePropertyChange(MultiConstants.bindingStatus, oldBindingStatus, this.bindingStatus); + return true; + } + return false; + } + + + /** + * Returns the value of {@link #component}. + * + * @return the value of {@link #component}. + */ + public String getComponent() { + if (isSetComponent()) { + return component; + } + return null; } + + /** + * Returns whether {@link #component} is set. + * + * @return whether {@link #component} is set. + */ + public boolean isSetComponent() { + return component != null; + } + + + /** + * Sets the value of component + * + * @param component the value of component to be set. + */ + public void setComponent(String component) { + String oldComponent = this.component; + this.component = component; + firePropertyChange(MultiConstants.component, oldComponent, this.component); + } + + + /** + * Unsets the variable component. + * + * @return {@code true} if component was set before, otherwise {@code false}. + */ + public boolean unsetComponent() { + if (isSetComponent()) { + String oldComponent = this.component; + this.component = null; + firePropertyChange(MultiConstants.component, oldComponent, this.component); + return true; + } + return false; + } + + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + + if (isSetComponent()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.component, getComponent()); + } + if (isSetBindingStatus()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.bindingStatus, getBindingStatus().toString()); + } + + return attributes; + } + + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); + if (!isAttributeRead) { + isAttributeRead = true; + + if (attributeName.equals(MultiConstants.component)) { + setComponent(value); + } + else if (attributeName.equals(MultiConstants.bindingStatus)) { + try { + setBindingStatus(BindingStatus.valueOf(value)); + } catch (Exception e) { + throw new SBMLException("Could not recognized the value '" + value + + "' for the attribute " + MultiConstants.bindingStatus + + " on the '" + MultiConstants.outwardBindingSite + "' element."); + } + } + else { + isAttributeRead = false; + } + } + return isAttributeRead; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override public String toString() { - // TODO Auto-generated method stub - return null; + return "OutwardBindingSite [bindingStatus=" + bindingStatus + + ", component=" + component + "]"; } } Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeature.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeature.java 2015-04-03 09:02:45 UTC (rev 2178) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeature.java 2015-04-07 16:12:08 UTC (rev 2179) @@ -22,29 +22,662 @@ package org.sbml.jsbml.ext.multi; +import java.text.MessageFormat; +import java.util.Map; + +import javax.swing.tree.TreeNode; + import org.sbml.jsbml.AbstractNamedSBase; -import org.sbml.jsbml.AbstractSBase; +import org.sbml.jsbml.LevelVersionError; +import org.sbml.jsbml.ListOf; +import org.sbml.jsbml.PropertyUndefinedError; +import org.sbml.jsbml.util.StringTools; +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.1 + */ public class SpeciesFeature extends AbstractNamedSBase { + /** + * Serial version identifier. + */ + private static final long serialVersionUID = 1L; + + /** + * + */ + private String speciesFeatureType; + + /** + * + */ + private Integer occur; + + /** + * + */ + private String component; + + /** + * + */ + private ListOf<SpeciesFeatureValue> listOfSpeciesFeatureValues; + + /** + * Creates an SpeciesFeature instance + */ + public SpeciesFeature() { + super(); + initDefaults(); + } + + + /** + * Creates a SpeciesFeature instance with an id. + * + * @param id the identifier for the new element. + */ + public SpeciesFeature(String id) { + super(id); + initDefaults(); + } + + + /** + * Creates a SpeciesFeature instance with a level and version. + * + * @param level SBML Level + * @param version SBML Version + */ + public SpeciesFeature(int level, int version) { + this(null, null, level, version); + } + + + /** + * Creates a SpeciesFeature instance with an id, level, and version. + * + * @param id the identifier for this element. + * @param level the SBML Level + * @param version the SBML Version + */ + public SpeciesFeature(String id, int level, int version) { + this(id, null, level, version); + } + + + /** + * Creates a SpeciesFeature instance with an id, name, level, and version. + * + * @param id the identifier for this element. + * @param name a human-readable name for this element that can be used for display purposes. + * @param level the SBML Level + * @param version the SBML Version + */ + public SpeciesFeature(String id, String name, int level, int version) { + super(id, name, level, version); + if (getLevelAndVersion().compareTo( + Integer.valueOf(MultiConstants.MIN_SBML_LEVEL), + Integer.valueOf(MultiConstants.MIN_SBML_VERSION)) < 0) { + throw new LevelVersionError(getElementName(), level, version); + } + initDefaults(); + } + + + /** + * Clone constructor + */ + public SpeciesFeature(SpeciesFeature obj) { + super(obj); + + // copy all class attributes + if (obj.isSetListOfSpeciesFeatureValues()) { + setListOfSpeciesFeatureValues(obj.getListOfSpeciesFeatureValues().clone()); + } + if (obj.isSetSpeciesFeatureType()) { + setSpeciesFeatureType(obj.getSpeciesFeatureType()); + } + if (obj.isSetOccur()) { + setOccur(obj.getOccur()); + } + if (obj.isSetComponent()) { + setComponent(obj.getComponent()); + } + } + + + /** + * clones this class + */ + public SpeciesFeature clone() { + return new SpeciesFeature(this); + } + + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = MultiConstants.shortLabel; + setPackageVersion(-1); + } + + + + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ @Override - public AbstractSBase clone() { - // TODO Auto-generated method stub + public int hashCode() { + final int prime = 6133; + int result = super.hashCode(); + result = prime * result + ((component == null) ? 0 : component.hashCode()); + result = prime + * result + + ((listOfSpeciesFeatureValues == null) ? 0 + : listOfSpeciesFeatureValues.hashCode()); + result = prime * result + ((occur == null) ? 0 : occur.hashCode()); + result = prime * result + + ((speciesFeatureType == null) ? 0 : speciesFeatureType.hashCode()); + return result; + } + + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + SpeciesFeature other = (SpeciesFeature) obj; + if (component == null) { + if (other.component != null) { + return false; + } + } else if (!component.equals(other.component)) { + return false; + } + if (listOfSpeciesFeatureValues == null) { + if (other.listOfSpeciesFeatureValues != null) { + return false; + } + } else if (!listOfSpeciesFeatureValues.equals(other.listOfSpeciesFeatureValues)) { + return false; + } + if (occur == null) { + if (other.occur != null) { + return false; + } + } else if (!occur.equals(other.occur)) { + return false; + } + if (speciesFeatureType == null) { + if (other.speciesFeatureType != null) { + return false; + } + } else if (!speciesFeatureType.equals(other.speciesFeatureType)) { + return false; + } + return true; + } + + + /** + * Returns {@code true} if {@link #listOfSpeciesFeatureValues} contains at least + * one element. + * + * @return {@code true} if {@link #listOfSpeciesFeatureValues} contains at least + * one element, otherwise {@code false}. + */ + public boolean isSetListOfSpeciesFeatureValues() { + if (listOfSpeciesFeatureValues == null) { + return false; + } + return true; + } + + + /** + * Returns the {@link #listOfSpeciesFeatureValues}. + * Creates it if it does not already exist. + * + * @return the {@link #listOfSpeciesFeatureValues}. + */ + public ListOf<SpeciesFeatureValue> getListOfSpeciesFeatureValues() { + if (listOfSpeciesFeatureValues == null) { + listOfSpeciesFeatureValues = new ListOf<SpeciesFeatureValue>(); + listOfSpeciesFeatureValues.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesFeatureValues.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfSpeciesFeatureValues.setPackageName(null); + listOfSpeciesFeatureValues.setPackageName(MultiConstants.shortLabel); + listOfSpeciesFeatureValues.setSBaseListType(ListOf.Type.other); + + registerChild(listOfSpeciesFeatureValues); + } + return listOfSpeciesFeatureValues; + } + + + /** + * Sets the given {@code ListOf<SpeciesFeatureValue>}. + * If {@link #listOfSpeciesFeatureValues} was defined before and contains some + * elements, they are all unset. + * + * @param listOfSpeciesFeatureValues + */ + public void setListOfSpeciesFeatureValues(ListOf<SpeciesFeatureValue> listOfSpeciesFeatureValues) { + unsetListOfSpeciesFeatureValues(); + this.listOfSpeciesFeatureValues = listOfSpeciesFeatureValues; + + if (listOfSpeciesFeatureValues != null) { + listOfSpeciesFeatureValues.unsetNamespace(); + listOfSpeciesFeatureValues.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesFeatureValues.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfSpeciesFeatureValues.setPackageName(null); + listOfSpeciesFeatureValues.setPackageName(MultiConstants.shortLabel); + this.listOfSpeciesFeatureValues.setSBaseListType(ListOf.Type.other); + + registerChild(listOfSpeciesFeatureValues); + } + } + + + /** + * Returns {@code true} if {@link #listOfSpeciesFeatureValues} contains at least + * one element, otherwise {@code false}. + * + * @return {@code true} if {@link #listOfSpeciesFeatureValues} contains at least + * one element, otherwise {@code false}. + */ + public boolean unsetListOfSpeciesFeatureValues() { + if (isSetListOfSpeciesFeatureValues()) { + ListOf<SpeciesFeatureValue> oldSpeciesFeatureValues = this.listOfSpeciesFeatureValues; + this.listOfSpeciesFeatureValues = null; + oldSpeciesFeatureValues.fireNodeRemovedEvent(); + return true; + } + return false; + } + + + /** + * Adds a new {@link SpeciesFeatureValue} to the {@link #listOfSpeciesFeatureValues}. + * <p>The listOfSpeciesFeatureValues is initialized if necessary. + * + * @param speciesFeatureValue the element to add to the list + * @return {@code true} (as specified by {@link java.util.Collection#add}) + * @see java.util.Collection#add(Object) + */ + public boolean addSpeciesFeatureValue(SpeciesFeatureValue speciesFeatureValue) { + return getListOfSpeciesFeatureValues().add(speciesFeatureValue); + } + + + /** + * Removes an element from the {@link #listOfSpeciesFeatureValues}. + * + * @param speciesFeatureValue the element to be removed from the list. + * @return {@code true} if the list contained the specified element and it was + * removed. + * @see java.util.List#remove(Object) + */ + public boolean removeSpeciesFeatureValue(SpeciesFeatureValue speciesFeatureValue) { + if (isSetListOfSpeciesFeatureValues()) { + return getListOfSpeciesFeatureValues().remove(speciesFeatureValue); + } + return false; + } + + + /** + * Removes an element from the {@link #listOfSpeciesFeatureValues} at the given index. + * + * @param i the index where to remove the {@link SpeciesFeatureValue}. + * @return the specified element if it was successfully found and removed. + * @throws IndexOutOfBoundsException if the listOf is not set or if the index is + * out of bound ({@code (i < 0) || (i > listOfSpeciesFeatureValues)}). + */ + public SpeciesFeatureValue removeSpeciesFeatureValue(int i) { + if (!isSetListOfSpeciesFeatureValues()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + return getListOfSpeciesFeatureValues().remove(i); + } + + + /** + * Creates a new SpeciesFeatureValue element and adds it to the + * {@link #listOfSpeciesFeatureValues} list. + * + * @return the newly created element, i.e., the last item in the + * {@link #listOfSpeciesFeatureValues} + */ + public SpeciesFeatureValue createSpeciesFeatureValue() { + return createSpeciesFeatureValue(); + } + + + /** + * Gets an element from the {@link #listOfSpeciesFeatureValues} at the given index. + * + * @param i the index of the {@link SpeciesFeatureValue} element to get. + * @return an element from the listOfSpeciesFeatureValues at the given index. + * @throws IndexOutOfBoundsException if the listOf is not set or + * if the index is out of bound (index < 0 || index > list.size). + */ + public SpeciesFeatureValue getSpeciesFeatureValue(int i) { + if (!isSetListOfSpeciesFeatureValues()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + return getListOfSpeciesFeatureValues().get(i); + } + + + /** + * Returns the number of {@link SpeciesFeatureValue}s in this + * {@link SpeciesFeature}. + * + * @return the number of {@link SpeciesFeatureValue}s in this + * {@link SpeciesFeature}. + */ + public int getSpeciesFeatureValueCount() { + return isSetListOfSpeciesFeatureValues() ? getListOfSpeciesFeatureValues().size() : 0; + } + + + /** + * Returns the number of {@link SpeciesFeatureValue}s in this + * {@link SpeciesFeature}. + * + * @return the number of {@link SpeciesFeatureValue}s in this + * {@link SpeciesFeature}. + * @libsbml.deprecated same as {@link #getSpeciesFeatureValueCount()} + */ + public int getNumSpeciesFeatureValues() { + return getSpeciesFeatureValueCount(); + } + + + + /** + * Returns the value of {@link #speciesFeatureType}. + * + * @return the value of {@link #speciesFeatureType}. + */ + public String getSpeciesFeatureType() { + if (isSetSpeciesFeatureType()) { + return speciesFeatureType; + } + return null; } + + /** + * Returns whether {@link #speciesFeatureType} is set. + * + * @return whether {@link #speciesFeatureType} is set. + */ + public boolean isSetSpeciesFeatureType() { + return speciesFeatureType != null; + } + + + /** + * Sets the value of speciesFeatureType + * + * @param speciesFeatureType the value of speciesFeatureType to be set. + */ + public void setSpeciesFeatureType(String speciesFeatureType) { + String oldSpeciesFeatureType = this.speciesFeatureType; + this.speciesFeatureType = speciesFeatureType; + firePropertyChange(MultiConstants.speciesFeatureType, oldSpeciesFeatureType, this.speciesFeatureType); + } + + + /** + * Unsets the variable speciesFeatureType. + * + * @return {@code true} if speciesFeatureType was set before, otherwise {@code false}. + */ + public boolean unsetSpeciesFeatureType() { + if (isSetSpeciesFeatureType()) { + String oldSpeciesFeatureType = this.speciesFeatureType; + this.speciesFeatureType = null; + firePropertyChange(MultiConstants.speciesFeatureType, oldSpeciesFeatureType, this.speciesFeatureType); + return true; + } + return false; + } + + + /** + * Returns the value of {@link #occur}. + * + * @return the value of {@link #occur}. + */ + public int getOccur() { + if (isSetOccur()) { + return occur; + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(MultiConstants.occur, this); + } + + + /** + * Returns whether {@link #occur} is set. + * + * @return whether {@link #occur} is set. + */ + public boolean isSetOccur() { + return occur != null; + } + + + /** + * Sets the value of occur + * + * @param occur the value of occur to be set. + */ + public void setOccur(int occur) { + Integer oldOccur = this.occur; + this.occur = occur; + firePropertyChange(MultiConstants.occur, oldOccur, this.occur); + } + + + /** + * Unsets the variable occur. + * + * @return {@code true} if occur was set before, otherwise {@code false}. + */ + public boolean unsetOccur() { + if (isSetOccur()) { + Integer oldOccur = this.occur; + this.occur = null; + firePropertyChange(MultiConstants.occur, oldOccur, this.occur); + return true; + } + return false; + } + + + /** + * Returns the value of {@link #component}. + * + * @return the value of {@link #component}. + */ + public String getComponent() { + if (isSetComponent()) { + return component; + } + + return null; + } + + + /** + * Returns whether {@link #component} is set. + * + * @return whether {@link #component} is set. + */ + public boolean isSetComponent() { + return component != null; + } + + + /** + * Sets the value of component + * + * @param component the value of component to be set. + */ + public void setComponent(String component) { + String oldComponent = this.component; + this.component = component; + firePropertyChange(MultiConstants.component, oldComponent, this.component); + } + + + /** + * Unsets the variable component. + * + * @return {@code true} if component was set before, otherwise {@code false}. + */ + public boolean unsetComponent() { + if (isSetComponent()) { + String oldComponent = this.component; + this.component = null; + firePropertyChange(MultiConstants.component, oldComponent, this.component); + r... [truncated message content] |
From: <nik...@us...> - 2015-04-03 09:02:48
|
Revision: 2178 http://sourceforge.net/p/jsbml/code/2178 Author: niko-rodrigue Date: 2015-04-03 09:02:45 +0000 (Fri, 03 Apr 2015) Log Message: ----------- corrected last compilation problem Modified Paths: -------------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java 2015-04-03 08:52:13 UTC (rev 2177) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java 2015-04-03 09:02:45 UTC (rev 2178) @@ -28,7 +28,6 @@ import org.sbml.jsbml.ListOf; import org.sbml.jsbml.Species; import org.sbml.jsbml.ext.AbstractSBasePlugin; -import org.sbml.jsbml.ext.multi.deprecated.SpeciesTypeRestriction; /** * @@ -97,12 +96,9 @@ * Generated serial version identifier. */ private static final long serialVersionUID = 3171952386462646205L; - /** - * - */ - ListOf<SpeciesTypeRestriction> listOfSpeciesTypeRestrictions; + /** * @param multiSpeciesReference */ @@ -110,28 +106,7 @@ super(multiSpeciesReference); } - /** - * Returns the list of {@link SpeciesTypeRestriction}. - * - * @return the list of {@link SpeciesTypeRestriction} - */ - public ListOf<SpeciesTypeRestriction> getListOfSpeciesTypeRestrictions() { - if (listOfSpeciesTypeRestrictions == null) { - listOfSpeciesTypeRestrictions = new ListOf<SpeciesTypeRestriction>(); - } - return listOfSpeciesTypeRestrictions; - } - - /** - * Adds a {@link SpeciesTypeRestriction}. - * - * @param speciesTypeRestriction the {@link SpeciesTypeRestriction} to add - */ - public void addSpeciesTypeRestriction(SpeciesTypeRestriction speciesTypeRestriction) { - getListOfSpeciesTypeRestrictions().add(speciesTypeRestriction); - } - @Override public boolean readAttribute(String attributeName, String prefix, String value) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-04-03 08:52:22
|
Revision: 2177 http://sourceforge.net/p/jsbml/code/2177 Author: niko-rodrigue Date: 2015-04-03 08:52:13 +0000 (Fri, 03 Apr 2015) Log Message: ----------- forgot to add one multi class Added Paths: ----------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeInstance.java Added: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeInstance.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeInstance.java (rev 0) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeInstance.java 2015-04-03 08:52:13 UTC (rev 2177) @@ -0,0 +1,377 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.multi; + +import java.util.Map; + +import org.sbml.jsbml.AbstractNamedSBase; +import org.sbml.jsbml.LevelVersionError; +import org.sbml.jsbml.PropertyUndefinedError; +import org.sbml.jsbml.UniqueNamedSBase; +import org.sbml.jsbml.util.StringTools; + +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.0 + * @date 16.10.2013 + */ +public class SpeciesTypeInstance extends AbstractNamedSBase implements UniqueNamedSBase { + + /** + * Generated serial version identifier. + */ + private static final long serialVersionUID = 1775590492963078468L; + + /** + * + */ + private String speciesType; + + /** + * + */ + private String compartmentReference; + + /** + * + */ + private Integer occur; + + + /** + * Creates an SpeciesTypeInstance instance + */ + public SpeciesTypeInstance() { + super(); + initDefaults(); + } + + + /** + * Creates a SpeciesTypeInstance instance with an id. + * + * @param id the identifier for the new element. + */ + public SpeciesTypeInstance(String id) { + super(id); + initDefaults(); + } + + + /** + * Creates a SpeciesTypeInstance instance with a level and version. + * + * @param level SBML Level + * @param version SBML Version + */ + public SpeciesTypeInstance(int level, int version) { + this(null, null, level, version); + } + + + /** + * Creates a SpeciesTypeInstance instance with an id, level, and version. + * + * @param id the identifier for this element. + * @param level the SBML Level + * @param version the SBML Version + */ + public SpeciesTypeInstance(String id, int level, int version) { + this(id, null, level, version); + } + + + /** + * Creates a SpeciesTypeInstance instance with an id, name, level, and version. + * + * @param id the identifier for this element. + * @param name a human-readable name for this element that can be used for display purposes. + * @param level the SBML Level + * @param version the SBML Version + */ + public SpeciesTypeInstance(String id, String name, int level, int version) { + super(id, name, level, version); + if (getLevelAndVersion().compareTo( + Integer.valueOf(MultiConstants.MIN_SBML_LEVEL), + Integer.valueOf(MultiConstants.MIN_SBML_VERSION)) < 0) { + throw new LevelVersionError(getElementName(), level, version); + } + initDefaults(); + } + + + /** + * Clone constructor + */ + public SpeciesTypeInstance(SpeciesTypeInstance obj) { + super(obj); + + // copy all class attributes + if (obj.isSetSpeciesType()) { + setSpeciesType(obj.getSpeciesType()); + } + if (obj.isSetCompartmentReference()) { + setCompartmentReference(obj.getCompartmentReference()); + } + if (obj.isSetOccur()) { + setOccur(obj.getOccur()); + } + } + + + /** + * clones this class + */ + public SpeciesTypeInstance clone() { + return new SpeciesTypeInstance(this); + } + + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = MultiConstants.shortLabel; + setPackageVersion(-1); + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.NamedSBase#isIdMandatory() + */ + @Override + public boolean isIdMandatory() { + return true; + } + + + + /** + * Returns the value of {@link #speciesType}. + * + * @return the value of {@link #speciesType}. + */ + public String getSpeciesType() { + if (isSetSpeciesType()) { + return speciesType; + } + + return null; + } + + + /** + * Returns whether {@link #speciesType} is set. + * + * @return whether {@link #speciesType} is set. + */ + public boolean isSetSpeciesType() { + return speciesType != null; + } + + + /** + * Sets the value of speciesType + * + * @param speciesType the value of speciesType to be set. + */ + public void setSpeciesType(String speciesType) { + String oldSpeciesType = this.speciesType; + this.speciesType = speciesType; + firePropertyChange(MultiConstants.speciesType, oldSpeciesType, this.speciesType); + } + + + /** + * Unsets the variable speciesType. + * + * @return {@code true} if speciesType was set before, otherwise {@code false}. + */ + public boolean unsetSpeciesType() { + if (isSetSpeciesType()) { + String oldSpeciesType = this.speciesType; + this.speciesType = null; + firePropertyChange(MultiConstants.speciesType, oldSpeciesType, this.speciesType); + return true; + } + return false; + } + + + /** + * Returns the value of {@link #compartmentReference}. + * + * @return the value of {@link #compartmentReference}. + */ + public String getCompartmentReference() { + if (isSetCompartmentReference()) { + return compartmentReference; + } + + return null; + } + + + /** + * Returns whether {@link #compartmentReference} is set. + * + * @return whether {@link #compartmentReference} is set. + */ + public boolean isSetCompartmentReference() { + return compartmentReference != null; + } + + + /** + * Sets the value of compartmentReference + * + * @param compartmentReference the value of compartmentReference to be set. + */ + public void setCompartmentReference(String compartmentReference) { + String oldCompartmentReference = this.compartmentReference; + this.compartmentReference = compartmentReference; + firePropertyChange(MultiConstants.compartmentReference, oldCompartmentReference, this.compartmentReference); + } + + + /** + * Unsets the variable compartmentReference. + * + * @return {@code true} if compartmentReference was set before, otherwise {@code false}. + */ + public boolean unsetCompartmentReference() { + if (isSetCompartmentReference()) { + String oldCompartmentReference = this.compartmentReference; + this.compartmentReference = null; + firePropertyChange(MultiConstants.compartmentReference, oldCompartmentReference, this.compartmentReference); + return true; + } + return false; + } + + + /** + * Returns the value of {@link #occur}. + * + * @return the value of {@link #occur}. + */ + public int getOccur() { + if (isSetOccur()) { + return occur; + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(MultiConstants.occur, this); + } + + + /** + * Returns whether {@link #occur} is set. + * + * @return whether {@link #occur} is set. + */ + public boolean isSetOccur() { + return occur != null; + } + + + /** + * Sets the value of occur + * + * @param occur the value of occur to be set. + */ + public void setOccur(int occur) { + Integer oldOccur = this.occur; + this.occur = occur; + firePropertyChange(MultiConstants.occur, oldOccur, this.occur); + } + + + /** + * Unsets the variable occur. + * + * @return {@code true} if occur was set before, otherwise {@code false}. + */ + public boolean unsetOccur() { + if (isSetOccur()) { + Integer oldOccur = this.occur; + this.occur = null; + firePropertyChange(MultiConstants.occur, oldOccur, this.occur); + return true; + } + return false; + } + + + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + + if (isSetId()) { + attributes.remove("id"); + attributes.put(MultiConstants.shortLabel+ ":id", getId()); + } + if (isSetName()) { + attributes.remove("name"); + attributes.put(MultiConstants.shortLabel+ ":name", getName()); + } + + if (isSetSpeciesType()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.speciesType, getSpeciesType()); + } + if (isSetCompartmentReference()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.compartmentReference, getCompartmentReference()); + } + if (isSetOccur()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.occur, occur.toString()); + } + + + return attributes; + } + + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); + + if (!isAttributeRead) { + isAttributeRead = true; + + if (attributeName.equals(MultiConstants.speciesType)) { + setSpeciesType(value); + } + if (attributeName.equals(MultiConstants.compartmentReference)) { + setCompartmentReference(value); + } + if (attributeName.equals(MultiConstants.occur)) { + setOccur(StringTools.parseSBMLInt(value)); + } + else { + isAttributeRead = false; + } + } + return isAttributeRead; + } +} Property changes on: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeInstance.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lea...@us...> - 2015-04-03 00:04:07
|
Revision: 2176 http://sourceforge.net/p/jsbml/code/2176 Author: leandrohw Date: 2015-04-03 00:04:05 +0000 (Fri, 03 Apr 2015) Log Message: ----------- Time was not working when it appeared in the middle of the math so this is fixed. In addition, added functions for >= and <= instead of using < and > so that the math remains unchanged. Modified Paths: -------------- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 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-04-02 17:15:05 UTC (rev 2175) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-04-03 00:04:05 UTC (rev 2176) @@ -2284,10 +2284,154 @@ */ @Override public ASTNodeValue geq(ASTNode left, ASTNode right) throws SBMLException { - lt(right, left); + left.compile(this); + ASTNode leftCompiled = getNode(); + right.compile(this); + ASTNode rightCompiled = getNode(); + if (leftCompiled.isVector()) { + if (rightCompiled.isVector()) { + ASTNode result = leftCompiled.clone(); + try { + geqRecursive(leftCompiled, rightCompiled, result); + } + catch(SBMLException e) { + unknownValue(); + return dummy; + } + setNode(result); + } else if (rightCompiled.isNumber() || useId) { + ASTNode result = leftCompiled.clone(); + try { + vectorScalarGeq(result, rightCompiled); + } + catch(SBMLException e) { + unknownValue(); + return dummy; + } + setNode(result); + } else { + unknownValue(); + } + } else if (leftCompiled.isNumber() || useId) { + if (rightCompiled.isVector()) { + ASTNode result = rightCompiled.clone(); + try { + scalarVectorGeq(leftCompiled, result); + } + catch(SBMLException e) { + unknownValue(); + return dummy; + } + setNode(result); + } else if (useId){ + if (leftCompiled.toString().equals("unknown") || rightCompiled.toString().equals("unknown")) { + unknownValue(); + } else { + ASTNode result = new ASTNode(ASTNode.Type.RELATIONAL_GEQ); + result.addChild(leftCompiled); + result.addChild(rightCompiled); + setNode(result); + } + } else if (rightCompiled.isNumber() && leftCompiled.isNumber()) { + double leftValue = leftCompiled.getReal(); + double rightValue = rightCompiled.getReal(); + ASTNode result = new ASTNode(leftValue >= rightValue ? 1 : 0); + setNode(result); + } else { + unknownValue(); + } + } else { + unknownValue(); + } return dummy; } + + /** + * + * @param left + * @param right + * @param node + * @throws IndexOutOfBoundsException + */ + private void geqRecursive(ASTNode left, ASTNode right, ASTNode node) throws IndexOutOfBoundsException{ + if (node.getChildCount() == 0) { + if (useId) { + node.setType(ASTNode.Type.RELATIONAL_GEQ); + node.getChildren().clear(); + node.addChild(left); + node.addChild(right); + } + else if (left.isNumber() && right.isNumber()) { + if (left.getReal() >= right.getReal()) { + node.setValue(1); + } else { + node.setValue(0); + } + } + else { + throw new SBMLException(); + } + return; + } + for (int i = 0; i < node.getChildCount(); ++i) { + right.compile(this); + ASTNode rightResult = getNode(); + left.compile(this); + ASTNode leftResult = getNode(); + if (rightResult.isVector() && leftResult.isVector()) { + geqRecursive(right.getChild(i),left.getChild(i), node.getChild(i)); + } else { + throw new SBMLException(); + } + } + } + + /** + * + * @param vectorLHS + * @param scalarRHS + */ + private void vectorScalarGeq(ASTNode vectorLHS, ASTNode scalarRHS) { + for (int i = 0; i < vectorLHS.getChildCount(); ++i) { + ASTNode child = vectorLHS.getChild(i); + child.compile(this); + ASTNode result = getNode(); + if (result.isVector()) { + vectorScalarGeq(child, scalarRHS); + } else if (useId) { + vectorLHS.replaceChild(i, ASTNode.geq(result, scalarRHS)); + } else if (result.isNumber() && scalarRHS.isNumber()) { + vectorLHS.getChild(i).setValue(result.getReal() >= scalarRHS.getReal() ? 1 : 0); + } + else { + throw new SBMLException(); + } + } + } + + /** + * + * @param scalarLHS + * @param vectorRHS + */ + private void scalarVectorGeq(ASTNode scalarLHS, ASTNode vectorRHS) { + for (int i = 0; i < vectorRHS.getChildCount(); ++i) { + ASTNode child = vectorRHS.getChild(i); + child.compile(this); + ASTNode result = getNode(); + if (result.isVector()) { + scalarVectorGeq(child, scalarLHS); + } else if (useId) { + vectorRHS.replaceChild(i, ASTNode.geq(scalarLHS, result)); + } else if (result.isNumber() && scalarLHS.isNumber()) { + vectorRHS.getChild(i).setValue(result.getReal() >= scalarLHS.getReal() ? 1 : 0); + } + else { + throw new SBMLException(); + } + } + } /* (non-Javadoc) * @see org.sbml.jsbml.util.compilers.ASTNodeCompiler#getConstantAvogadro(java.lang.String) */ @@ -2573,10 +2717,153 @@ */ @Override public ASTNodeValue leq(ASTNode left, ASTNode right) throws SBMLException { - gt(right, left); + left.compile(this); + ASTNode leftCompiled = getNode(); + right.compile(this); + ASTNode rightCompiled = getNode(); + if (leftCompiled.isVector()) { + if (rightCompiled.isVector()) { + ASTNode result = leftCompiled.clone(); + try { + leqRecursive(leftCompiled, rightCompiled, result); + } + catch(SBMLException e) { + unknownValue(); + return dummy; + } + setNode(result); + } else if (rightCompiled.isNumber() || useId) { + ASTNode result = leftCompiled.clone(); + try { + vectorScalarLeq(result, rightCompiled); + } + catch(SBMLException e) { + unknownValue(); + return dummy; + } + setNode(result); + } else { + unknownValue(); + } + } else if (leftCompiled.isNumber() || useId) { + if (rightCompiled.isVector()) { + ASTNode result = rightCompiled.clone(); + try { + scalarVectorLeq(leftCompiled, result); + } + catch(SBMLException e) { + unknownValue(); + return dummy; + } + setNode(result); + } else if (useId){ + if (leftCompiled.toString().equals("unknown") || rightCompiled.toString().equals("unknown")) { + unknownValue(); + } else { + ASTNode result = new ASTNode(ASTNode.Type.RELATIONAL_LEQ); + result.addChild(leftCompiled); + result.addChild(rightCompiled); + setNode(result); + } + } else if (rightCompiled.isNumber() && leftCompiled.isNumber()) { + double leftValue = leftCompiled.getReal(); + double rightValue = rightCompiled.getReal(); + ASTNode result = new ASTNode(leftValue <= rightValue ? 1 : 0); + setNode(result); + } else { + unknownValue(); + } + } else { + unknownValue(); + } return dummy; } + /** + * + * @param left + * @param right + * @param node + * @throws IndexOutOfBoundsException + */ + private void leqRecursive(ASTNode left, ASTNode right, ASTNode node) throws IndexOutOfBoundsException{ + if (node.getChildCount() == 0) { + if (useId) { + node.setType(ASTNode.Type.RELATIONAL_LEQ); + node.getChildren().clear(); + node.addChild(left); + node.addChild(right); + } + else if (left.isNumber() && right.isNumber()) { + if (left.getReal() <= right.getReal()) { + node.setValue(1); + } else { + node.setValue(0); + } + } + else { + throw new SBMLException(); + } + return; + } + for (int i = 0; i < node.getChildCount(); ++i) { + right.compile(this); + ASTNode rightResult = getNode(); + left.compile(this); + ASTNode leftResult = getNode(); + if (rightResult.isVector() && leftResult.isVector()) { + leqRecursive(right.getChild(i),left.getChild(i), node.getChild(i)); + } else { + throw new SBMLException(); + } + } + } + + /** + * + * @param vectorLHS + * @param scalarRHS + */ + private void vectorScalarLeq(ASTNode vectorLHS, ASTNode scalarRHS) { + for (int i = 0; i < vectorLHS.getChildCount(); ++i) { + ASTNode child = vectorLHS.getChild(i); + child.compile(this); + ASTNode result = getNode(); + if (result.isVector()) { + vectorScalarLeq(child, scalarRHS); + } else if (useId) { + vectorLHS.replaceChild(i, ASTNode.leq(result, scalarRHS)); + } else if (result.isNumber() && scalarRHS.isNumber()) { + vectorLHS.getChild(i).setValue(result.getReal() <= scalarRHS.getReal() ? 1 : 0); + } + else { + throw new SBMLException(); + } + } + } + + /** + * + * @param scalarLHS + * @param vectorRHS + */ + private void scalarVectorLeq(ASTNode scalarLHS, ASTNode vectorRHS) { + for (int i = 0; i < vectorRHS.getChildCount(); ++i) { + ASTNode child = vectorRHS.getChild(i); + child.compile(this); + ASTNode result = getNode(); + if (result.isVector()) { + scalarVectorLt(scalarLHS, child); + } else if (useId) { + vectorRHS.replaceChild(i, ASTNode.leq(scalarLHS, result)); + } else if (result.isNumber() && scalarLHS.isNumber()) { + vectorRHS.getChild(i).setValue(result.getReal() < scalarLHS.getReal() ? 1 : 0); + } + else { + throw new SBMLException(); + } + } + } /* (non-Javadoc) * @see org.sbml.jsbml.util.compilers.ASTNodeCompiler#ln(org.sbml.jsbml.ASTNode) */ @@ -3987,6 +4274,9 @@ */ @Override public ASTNodeValue symbolTime(String time) { + ASTNode node = new ASTNode(ASTNode.Type.NAME_TIME); + node.setName(time); + setNode(node); return dummy; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lea...@us...> - 2015-04-02 17:15:08
|
Revision: 2175 http://sourceforge.net/p/jsbml/code/2175 Author: leandrohw Date: 2015-04-02 17:15:05 +0000 (Thu, 02 Apr 2015) Log Message: ----------- Updated vector compiler to fix a bug where time was getting replaced by 0 Modified Paths: -------------- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 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-04-02 15:57:29 UTC (rev 2174) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-04-02 17:15:05 UTC (rev 2175) @@ -307,7 +307,9 @@ } out = result; } - out.addChild(new ASTNode(sumScalar)); + if (isSetSumScalar) { + out.addChild(new ASTNode(sumScalar)); + } } setNode(out); @@ -2373,6 +2375,12 @@ if (value.isVector()) { vectors.add(value); } + else if (useId){ + if (value.isName() && value.getName().equals("unknown")) { + return false; + } + ids.add(value); + } else if (value.isNumber()){ scalars.add(value); } @@ -2382,9 +2390,6 @@ } ids.add(value); } - else if (useId){ - ids.add(value); - } else { return false; } @@ -3130,7 +3135,9 @@ } out = result; } - out.addChild(new ASTNode(sumScalar)); + if (isSetSumScalar) { + out.addChild(new ASTNode(sumScalar)); + } } setNode(out); @@ -3357,7 +3364,9 @@ } out = result; } - out.addChild(new ASTNode(sumScalar)); + if (isSetSumScalar) { + out.addChild(new ASTNode(sumScalar)); + } } setNode(out); @@ -3978,7 +3987,6 @@ */ @Override public ASTNodeValue symbolTime(String time) { - setNode(new ASTNode(0)); return dummy; } @@ -4161,7 +4169,9 @@ } out = result; } - out.addChild(new ASTNode(sumScalar)); + if (isSetSumScalar) { + out.addChild(new ASTNode(sumScalar)); + } } setNode(out); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-04-02 15:57:43
|
Revision: 2174 http://sourceforge.net/p/jsbml/code/2174 Author: niko-rodrigue Date: 2015-04-02 15:57:29 +0000 (Thu, 02 Apr 2015) Log Message: ----------- more work through the massive changes in multi Modified Paths: -------------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReactionPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesType.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/StateFeatureValue.java trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java Added Paths: ----------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/DenotedSpeciesTypeComponentIndex.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InSpeciesTypeBond.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/OutwardBindingSite.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/PossibleSpeciesFeatureValue.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeature.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeatureType.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeComponentIndex.java Removed Paths: ------------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingSiteReference.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/Bond.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/ContainedSpeciesType.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InitialSpeciesInstance.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/PossibleValue.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/ProductSpeciesReference.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/ReactionRule.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeInstance.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeInstanceChange.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeRestriction.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeRestrictionReference.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeState.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/MultiEventAssignmentPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/MultiInitialAssignmentPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/MultiRulePlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/Selector.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/StateFeature.java Deleted: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingSiteReference.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingSiteReference.java 2015-04-01 16:11:12 UTC (rev 2173) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingSiteReference.java 2015-04-02 15:57:29 UTC (rev 2174) @@ -1,136 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2015 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * 4. The University of California, San Diego, La Jolla, CA, USA - * 5. The Babraham Institute, Cambridge, UK - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.multi; - -import java.util.Map; - -import org.sbml.jsbml.AbstractSBase; - -/** - * @author Nicolas Rodriguez - * @version $Rev$ - * @since 1.0 - * @date 10.10.2013 - */ -public class BindingSiteReference extends AbstractSBase { - - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = -744301449365477023L; - - /** - * - */ - private String speciesTypeState; - - /** - * - */ - public BindingSiteReference() { - super(); - initDefaults(); - } - - /** - * - */ - public void initDefaults() { - setNamespace(MultiConstants.namespaceURI); - } - - @Override - public AbstractSBase clone() { - // TODO - return null; - } - - /** - * Returns the speciesTypeState. - * - * @return the speciesTypeState - */ - public String getSpeciesTypeState() { - return speciesTypeState; - } - - /** - * Sets the speciesTypeState. - * - * @param speciesTypeState the speciesTypeState to set - */ - public void setSpeciesTypeState(String speciesTypeState) { - this.speciesTypeState = speciesTypeState; - } - - /** - * Returns {@code true} if the speciesTypeState is set. - * - * @return {@code true} if the speciesTypeState is set. - */ - public boolean isSetSpeciesTypeState() { - return speciesTypeState != null; - } - - @Override - public String toString() { - // TODO - return null; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#readAttribute(java.lang.String, java.lang.String, java.lang.String) - */ - @Override - public boolean readAttribute(String attributeName, String prefix, - String value) - { - boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); - - if (!isAttributeRead) { - - if (attributeName.equals(MultiConstants.speciesTypeState)) { - setSpeciesTypeState(value); - isAttributeRead = true; - } - } - - return isAttributeRead; - - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#writeXMLAttributes() - */ - @Override - public Map<String, String> writeXMLAttributes() { - Map<String, String> attributes = super.writeXMLAttributes(); - - if (isSetSpeciesTypeState()) { - attributes.put(MultiConstants.shortLabel + ':' + MultiConstants.speciesTypeState, getSpeciesTypeState()); - } - - return attributes; - } - - // TODO: removeXX unsetXX, equals, hashCode, ... -} Deleted: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/Bond.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/Bond.java 2015-04-01 16:11:12 UTC (rev 2173) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/Bond.java 2015-04-02 15:57:29 UTC (rev 2174) @@ -1,315 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2015 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * 4. The University of California, San Diego, La Jolla, CA, USA - * 5. The Babraham Institute, Cambridge, UK - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.multi; - -import java.text.MessageFormat; -import java.util.Map; - -import javax.swing.tree.TreeNode; - -import org.sbml.jsbml.AbstractSBase; -import org.sbml.jsbml.SBMLException; - -/** - * @author Nicolas Rodriguez - * @version $Rev$ - * @since 1.0 - * @date 16.10.2013 - */ -public class Bond extends AbstractSBase { - - // TODO: store the BindingSiteReference in a list and test that there are no more than two of them. - - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = -8781651881389720582L; - - /** - * @author Andreas Dräger - * @version $Rev$ - * @since 1.0 - * @date 10.12.2014 - */ - public enum BOND_OCCURRENCE_TYPE { - /** - * - */ - prohibited, - /** - * - */ - allowed, - /** - * - */ - required - }; - - /** - * - */ - private BOND_OCCURRENCE_TYPE occurence; - - /** - * - */ - private BindingSiteReference bindingSiteReference1; - - /** - * - */ - private BindingSiteReference bindingSiteReference2; - - /** - * - */ - public Bond() { - super(); - initDefaults(); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#clone() - */ - @Override - public AbstractSBase clone() { - // TODO - return null; - } - - - /** - * Returns the occurrence. - * - * @return the occurrence - */ - public BOND_OCCURRENCE_TYPE getOccurence() { - return occurence; - } - - /** - * Sets the occurrence. - * - * @param occurence the occurrence to set - */ - public void setOccurence(BOND_OCCURRENCE_TYPE occurence) { - this.occurence = occurence; - } - - /** - * Returns {@code true} if the occurrence is set. - * - * @return {@code true} if the occurrence is set. - */ - public boolean isSetOccurence() { - return occurence != null; - } - - /** - * Returns the first {@link BindingSiteReference} - * - * @return the first {@link BindingSiteReference} - */ - public BindingSiteReference getBindingSiteReference1() { - return bindingSiteReference1; - } - - /** - * Sets the first {@link BindingSiteReference}. - * - * @param bindingSite1 the {@link BindingSiteReference} to set - */ - public void setBindingSiteReference1(BindingSiteReference bindingSite1) { - bindingSiteReference1 = bindingSite1; - } - - /** - * Returns {@code true} if the first {@link BindingSiteReference} is set. - * - * @return {@code true} if the first {@link BindingSiteReference} is set. - */ - public boolean isSetBindingSiteReference1() { - return bindingSiteReference1 != null; - } - - /** - * Returns the second {@link BindingSiteReference}. - * - * @return the second {@link BindingSiteReference}. - */ - public BindingSiteReference getBindingSiteReference2() { - return bindingSiteReference2; - } - - - /** - * Sets the second {@link BindingSiteReference}. - * - * @param bindingSiteReference2 the {@link BindingSiteReference} to set - */ - public void setBindingSiteReference2(BindingSiteReference bindingSiteReference2) { - this.bindingSiteReference2 = bindingSiteReference2; - } - - /** - * Returns {@code true} if the second {@link BindingSiteReference} is set. - * - * @return {@code true} if the second {@link BindingSiteReference} is set. - */ - public boolean isSetBindingSiteReference2() { - return bindingSiteReference2 != null; - } - - /** - * Adds a {@link BindingSiteReference} to this {@link Bond}. If there are - * already two {@link BindingSiteReference}s, the new {@link BindingSiteReference} is - * not added and false is returned. - * - * @param bindingSiteReference - * @return {@code true} is the {@link BindingSiteReference} was added successfully to the {@link Bond}. - */ - public boolean addBindingSiteReference(BindingSiteReference bindingSiteReference) { - - if (!isSetBindingSiteReference1()) - { - setBindingSiteReference1(bindingSiteReference); - } - else if (!isSetBindingSiteReference2()) - { - setBindingSiteReference2(bindingSiteReference); - } else { - // There is already two bindingsiteReferences, we do nothing - return false; - } - - return true; - } - - @Override - public String toString() { - // TODO - return null; - } - - - /** - * - */ - public void initDefaults() { - setNamespace(MultiConstants.namespaceURI); - } - - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#getChildAt(int) - */ - @Override - public TreeNode getChildAt(int index) { - if (index < 0) { - throw new IndexOutOfBoundsException(index + " < 0"); - } - - int count = super.getChildCount(), pos = 0; - if (index < count) { - return super.getChildAt(index); - } else { - index -= count; - } - if (isSetBindingSiteReference1()) { - if (pos == index) { - return getBindingSiteReference1(); - } - pos++; - } - if (isSetBindingSiteReference2()) { - if (pos == index) { - return getBindingSiteReference2(); - } - pos++; - } - - throw new IndexOutOfBoundsException(MessageFormat.format( - "Index {0,number,integer} >= {1,number,integer}", - index, +Math.min(pos, 0))); - } - - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#getChildCount() - */ - @Override - public int getChildCount() { - int count = super.getChildCount(); - - if (isSetBindingSiteReference1()) { - count++; - } - if (isSetBindingSiteReference2()) { - count++; - } - - return count; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#readAttribute(java.lang.String, java.lang.String, java.lang.String) - */ - @Override - public boolean readAttribute(String attributeName, String prefix, - String value) - { - boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); - - if (!isAttributeRead) { - - if (attributeName.equals(MultiConstants.occurrence)) { - try { - setOccurence(BOND_OCCURRENCE_TYPE.valueOf(value)); - isAttributeRead = true; - } catch (Exception e) { - throw new SBMLException("Could not recognized the value '" + value - + "' for the attribute " + MultiConstants.occurrence - + " on the 'bond' element."); - } - } - } - - return isAttributeRead; - - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#writeXMLAttributes() - */ - @Override - public Map<String, String> writeXMLAttributes() { - Map<String, String> attributes = super.writeXMLAttributes(); - - if (isSetOccurence()) { - attributes.put(MultiConstants.shortLabel + ':' + MultiConstants.occurrence, getOccurence().toString()); - } - - return attributes; - } - -} Deleted: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/ContainedSpeciesType.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/ContainedSpeciesType.java 2015-04-01 16:11:12 UTC (rev 2173) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/ContainedSpeciesType.java 2015-04-02 15:57:29 UTC (rev 2174) @@ -1,140 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2015 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * 4. The University of California, San Diego, La Jolla, CA, USA - * 5. The Babraham Institute, Cambridge, UK - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.multi; - -import java.util.Map; - -import org.sbml.jsbml.AbstractSBase; - -/** - * @author Nicolas Rodriguez - * @version $Rev$ - * @since 1.0 - * @date 16.10.2013 - */ -public class ContainedSpeciesType extends AbstractSBase { - - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = 6818715002582655076L; - - /** - * - */ - private String speciesTypeState; - - /** - * - */ - public ContainedSpeciesType() { - super(); - initDefaults(); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#clone() - */ - @Override - public AbstractSBase clone() { - // TODO - return null; - } - - /** - * Returns the speciesTypeState. - * - * @return the speciesTypeState - */ - public String getSpeciesTypeState() { - return speciesTypeState; - } - - /** - * Sets the speciesTypeState. - * - * @param speciesTypeState the speciesTypeState to set - */ - public void setSpeciesTypeState(String speciesTypeState) { - this.speciesTypeState = speciesTypeState; - } - - /** - * Returns {@code true} if the speciesTypeState is set. - * - * @return {@code true} if the speciesTypeState is set. - */ - public boolean isSetSpeciesTypeState() { - return speciesTypeState != null; - } - - - @Override - public String toString() { - // TODO - return null; - } - - - /** - * - */ - public void initDefaults() { - setNamespace(MultiConstants.namespaceURI); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#readAttribute(java.lang.String, java.lang.String, java.lang.String) - */ - @Override - public boolean readAttribute(String attributeName, String prefix, - String value) - { - boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); - - if (!isAttributeRead) { - - if (attributeName.equals(MultiConstants.speciesTypeState)) { - setSpeciesTypeState(value); - isAttributeRead = true; - } - } - - return isAttributeRead; - - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#writeXMLAttributes() - */ - @Override - public Map<String, String> writeXMLAttributes() { - Map<String, String> attributes = super.writeXMLAttributes(); - - if (isSetSpeciesTypeState()) { - attributes.put(MultiConstants.shortLabel + ':' + MultiConstants.speciesTypeState, getSpeciesTypeState()); - } - - return attributes; - } - -} Added: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/DenotedSpeciesTypeComponentIndex.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/DenotedSpeciesTypeComponentIndex.java (rev 0) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/DenotedSpeciesTypeComponentIndex.java 2015-04-02 15:57:29 UTC (rev 2174) @@ -0,0 +1,227 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2014 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ + +package org.sbml.jsbml.ext.multi; + +import java.util.Map; + +import org.sbml.jsbml.AbstractSBase; + + +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.1 + */ +public class DenotedSpeciesTypeComponentIndex extends AbstractSBase { + + + /** + * + */ + private String speciesTypeComponentIndex; + + + /** + * Creates an DenotedSpeciesTypeComponentIndex instance + */ + public DenotedSpeciesTypeComponentIndex() { + super(); + initDefaults(); + } + + + /** + * Creates a DenotedSpeciesTypeComponentIndex instance with a level and version. + * + * @param level SBML Level + * @param version SBML Version + */ + public DenotedSpeciesTypeComponentIndex(int level, int version) { + super(level, version); + initDefaults(); + } + + + /** + * Clone constructor + */ + public DenotedSpeciesTypeComponentIndex(DenotedSpeciesTypeComponentIndex obj) { + super(obj); + + // SpeciesTypeComponentIndex + if (obj.isSetSpeciesTypeComponentIndex()) { + setSpeciesTypeComponentIndex(obj.getSpeciesTypeComponentIndex()); + } + } + + + /** + * clones this class + */ + public DenotedSpeciesTypeComponentIndex clone() { + return new DenotedSpeciesTypeComponentIndex(this); + } + + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = MultiConstants.shortLabel; + setPackageVersion(-1); + } + + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 5669; + int result = super.hashCode(); + result = prime + * result + + ((speciesTypeComponentIndex == null) ? 0 + : speciesTypeComponentIndex.hashCode()); + return result; + } + + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + DenotedSpeciesTypeComponentIndex other = (DenotedSpeciesTypeComponentIndex) obj; + if (speciesTypeComponentIndex == null) { + if (other.speciesTypeComponentIndex != null) { + return false; + } + } else if (!speciesTypeComponentIndex.equals(other.speciesTypeComponentIndex)) { + return false; + } + return true; + } + + + /** + * Returns the value of {@link #speciesTypeComponentIndex}. + * + * @return the value of {@link #speciesTypeComponentIndex}. + */ + public String getSpeciesTypeComponentIndex() { + if (isSetSpeciesTypeComponentIndex()) { + return speciesTypeComponentIndex; + } + + return null; + } + + + /** + * Returns whether {@link #speciesTypeComponentIndex} is set. + * + * @return whether {@link #speciesTypeComponentIndex} is set. + */ + public boolean isSetSpeciesTypeComponentIndex() { + return speciesTypeComponentIndex != null; + } + + + /** + * Sets the value of speciesTypeComponentIndex + * + * @param speciesTypeComponentIndex the value of speciesTypeComponentIndex to be set. + */ + public void setSpeciesTypeComponentIndex(String speciesTypeComponentIndex) { + String oldSpeciesTypeComponentIndex = this.speciesTypeComponentIndex; + this.speciesTypeComponentIndex = speciesTypeComponentIndex; + firePropertyChange(MultiConstants.speciesTypeComponentIndex, oldSpeciesTypeComponentIndex, this.speciesTypeComponentIndex); + } + + + /** + * Unsets the variable speciesTypeComponentIndex. + * + * @return {@code true} if speciesTypeComponentIndex was set before, otherwise {@code false}. + */ + public boolean unsetSpeciesTypeComponentIndex() { + if (isSetSpeciesTypeComponentIndex()) { + String oldSpeciesTypeComponentIndex = this.speciesTypeComponentIndex; + this.speciesTypeComponentIndex = null; + firePropertyChange(MultiConstants.speciesTypeComponentIndex, oldSpeciesTypeComponentIndex, this.speciesTypeComponentIndex); + return true; + } + return false; + } + + + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + + if (isSetSpeciesTypeComponentIndex()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.speciesTypeComponentIndex, getSpeciesTypeComponentIndex()); + } + return attributes; + } + + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); + + if (!isAttributeRead) { + isAttributeRead = true; + + if (attributeName.equals(MultiConstants.speciesTypeComponentIndex)) { + setSpeciesTypeComponentIndex(value); + } + else { + isAttributeRead = false; + } + } + return isAttributeRead; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "DenotedSpeciesTypeComponentIndex [speciesTypeComponentIndex=" + + speciesTypeComponentIndex + "]"; + } + +} Property changes on: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/DenotedSpeciesTypeComponentIndex.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InSpeciesTypeBond.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InSpeciesTypeBond.java (rev 0) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InSpeciesTypeBond.java 2015-04-02 15:57:29 UTC (rev 2174) @@ -0,0 +1,369 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.multi; + +import java.util.Map; + +import org.sbml.jsbml.AbstractNamedSBase; +import org.sbml.jsbml.LevelVersionError; + +/** + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.1 + */ +public class InSpeciesTypeBond extends AbstractNamedSBase { + + /** + * Generated serial version identifier. + */ + private static final long serialVersionUID = -8781651881389720582L; + + /** + * + */ + private String bindingSite1; + + /** + * + */ + private String bindingSite2; + + + /** + * Creates an InSpeciesTypeBond instance + */ + public InSpeciesTypeBond() { + super(); + initDefaults(); + } + + + /** + * Creates a InSpeciesTypeBond instance with an id. + * + * @param id the identifier for the new element. + */ + public InSpeciesTypeBond(String id) { + super(id); + initDefaults(); + } + + + /** + * Creates a InSpeciesTypeBond instance with a level and version. + * + * @param level SBML Level + * @param version SBML Version + */ + public InSpeciesTypeBond(int level, int version) { + this(null, null, level, version); + } + + + /** + * Creates a InSpeciesTypeBond instance with an id, level, and version. + * + * @param id the identifier for this element. + * @param level the SBML Level + * @param version the SBML Version + */ + public InSpeciesTypeBond(String id, int level, int version) { + this(id, null, level, version); + } + + + /** + * Creates a InSpeciesTypeBond instance with an id, name, level, and version. + * + * @param id the identifier for this element. + * @param name a human-readable name for this element that can be used for display purposes. + * @param level the SBML Level + * @param version the SBML Version + */ + public InSpeciesTypeBond(String id, String name, int level, int version) { + super(id, name, level, version); + if (getLevelAndVersion().compareTo( + Integer.valueOf(MultiConstants.MIN_SBML_LEVEL), + Integer.valueOf(MultiConstants.MIN_SBML_VERSION)) < 0) { + throw new LevelVersionError(getElementName(), level, version); + } + initDefaults(); + } + + + /** + * Clone constructor + */ + public InSpeciesTypeBond(InSpeciesTypeBond obj) { + super(obj); + + // copy all class attributes + if (obj.isSetBindingSite1()) { + setBindingSite1(obj.getBindingSite1()); + } + if (obj.isSetBindingSite2()) { + setBindingSite2(obj.getBindingSite2()); + } + } + + + /** + * clones this class + */ + public InSpeciesTypeBond clone() { + return new InSpeciesTypeBond(this); + } + + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = MultiConstants.shortLabel; + setPackageVersion(-1); + } + + + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 5791; + int result = super.hashCode(); + result = prime * result + + ((bindingSite1 == null) ? 0 : bindingSite1.hashCode()); + result = prime * result + + ((bindingSite2 == null) ? 0 : bindingSite2.hashCode()); + return result; + } + + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + InSpeciesTypeBond other = (InSpeciesTypeBond) obj; + if (bindingSite1 == null) { + if (other.bindingSite1 != null) { + return false; + } + } else if (!bindingSite1.equals(other.bindingSite1)) { + return false; + } + if (bindingSite2 == null) { + if (other.bindingSite2 != null) { + return false; + } + } else if (!bindingSite2.equals(other.bindingSite2)) { + return false; + } + return true; + } + + + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "InSpeciesTypeBond [bindingSite1 = " + bindingSite1 + + ", bindingSite2 = " + bindingSite2 + ", id = " + getId() + + ", name = " + getName() + "]"; + } + + + /** + * Returns the value of {@link #bindingSite1}. + * + * @return the value of {@link #bindingSite1}. + */ + public String getBindingSite1() { + if (isSetBindingSite1()) { + return bindingSite1; + } + + return null; + } + + + /** + * Returns whether {@link #bindingSite1} is set. + * + * @return whether {@link #bindingSite1} is set. + */ + public boolean isSetBindingSite1() { + return bindingSite1 != null; + } + + + /** + * Sets the value of bindingSite1 + * + * @param bindingSite1 the value of bindingSite1 to be set. + */ + public void setBindingSite1(String bindingSite1) { + String oldBindingSite1 = this.bindingSite1; + this.bindingSite1 = bindingSite1; + firePropertyChange(MultiConstants.bindingSite1, oldBindingSite1, this.bindingSite1); + } + + + /** + * Unsets the variable bindingSite1. + * + * @return {@code true} if bindingSite1 was set before, otherwise {@code false}. + */ + public boolean unsetBindingSite1() { + if (isSetBindingSite1()) { + String oldBindingSite1 = this.bindingSite1; + this.bindingSite1 = null; + firePropertyChange(MultiConstants.bindingSite1, oldBindingSite1, this.bindingSite1); + return true; + } + return false; + } + + + /** + * Returns the value of {@link #bindingSite2}. + * + * @return the value of {@link #bindingSite2}. + */ + public String getBindingSite2() { + if (isSetBindingSite2()) { + return bindingSite2; + } + + return null; + } + + + /** + * Returns whether {@link #bindingSite2} is set. + * + * @return whether {@link #bindingSite2} is set. + */ + public boolean isSetBindingSite2() { + return bindingSite2 != null; + } + + + /** + * Sets the value of bindingSite2 + * + * @param bindingSite2 the value of bindingSite2 to be set. + */ + public void setBindingSite2(String bindingSite2) { + String oldBindingSite2 = this.bindingSite2; + this.bindingSite2 = bindingSite2; + firePropertyChange(MultiConstants.bindingSite2, oldBindingSite2, this.bindingSite2); + } + + + /** + * Unsets the variable bindingSite2. + * + * @return {@code true} if bindingSite2 was set before, otherwise {@code false}. + */ + public boolean unsetBindingSite2() { + if (isSetBindingSite2()) { + String oldBindingSite2 = this.bindingSite2; + this.bindingSite2 = null; + firePropertyChange(MultiConstants.bindingSite2, oldBindingSite2, this.bindingSite2); + return true; + } + return false; + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractNamedSBase#readAttribute(java.lang.String, java.lang.String, java.lang.String) + */ + @Override + public boolean readAttribute(String attributeName, String prefix, + String value) + { + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); + + if (!isAttributeRead) { + + if (attributeName.equals(MultiConstants.bindingSite1)) { + setBindingSite1(value); + isAttributeRead = true; + } else if (attributeName.equals(MultiConstants.bindingSite2)) { + setBindingSite2(value); + isAttributeRead = true; + } + + } + + return isAttributeRead; + + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractNamedSBase#writeXMLAttributes() + */ + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + + if (isSetId()) { + attributes.remove("id"); + attributes.put(MultiConstants.shortLabel+ ":id", getId()); + } + if (isSetName()) { + attributes.remove("name"); + attributes.put(MultiConstants.shortLabel+ ":name", getName()); + } + + if (isSetBindingSite1()) { + attributes.put(MultiConstants.shortLabel + ':' + MultiConstants.bindingSite1, getBindingSite1()); + } + if (isSetBindingSite2()) { + attributes.put(MultiConstants.shortLabel + ':' + MultiConstants.bindingSite2, getBindingSite2()); + } + + return attributes; + } + + @Override + public boolean isIdMandatory() { + return false; + } + +} Property changes on: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InSpeciesTypeBond.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Deleted: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InitialSpeciesInstance.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InitialSpeciesInstance.java 2015-04-01 16:11:12 UTC (rev 2173) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InitialSpeciesInstance.java 2015-04-02 15:57:29 UTC (rev 2174) @@ -1,213 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2015 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * 4. The University of California, San Diego, La Jolla, CA, USA - * 5. The Babraham Institute, Cambridge, UK - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.multi; - -import java.util.HashMap; -import java.util.Locale; - -import org.sbml.jsbml.AbstractNamedSBase; -import org.sbml.jsbml.ext.multi.deprecated.Selector; -import org.sbml.jsbml.util.StringTools; - -/** - * @author Marine Dumousseau - * @since 1.0 - * @version $Rev$ - */ -public class InitialSpeciesInstance extends AbstractNamedSBase { - - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = 6619677758810986153L; - /** - * - */ - private Double initialProportion; - /** - * - */ - private String selectorID; - - /** - * - */ - public InitialSpeciesInstance() { - super(); - selectorID = null; - initialProportion = null; - } - - /** - * - * @param in - */ - public InitialSpeciesInstance(InitialSpeciesInstance in) { - super(in); - this.setSelector(in.getSelector()); - setInitialProportion(in.getInitialProportion()); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractSBase#clone() - */ - @Override - public InitialSpeciesInstance clone() { - return new InitialSpeciesInstance(this); - } - - /** - * - * @return - */ - public double getInitialProportion() { - return isSetInitialProportion() ? initialProportion : 0; - } - - /** - * - * @return - */ - public String getSelector() { - return isSetSelector() ? selectorID : ""; - } - - /** - * - * @return - */ - public Selector getSelectorInstance() { - // TODO extend model to have the listOfSelector and the appropriate - // methods - return null; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.NamedSBase#isIdMandatory() - */ - @Override - public boolean isIdMandatory() { - // TODO Auto-generated method stub - return false; - } - - /** - * - * @return - */ - public boolean isSetInitialProportion() { - return initialProportion != null; - } - - /** - * - * @return - */ - public boolean isSetSelector() { - return selectorID != null; - } - - /** - * - * @return - */ - public boolean isSetSelectorInstance() { - // TODO extend Model to add the listOfSelector and the appropriate - // methods - return false; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#readAttribute(java.lang.String, java.lang.String, java.lang.String) - */ - @Override - public boolean readAttribute(String attributeName, String prefix, - String value) { - boolean isReadAttribute = super.readAttribute(attributeName, prefix, - value); - - if (!isReadAttribute) { - if (attributeName.equals("initialProportion")) { - initialProportion = StringTools.parseSBMLDouble(value); - - return true; - } else if (attributeName.equals("selector")) { - selectorID = value; - - return true; - } - } - - return isReadAttribute; - } - - /** - * - * @param initialProportion - */ - public void setInitialProportion(double initialProportion) { - this.initialProportion = initialProportion; - } - - /** - * - * @param selector - */ - public void setSelector(Selector selector) { - selectorID = selector.isSetId() ? selector.getId() : ""; - } - - /** - * - * @param selectorID - */ - public void setSelector(String selectorID) { - this.selectorID = selectorID; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#toString() - */ - @Override - public String toString() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractNamedSBase#writeXMLAttributes() - */ - @Override - public HashMap<String, String> writeXMLAttributes() { - HashMap<String, String> attributes = new HashMap<String, String>(); - - if (isSetInitialProportion()) { - attributes.put("initialProportion", StringTools.toString( - Locale.ENGLISH, getInitialProportion())); - } - if (isSetSelector()) { - attributes.put("selector", getSelector()); - } - - return attributes; - } -} Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java 2015-04-01 16:11:12 UTC (rev 2173) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java 2015-04-02 15:57:29 UTC (rev 2174) @@ -105,109 +105,129 @@ * */ public static final String speciesType = "speciesType"; + + // speciesType /** * */ - public static final String selector = "selector"; + public static final String bindingSite = "bindingSite"; + + // speciesTypeState /** * */ - public static final String stateFeature = "stateFeature"; + public static final String minOccur = "minOccur"; /** * */ - public static final String possibleValue = "possibleValue"; + public static final String maxOccur = "maxOccur"; /** * */ - public static final String speciesTypeState = "speciesTypeState"; + public static final String connex = "connex"; /** * */ - public static final String stateFeatureInstance = "stateFeatureInstance"; + public static final String saturated = "saturated"; + + // bond /** * */ - public static final String stateFeatureValue = "stateFeatureValue"; + public static final String occurrence = "occurrence"; + /** * */ - public static final String containedSpeciesType = "containedSpeciesType"; + public static String speciesTypeRestriction = "speciesTypeRestriction"; + /** * */ - public static final String bond = "bond"; + public static final String packageName = "Multistate and Multicomponent Species"; + /** * */ - public static final String bindingSiteReference = "bindingSiteReference"; + public static final String compartmentType = "compartmentType"; - // speciesType /** * */ - public static final String bindingSite = "bindingSite"; + public static final String isType = "isType"; - // speciesTypeState /** * */ - public static final String minOccur = "minOccur"; + public static final int MIN_SBML_LEVEL = 3; + /** * */ - public static final String maxOccur = "maxOccur"; + public static final int MIN_SBML_VERSION = 1; + /** * */ - public static final String connex = "connex"; + public static final String compartment = "compartment"; + /** * */ - public static final String saturated = "saturated"; + public static final String listOfPossibleSpeciesFeatureValues = "listOfPossibleSpeciesFeatureValues"; - // bond /** * */ - public static final String occurrence = "occurrence"; + public static final String possibleSpeciesFeatureValue = "possibleSpeciesFeatureValue"; /** * */ - public static String speciesTypeRestriction = "speciesTypeRestriction"; + public static final String numericValue = "numericValue"; /** * */ - public static final String packageName = "Multistate and Multicomponent Species"; + public static final String compartmentReference = "compartmentReference"; /** * */ - public static final String compartmentType = "compartmentType"; + public static final String occur = "occur"; /** * */ - public static final String isType = "isType"; + public static final String speciesTypeComponentIndex = "speciesTypeComponentIndex"; /** * */ - public static final int MIN_SBML_LEVEL = 3; + public static final String denotedSpeciesTypeComponentIndex = "denotedSpeciesTypeComponentIndex"; /** * */ - public static final int MIN_SBML_VERSION = 1; + public static final String component = "component"; /** * */ - public static final String compartment = "compartment"; + public static final String identifyingParent = "indentifyingParent"; /** + * + */ + public static final String bindingSite1 = "bindingSite1"; + + /** + * + */ + public static final String bindingSite2 = "bindingSite2"; + + + /** * @param level * @param version * @return @@ -216,4 +236,45 @@ return namespaceURI; } + + // TODO - delete values not used any more + + /** + * + */ + public static final String selector = "selector"; + /** + * + */ + public static final String stateFeature = "stateFeature"; + /** + * + */ + public static final String speciesTypeState = "speciesTypeState"; + /** + * + */ + public static final String stateFeatureInstance = "stateFeatureInstance"; + /** + * + */ + public static final String stateFeatureValue = "stateFeatureValue"; + /** + * + */ + public static final String containedSpeciesType = "containedSpeciesType"; + /** + * + */ + public static final String bond = "bond"; + /** + * + */ + public static final String bindingSiteReference = "bindingSiteReference"; + + + + + + } Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReactionPlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReactionPlugin.java 2015-04-01 16:11:12 UTC (rev 2173) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReactionPlugin.java 2015-04-02 15:57:29 UTC (rev 2174) @@ -25,8 +25,6 @@ import javax.swing.tree.TreeNode; -import org.sbml.jsbml.ListOf; -import org.sbml.jsbml.Reaction; import org.sbml.jsbml.ext.AbstractSBasePlugin; /** @@ -40,20 +38,11 @@ /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return MultiConstants.getNamespaceURI(getLevel(), getVersion()); - } - - - /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() */ @Override public String getPackageName() { - return MultiConstants.packageName; + return MultiConstants.shortLabel; } @@ -74,33 +63,13 @@ return getElementNamespace(); } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractTreeNode#getParent() - */ - @SuppressWarnings("unchecked") - @Override - public ListOf<Reaction> getParent() { - return (ListOf<Reaction>) getExtendedSBase().getParent(); - } - - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() - */ - @Override - public ListOf<Reaction> getParentSBMLObject() { - return getParent(); - } /** * Generated serial version identifier. */ private static final long serialVersionUID = 7392764563567861115L; - /** - * - */ - ListOf<ReactionRule> listOfReactionRules; + // TODO - IntraSpeciesReaction + /** * @param multiReaction */ @@ -108,24 +77,7 @@ super(multiReaction); } - /** - * @return the listOfReactionRules - */ - public ListOf<ReactionRule> getListOfReactionRules() { - if (listOfReactionRules == null) { - listOfReactionRules = new ListOf<ReactionRule>(); - } - return listOfReactionRules; - } - - /** - * @param reactionRule the listOfReactionRules to set - */ - public void addReactionRule(ReactionRule reactionRule) { - getListOfReactionRules().add(reactionRule); - } - @Override public boolean readAttribute(String attributeName, String prefix, String value) { Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java 2015-04-01 16:11:12 UTC (rev 2173) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java 2015-04-02 15:57:29 UTC (rev 2174) @@ -21,14 +21,13 @@ */ package org.sbml.jsbml.ext.multi; +import java.text.MessageFormat; import java.util.Map; import org.sbml.jsbml.ListOf; -import org.sbml.jsbml.Model; import org.sbml.jsbml.SBase; import org.sbml.jsbml.Species; import org.sbml.jsbml.ext.AbstractSBasePlugin; -import org.sbml.jsbml.util.TreeNodeChangeListener; /** * @@ -37,24 +36,15 @@ * @since 1.0 * @version $Rev$ */ -public class MultiSpeciesPlugin extends AbstractSBasePlugin { +public class MultiSpeciesPlugin extends AbstractSBasePlugin { /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return MultiConstants.getNamespaceURI(getLevel(), getVersion()); - } - - - /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() */ @Override public String getPackageName() { - return MultiConstants.packageName; + return MultiConstants.shortLabel; } @@ -76,43 +66,33 @@ } - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractTreeNode#getParent() - */ - @SuppressWarnings("unchecked") - @Override - public ListOf<Species> getParent() { - return (ListOf<Species>) getExtendedSBase().getParent(); - } - - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() - */ - @Override - public ListOf<Species> getParentSBMLObject() { - return getParent(); - } /** * Generated serial version identifier. */ private static final long serialVersionUID = -5396837209115412420L; + /** * */ - private ListOf<SpeciesTypeInstance> listOfSpeciesTypeInstances; + private ListOf<OutwardBindingSite> listOfOutwardBindingSites; /** * */ - private Species species; // TODO: Do we need this anymore ? + private ListOf<SpeciesFeature> listOfSpeciesFeatures; /** * + */ + private String speciesType; + + /** + * * @param species */ public MultiSpeciesPlugin(Species species) { - this.species = species; + super(species); + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace } @@ -121,6 +101,17 @@ */ public MultiSpeciesPlugin(MultiSpeciesPlugin multiSpecies) { super(multiSpecies); + + // copy all attributes + if (multiSpecies.isSetListOfOutwardBindingSites()) { + setListOfOutwardBindingSites(multiSpecies.getListOfOutwardBindingSites().clone()); + } + if (multiSpecies.isSetListOfSpeciesFeatures()) { + setListOfSpeciesFeatures(multiSpecies.getListOfSpeciesFeatures().clone()); + } + if (multiSpecies.isSetSpeciesType()) { + setSpeciesType(multiSpecies.getSpeciesType()); + } } @@ -129,137 +120,551 @@ return new MultiSpeciesPlugin(this); } - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getAllowsChildren() + + + /** + * Returns {@code true} if {@link #listOfOutwardBindingSites} contains at least + * one element. + * + * @return {@code true} if {@link #listOfOutwardBindingSites} contains at least + * one element, otherwise {@code false}. */ - @Override - public boolean getAllowsChildren() { + public boolean isSetListOfOutwardBindingSites() { + if (listOfOutwardBindingSites == null) { + return false; + } return true; } - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getChildAt(int) + + /** + * Returns the {@link #listOfOutwardBindingSites}. + * Creates it if it does not already exist. + * + * @return the {@link #listOfOutwardBindingSites}. */ - @Override - public SBase getChildAt(int childIndex) { - // TODO Auto-generated method stub - return null; + public ListOf<OutwardBindingSite> getListOfOutwardBindingSites() { + if (listOfOutwardBindingSites == null) { + listOfOutwardBindingSites = new ListOf<OutwardBindingSite>(); + listOfOutwardBindingSites.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfOutwardBindingSites.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfOutwardBindingSites.setPackageName(null); + listOfOutwardBindingSites.setPackageName(MultiConstants.shortLabel); + listOfOutwardBindingSites.setSBaseListType(ListOf.Type.other); + + if (isSetExtendedSBase()) { + extendedSBase.registerChild(listOfOutwardBindingSites); + } + } + return listOfOutwardBindingSites; } - @Override - public int getChildCount() { - // TODO Auto-generated method stub - return 0; + + /** + * Sets the given {@code ListOf<OutwardBindingSite>}. + * If {@link #listOfOutwardBindingSites} was defined before and contains some + * elements, they are all unset. + * + * @param listOfOutwardBindingSites + */ + public void setListOfOutwardBindingSites(ListOf<OutwardBindingSite> listOfOutwardBindingSites) { + unsetListOfOutwardBindingSites(); + this.listOfOutwardBindingSites = listOfOutwardBindingSites; + + if (listOfOutwardBindingSites != null) { + listOfOutwardBindingSites.unsetNamespace(); + listOfOutwardBindingSites.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfOutwardBindingSites.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfOutwardBindingSites.setPackageName(null); + listOfOutwardBindingSites.setPackageName(MultiConstants.shortLabel); + this.listOfOutwardBindingSites.setSBaseListType(ListOf.Type.other); + + if (isSetExtendedSBase()) { + extendedSBase.registerChild(this.listOfOutwardBindingSites); + } + } } /** - * - * @param speciesTypeInstance + * Returns {@code true} if {@link #listOfOutwardBindingSites} contains at least + * one element, otherwise {@code false}. + * + * @return {@code true} if {@link #listOfOutwardBindingSites} contains at least + * one element, otherwise {@code false}. */ - public void addSpeciesTypeInstance(SpeciesTypeInstance speciesTypeInstance) { - getListOfSpeciesTypeInstances().add(speciesTypeInstance); + public boolean unsetListOfOutwardBindingSites() { + if (isSetListOfOutwardBindingSites()) { + ListOf<OutwardBindingSite> oldOutwardBindingSites = this.listOfOutwardBindingSites; + this.listOfOutwardBindingSites = null; + oldOutwardBindingSites.fireNodeRemovedEvent(); + return true; + } + return false; } + /** + * Adds a new {@link OutwardBindingSite} to the {@link #listOfOutwardBindingSites}. + * <p>The listOfOutwardBindingSites is initialized if necessary. + * + * @param outwardBindingSite the element to add to the list + * @return {@code true} (as specified by {@link java.util.Collection#add}) + * @see java.util.Collection#add(Object) + */ + public boolean addOutwardBindingSite(OutwardBindingSite outwardBindingSite) { + return getListOfOutwardBindingSites().add(outwardBindingSite); + } + + + /** + * Removes an element from the {@link #listOfOutwardBindingSites}. + * + * @param outwardBindingSite the element to be removed from the list. + * @return {@code true} if the list contained the specified element and it was + * removed. + * @see java.util.List#remove(Object) + */ + public boolean removeOutwardBindingSite(OutwardBindingSite outwardBindingSite) { + if (isSetListOfOutwardBindingSites()) { + return getListOfOutwardBindingSites().remove(outwardBindingSite); + } + return false; + } + + + /** + * Removes an element from the {@link #listOfOutwardBindingSites} at the given index. + * + * @param i the index where to remove the {@link OutwardBindingSite}. + * @return the specified element if it was successfully found and removed. + * @throws IndexOutOfBoundsException if the listOf is not set or if the index is + * out of bound ({@code (i < 0) || (i > listOfOutwardBindingSites)}). + */ + public OutwardBindingSite removeOutwardBindingSite(int i) { + if (!isSetListOfOutwardBindingSites()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + return getListOfOutwardBindingSites().remove(i); + } + + + /** + * Creates a new OutwardBindingSite element and adds it to the + * {@link #listOfOutwardBindingSites} list. + * + * @return the newly created element, i.e., the last item in the + * {@link #listOfOutwardBindingSites} + */ + public OutwardBindingSite createOutwardBindingSite() { + OutwardBindingSite outwardBindingSite = new OutwardBindingSite(); + addOutwardBindingSite(outwardBindingSite); + return outwardBindingSite; + } + + + /** + * Gets an element from the {@link #listOfOutwardBindingSites} at the given index. + * + * @param i the index of the {@link OutwardBindingSite} element to get. + * @return an element from the listOfOutwardBindingSites at the given index. + * @throws IndexOutOfBoundsException if the listOf is not set or + * if the index is out of bound (index < 0 || index > list.size). + */ + public OutwardBindingSite getOutwardBindingSite(int i) { + if (!isSetListOfOutwardBindingSites()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + return getListOfOutwardBindingSites().get(i); + } + + + /** + * Returns the number of {@link OutwardBindingSite}s in this + * {@link MultiSpeciesPlugin}. * - * @param n - * @return + * @return the number of {@link OutwardBindingSite}s in this + * {@link MultiSpeciesPlugin}. */ - public SpeciesTypeInstance getSpeciesTypeInstance(int n) { - return getListOfSpeciesTypeInstances().get(n); + public int getOutwardBindingSiteCount() { + return isSetListOfOutwardBindingSites() ? getListOfOutwardBindingSites().size() : 0; } + /** + * Returns the number of {@link OutwardBindingSite}s in this + * {@link MultiSpeciesPlugin}. * - * @param id - * @return + * @return the number of {@link OutwardBindingSite}s in this + * {@link MultiSpeciesPlugin}. + * @libsbml.deprecated same as {@link #getOutwardBindingSiteCount()} */ - public SpeciesTypeInstance getInitialSpeciesInstance(String id) { - if (isSetListOfSpeciesInstances()) { - for (SpeciesTypeInstance comp : listOfSpeciesTypeInstances) { - if (... [truncated message content] |
From: <nik...@us...> - 2015-04-01 16:11:14
|
Revision: 2173 http://sourceforge.net/p/jsbml/code/2173 Author: niko-rodrigue Date: 2015-04-01 16:11:12 +0000 (Wed, 01 Apr 2015) Log Message: ----------- corrected MultiParser Modified Paths: -------------- trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java Modified: trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java 2015-04-01 16:09:36 UTC (rev 2172) +++ trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java 2015-04-01 16:11:12 UTC (rev 2173) @@ -29,7 +29,6 @@ import static org.sbml.jsbml.ext.multi.MultiConstants.listOfSpeciesTypes; import static org.sbml.jsbml.ext.multi.MultiConstants.listOfStateFeatureInstances; import static org.sbml.jsbml.ext.multi.MultiConstants.listOfStateFeatureValues; -import static org.sbml.jsbml.ext.multi.MultiConstants.listOfStateFeatures; import static org.sbml.jsbml.ext.multi.MultiConstants.listOfUnboundBindingSites; import static org.sbml.jsbml.ext.multi.MultiConstants.namespaceURI; import static org.sbml.jsbml.ext.multi.MultiConstants.shortLabel; @@ -155,9 +154,10 @@ { SpeciesType speciesType = (SpeciesType) contextObject; - if (elementName.equals(listOfStateFeatures)) { - return speciesType.getListOfStateFeatures(); - } + // TODO - update to include all the new children +// if (elementName.equals(listOfStateFeatures)) { +// return speciesType.getListOfStateFeatures(); +// } } // end SpeciesType else if (contextObject instanceof StateFeature) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-04-01 16:09:51
|
Revision: 2172 http://sourceforge.net/p/jsbml/code/2172 Author: niko-rodrigue Date: 2015-04-01 16:09:36 +0000 (Wed, 01 Apr 2015) Log Message: ----------- started to update to latest draft, clean and modify the multi package to be able to set properly the package version. Right now I moved some classes that I think are not in use any more to a 'deprecated' package, I will remove them later when I went through the whole specs Modified Paths: -------------- trunk/core/test/org/sbml/jsbml/xml/test/UnregisterTests.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InitialSpeciesInstance.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/PossibleValue.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesType.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeInstance.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeState.java trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java Added Paths: ----------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModelPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReactionPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/MultiEventAssignmentPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/MultiInitialAssignmentPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/MultiRulePlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/Selector.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/SelectorReference.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/StateFeature.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/StateFeatureInstance.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/deprecated/StateFeatureValue.java Removed Paths: ------------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiEventAssignment.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiInitialAssignment.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModel.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiReaction.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiRule.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpecies.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReference.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/Selector.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SelectorReference.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/StateFeature.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/StateFeatureInstance.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/StateFeatureValue.java Modified: trunk/core/test/org/sbml/jsbml/xml/test/UnregisterTests.java =================================================================== --- trunk/core/test/org/sbml/jsbml/xml/test/UnregisterTests.java 2015-04-01 14:01:42 UTC (rev 2171) +++ trunk/core/test/org/sbml/jsbml/xml/test/UnregisterTests.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -434,7 +434,7 @@ Species s3 = new Species(); s3.setId("S3"); - MultiSpecies mS3 = new MultiSpecies(s3); + MultiSpeciesPlugin mS3 = new MultiSpeciesPlugin(s3); s3.addExtension("any", mS3); Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java 2015-04-01 14:01:42 UTC (rev 2171) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -164,9 +164,7 @@ /** * Initializes the default values using the namespace. */ - public void initDefaults() { - setPackageVersion(-1); - } + public void initDefaults() {} @@ -371,7 +369,7 @@ /** * Sets the listOfReplacedElements. If there was already some elements defined - * on listOfReplacedElements, the will be unset beforehand. If present it must + * on listOfReplacedElements, they will be unset beforehand. If present it must * contain at least one {@link ReplacedElement} object. * * @param listOfReplacedElements Added: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java (rev 0) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -0,0 +1,223 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2014 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ + +package org.sbml.jsbml.ext.multi; + +import java.util.Map; + +import org.sbml.jsbml.AbstractNamedSBase; +import org.sbml.jsbml.LevelVersionError; + + +public class CompartmentReference extends AbstractNamedSBase { + + private String compartment; + + /** + * Creates an CompartmentReference instance + */ + public CompartmentReference() { + super(); + initDefaults(); + } + + + /** + * Creates a CompartmentReference instance with an id. + * + * @param id the identifier for the new element. + */ + public CompartmentReference(String id) { + super(id); + initDefaults(); + } + + + /** + * Creates a CompartmentReference instance with a level and version. + * + * @param level SBML Level + * @param version SBML Version + */ + public CompartmentReference(int level, int version) { + this(null, null, level, version); + } + + + /** + * Creates a CompartmentReference instance with an id, level, and version. + * + * @param id the identifier for this element. + * @param level the SBML Level + * @param version the SBML Version + */ + public CompartmentReference(String id, int level, int version) { + this(id, null, level, version); + } + + + /** + * Creates a CompartmentReference instance with an id, name, level, and version. + * + * @param id the identifier for this element. + * @param name a human-readable name for this element that can be used for display purposes. + * @param level the SBML Level + * @param version the SBML Version + */ + public CompartmentReference(String id, String name, int level, int version) { + super(id, name, level, version); + if (getLevelAndVersion().compareTo( + Integer.valueOf(MultiConstants.MIN_SBML_LEVEL), + Integer.valueOf(MultiConstants.MIN_SBML_VERSION)) < 0) { + throw new LevelVersionError(getElementName(), level, version); + } + initDefaults(); + } + + + /** + * Clone constructor + */ + public CompartmentReference(CompartmentReference obj) { + super(obj); + + // compartment + if (obj.isSetCompartment()) { + setCompartment(obj.getCompartment()); + } + } + + + /** + * clones this class + */ + public CompartmentReference clone() { + return new CompartmentReference(this); + } + + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = MultiConstants.shortLabel; + setPackageVersion(-1); + } + + + @Override + public boolean isIdMandatory() { + return false; + } + + + /** + * Returns the value of {@link #compartment}. + * + * @return the value of {@link #compartment}. + */ + public String getCompartment() { + if (isSetCompartment()) { + return compartment; + } + + return null; + } + + + /** + * Returns whether {@link #compartment} is set. + * + * @return whether {@link #compartment} is set. + */ + public boolean isSetCompartment() { + return compartment != null; + } + + + /** + * Sets the value of compartment + * + * @param compartment the value of compartment to be set. + */ + public void setCompartment(String compartment) { + String oldCompartment = this.compartment; + this.compartment = compartment; + firePropertyChange(MultiConstants.compartment, oldCompartment, this.compartment); + } + + + /** + * Unsets the variable compartment. + * + * @return {@code true} if compartment was set before, otherwise {@code false}. + */ + public boolean unsetCompartment() { + if (isSetCompartment()) { + String oldCompartment = this.compartment; + this.compartment = null; + firePropertyChange(MultiConstants.compartment, oldCompartment, this.compartment); + return true; + } + return false; + } + + + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + + if (isSetId()) { + attributes.remove("id"); + attributes.put(MultiConstants.shortLabel + ":id", getId()); + } + if (isSetName()) { + attributes.remove("name"); + attributes.put(MultiConstants.shortLabel + ":name", getName()); + } + + if (isSetCompartment()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.compartment, getCompartment()); + } + return attributes; + } + + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); + + if (!isAttributeRead) { + isAttributeRead = true; + + if (attributeName.equals(MultiConstants.compartment)) { + setCompartment(value); + } + else { + isAttributeRead = false; + } + } + return isAttributeRead; + } + +} Property changes on: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/CompartmentReference.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InitialSpeciesInstance.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InitialSpeciesInstance.java 2015-04-01 14:01:42 UTC (rev 2171) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InitialSpeciesInstance.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -25,6 +25,7 @@ import java.util.Locale; import org.sbml.jsbml.AbstractNamedSBase; +import org.sbml.jsbml.ext.multi.deprecated.Selector; import org.sbml.jsbml.util.StringTools; /** Added: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java (rev 0) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -0,0 +1,564 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.multi; + +import java.text.MessageFormat; +import java.util.Map; + +import javax.swing.tree.TreeNode; + +import org.sbml.jsbml.Compartment; +import org.sbml.jsbml.ListOf; +import org.sbml.jsbml.PropertyUndefinedError; +import org.sbml.jsbml.ext.AbstractSBasePlugin; +import org.sbml.jsbml.util.StringTools; + +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.0 + */ +public class MultiCompartmentPlugin extends AbstractSBasePlugin { + + + /** + * Generated serial version identifier. + */ + private static final long serialVersionUID = 4526455581462978178L; + + /** + * + */ + private String compartmentType; + + /** + * + */ + private Boolean isType; + + /** + * + */ + private ListOf<CompartmentReference> listOfCompartmentReferences; + + /** + * Creates an MultiCompartmentPlugin instance + */ + public MultiCompartmentPlugin() { + super(); + initDefaults(); + } + + + /** + * Creates a MultiCompartmentPlugin instance associated with the given {@link Compartment}. + * + * @param id the compartment to extend. + */ + public MultiCompartmentPlugin(Compartment compartment) { + super(compartment); + initDefaults(); + } + + + /** + * Clone constructor + */ + public MultiCompartmentPlugin(MultiCompartmentPlugin obj) { + super(obj); + + if (obj.isSetListOfCompartmentReferences()) { + setListOfCompartmentReferences(obj.getListOfCompartmentReferences().clone()); + } + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.AbstractSBasePlugin#clone() + */ + @Override + public MultiCompartmentPlugin clone() { + return new MultiCompartmentPlugin(this); + } + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() + */ + @Override + public String getPackageName() { + return MultiConstants.packageName; + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() + */ + @Override + public String getPrefix() { + return MultiConstants.shortLabel; + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getURI() + */ + @Override + public String getURI() { + return getElementNamespace(); + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractTreeNode#getParent() + */ + @Override + public Compartment getParent() { + return (Compartment) getExtendedSBase(); + } + + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() + */ + @Override + public Compartment getParentSBMLObject() { + return getParent(); + } + + + /** + * Returns {@code true} if {@link #listOfCompartmentReferences} contains at least + * one element. + * + * @return {@code true} if {@link #listOfCompartmentReferences} contains at least + * one element, otherwise {@code false}. + */ + public boolean isSetListOfCompartmentReferences() { + if (listOfCompartmentReferences == null) { + return false; + } + return true; + } + + + /** + * Returns the {@link #listOfCompartmentReferences}. + * Creates it if it does not already exist. + * + * @return the {@link #listOfCompartmentReferences}. + */ + public ListOf<CompartmentReference> getListOfCompartmentReferences() { + if (listOfCompartmentReferences == null) { + listOfCompartmentReferences = new ListOf<CompartmentReference>(); + listOfCompartmentReferences.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCompartmentReferences.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfCompartmentReferences.setPackageName(null); + listOfCompartmentReferences.setPackageName(MultiConstants.shortLabel); + listOfCompartmentReferences.setSBaseListType(ListOf.Type.other); + + if (isSetExtendedSBase()) { + extendedSBase.registerChild(listOfCompartmentReferences); + } + } + + return listOfCompartmentReferences; + } + + + /** + * Sets the given {@code ListOf<CompartmentReference>}. + * If {@link #listOfCompartmentReferences} was defined before and contains some + * elements, they are all unset. + * + * @param listOfCompartmentReferences + */ + public void setListOfCompartmentReferences(ListOf<CompartmentReference> listOfCompartmentReferences) { + unsetListOfCompartmentReferences(); + this.listOfCompartmentReferences = listOfCompartmentReferences; + + if (listOfCompartmentReferences != null) { + listOfCompartmentReferences.unsetNamespace(); + listOfCompartmentReferences.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCompartmentReferences.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfCompartmentReferences.setPackageName(null); + listOfCompartmentReferences.setPackageName(MultiConstants.shortLabel); + listOfCompartmentReferences.setSBaseListType(ListOf.Type.other); + + if (isSetExtendedSBase()) { + extendedSBase.registerChild(this.listOfCompartmentReferences); + } + } + } + + + /** + * Returns {@code true} if {@link #listOfCompartmentReferences} contains at least + * one element, otherwise {@code false}. + * + * @return {@code true} if {@link #listOfCompartmentReferences} contains at least + * one element, otherwise {@code false}. + */ + public boolean unsetListOfCompartmentReferences() { + if (isSetListOfCompartmentReferences()) { + ListOf<CompartmentReference> oldCompartmentReferences = this.listOfCompartmentReferences; + this.listOfCompartmentReferences = null; + oldCompartmentReferences.fireNodeRemovedEvent(); + return true; + } + return false; + } + + + /** + * Adds a new {@link CompartmentReference} to the {@link #listOfCompartmentReferences}. + * <p>The listOfCompartmentReferences is initialized if necessary. + * + * @param compartmentReference the element to add to the list + * @return {@code true} (as specified by {@link java.util.Collection#add}) + * @see java.util.Collection#add(Object) + */ + public boolean addCompartmentReference(CompartmentReference compartmentReference) { + return getListOfCompartmentReferences().add(compartmentReference); + } + + + /** + * Removes an element from the {@link #listOfCompartmentReferences}. + * + * @param compartmentReference the element to be removed from the list. + * @return {@code true} if the list contained the specified element and it was + * removed. + * @see java.util.List#remove(Object) + */ + public boolean removeCompartmentReference(CompartmentReference compartmentReference) { + if (isSetListOfCompartmentReferences()) { + return getListOfCompartmentReferences().remove(compartmentReference); + } + return false; + } + + + /** + * Removes an element from the {@link #listOfCompartmentReferences}. + * + * @param compartmentReferenceId the id of the element to be removed from the list. + * @return the removed element, if it was successfully found and removed or + * {@code null}. + */ + public CompartmentReference removeCompartmentReference(String compartmentReferenceId) { + if (isSetListOfCompartmentReferences()) { + return getListOfCompartmentReferences().remove(compartmentReferenceId); + } + return null; + } + + + /** + * Removes an element from the {@link #listOfCompartmentReferences} at the given index. + * + * @param i the index where to remove the {@link CompartmentReference}. + * @return the specified element if it was successfully found and removed. + * @throws IndexOutOfBoundsException if the listOf is not set or if the index is + * out of bound ({@code (i < 0) || (i > listOfCompartmentReferences)}). + */ + public CompartmentReference removeCompartmentReference(int i) { + if (!isSetListOfCompartmentReferences()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + return getListOfCompartmentReferences().remove(i); + } + + + /** + * Creates a new CompartmentReference element and adds it to the + * {@link #listOfCompartmentReferences} list. + * + * @return the newly created element, i.e., the last item in the + * {@link #listOfCompartmentReferences} + */ + public CompartmentReference createCompartmentReference() { + return createCompartmentReference(null); + } + + + /** + * Creates a new {@link CompartmentReference} element and adds it to the + * {@link #listOfCompartmentReferences} list. + * + * @param id the identifier that is to be applied to the new element. + * @return the newly created {@link CompartmentReference} element, which is the last + * element in the {@link #listOfCompartmentReferences}. + */ + public CompartmentReference createCompartmentReference(String id) { + CompartmentReference compartmentReference = new CompartmentReference(id); + addCompartmentReference(compartmentReference); + return compartmentReference; + } + + + /** + * Gets an element from the {@link #listOfCompartmentReferences} at the given index. + * + * @param i the index of the {@link CompartmentReference} element to get. + * @return an element from the listOfCompartmentReferences at the given index. + * @throws IndexOutOfBoundsException if the listOf is not set or + * if the index is out of bound (index < 0 || index > list.size). + */ + public CompartmentReference getCompartmentReference(int i) { + if (!isSetListOfCompartmentReferences()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + return getListOfCompartmentReferences().get(i); + } + + + /** + * Gets an element from the listOfCompartmentReferences, with the given id. + * + * @param compartmentReferenceId the id of the {@link CompartmentReference} element to get. + * @return an element from the listOfCompartmentReferences with the given id + * or {@code null}. + */ + public CompartmentReference getCompartmentReference(String compartmentReferenceId) { + if (isSetListOfCompartmentReferences()) { + return getListOfCompartmentReferences().get(compartmentReferenceId); + } + return null; + } + + + /** + * Returns the number of {@link CompartmentReference}s in this + * {@link MultiCompartmentPlugin}. + * + * @return the number of {@link CompartmentReference}s in this + * {@link MultiCompartmentPlugin}. + */ + public int getCompartmentReferenceCount() { + return isSetListOfCompartmentReferences() ? getListOfCompartmentReferences().size() : 0; + } + + + /** + * Returns the number of {@link CompartmentReference}s in this + * {@link MultiCompartmentPlugin}. + * + * @return the number of {@link CompartmentReference}s in this + * {@link MultiCompartmentPlugin}. + * @libsbml.deprecated same as {@link #getCompartmentReferenceCount()} + */ + public int getNumCompartmentReferences() { + return getCompartmentReferenceCount(); + } + + + /** + * Returns the value of {@link #compartmentType}. + * + * @return the value of {@link #compartmentType}. + */ + public String getCompartmentType() { + if (isSetCompartmentType()) { + return compartmentType; + } + + return null; + } + + + /** + * Returns whether {@link #compartmentType} is set. + * + * @return whether {@link #compartmentType} is set. + */ + public boolean isSetCompartmentType() { + return compartmentType != null; + } + + + /** + * Sets the value of compartmentType + * + * @param compartmentType the value of compartmentType to be set. + */ + public void setCompartmentType(String compartmentType) { + String oldCompartmentType = this.compartmentType; + this.compartmentType = compartmentType; + firePropertyChange(MultiConstants.compartmentType, oldCompartmentType, this.compartmentType); + } + + + /** + * Unsets the variable compartmentType. + * + * @return {@code true} if compartmentType was set before, otherwise {@code false}. + */ + public boolean unsetCompartmentType() { + if (isSetCompartmentType()) { + String oldCompartmentType = this.compartmentType; + this.compartmentType = null; + firePropertyChange(MultiConstants.compartmentType, oldCompartmentType, this.compartmentType); + return true; + } + return false; + } + + + /** + * Returns the value of {@link #isType}. + * + * @return the value of {@link #isType}. + */ + public boolean getIsType() { + if (isSetIsType()) { + return isType; + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(MultiConstants.isType, this); + } + + /** + * Returns the value of {@link #isType}, return false if isType is not defined. + * + * @return the value of {@link #isType}, return false if isType is not defined. + */ + public boolean isType() { + if (isSetIsType()) { + return isType; + } + + return false; + } + + + /** + * Returns whether {@link #isType} is set. + * + * @return whether {@link #isType} is set. + */ + public boolean isSetIsType() { + return isType != null; + } + + + /** + * Sets the value of isType + * + * @param isType the value of isType to be set. + */ + public void setIsType(boolean isType) { + Boolean oldIsType = this.isType; + this.isType = isType; + firePropertyChange(MultiConstants.isType, oldIsType, this.isType); + } + + + /** + * Unsets the variable isType. + * + * @return {@code true} if isType was set before, otherwise {@code false}. + */ + public boolean unsetIsType() { + if (isSetIsType()) { + Boolean oldIsType = this.isType; + this.isType = null; + firePropertyChange(MultiConstants.isType, oldIsType, this.isType); + return true; + } + return false; + } + + @Override + public boolean getAllowsChildren() { + return true; + } + + @Override + public int getChildCount() { + int count = 0; + + if (isSetListOfCompartmentReferences()) { + count++; + } + + return count; + } + + @Override + public TreeNode getChildAt(int index) { + if (index < 0) { + throw new IndexOutOfBoundsException(index + " < 0"); + } + int pos = 0; + + if (isSetListOfCompartmentReferences()) { + if (pos == index) { + return getListOfCompartmentReferences(); + } + pos++; + } + + throw new IndexOutOfBoundsException( + MessageFormat.format("Index {0,number,integer} >= {1,number,integer}", + index, Math.min(pos, 0))); + } + + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + + if (isSetCompartmentType()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.compartmentType, getCompartmentType()); + } + if (isSetIsType()) { + attributes.put(MultiConstants.shortLabel + ":" + MultiConstants.isType, isType.toString()); + } + return attributes; + } + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = true; + + if (attributeName.equals(MultiConstants.compartmentType)) { + setCompartmentType(value); + } + if (attributeName.equals(MultiConstants.isType)) { + setIsType(StringTools.parseSBMLBoolean(value)); + } + else { + isAttributeRead = false; + } + + return isAttributeRead; + } +} Property changes on: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java 2015-04-01 14:01:42 UTC (rev 2171) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -183,6 +183,31 @@ public static final String packageName = "Multistate and Multicomponent Species"; /** + * + */ + public static final String compartmentType = "compartmentType"; + + /** + * + */ + public static final String isType = "isType"; + + /** + * + */ + public static final int MIN_SBML_LEVEL = 3; + + /** + * + */ + public static final int MIN_SBML_VERSION = 1; + + /** + * + */ + public static final String compartment = "compartment"; + + /** * @param level * @param version * @return Deleted: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiEventAssignment.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiEventAssignment.java 2015-04-01 14:01:42 UTC (rev 2171) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiEventAssignment.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -1,160 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2015 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * 4. The University of California, San Diego, La Jolla, CA, USA - * 5. The Babraham Institute, Cambridge, UK - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.multi; - -import java.util.Map; - -import javax.swing.tree.TreeNode; - -import org.sbml.jsbml.EventAssignment; -import org.sbml.jsbml.ListOf; -import org.sbml.jsbml.ext.AbstractSBasePlugin; - -/** - * - * @author Nicolas Rodriguez - * @version $Rev$ - * @since 1.0 - * @date 16.10.2013 - */ -public class MultiEventAssignment extends AbstractSBasePlugin { - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return MultiConstants.getNamespaceURI(getLevel(), getVersion()); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() - */ - @Override - public String getPackageName() { - return MultiConstants.packageName; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() - */ - @Override - public String getPrefix() { - return MultiConstants.shortLabel; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getURI() - */ - @Override - public String getURI() { - return getElementNamespace(); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractTreeNode#getParent() - */ - @SuppressWarnings("unchecked") - @Override - public ListOf<EventAssignment> getParent() { - return (ListOf<EventAssignment>) getExtendedSBase().getParent(); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() - */ - @Override - public ListOf<EventAssignment> getParentSBMLObject() { - return getParent(); - } - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = -5524105017747151889L; - - /** - * - */ - private SpeciesTypeInstanceChange speciesTypeInstanceChange; // TODO: should probably be a listOf here - - /** - * @param multiEventAssignment - */ - public MultiEventAssignment(MultiEventAssignment multiEventAssignment) { - super(multiEventAssignment); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#readAttribute(java.lang.String, java.lang.String, java.lang.String) - */ - @Override - public boolean readAttribute(String attributeName, String prefix, - String value) { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getChildAt(int) - */ - @Override - public TreeNode getChildAt(int childIndex) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getChildCount() - */ - @Override - public int getChildCount() { - // TODO Auto-generated method stub - return 0; - } - - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getAllowsChildren() - */ - @Override - public boolean getAllowsChildren() { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#writeXMLAttributes() - */ - @Override - public Map<String, String> writeXMLAttributes() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#clone() - */ - @Override - public MultiEventAssignment clone() { - return new MultiEventAssignment(this); - } - -} Deleted: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiInitialAssignment.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiInitialAssignment.java 2015-04-01 14:01:42 UTC (rev 2171) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiInitialAssignment.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -1,158 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2015 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * 4. The University of California, San Diego, La Jolla, CA, USA - * 5. The Babraham Institute, Cambridge, UK - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.multi; - -import java.util.Map; - -import javax.swing.tree.TreeNode; - -import org.sbml.jsbml.InitialAssignment; -import org.sbml.jsbml.ListOf; -import org.sbml.jsbml.ext.AbstractSBasePlugin; - -/** - * - * @author Nicolas Rodriguez - * @version $Rev$ - * @since 1.0 - * @date 16.10.2013 - */ -public class MultiInitialAssignment extends AbstractSBasePlugin { - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return MultiConstants.getNamespaceURI(getLevel(), getVersion()); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() - */ - @Override - public String getPackageName() { - return MultiConstants.packageName; - } - - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() - */ - @Override - public String getPrefix() { - return MultiConstants.shortLabel; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getURI() - */ - @Override - public String getURI() { - return getElementNamespace(); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractTreeNode#getParent() - */ - @SuppressWarnings("unchecked") - @Override - public ListOf<InitialAssignment> getParent() { - return (ListOf<InitialAssignment>) getExtendedSBase().getParent(); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() - */ - @Override - public ListOf<InitialAssignment> getParentSBMLObject() { - return getParent(); - } - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = 6089211452281417062L; - - /** - * - */ - private SpeciesTypeInstanceChange speciesTypeInstanceChange; // TODO: should probably be a listOf here - - /** - * @param multiInitialAssignment - */ - public MultiInitialAssignment(MultiInitialAssignment multiInitialAssignment) { - super(multiInitialAssignment); - } - - @Override - public boolean readAttribute(String attributeName, String prefix, - String value) { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getChildAt(int) - */ - @Override - public TreeNode getChildAt(int childIndex) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getChildCount() - */ - @Override - public int getChildCount() { - // TODO Auto-generated method stub - return 0; - } - - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getAllowsChildren() - */ - @Override - public boolean getAllowsChildren() { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#writeXMLAttributes() - */ - @Override - public Map<String, String> writeXMLAttributes() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#clone() - */ - @Override - public MultiInitialAssignment clone() { - return new MultiInitialAssignment(this); - } - -} Deleted: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModel.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModel.java 2015-04-01 14:01:42 UTC (rev 2171) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModel.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -1,428 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2015 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * 4. The University of California, San Diego, La Jolla, CA, USA - * 5. The Babraham Institute, Cambridge, UK - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.multi; - -import java.text.MessageFormat; -import java.util.Map; - -import org.sbml.jsbml.ListOf; -import org.sbml.jsbml.Model; -import org.sbml.jsbml.SBMLDocument; -import org.sbml.jsbml.SBase; -import org.sbml.jsbml.ext.AbstractSBasePlugin; -import org.sbml.jsbml.util.filters.NameFilter; - -/** - * In order to encode the structures needed to define and use multistate and multi-component - * complexes, the element model is extended to be linked to a list of {@link SpeciesType}s and a list of - * {@link Selector}s. - * - * @author Nicolas Rodriguez - * - */ -public class MultiModel extends AbstractSBasePlugin { - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return MultiConstants.getNamespaceURI(getLevel(), getVersion()); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() - */ - @Override - public String getPackageName() { - return MultiConstants.packageName; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() - */ - @Override - public String getPrefix() { - return MultiConstants.shortLabel; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getURI() - */ - @Override - public String getURI() { - return getElementNamespace(); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractTreeNode#getParent() - */ - @Override - public SBMLDocument getParent() { - return (SBMLDocument) getExtendedSBase().getParent(); - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() - */ - @Override - public SBMLDocument getParentSBMLObject() { - return getParent(); - } - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = -2875299722787282885L; - /** - * - */ - ListOf<SpeciesType> listOfSpeciesTypes; - /** - * - */ - ListOf<Selector> listOfSelectors; - - /** - * - * @param model - */ - public MultiModel(Model model) { - super(model); - } - - /** - * - * @param multiModel - */ - public MultiModel(MultiModel multiModel) { - super(multiModel); - - if (multiModel == null) { - return; - } - if (multiModel.isSetListOfSelectors()) { - listOfSelectors = multiModel.getListOfSelectors().clone(); - } - if (multiModel.isSetListOfSpeciesTypes()) { - listOfSpeciesTypes = multiModel.getListOfSpeciesTypes().clone(); - } - // The listOf would have to be referenced elsewhere - // TODO: check how libSBML is doing the cloning - /* - if (multiModel.getModel() != null) { - getModel().registerChild(listOfSelectors); - getModel().registerChild(listOfSpeciesTypes); - } - */ - - } - - @Override - public MultiModel clone() { - return new MultiModel(this); - } - - /** - * Returns the {@link Model} - * - * @return the {@link Model} - */ - public Model getModel() { - return (Model) extendedSBase; - } - - - /** - * Returns the listOfSpeciesTypes. - * - * @return the listOfSpeciesTypes - */ - public ListOf<SpeciesType> getListOfSpeciesTypes() { - if (listOfSpeciesTypes == null) { - listOfSpeciesTypes = new ListOf<SpeciesType>(); - listOfSpeciesTypes.setNamespace(MultiConstants.namespaceURI); - getModel().registerChild(listOfSpeciesTypes); - listOfSpeciesTypes.setSBaseListType(ListOf.Type.other); - } - - return listOfSpeciesTypes; - } - - /** - * Adds a {@link SpeciesType}. - * - * @param speciesType the speciesType to add - * @return - */ - public boolean addSpeciesType(SpeciesType speciesType) { - return getListOfSpeciesTypes().add(speciesType); - } - - /** - * Creates a new {@link SpeciesType} inside this {@link MultiModel} and returns it. - * <p> - * - * @return the {@link SpeciesType} object created - * <p> - * @see #addSpeciesType(SpeciesType r) - */ - public SpeciesType createSpeciesType() { - return createSpeciesType(null); - } - - /** - * Creates a new {@link SpeciesType} inside this {@link MultiModel} and returns it. - * - * @param id - * the id of the new element to create - * @return the {@link SpeciesType} object created - */ - public SpeciesType createSpeciesType(String id) { - SpeciesType speciesType = new SpeciesType(); - speciesType.setId(id); - addSpeciesType(speciesType); - - return speciesType; - } - - /** - * Gets the ith {@link SpeciesType}. - * - * @param i - * - * @return the ith {@link SpeciesType} - * @throws IndexOutOfBoundsException if the index is invalid. - */ - public SpeciesType getSpeciesType(int i) { - return getListOfSpeciesTypes().get(i); - } - - /** - * Gets the {@link SpeciesType} that has the given id. - * - * @param id - * @return the {@link SpeciesType} that has the given id or null if - * no {@link SpeciesType} are found that match {@code id}. - */ - public SpeciesType getSpeciesType(String id) { - if (isSetListOfSpeciesTypes()) { - return listOfSpeciesTypes.firstHit(new NameFilter(id)); - } - return null; - } - - /** - * Returns {@code true} if the listOfSpeciesType is set. - * - * @return {@code true} if the listOfSpeciesType is set. - */ - public boolean isSetListOfSpeciesTypes() { - if ((listOfSpeciesTypes == null) || listOfSpeciesTypes.isEmpty()) { - return false; - } - return true; - } - - /** - * Sets the listOfSpeciesTypes to null - * - * @return {@code true} is successful - */ - public boolean unsetListOfSpeciesTypes() { - if (isSetListOfSpeciesTypes()) { - // TODO: unregister the ids if needed. - // getModel().unregisterChild(this.listOfSpeciesTypes); - listOfSpeciesTypes = null; - return true; - } - return false; - } - - - /** - * Returns the listOfSelectors. - * - * @return the listOfSelectors - */ - public ListOf<Selector> getListOfSelectors() { - if (listOfSelectors == null) { - listOfSelectors = new ListOf<Selector>(); - listOfSelectors.setNamespace(MultiConstants.namespaceURI); - getModel().registerChild(listOfSelectors); - listOfSelectors.setSBaseListType(ListOf.Type.other); - } - - return listOfSelectors; - } - - /** - * Adds a {@link Selector}. - * - * @param selector the selector to add - */ - public void addSelector(Selector selector) { - getListOfSelectors().add(selector); - } - - - /** - * Creates a new {@link Selector} inside this {@link MultiModel} and returns it. - * <p> - * - * @return the {@link Selector} object created - * <p> - * @see #addSelector(Selector r) - */ - public Selector createSelector() { - return createSelector(null); - } - - /** - * Creates a new {@link Selector} inside this {@link MultiModel} and returns it. - * - * @param id - * the id of the new element to create - * @return the {@link Selector} object created - */ - public Selector createSelector(String id) { - Selector selector = new Selector(); - selector.setId(id); - addSelector(selector); - - return selector; - } - - /** - * Gets the ith {@link Selector}. - * - * @param i - * - * @return the ith {@link Selector} - * @throws IndexOutOfBoundsException if the index is invalid. - */ - public Selector getSelector(int i) { - return getListOfSelectors().get(i); - } - - /** - * Gets the {@link Selector} that has the given id. - * - * @param id - * @return the {@link Selector} that has the given id or null if - * no {@link Selector} are found that match {@code id}. - */ - public Selector getSelector(String id) { - if (isSetListOfSelectors()) { - return listOfSelectors.firstHit(new NameFilter(id)); - } - return null; - } - - /** - * Returns {@code true} if the listOfSelector is set. - * - * @return {@code true} if the listOfSelector is set. - */ - public boolean isSetListOfSelectors() { - if ((listOfSelectors == null) || listOfSelectors.isEmpty()) { - return false; - } - return true; - } - - /** - * Sets the listOfSelectors to null - * - * @return {@code true} is successful - */ - public boolean unsetListOfSelectors() { - if (isSetListOfSelectors()) { - // TODO: unregister the ids if needed for SBasePlugin. - // fireNodeRemoved(this.listOfSelectors); - listOfSelectors = null; - return true; - } - return false; - } - - - @Override - public boolean readAttribute(String attributeName, String prefix, String value) { - // no attribute to read - return false; - } - - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getChildAt(int) - */ - @Override - public SBase getChildAt(int childIndex) { - if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); - } - - int pos = 0; - if (isSetListOfSpeciesTypes()) { - if (pos == childIndex) { - return getListOfSpeciesTypes(); - } - pos++; - } - if (isSetListOfSelectors()) { - if (pos == childIndex) { - return getListOfSelectors(); - } - pos++; - } - throw new IndexOutOfBoundsException(MessageFormat.format( - "Index {0,number,integer} >= {1,number,integer}", - childIndex, +Math.min(pos, 0))); - } - - /* (non-Javadoc) - * @see javax.swing.tree.TreeNode#getChildCount() - */ - @Override - public int getChildCount() { - int count = 0; - if (isSetListOfSpeciesTypes()) { - count++; - } - if (isSetListOfSelectors()) { - count++; - } - return count; - } - - @Override - public boolean getAllowsChildren() { - return true; - } - - @Override - public Map<String, String> writeXMLAttributes() { - // no attribute to write - return null; - } - - -} Added: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModelPlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModelPlugin.java (rev 0) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModelPlugin.java 2015-04-01 16:09:36 UTC (rev 2172) @@ -0,0 +1,321 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.multi; + +import java.text.MessageFormat; +import java.util.Map; + +import org.sbml.jsbml.ListOf; +import org.sbml.jsbml.Model; +import org.sbml.jsbml.SBMLDocument; +import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.AbstractSBasePlugin; +import org.sbml.jsbml.util.filters.NameFilter; + +/** + * In order to encode the structures needed to define and use multistate and multi-component + * complexes, the element model is extended to be linked to a list of {@link SpeciesType}s. + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.0 + */ +public class MultiModelPlugin extends AbstractSBasePlugin { + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() + */ + @Override + public String getPackageName() { + return MultiConstants.shortLabel; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getPrefix() + */ + @Override + public String getPrefix() { + return MultiConstants.shortLabel; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getURI() + */ + @Override + public String getURI() { + return getElementNamespace(); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractTreeNode#getParent() + */ + @Override + public SBMLDocument getParent() { + return (SBMLDocument) getExtendedSBase().getParent(); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.AbstractSBasePlugin#getParentSBMLObject() + */ + @Override + public SBMLDocument getParentSBMLObject() { + return getParent(); + } + /** + * Generated serial version identifier. + */ + private static final long serialVersionUID = -2875299722787282885L; + /** + * + */ + ListOf<SpeciesType> listOfSpeciesTypes; + + /** + * + * @param model + */ + public MultiModelPlugin(Model model) { + super(model); + setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + } + + /** + * + * @param multiModel + */ + public MultiModelPlugin(MultiModelPlugin multiModel) { + super(multiModel); + + if (multiModel == null) { + return; + } + if (multiModel.isSetListOfSpeciesTypes()) { + setListOfSpeciesTypes(multiModel.getListOfSpeciesTypes().clone()); + } + } + + @Override + public MultiModelPlugin clone() { + return new MultiModelPlugin(this); + } + + /** + * Returns the {@link Model} + * + * @return the {@link Model} + */ + public Model getModel() { + return (Model) extendedSBase; + } + + + /** + * Returns the listOfSpeciesTypes. + * + * @return the listOfSpeciesTypes + */ + public ListOf<SpeciesType> getListOfSpeciesTypes() { + if (listOfSpeciesTypes == null) { + listOfSpeciesTypes = new ListOf<SpeciesType>(); + listOfSpeciesTypes.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesTypes.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfSpeciesTypes.setPackageName(null); + listOfSpeciesTypes.setPackageName(MultiConstants.shortLabel); + listOfSpeciesTypes.setSBaseListType(ListOf.Type.other); + + if (isSetExtendedSBase()) { + extendedSBase.registerChild(listOfSpeciesTypes); + } + } + + return listOfSpeciesTypes; + } + + /** + * Adds a {@link SpeciesType}. + * + * @param speciesType the speciesType to add + * @return + */ + public boolean addSpeciesType(SpeciesType speciesType) { + return getListOfSpeciesTypes().add(speciesType); + } + + /** + * Creates a new {@link SpeciesType} inside this {@link MultiModelPlugin} and returns it. + * <p> + * + * @return the {@link SpeciesType} object created + * <p> + * @see #addSpeciesType(SpeciesType r) + */ + public SpeciesType createSpeciesType() { + return createSpeciesType(null); + } + + /** + * Creates a new {@link SpeciesType} inside this {@link MultiModelPlugin} and returns it. + * + * @param id + * the id of the new element to create + * @return the {@link SpeciesType} object created + */ + public SpeciesType createSpeciesType(String id) { + SpeciesType speciesType = new SpeciesType(); + speciesType.setId(id); + addSpeciesType(speciesType); + + return speciesType; + } + + /** + * Gets the ith {@link SpeciesType}. + * + * @param i + * + * @return the ith {@link SpeciesType} + * @throws IndexOutOfBoundsException if the index is invalid. + */ + public SpeciesType getSpeciesType(int i) { + return getListOfSpeciesTypes().get(i); + } + + /** + * Gets the {@link SpeciesType} that has the given id. + * + * @param id + * @return the {@link SpeciesType} that has the given id or null if + * no {@link SpeciesType} are found that match {@code id}. + */ + public SpeciesType getSpeciesType(String id) { + if (isSetListOfSpeciesTypes()) { + return listOfSpeciesTypes.firstHit(new NameFilter(id)); + } + return null; + } + + /** + * Returns {@code true} if the listOfSpeciesType is set. + * + * @return {@code true} if the listOfSpeciesType is set. + */ + public boolean isSetListOfSpeciesTypes() { + return listOfSpeciesTypes != null; + } + + /** + * Sets the listOfSpeciesTypes. If there was already some elements defined + * on listOfSpeciesTypes, they will be unset beforehand. + * + * @param listOfSpeciesTypes + */ + public void setListOfSpeciesTypes(ListOf<SpeciesType> listOfSpeciesTypes) { + unsetListOfSpeciesTypes(); + this.listOfSpeciesTypes = listOfSpeciesTypes; + + if (listOfSpeciesTypes != null) { + listOfSpeciesTypes.unsetNamespace(); + listOfSpeciesTypes.setNamespace(MultiConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesTypes.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'multi' + listOfSpeciesTypes.setPackageName(null); + listOfSpeciesTypes.setPackageName(MultiConstants.shortLabel); + listOfSpeciesTypes.setSBaseListType(ListOf.Type.other); + } + if (extendedSBase != null) { + extendedSBase.registerChild(this.listOfSpeciesTypes); + } + } + + + /** + * Sets the listOfSpeciesTypes to null + * + * @return {@code true} is successful + */ + public boolean unsetListOfSpeciesTypes() { + if (isSetListOfSpeciesTypes()) { + ListOf<SpeciesType> oldSpeciesTypeElements = listOfSpeciesTypes; + listOfSpeciesTypes = null; + oldSpeciesTypeElements.fireNodeRemovedEvent(); + return true; + } + return false; + } + + + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + // no attribute to read + return false; + } + + /* (non-Javadoc) + * @see javax.swing.tree.TreeNode#getChildAt(int) + */ + @Override + public SBase getChildAt(int childIndex) { + if... [truncated message content] |
From: <nik...@us...> - 2015-04-01 14:01:52
|
Revision: 2171 http://sourceforge.net/p/jsbml/code/2171 Author: niko-rodrigue Date: 2015-04-01 14:01:42 +0000 (Wed, 01 Apr 2015) Log Message: ----------- started to modify the layout package to be able to set properly the package version + corrected the PackageUtil class to make sure that we don't enable a package that was specifically disabled by the user Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/BoundingBox.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Curve.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CurveSegment.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GeneralGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GraphicalObject.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Layout.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutModelPlugin.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Point.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/LayoutJUnitTests.java trunk/test/org/sbml/jsbml/test/DisablePackageTests.java Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -359,6 +359,10 @@ // Get the package parser PackageParser packageParser = ParserManager.getManager().getPackageParser(packageName); + if (packageParser == null) { + return null; // There is something wrong with the packageName or the ParserManager + } + if (packageVersion != -1) { elementNamespace = packageParser.getNamespaceFor(doc.getLevel(), doc.getVersion(), packageVersion); } @@ -371,31 +375,26 @@ elementNamespace = packageParser.getPackageNamespaces().get(packageParser.getPackageNamespaces().size() - 1); // TODO - add a getDefaultNamespace() to PackageParser } - // making sure the package is enabled in the SBMLDocument - doc.enablePackage(elementNamespace); - - if (packageParser != null) { - pi = new PackageInfo(); - pi.prefix = packageParser.getPackageName(); - pi.namespace = elementNamespace; - pi.version = extractPackageVersion(elementNamespace); + // making sure the package is enabled in the SBMLDocument if it was not deliberately disabled + if (!Boolean.FALSE.equals(doc.isPackageEnabledOrDisabled(packageParser.getPackageName()))) { + doc.enablePackage(elementNamespace); + } - prefixMap.put(pi.prefix, pi); - namespaceMap.put(elementNamespace, pi); + pi = new PackageInfo(); + pi.prefix = packageParser.getPackageName(); + pi.namespace = elementNamespace; + pi.version = extractPackageVersion(elementNamespace); - if (logger.isDebugEnabled()) { - logger.debug(pi); - } + prefixMap.put(pi.prefix, pi); + namespaceMap.put(elementNamespace, pi); + + if (logger.isDebugEnabled()) { + logger.debug(pi); } } else if (!silent) { logger.info("Can not found SBMLDocument on the element '" + sbase.getElementName() + "'. Stopping the check"); } - - // if we were not able to find the package information, we just return. - if (pi == null) { - return null; - } } return pi; Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -58,15 +58,6 @@ /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return CompConstants.getNamespaceURI(getLevel(), getVersion()); - } - - - /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() */ @Override Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -69,7 +69,6 @@ public AbstractReferenceGlyph(AbstractReferenceGlyph glyph) { super(glyph); if (glyph.isSetReference()) { - setName(glyph.getReference()); // TODO - this setName call seems strange !! setReference(glyph.getReference()); } } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/BoundingBox.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/BoundingBox.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/BoundingBox.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -279,7 +279,9 @@ * */ private void init() { - setNamespace(LayoutConstants.namespaceURI); + setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; } /* (non-Javadoc) Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Curve.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Curve.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Curve.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -229,7 +229,9 @@ * */ private void initDefaults() { - setNamespace(LayoutConstants.namespaceURI); + setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; listOfCurveSegments.setNamespace(LayoutConstants.namespaceURI); listOfCurveSegments.setSBaseListType(ListOf.Type.other); registerChild(listOfCurveSegments); Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CurveSegment.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CurveSegment.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CurveSegment.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -248,7 +248,9 @@ * */ private void initDefaults() { - setNamespace(LayoutConstants.namespaceURI); + setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; } /** Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -79,8 +79,7 @@ * */ public Dimensions() { - setNamespace(LayoutConstants.namespaceURI); - depth = height = width = Double.NaN; + initDefaults(); } /** @@ -130,8 +129,7 @@ */ public Dimensions(int level, int version) { super(level, version); - setNamespace(LayoutConstants.namespaceURI); - depth = height = width = Double.NaN; + initDefaults(); } /** @@ -142,8 +140,7 @@ */ public Dimensions(String id, int level, int version) { super(id, level, version); - setNamespace(LayoutConstants.namespaceURI); - depth = height = width = Double.NaN; + initDefaults(); } /* (non-Javadoc) @@ -154,7 +151,17 @@ return new Dimensions(this); } + /** + * + */ + private void initDefaults() { + setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + depth = height = width = Double.NaN; + } + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractNamedSBase#equals(java.lang.Object) */ Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GeneralGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GeneralGlyph.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GeneralGlyph.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -144,7 +144,11 @@ public ListOf<GraphicalObject> getListOfSubGlyphs() { if (!isSetListOfSubGlyphs()) { listOfSubGlyphs = new ListOfWithName<GraphicalObject>(getLevel(), getVersion(), LayoutConstants.listOfSubGlyphs); - listOfSubGlyphs.setNamespace(LayoutConstants.namespaceURI); + listOfSubGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSubGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfSubGlyphs.setPackageName(null); + listOfSubGlyphs.setPackageName(LayoutConstants.shortLabel); listOfSubGlyphs.setSBaseListType(ListOf.Type.other); registerChild(listOfSubGlyphs); } @@ -171,8 +175,19 @@ if (listOfSubGlyphs != null) { - this.listOfSubGlyphs = getListOfSubGlyphs(); // initializing a new ListOfWithName with the proper settings - this.listOfSubGlyphs.addAll(listOfSubGlyphs); + if ((listOfSubGlyphs instanceof ListOfWithName<?>) && (listOfSubGlyphs.getElementName().equals(LayoutConstants.listOfSubGlyphs))) { + this.listOfSubGlyphs = listOfSubGlyphs; + listOfSubGlyphs.unsetNamespace(); + listOfSubGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSubGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfSubGlyphs.setPackageName(null); + listOfSubGlyphs.setPackageName(LayoutConstants.shortLabel); + listOfSubGlyphs.setSBaseListType(ListOf.Type.other); + } else { + this.listOfSubGlyphs = getListOfSubGlyphs(); // initializing a new ListOfWithName with the proper settings + this.listOfSubGlyphs.addAll(listOfSubGlyphs); + } registerChild(this.listOfSubGlyphs); } } @@ -550,7 +565,11 @@ public ListOf<ReferenceGlyph> getListOfReferenceGlyphs() { if (!isSetListOfReferenceGlyphs()) { listOfReferenceGlyphs = new ListOf<ReferenceGlyph>(); - listOfReferenceGlyphs.setNamespace(LayoutConstants.namespaceURI); + listOfReferenceGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfReferenceGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfReferenceGlyphs.setPackageName(null); + listOfReferenceGlyphs.setPackageName(LayoutConstants.shortLabel); listOfReferenceGlyphs.setSBaseListType(ListOf.Type.other); registerChild(listOfReferenceGlyphs); } @@ -643,6 +662,12 @@ if (listOfReferenceGlyph != null) { + listOfReferenceGlyphs.unsetNamespace(); + listOfReferenceGlyphs.setPackageName(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfReferenceGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfReferenceGlyphs.setPackageName(null); + listOfReferenceGlyphs.setPackageName(LayoutConstants.shortLabel); listOfReferenceGlyph.setSBaseListType(ListOf.Type.other); } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GraphicalObject.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GraphicalObject.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GraphicalObject.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -77,7 +77,7 @@ */ public GraphicalObject() { super(); - setNamespace(LayoutConstants.namespaceURI); + initDefaults(); } /** @@ -102,7 +102,7 @@ */ public GraphicalObject(int level, int version) { super(level, version); - setNamespace(LayoutConstants.namespaceURI); + initDefaults(); } /** @@ -110,7 +110,7 @@ */ public GraphicalObject(String id) { super(id); - setNamespace(LayoutConstants.namespaceURI); + initDefaults(); } @@ -122,7 +122,7 @@ */ public GraphicalObject(String id, int level, int version) { super(id, level, version); - setNamespace(LayoutConstants.namespaceURI); + initDefaults(); } /* (non-Javadoc) @@ -134,6 +134,16 @@ } /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + } + + + /** * Creates and sets a {@link BoundingBox} for this object. * @return {@link BoundingBox}. */ Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Layout.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Layout.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Layout.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -706,7 +706,11 @@ if (!isSetListOfAdditionalGraphicalObjects()) { listOfAdditionalGraphicalObjects = new ListOfWithName<GraphicalObject>(LayoutConstants.listOfAdditionalGraphicalObjects); listOfAdditionalGraphicalObjects.setSBaseListType(ListOf.Type.other); - listOfAdditionalGraphicalObjects.setNamespace(LayoutConstants.namespaceURI); + listOfAdditionalGraphicalObjects.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfAdditionalGraphicalObjects.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfAdditionalGraphicalObjects.setPackageName(null); + listOfAdditionalGraphicalObjects.setPackageName(LayoutConstants.shortLabel); registerChild(listOfAdditionalGraphicalObjects); } return listOfAdditionalGraphicalObjects; @@ -719,7 +723,12 @@ public ListOf<CompartmentGlyph> getListOfCompartmentGlyphs() { if (!isSetListOfCompartmentGlyphs()) { listOfCompartmentGlyphs = ListOf.newInstance(this, CompartmentGlyph.class); - listOfCompartmentGlyphs.setNamespace(LayoutConstants.namespaceURI); + listOfCompartmentGlyphs.setSBaseListType(ListOf.Type.other); + listOfCompartmentGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCompartmentGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfCompartmentGlyphs.setPackageName(null); + listOfCompartmentGlyphs.setPackageName(LayoutConstants.shortLabel); registerChild(listOfCompartmentGlyphs); } return listOfCompartmentGlyphs; @@ -732,7 +741,12 @@ public ListOf<ReactionGlyph> getListOfReactionGlyphs() { if (!isSetListOfReactionGlyphs()) { listOfReactionGlyphs = ListOf.newInstance(this, ReactionGlyph.class); - listOfReactionGlyphs.setNamespace(LayoutConstants.namespaceURI); + listOfReactionGlyphs.setSBaseListType(ListOf.Type.other); + listOfReactionGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfReactionGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfReactionGlyphs.setPackageName(null); + listOfReactionGlyphs.setPackageName(LayoutConstants.shortLabel); registerChild(listOfReactionGlyphs); } return listOfReactionGlyphs; @@ -745,7 +759,12 @@ public ListOf<SpeciesGlyph> getListOfSpeciesGlyphs() { if (!isSetListOfSpeciesGlyphs()) { listOfSpeciesGlyphs = ListOf.newInstance(this, SpeciesGlyph.class); - listOfSpeciesGlyphs.setNamespace(LayoutConstants.namespaceURI); + listOfSpeciesGlyphs.setSBaseListType(ListOf.Type.other); + listOfSpeciesGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfSpeciesGlyphs.setPackageName(null); + listOfSpeciesGlyphs.setPackageName(LayoutConstants.shortLabel); registerChild(listOfSpeciesGlyphs); } return listOfSpeciesGlyphs; @@ -758,7 +777,12 @@ public ListOf<TextGlyph> getListOfTextGlyphs() { if (!isSetListOfTextGlyphs()) { listOfTextGlyphs = ListOf.newInstance(this, TextGlyph.class); - listOfTextGlyphs.setNamespace(LayoutConstants.namespaceURI); + listOfTextGlyphs.setSBaseListType(ListOf.Type.other); + listOfTextGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfTextGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfTextGlyphs.setPackageName(null); + listOfTextGlyphs.setPackageName(LayoutConstants.shortLabel); registerChild(listOfTextGlyphs); } return listOfTextGlyphs; @@ -926,7 +950,9 @@ * */ private void initDefault() { - setNamespace(LayoutConstants.namespaceURI); + setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; } /* (non-Javadoc) @@ -1267,11 +1293,7 @@ * @param addGraphicalObjects */ public void setAddGraphicalObjects(ListOf<GraphicalObject> addGraphicalObjects) { - if (listOfAdditionalGraphicalObjects != null) { - listOfAdditionalGraphicalObjects.fireNodeRemovedEvent(); - } - listOfAdditionalGraphicalObjects = addGraphicalObjects; - registerChild(listOfAdditionalGraphicalObjects); + setListOfAdditionalGraphicalObjects(addGraphicalObjects); } @@ -1335,13 +1357,16 @@ if (!registerDone) { listOfAdditionalGraphicalObjects = additionalGraphicalObjects; + + listOfAdditionalGraphicalObjects.unsetNamespace(); + listOfAdditionalGraphicalObjects.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfAdditionalGraphicalObjects.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfAdditionalGraphicalObjects.setPackageName(null); + listOfAdditionalGraphicalObjects.setPackageName(LayoutConstants.shortLabel); + listOfAdditionalGraphicalObjects.setSBaseListType(ListOf.Type.other); registerChild(listOfAdditionalGraphicalObjects); } - - if ((listOfAdditionalGraphicalObjects != null) && (listOfAdditionalGraphicalObjects.getSBaseListType() != ListOf.Type.other)) { - listOfAdditionalGraphicalObjects.setSBaseListType(ListOf.Type.other); - } - } } @@ -1355,10 +1380,18 @@ public void setListOfCompartmentGlyphs(ListOf<CompartmentGlyph> compartmentGlyphs) { unsetListOfCompartmentGlyphs(); listOfCompartmentGlyphs = compartmentGlyphs; - if ((listOfCompartmentGlyphs != null) && (listOfCompartmentGlyphs.getSBaseListType() != ListOf.Type.other)) { + + if (listOfCompartmentGlyphs != null) { + listOfCompartmentGlyphs.unsetNamespace(); + listOfCompartmentGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfCompartmentGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfCompartmentGlyphs.setPackageName(null); + listOfCompartmentGlyphs.setPackageName(LayoutConstants.shortLabel); listOfCompartmentGlyphs.setSBaseListType(ListOf.Type.other); + registerChild(listOfCompartmentGlyphs); } - registerChild(listOfCompartmentGlyphs); + } /** @@ -1370,7 +1403,14 @@ public void setListOfReactionGlyphs(ListOf<ReactionGlyph> reactionGlyphs) { unsetListOfReactionGlyphs(); listOfReactionGlyphs = reactionGlyphs; + if (listOfReactionGlyphs != null) { + listOfReactionGlyphs.unsetNamespace(); + listOfReactionGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfReactionGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfReactionGlyphs.setPackageName(null); + listOfReactionGlyphs.setPackageName(LayoutConstants.shortLabel); listOfReactionGlyphs.setSBaseListType(ListOf.Type.other); registerChild(listOfReactionGlyphs); } @@ -1385,12 +1425,15 @@ */ public void setListOfSpeciesGlyphs(ListOf<SpeciesGlyph> speciesGlyphs) { unsetListOfSpeciesGlyphs(); - if (speciesGlyphs == null) { - listOfSpeciesGlyphs = new ListOf<SpeciesGlyph>(); - } else { - listOfSpeciesGlyphs = speciesGlyphs; - } + listOfSpeciesGlyphs = speciesGlyphs; + if (listOfSpeciesGlyphs != null) { + listOfSpeciesGlyphs.unsetNamespace(); + listOfSpeciesGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfSpeciesGlyphs.setPackageName(null); + listOfSpeciesGlyphs.setPackageName(LayoutConstants.shortLabel); listOfSpeciesGlyphs.setSBaseListType(ListOf.Type.other); registerChild(listOfSpeciesGlyphs); } @@ -1405,7 +1448,14 @@ public void setListOfTextGlyphs(ListOf<TextGlyph> textGlyphs) { unsetListOfTextGlyphs(); listOfTextGlyphs = textGlyphs; + if (listOfTextGlyphs != null) { + listOfTextGlyphs.unsetNamespace(); + listOfTextGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfTextGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfTextGlyphs.setPackageName(null); + listOfTextGlyphs.setPackageName(LayoutConstants.shortLabel); listOfTextGlyphs.setSBaseListType(ListOf.Type.other); registerChild(listOfTextGlyphs); } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutModelPlugin.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutModelPlugin.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutModelPlugin.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -76,6 +76,8 @@ */ public LayoutModelPlugin(Model model) { super(model); + setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); createListOfLayout(); } @@ -136,7 +138,11 @@ */ private ListOf<Layout> createListOfLayout() { listOfLayouts = new ListOf<Layout>(); - listOfLayouts.setNamespace(LayoutConstants.namespaceURI); + listOfLayouts.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfLayouts.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfLayouts.setPackageName(null); + listOfLayouts.setPackageName(LayoutConstants.shortLabel); listOfLayouts.setSBaseListType(ListOf.Type.other); if (isSetExtendedSBase()) { @@ -320,14 +326,17 @@ */ public void setListOfLayouts(ListOf<Layout> listOfLayouts) { unsetListOfLayouts(); - if (listOfLayouts == null) { - this.listOfLayouts = new ListOf<Layout>(); - } else { - this.listOfLayouts = listOfLayouts; + this.listOfLayouts = listOfLayouts; + + if (listOfLayouts != null) { + listOfLayouts.unsetNamespace(); + listOfLayouts.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfLayouts.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfLayouts.setPackageName(null); + listOfLayouts.setPackageName(LayoutConstants.shortLabel); + listOfLayouts.setSBaseListType(ListOf.Type.other); } - if ((this.listOfLayouts != null) && (this.listOfLayouts.getSBaseListType() != ListOf.Type.other)) { - this.listOfLayouts.setSBaseListType(ListOf.Type.other); - } if (isSetExtendedSBase()) { getExtendedSBase().registerChild(listOfLayouts); @@ -388,7 +397,7 @@ */ @Override public String getPackageName() { - return LayoutConstants.packageName; + return LayoutConstants.shortLabel; } /* (non-Javadoc) Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Point.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Point.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Point.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -85,8 +85,7 @@ */ public Point() { super(); - setNamespace(LayoutConstants.namespaceURI); - x = y = z = Double.NaN; + initDefaults(); } /** @@ -140,8 +139,7 @@ */ public Point(int level, int version) { super(level, version); - setNamespace(LayoutConstants.namespaceURI); - x = y = z = Double.NaN; + initDefaults(); } /** @@ -187,6 +185,17 @@ } } + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = LayoutConstants.shortLabel; + + x = y = z = Double.NaN; + } + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractNamedSBase#equals(java.lang.Object) */ Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -263,7 +263,11 @@ public ListOf<SpeciesReferenceGlyph> getListOfSpeciesReferenceGlyphs() { if (!isSetListOfSpeciesReferencesGlyphs()) { listOfSpeciesReferencesGlyphs = new ListOf<SpeciesReferenceGlyph>(); - listOfSpeciesReferencesGlyphs.setNamespace(LayoutConstants.namespaceURI); + listOfSpeciesReferencesGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesReferencesGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfSpeciesReferencesGlyphs.setPackageName(null); + listOfSpeciesReferencesGlyphs.setPackageName(LayoutConstants.shortLabel); listOfSpeciesReferencesGlyphs.setSBaseListType(ListOf.Type.other); registerChild(listOfSpeciesReferencesGlyphs); } @@ -392,11 +396,21 @@ * * @param listOfSpeciesReferencesGlyph */ - public void setListOfSpeciesReferencesGlyph( - ListOf<SpeciesReferenceGlyph> listOfSpeciesReferencesGlyph) { + public void setListOfSpeciesReferencesGlyph(ListOf<SpeciesReferenceGlyph> listOfSpeciesReferencesGlyph) { unsetListOfSpeciesReferencesGlyph(); listOfSpeciesReferencesGlyphs = listOfSpeciesReferencesGlyph; - registerChild(listOfSpeciesReferencesGlyphs); + + if (listOfSpeciesReferencesGlyphs != null) { + listOfSpeciesReferencesGlyph.unsetNamespace(); + listOfSpeciesReferencesGlyphs.setNamespace(LayoutConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpeciesReferencesGlyphs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'layout' + listOfSpeciesReferencesGlyphs.setPackageName(null); + listOfSpeciesReferencesGlyphs.setPackageName(LayoutConstants.shortLabel); + listOfSpeciesReferencesGlyphs.setSBaseListType(ListOf.Type.other); + + registerChild(listOfSpeciesReferencesGlyphs); + } } /** Modified: trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/LayoutJUnitTests.java =================================================================== --- trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/LayoutJUnitTests.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/LayoutJUnitTests.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -33,6 +33,6 @@ * @date May 7, 2014 */ @RunWith(value=Suite.class) -@SuiteClasses(value={TextGlyphTest.class, SpeciesReferenceGlyphTest.class}) +@SuiteClasses(value={TextGlyphTest.class, SpeciesReferenceGlyphTest.class, LayoutExtentionTest.class}) public class LayoutJUnitTests { } Modified: trunk/test/org/sbml/jsbml/test/DisablePackageTests.java =================================================================== --- trunk/test/org/sbml/jsbml/test/DisablePackageTests.java 2015-04-01 10:04:01 UTC (rev 2170) +++ trunk/test/org/sbml/jsbml/test/DisablePackageTests.java 2015-04-01 14:01:42 UTC (rev 2171) @@ -136,11 +136,15 @@ assertTrue(doc.getDeclaredNamespaces().containsKey("xmlns:layout") == false); assertTrue(doc.getDeclaredNamespaces().containsKey("xmlns:comp") == false); - String docWithoutPakageString = new SBMLWriter().writeSBMLToString(doc); + String docWithoutPackageString = new SBMLWriter().writeSBMLToString(doc); + // check that disabled package are still disabled after writing to XML + assertTrue(doc.isPackageEnabled("comp") == false); + assertTrue(doc.isPackageEnabled("layout") == false); + // System.out.println("Document without package:\n" + docWithoutPakageString); - SBMLDocument docWithoutPackage = new SBMLReader().readSBMLFromString(docWithoutPakageString); + SBMLDocument docWithoutPackage = new SBMLReader().readSBMLFromString(docWithoutPackageString); assertTrue(docWithoutPackage.isPackageEnabled("comp") == false); assertTrue(docWithoutPackage.isPackageEnabled("layout") == false); @@ -212,6 +216,10 @@ try { docString = new SBMLWriter().writeSBMLToString(clonedDoc); + // package are enabled after a call to the SBMLWriter write methods + assertTrue(clonedDoc.isPackageEnabled("comp")); + assertTrue(clonedDoc.isPackageEnabled("layout")); + System.out.println("Document with only layout package:\n" + docString); SBMLDocument docWithoutPackNamespace = new SBMLReader().readSBMLFromString(docString); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-04-01 10:04:14
|
Revision: 2170 http://sourceforge.net/p/jsbml/code/2170 Author: niko-rodrigue Date: 2015-04-01 10:04:01 +0000 (Wed, 01 Apr 2015) Log Message: ----------- started to modify the groups package to be able to set properly the package version Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ListOf.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/CBO.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/ListOfMemberConstraint.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/MemberConstraint.java trunk/test/org/sbml/jsbml/test/PackageVersionTests.java Modified: trunk/core/src/org/sbml/jsbml/ListOf.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ListOf.java 2015-03-31 16:51:38 UTC (rev 2169) +++ trunk/core/src/org/sbml/jsbml/ListOf.java 2015-04-01 10:04:01 UTC (rev 2170) @@ -586,7 +586,7 @@ @Override public T get(int index) { if ((index < 0) || (index >= listOf.size())) { - return null; + return null; // TODO - throw IndexOutOfBoundsException instead of null here ? } return listOf.get(index); Modified: trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/CBO.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/CBO.java 2015-03-31 16:51:38 UTC (rev 2169) +++ trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/CBO.java 2015-04-01 10:04:01 UTC (rev 2170) @@ -88,7 +88,6 @@ private static Set<Term> terms; static { - System.out.println(Resource.getInstance()); OboParser parser = new OboParser(); try { String path = "org/sbml/jsbml/ext/dyn/"; Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java 2015-03-31 16:51:38 UTC (rev 2169) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java 2015-04-01 10:04:01 UTC (rev 2170) @@ -79,7 +79,6 @@ */ public ListOfObjectives(ListOf<Objective> listOf) { super(listOf); - initDefaults(); } /** Modified: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java 2015-03-31 16:51:38 UTC (rev 2169) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java 2015-04-01 10:04:01 UTC (rev 2170) @@ -77,16 +77,13 @@ super(group); if (group.isSetListOfMembers()) { - // TODO - update to have a proper clone of the ListOf as well - for (Member m : group.listOfMembers) { - addMember(m.clone()); - } + setListOfMembers(group.getListOfMembers().clone()); } if (group.isSetKind()) { setKind(group.getKind()); } if (group.isSetListOfMemberConstraints()) { - setListOfMemberConstraints((ListOfMemberConstraint) group.getListOfMemberConstraints().clone()); + setListOfMemberConstraints(group.getListOfMemberConstraints().clone()); } } @@ -97,16 +94,9 @@ */ public Group(int level, int version) { super(level, version); + initDefaults(); } - /** - * @param member - * @return - */ - public boolean addMember(Member member) { - return getListOfMembers().add(member); - } - /* (non-Javadoc) * @see org.sbml.jsbml.AbstractSBase#clone() */ @@ -118,19 +108,6 @@ /** * Creates a new instance of {@link Member} and add it to this {@link Group}. * - * @param id the id to be set to the new {@link Member}. - * @return the new {@link Member} instance. - */ - public Member createMember(String id) { - Member m = new Member(); - m.setId(id); - addMember(m); - return m; - } - - /** - * Creates a new instance of {@link Member} and add it to this {@link Group}. - * * @param idRef the identifier of an object elsewhere in the Model. * An example value of idRef might be the identifier of a species in the model, or the identifier of another group. * @@ -252,33 +229,200 @@ } /** - * - * @return + * Returns the {@link #listOfMembers}. + * Creates it if it does not already exist. + * + * @return the {@link #listOfMembers}. */ public ListOf<Member> getListOfMembers() { if (!isSetListOfMembers()) { listOfMembers = new ListOf<Member>(); - listOfMembers.setNamespace(GroupsConstants.namespaceURI); + listOfMembers.setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfMembers.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'groups' + listOfMembers.setPackageName(null); + listOfMembers.setPackageName(GroupsConstants.shortLabel); + listOfMembers.setSBaseListType(ListOf.Type.other); + registerChild(listOfMembers); - listOfMembers.setSBaseListType(ListOf.Type.other); } return listOfMembers; } + /** - * - * @param i - * @return + * Returns {@code true} if {@link #listOfMembers} is not null. + * + * @return {@code true} if {@link #listOfMembers} is not null. */ + public boolean isSetListOfMembers() { + return listOfMembers != null; + } + + + /** + * Sets the given {@code ListOf<Member>}. + * If {@link #listOfMembers} was defined before and contains some + * elements, they are all unset. + * + * @param listOfMembers + */ + public void setListOfMembers(ListOf<Member> listOfMembers) { + unsetListOfMembers(); + this.listOfMembers = listOfMembers; + + if (listOfMembers != null) { + listOfMembers.unsetNamespace(); + listOfMembers.setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfMembers.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'groups' + listOfMembers.setPackageName(null); + listOfMembers.setPackageName(GroupsConstants.shortLabel); + listOfMembers.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfMembers); + } + } + + + /** + * Returns {@code true} if {@link #listOfMembers} contains at least + * one element, otherwise {@code false}. + * + * @return {@code true} if {@link #listOfMembers} contains at least + * one element, otherwise {@code false}. + */ + public boolean unsetListOfMembers() { + if (isSetListOfMembers()) { + ListOf<Member> oldMembers = this.listOfMembers; + this.listOfMembers = null; + oldMembers.fireNodeRemovedEvent(); + return true; + } + return false; + } + + + /** + * Adds a new {@link Member} to the {@link #listOfMembers}. + * <p>The listOfMembers is initialized if necessary. + * + * @param member the element to add to the list + * @return {@code true} (as specified by {@link java.util.Collection#add}) + * @see java.util.Collection#add(Object) + */ + public boolean addMember(Member member) { + return getListOfMembers().add(member); + } + + + /** + * Removes an element from the {@link #listOfMembers}. + * + * @param member the element to be removed from the list. + * @return {@code true} if the list contained the specified element and it was + * removed. + * @see java.util.List#remove(Object) + */ + public boolean removeMember(Member member) { + if (isSetListOfMembers()) { + return getListOfMembers().remove(member); + } + return false; + } + + + /** + * Removes an element from the {@link #listOfMembers}. + * + * @param id the id of the element to be removed from the list. + * @return the removed element, if it was successfully found and removed or + * {@code null}. + */ + public Member removeMember(String id) { + if (isSetListOfMembers()) { + return getListOfMembers().remove(id); + } + return null; + } + + + /** + * Removes an element from the {@link #listOfMembers} at the given index. + * + * @param i the index where to remove the {@link Member}. + * @return the specified element if it was successfully found and removed. + * @throws IndexOutOfBoundsException if the listOf is not set or if the index is + * out of bound ({@code (i < 0) || (i > listOfMembers)}). + */ + public Member removeMember(int i) { + if (!isSetListOfMembers()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); + } + return getListOfMembers().remove(i); + } + + + /** + * Creates a new Member element and adds it to the + * {@link #listOfMembers} list. + * + * @return the newly created element, i.e., the last item in the + * {@link #listOfMembers} + */ + public Member createMember() { + return createMember(null); + } + + + /** + * Creates a new {@link Member} element and adds it to the + * {@link #listOfMembers} list. + * + * @param id the identifier that is to be applied to the new element. + * @return the newly created {@link Member} element, which is the last + * element in the {@link #listOfMembers}. + */ + public Member createMember(String id) { + Member member = new Member(); + member.setId(id); + addMember(member); + return member; + } + + + /** + * Gets an element from the {@link #listOfMembers} at the given index. + * + * @param i the index of the {@link Member} element to get. + * @return an element from the listOfMembers at the given index. + * @throws IndexOutOfBoundsException if the listOf is not set or + * if the index is out of bound (index < 0 || index > list.size). + */ public Member getMember(int i) { - if (i >= 0 && i < getListOfMembers().size()) { - return getListOfMembers().get(i); + if (!isSetListOfMembers()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); } + return getListOfMembers().get(i); + } + + /** + * Gets an element from the listOfMembers, with the given id. + * + * @param id the id of the {@link Member} element to get. + * @return an element from the listOfMembers with the given id + * or {@code null}. + */ + public Member getMember(String id) { + if (isSetListOfMembers()) { + return getListOfMembers().get(id); + } return null; } + /** * Returns the number of {@link Member}s of this {@link Group}. * @@ -321,7 +465,9 @@ * */ private void initDefaults() { - setNamespace(GroupsConstants.namespaceURI); + setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = GroupsConstants.shortLabel; + setPackageVersion(-1); } /* (non-Javadoc) @@ -342,28 +488,13 @@ } /** - * - * @return - */ - public boolean isSetListOfMembers() { - if (listOfMembers == null) { - return false; - } - return true; - } - - - /** - * Returns {@code true}, if listOfMemberConstraints contains at least one element. + * Returns {@code true}, if listOfMemberConstraints is not null. * - * @return {@code true}, if listOfMemberConstraints contains at least one element, + * @return {@code true}, if listOfMemberConstraints is not null, * otherwise {@code false} */ public boolean isSetListOfMemberConstraints() { - if ((listOfMemberConstraints == null) || listOfMemberConstraints.isEmpty()) { - return false; - } - return true; + return listOfMemberConstraints != null; } /** @@ -371,18 +502,20 @@ * * @return the listOfMemberConstraints */ - public ListOf<MemberConstraint> getListOfMemberConstraints() { + public ListOfMemberConstraint getListOfMemberConstraints() { if (!isSetListOfMemberConstraints()) { listOfMemberConstraints = new ListOfMemberConstraint(getLevel(), getVersion()); - listOfMemberConstraints.setNamespace(GroupsConstants.namespaceURI); + listOfMemberConstraints.setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfMemberConstraints.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'groups' + listOfMemberConstraints.setPackageName(null); + listOfMemberConstraints.setPackageName(GroupsConstants.shortLabel); listOfMemberConstraints.setSBaseListType(ListOf.Type.other); registerChild(listOfMemberConstraints); } return listOfMemberConstraints; } - // TODO - helper method with setListOfMemberConstraints(ListOf<MemberConstraint>) ?? - /** * Sets the given {@code ListOf<MemberConstraint>}. If listOfMemberConstraints * was defined before and contains some elements, they are all unset. @@ -392,7 +525,18 @@ public void setListOfMemberConstraints(ListOfMemberConstraint listOfMemberConstraints) { unsetListOfMemberConstraints(); this.listOfMemberConstraints = listOfMemberConstraints; - registerChild(this.listOfMemberConstraints); + + if (listOfMemberConstraints != null) { + listOfMemberConstraints.unsetNamespace(); + listOfMemberConstraints.setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfMemberConstraints.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'groups' + listOfMemberConstraints.setPackageName(null); + listOfMemberConstraints.setPackageName(GroupsConstants.shortLabel); + listOfMemberConstraints.setSBaseListType(ListOf.Type.other); + + registerChild(this.listOfMemberConstraints); + } } /** @@ -517,23 +661,6 @@ + ", listOfMembers=" + listOfMembers + "]"; } - /** - * Removes the {@link #listOfMembers} from this {@link org.sbml.jsbml.Model} and notifies - * all registered instances of {@link org.sbml.jsbml.util.TreeNodeChangeListener}. - * - * @return {@code true} if calling this method lead to a change in this - * data structure. - */ - public boolean unsetListOfMembers() { - if (isSetListOfMembers()) { - ListOf<Member> oldListOfMembers = listOfMembers; - listOfMembers = null; - oldListOfMembers.fireNodeRemovedEvent(); - return true; - } - return false; - } - /* (non-Javadoc) * @see org.sbml.jsbml.element.SBase#writeXMLAttributes() */ Modified: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java 2015-03-31 16:51:38 UTC (rev 2169) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java 2015-04-01 10:04:01 UTC (rev 2170) @@ -22,6 +22,7 @@ package org.sbml.jsbml.ext.groups; import java.text.MessageFormat; +import java.util.Collection; import java.util.Map; import org.sbml.jsbml.ListOf; @@ -41,20 +42,11 @@ /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return GroupsConstants.getNamespaceURI(getLevel(), getVersion()); - } - - - /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() */ @Override public String getPackageName() { - return GroupsConstants.packageName; + return GroupsConstants.shortLabel; } @@ -103,10 +95,11 @@ /** * */ - protected ListOf<Group> listOfGroups = new ListOf<Group>(); + protected ListOf<Group> listOfGroups; /** + * Creates a new {@link GroupsModelPlugin} instance * * @param model */ @@ -116,6 +109,8 @@ } /** + * Creates a new {@link GroupsModelPlugin} instance cloned from the given parameter. + * * @param groupModelPlugin */ public GroupsModelPlugin(GroupsModelPlugin groupModelPlugin) { @@ -130,40 +125,57 @@ * */ private void initDefaults() { - listOfGroups.setNamespace(GroupsConstants.namespaceURI); - listOfGroups.setSBaseListType(ListOf.Type.other); - - if (isSetExtendedSBase()) { - extendedSBase.registerChild(listOfGroups); - } + setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); } /** - * + * Adds a new element to the listOfGroups. + * <p>listOfGroups is initialized if necessary. + * * @param group + * @return {@code true} (as specified by {@link Collection#add}) */ public void addGroup(Group group) { - listOfGroups.add(group); + getListOfGroups().add(group); } /** - * - * @param i - * @return + * Returns the n-th {@link Group} object in this {@link GroupsModelPlugin}. + * + * @param i an index + * @return the {@link Group} with the given index if it exists. + * @throws IndexOutOfBoundsException */ public Group getGroup(int i) { - if ((i >= 0) && (i < listOfGroups.size())) { - return listOfGroups.get(i); + if (!isSetListOfGroups()) { + throw new IndexOutOfBoundsException(Integer.toString(i)); } - return null; + return listOfGroups.get(i); } /** + * Returns the listOfGroups. If the {@link ListOf} is not defined, creates an empty one. * - * @return + * @return the listOfGroups */ public ListOf<Group> getListOfGroups() { + if (!isSetListOfGroups()) { + listOfGroups = new ListOf<Group>(); + + listOfGroups.setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGroups.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'groups' + listOfGroups.setPackageName(null); + listOfGroups.setPackageName(GroupsConstants.shortLabel); + listOfGroups.setSBaseListType(ListOf.Type.other); + + if (extendedSBase != null) { + extendedSBase.registerChild(listOfGroups); + } + } + return listOfGroups; } @@ -191,10 +203,7 @@ * @return */ public boolean isSetListOfGroups() { - if ((listOfGroups == null) || listOfGroups.isEmpty()) { - return false; - } - return true; + return listOfGroups != null; } /** @@ -203,17 +212,20 @@ */ public void setListOfGroups(ListOf<Group> listOfGroups) { unsetListOfGroups(); - if (listOfGroups == null) { - this.listOfGroups = new ListOf<Group>(); - } else { - this.listOfGroups = listOfGroups; - } - if ((this.listOfGroups != null) && (this.listOfGroups.getSBaseListType() != ListOf.Type.other)) { - this.listOfGroups.setSBaseListType(ListOf.Type.other); - } - if (isSetExtendedSBase()) { - extendedSBase.registerChild(listOfGroups); + this.listOfGroups = listOfGroups; + + if (listOfGroups != null) { + listOfGroups.setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGroups.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'groups' + listOfGroups.setPackageName(null); + listOfGroups.setPackageName(GroupsConstants.shortLabel); + listOfGroups.setSBaseListType(ListOf.Type.other); + + if (isSetExtendedSBase()) { + extendedSBase.registerChild(listOfGroups); + } } } @@ -247,8 +259,7 @@ */ @Override public String toString() { - return "GroupModelPlugin [listOfGroups=" + listOfGroups + ", model=" + extendedSBase - + "]"; + return "GroupModelPlugin [nb Group = " + getGroupCount() + "]"; } /* (non-Javadoc) Modified: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/ListOfMemberConstraint.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/ListOfMemberConstraint.java 2015-03-31 16:51:38 UTC (rev 2169) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/ListOfMemberConstraint.java 2015-04-01 10:04:01 UTC (rev 2170) @@ -75,6 +75,9 @@ */ public ListOfMemberConstraint() { super(); + setPackageVersion(-1); + packageName = GroupsConstants.shortLabel; + setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace } /** @@ -83,6 +86,9 @@ */ public ListOfMemberConstraint(int level, int version) { super(level, version); + setPackageVersion(-1); + packageName = GroupsConstants.shortLabel; + setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace } /** Modified: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java 2015-03-31 16:51:38 UTC (rev 2169) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java 2015-04-01 10:04:01 UTC (rev 2170) @@ -65,7 +65,9 @@ * */ private void initDefaults() { - setNamespace(GroupsConstants.namespaceURI); + setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = GroupsConstants.shortLabel; + setPackageVersion(-1); } /** Modified: trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/MemberConstraint.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/MemberConstraint.java 2015-03-31 16:51:38 UTC (rev 2169) +++ trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/MemberConstraint.java 2015-04-01 10:04:01 UTC (rev 2170) @@ -180,7 +180,9 @@ * Initializes the default values using the namespace. */ public void initDefaults() { - setNamespace(GroupsConstants.namespaceURI); + setNamespace(GroupsConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = GroupsConstants.shortLabel; + setPackageVersion(-1); } /* (non-Javadoc) Modified: trunk/test/org/sbml/jsbml/test/PackageVersionTests.java =================================================================== --- trunk/test/org/sbml/jsbml/test/PackageVersionTests.java 2015-03-31 16:51:38 UTC (rev 2169) +++ trunk/test/org/sbml/jsbml/test/PackageVersionTests.java 2015-04-01 10:04:01 UTC (rev 2170) @@ -28,6 +28,8 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; +import org.sbml.jsbml.Compartment; +import org.sbml.jsbml.Event; import org.sbml.jsbml.FunctionDefinition; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.Model; @@ -42,10 +44,18 @@ import org.sbml.jsbml.ext.comp.Submodel; import org.sbml.jsbml.ext.distrib.DistribConstants; import org.sbml.jsbml.ext.distrib.util.DistribModelBuilder; +import org.sbml.jsbml.ext.dyn.CBO; +import org.sbml.jsbml.ext.dyn.DynCompartmentPlugin; +import org.sbml.jsbml.ext.dyn.DynConstants; +import org.sbml.jsbml.ext.dyn.DynEventPlugin; +import org.sbml.jsbml.ext.dyn.SpatialKind; import org.sbml.jsbml.ext.fbc.FBCConstants; import org.sbml.jsbml.ext.fbc.FBCModelPlugin; import org.sbml.jsbml.ext.fbc.FluxBound; import org.sbml.jsbml.ext.fbc.Objective; +import org.sbml.jsbml.ext.groups.Group; +import org.sbml.jsbml.ext.groups.GroupsConstants; +import org.sbml.jsbml.ext.groups.GroupsModelPlugin; import org.sbml.jsbml.ext.qual.QualConstants; import org.sbml.jsbml.xml.parsers.PackageUtil; @@ -74,10 +84,13 @@ m = doc.createModel("test"); + Compartment cell = m.createCompartment("cell"); m.createReaction("R1"); m.createSpecies("S1"); m.createSpecies("S2"); + Event event = m.createEvent("E1"); + FBCModelPlugin fbcModel = (FBCModelPlugin) m.getPlugin("fbc"); FluxBound fb1 = fbcModel.createFluxBound("fb1"); @@ -107,10 +120,27 @@ arraySubModel.createDimension("A_D1"); arraySubModel.createIndex(); + DynCompartmentPlugin dynCell = (DynCompartmentPlugin) cell.getPlugin(DynConstants.namespaceURI_L3V1V1); + dynCell.createSpatialComponent("Dy_SP1").setSpatialIndex(SpatialKind.cartesianX); + dynCell.createSpatialComponent("Dy_SP2"); + dynCell.setCBOTerm(CBO.getTerm("CellDeath")); + DynEventPlugin dynEvent = (DynEventPlugin) event.getPlugin("dyn"); + dynEvent.createDynElement("D_cell").setIdRef("cell"); + + GroupsModelPlugin groupModel = (GroupsModelPlugin) m.getPlugin(GroupsConstants.namespaceURI_L3V1V1); + groupModel.createGroup("G_G1"); + Group g2 = groupModel.createGroup("G_G2", new String[]{"G_M1", "G_M2", "G_M3"}); + g2.createMemberWithIdRef("G_M4", "S1"); + g2.getMember(0).setIdRef("S2"); + g2.getMember("G_M2").setIdRef(cell); + g2.createMemberConstraint("G_MC1").setDistinctAttribute("test"); + // check and fix package version and namespaces // TODO - update when jsbml will be fixed to set properly package version and namespace - // now the fix is done in SBMLCoreParser#processEndDocument when reading a file + PackageUtil.checkPackages(doc, true, true); + System.out.println("Checking packages:"); PackageUtil.checkPackages(doc, false, true); } @@ -181,6 +211,8 @@ Assert.assertTrue(newDoc.isPackageEnabled("comp")); Assert.assertTrue(newDoc.isPackageEnabled("distrib")); Assert.assertTrue(newDoc.isPackageEnabled("fbc")); + Assert.assertTrue(newDoc.isPackageEnabled("groups")); + Assert.assertTrue(newDoc.isPackageEnabled("dyn")); Assert.assertFalse(newDoc.isPackageEnabled("qual")); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-03-31 16:51:40
|
Revision: 2169 http://sourceforge.net/p/jsbml/code/2169 Author: niko-rodrigue Date: 2015-03-31 16:51:38 +0000 (Tue, 31 Mar 2015) Log Message: ----------- started to modify the dyn package to be able to set properly the package version Modified Paths: -------------- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynElement.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynEventPlugin.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynSBasePlugin.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/SpatialComponent.java Modified: trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.java 2015-03-31 12:59:32 UTC (rev 2168) +++ trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.java 2015-03-31 16:51:38 UTC (rev 2169) @@ -83,13 +83,7 @@ * Initializes custom Class attributes * */ private void initDefaults() { - listOfSpatialComponents = new ListOf<SpatialComponent>(); - listOfSpatialComponents.setNamespace(DynConstants.namespaceURI); - listOfSpatialComponents.setSBaseListType(ListOf.Type.other); - - if (isSetExtendedSBase()) { - extendedSBase.registerChild(listOfSpatialComponents); - } + setPackageVersion(-1); } /** @@ -98,11 +92,18 @@ * @return the value of listOfSpatialComponents */ public ListOf<SpatialComponent> getListOfSpatialComponents() { - if (!isSetListOfSpatialComponents()) { + if (listOfSpatialComponents == null) { listOfSpatialComponents = new ListOf<SpatialComponent>(); - listOfSpatialComponents.setNamespace(DynConstants.namespaceURI); + listOfSpatialComponents.setNamespace(DynConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpatialComponents.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'dyn' + listOfSpatialComponents.setPackageName(null); + listOfSpatialComponents.setPackageName(DynConstants.shortLabel); listOfSpatialComponents.setSBaseListType(ListOf.Type.other); - extendedSBase.registerChild(listOfSpatialComponents); + + if (isSetExtendedSBase()) { + extendedSBase.registerChild(listOfSpatialComponents); + } } return listOfSpatialComponents; } @@ -124,18 +125,20 @@ * Sets the value of listOfSpatialComponents * @param listOfSpatialComponents */ - public void setListOfSpatialComponents( - ListOf<SpatialComponent> listOfSpatialComponents) { + public void setListOfSpatialComponents(ListOf<SpatialComponent> listOfSpatialComponents) { unsetListOfSpatialComponents(); - if (!isSetListOfSpatialComponents()) { - this.listOfSpatialComponents = new ListOf<SpatialComponent>(); - } else { - this.listOfSpatialComponents = listOfSpatialComponents; + + this.listOfSpatialComponents = listOfSpatialComponents; + + if ((this.listOfSpatialComponents != null)) { + listOfSpatialComponents.setNamespace(DynConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSpatialComponents.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'dyn' + listOfSpatialComponents.setPackageName(null); + listOfSpatialComponents.setPackageName(DynConstants.shortLabel); + listOfSpatialComponents.setSBaseListType(ListOf.Type.other); } - if ((this.listOfSpatialComponents != null) - && (this.listOfSpatialComponents.getSBaseListType() != ListOf.Type.other)) { - this.listOfSpatialComponents.setSBaseListType(ListOf.Type.other); - } + if (isSetExtendedSBase()) { extendedSBase.registerChild(listOfSpatialComponents); } @@ -282,7 +285,7 @@ } @Override - public String toString() { + public String toString() { // TODO - recursive display. modify it? return "DynCompartmentPlugin [listOfSpatialComponents=" + listOfSpatialComponents + "]"; } Modified: trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynElement.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynElement.java 2015-03-31 12:59:32 UTC (rev 2168) +++ trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynElement.java 2015-03-31 16:51:38 UTC (rev 2169) @@ -62,7 +62,9 @@ * Initializes custom Class attributes * */ private void initDefaults() { - setNamespace(DynConstants.namespaceURI); + setNamespace(DynConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = DynConstants.shortLabel; idRef = null; metaIdRef = null; } @@ -261,12 +263,10 @@ Map<String, String> attributes = super.writeXMLAttributes(); if (isSetIdRef()) { - attributes.remove("idRef"); attributes.put(DynConstants.shortLabel + ":" + DynConstants.idRef, idRef); } if (isSetMetaIdRef()) { - attributes.remove("metaIdRef"); attributes.put(DynConstants.shortLabel + ":" + DynConstants.metaIdRef, metaIdRef); } Modified: trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynEventPlugin.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynEventPlugin.java 2015-03-31 12:59:32 UTC (rev 2168) +++ trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynEventPlugin.java 2015-03-31 16:51:38 UTC (rev 2169) @@ -92,14 +92,7 @@ * Initializes custom Class attributes * */ private void initDefaults() { - listOfDynElements = new ListOf<DynElement>(); applyToAll = false; - listOfDynElements.setNamespace(DynConstants.namespaceURI); - listOfDynElements.setSBaseListType(ListOf.Type.other); - - if (isSetExtendedSBase()) { - extendedSBase.registerChild(listOfDynElements); - } } /** @@ -127,7 +120,7 @@ * @return whether applyToAll is set */ public boolean isSetApplyToAll() { - return applyToAll != false; + return applyToAll != null && applyToAll != false; } /** @@ -135,7 +128,7 @@ * @param applyToAll */ public void setApplyToAll(boolean applyToAll) { - boolean oldApplyToAll = this.applyToAll; + Boolean oldApplyToAll = this.applyToAll; this.applyToAll = applyToAll; firePropertyChange(DynConstants.applyToAll, oldApplyToAll, this.applyToAll); @@ -164,10 +157,15 @@ * @return the value of listOfDynElements */ public ListOf<DynElement> getListOfDynElements() { - if (!isSetListOfDynElements()) { + if (listOfDynElements == null) { listOfDynElements = new ListOf<DynElement>(); - listOfDynElements.setNamespace(DynConstants.namespaceURI); + listOfDynElements.setNamespace(DynConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDynElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'dyn' + listOfDynElements.setPackageName(null); + listOfDynElements.setPackageName(DynConstants.shortLabel); listOfDynElements.setSBaseListType(ListOf.Type.other); + extendedSBase.registerChild(listOfDynElements); } return listOfDynElements; @@ -191,13 +189,15 @@ */ public void setListOfDynElements(ListOf<DynElement> listOfDynElements) { unsetListOfDynElements(); - if (!isSetListOfDynElements()) { - this.listOfDynElements = new ListOf<DynElement>(); - } else { - this.listOfDynElements = listOfDynElements; - } - if ((this.listOfDynElements != null) - && (this.listOfDynElements.getSBaseListType() != ListOf.Type.other)) { + + this.listOfDynElements = listOfDynElements; + + if (this.listOfDynElements != null) { + listOfDynElements.setNamespace(DynConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDynElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'dyn' + listOfDynElements.setPackageName(null); + listOfDynElements.setPackageName(DynConstants.shortLabel); this.listOfDynElements.setSBaseListType(ListOf.Type.other); } if (isSetExtendedSBase()) { @@ -212,7 +212,7 @@ * {@code false} */ public boolean unsetListOfDynElements() { - if (isSetListOfDynElements()) { + if (listOfDynElements == null) { ListOf<DynElement> oldListOfDynElements = listOfDynElements; listOfDynElements = null; firePropertyChange(DynConstants.listOfDynElements, @@ -300,7 +300,7 @@ } @Override - public int getChildCount() { + public int getChildCount() { // TODO - will not write the ListOf if it is empty return isSetListOfDynElements() ? 1 : 0; } @@ -349,7 +349,7 @@ } @Override - public String toString() { + public String toString() { // TODO - recursive display. modify it? return "DynEventPlugin [listOfDynElements=" + listOfDynElements + ", applyToAll=" + applyToAll + "]"; } Modified: trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynSBasePlugin.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynSBasePlugin.java 2015-03-31 12:59:32 UTC (rev 2168) +++ trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynSBasePlugin.java 2015-03-31 16:51:38 UTC (rev 2169) @@ -54,6 +54,7 @@ * */ public DynSBasePlugin() { super(); + elementNamespace = DynConstants.namespaceURI; // TODO - removed once the mechanism are in place to set package version and namespace } /** @@ -75,6 +76,7 @@ */ public DynSBasePlugin(SBase extendedSBase) { super(extendedSBase); + elementNamespace = DynConstants.namespaceURI; // TODO - removed once the mechanism are in place to set package version and namespace } /** @@ -139,13 +141,8 @@ } @Override - public String getElementNamespace() { - return DynConstants.getNamespaceURI(getLevel(), getVersion()); - } - - @Override public String getPackageName() { - return DynConstants.packageName; + return DynConstants.shortLabel; } @Override Modified: trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/SpatialComponent.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/SpatialComponent.java 2015-03-31 12:59:32 UTC (rev 2168) +++ trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/SpatialComponent.java 2015-03-31 16:51:38 UTC (rev 2169) @@ -64,7 +64,9 @@ * Initializes custom Class attributes * */ private void initDefaults() { - setNamespace(DynConstants.namespaceURI); + setNamespace(DynConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = DynConstants.namespaceURI; variable = null; spatialIndex = null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-03-31 12:59:41
|
Revision: 2168 http://sourceforge.net/p/jsbml/code/2168 Author: niko-rodrigue Date: 2015-03-31 12:59:32 +0000 (Tue, 31 Mar 2015) Log Message: ----------- improved the method PackageUtil.checkPackages to log problems only when we want it + moved the method setPackageName from AbstractSBase to ListOf as it is the only use case that I can think of that would make use of the method + added a call to PackageUtil.checkPackages just before writing an SBMLDocument to xml in order to correct SBMLDocument created by hand or to enable packages if needed after cloning + added setNamespace to AbstractFBCSBasePlugin Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/AbstractSBase.java trunk/core/src/org/sbml/jsbml/ListOf.java trunk/core/src/org/sbml/jsbml/ext/AbstractSBasePlugin.java trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Submodel.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/AbstractFBCSBasePlugin.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java trunk/test/org/sbml/jsbml/test/PackageVersionTests.java trunk/test/org/sbml/jsbml/test/UnregisterPackageTests.java Modified: trunk/core/src/org/sbml/jsbml/AbstractSBase.java =================================================================== --- trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -254,6 +254,8 @@ // extensions is needed when doing getChildCount() extensions = new TreeMap<String, SBasePlugin>(); elementNamespace = null; + packageName = sb.getPackageName(); + packageVersion = sb.getPackageVersion(); declaredNamespaces = new HashMap<String, String>(); if (sb.isSetLevel()) { @@ -1995,29 +1997,6 @@ firePropertyChange(TreeNodeChangeEvent.packageVersion, oldPackageVersion, packageVersion); } - /** - * Sets the name of the package to which this {@link SBase} belong. - * - * <p>This an internal method that should not be used outside of the main jsbml code - * (core + packages). One class should always belong to the same package. - * You have to know what you are doing when using this method. - * - * @param newPackageName the name of the package to which this {@link SBase} belong. - */ - public void setPackageName(String newPackageName) { - - if ((packageName != null) && (newPackageName != null) && (!packageName.equals(newPackageName))) { - // if we implement proper conversion some days, we need to unset the namespace before changing it. - logger.error(MessageFormat.format("An SBase element cannot belong to two different packages! Current package = ''{0}'', new package = ''{1}''", packageName, newPackageName)); - // throw new IllegalArgumentException(MessageFormat.format("An SBase element cannot belong to two different namespaces ! " - // + "Current namespace = '{0}', new namespace = '{1}' ", elementNamespace, namespace)); - } - String old = packageName; - packageName = newPackageName; - - firePropertyChange(TreeNodeChangeEvent.packageName, old, newPackageName); - } - /* (non-Javadoc) * @see org.sbml.jsbml.SBase#setSBOTerm(int) */ Modified: trunk/core/src/org/sbml/jsbml/ListOf.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ListOf.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/core/src/org/sbml/jsbml/ListOf.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -949,6 +949,27 @@ } /** + * Sets the name of the package to which this {@link SBase} belong. + * + * <p>This an internal method that should not be used outside of the main jsbml code + * (core + packages). One class should always belong to the same package. + * You have to know what you are doing when using this method. + * + * @param newPackageName the name of the package to which this {@link SBase} belong. + */ + public void setPackageName(String newPackageName) { + + if ((packageName != null) && (newPackageName != null) && (!packageName.equals(newPackageName))) { + // if we implement proper conversion some days, we need to unset the namespace before changing it. + logger.error(MessageFormat.format("An SBase element cannot belong to two different packages! Current package = ''{0}'', new package = ''{1}''", packageName, newPackageName)); + } + String old = packageName; + packageName = newPackageName; + + firePropertyChange(TreeNodeChangeEvent.packageName, old, newPackageName); + } + + /** * Sets the {@link Type} of this {@link ListOf} instance to the {@link Type} * defined by the given {@link Class}. * Modified: trunk/core/src/org/sbml/jsbml/ext/AbstractSBasePlugin.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ext/AbstractSBasePlugin.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/core/src/org/sbml/jsbml/ext/AbstractSBasePlugin.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -22,14 +22,17 @@ */ package org.sbml.jsbml.ext; +import java.text.MessageFormat; import java.util.Map; import java.util.TreeMap; import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.AbstractTreeNode; import org.sbml.jsbml.SBMLDocument; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.util.TreeNodeChangeEvent; /** * @author Andreas Dräger @@ -48,6 +51,11 @@ /** * */ + private Logger logger = Logger.getLogger(AbstractSBasePlugin.class); + + /** + * + */ protected SBase extendedSBase; /** @@ -58,6 +66,11 @@ /** * */ + protected String elementNamespace; + + /** + * + */ public AbstractSBasePlugin() { super(); } @@ -138,6 +151,14 @@ super.firePropertyChange(propertyName, oldValue, newValue); } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() + */ + @Override + public String getElementNamespace() { + return elementNamespace; + } /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getExtendedSBase() @@ -235,6 +256,28 @@ } /** + * Sets the XML namespace to which this {@link SBasePlugin} belong. + * + * <p>This an internal method that should not be used outside of the main jsbml code + * (core + packages). One class should always belong to the same namespace, although the namespaces can + * have different level and version (and package version). You have to know what you are doing + * when using this method. + * + * @param namespace the XML namespace to which this {@link SBasePlugin} belong. + */ + public void setNamespace(String namespace) { + + if ((elementNamespace != null) && (namespace != null) && (!elementNamespace.equals(namespace))) { + // if we implement proper conversion some days, we need to unset the namespace before changing it. + logger.error(MessageFormat.format("An SBasePlugin element cannot belong to two different namespaces! Current namespace = ''{0}'', new namespace = ''{1}''", elementNamespace, namespace)); + } + String old = elementNamespace; + elementNamespace = namespace; + + firePropertyChange(TreeNodeChangeEvent.namespace, old, namespace); + } + + /** * Sets the extended {@link SBase}. * * <p>This method should not be called in general but it is necessary Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -170,55 +170,58 @@ return; } - // TODO - make use of the silent and fix parameters - String packageName = sbase.getPackageName(); String elementNamespace = sbase.getNamespace(); int packageVersion = sbase.getPackageVersion(); if (packageName.equals("core") && packageVersion != 0) { - System.out.println("Warning: the element '" + sbase.getElementName() + "' seems to be part of SBML core but it's package version is not '0'!"); - } // TODO - do we want to check and set the namespace for core elements ? + if (!silent) { + logger.warn("The element '" + sbase.getElementName() + "' seems to be part of SBML core but it's package version is not '0'!"); + } + if (fix) { + sbase.setPackageVersion(0); + } + } + // TODO - do we want to check and set the namespace for core elements ? namespace not set at the moment for them +// if (packageName.equals("core") && elementNamespace == null) { +// logger.warn("The element '" + sbase.getElementName() + "' seems to be part of SBML core but it's package namespace is not set!"); +// } // check package name != core if (!packageName.equals("core")) { - PackageInfo pi = prefixMap.get(packageName); + PackageInfo pi = getPackageInfo(sbase, packageName, packageVersion, elementNamespace, prefixMap, namespaceMap, silent, fix); if (pi == null) { - // The package might not be enabled on the SBMLDocument - System.out.println("Warning: the package '" + packageName + "' does not seem to be enabled."); - SBMLDocument doc = sbase.getSBMLDocument(); - - // TODO - register package using package version or default namespace - // TODO - and add the package to the maps - if (doc != null) { - // TODO - register package using package version or default namespace - - } else { - System.out.println("Warning: Can not found SBMLDocument on the element '" + sbase.getElementName() + "'. Stopping the check"); - } + return; } // checking package version if (packageVersion != -1 && packageVersion != pi.version) { - System.out.println("Warning: the element '" + sbase.getElementName() + "' does not seems to have" - + " the expected package version. Found '" + packageVersion + "', expected '" + pi.version + "'"); - // TODO - fix if asked to + if (!silent) { + logger.warn("The element '" + sbase.getElementName() + "' does not seems to have" + + " the expected package version. Found '" + packageVersion + "', expected '" + pi.version + "'"); + } + if (fix) { + sbase.setPackageVersion(pi.version); + } } else if (packageVersion == -1) { - System.out.println("Warning: the element '" + sbase.getElementName() + "' does not have a package version set!"); - sbase.setPackageVersion(pi.version); + if (!silent) { + logger.warn("The element '" + sbase.getElementName() + "' does not have a package version set!"); + } + if (fix) { + sbase.setPackageVersion(pi.version); + } } - // System.out.println("DEBUG: element = '" + sbase.getElementName() + "'. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); - // checking package namespace - if (!elementNamespace.equals(pi.namespace)) { - System.out.println("Warning: the element '" + sbase.getElementName() + "' does not seems to have" - + " the expected package namespace. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); - - if (sbase instanceof AbstractSBase) { + if ((elementNamespace == null) || (!elementNamespace.equals(pi.namespace))) { + if (!silent) { + logger.warn("The element '" + sbase.getElementName() + "' does not seems to have" + + " the expected package namespace. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); + } + if (sbase instanceof AbstractSBase && fix) { ((AbstractSBase) sbase).unsetNamespace(); ((AbstractSBase) sbase).setNamespace(pi.namespace); } @@ -237,49 +240,49 @@ elementNamespace = sbasePlugin.getElementNamespace(); packageVersion = sbasePlugin.getPackageVersion(); - // TODO - checks similar as for SBase, try to refactor into one function - PackageInfo pi = prefixMap.get(packageName); + if (packageName.equals("core")) { + if (!silent) { + logger.error("The element '" + sbasePlugin.getClass().getSimpleName() + "' has it's package version set to 'core'!"); + } + continue; + } + PackageInfo pi = getPackageInfo(sbase, packageName, packageVersion, elementNamespace, prefixMap, namespaceMap, silent, fix); + if (pi == null) { - // The package might not be enabled on the SBMLDocument - System.out.println("Warning: the package '" + packageName + "' does not seem to be enabled."); - SBMLDocument doc = sbase.getSBMLDocument(); - - // TODO - register package using package version or default namespace - // TODO - and add the package to the maps - if (doc != null) { - // TODO - register package using package version or default namespace - - } else { - System.out.println("Warning: Can not found SBMLDocument on the element '" + sbase.getElementName() + "'. Stopping the check"); - } continue; } // checking package version if (packageVersion != -1 && packageVersion != pi.version) { - System.out.println("Warning: the element '" + sbasePlugin.getClass().getSimpleName() + "' does not seems to have" - + " the expected package version. Found '" + packageVersion + "', expected '" + pi.version + "'"); - // TODO - fix if asked to + if (!silent) { + logger.warn("The element '" + sbasePlugin.getClass().getSimpleName() + "' does not seems to have" + + " the expected package version. Found '" + packageVersion + "', expected '" + pi.version + "'"); + } + if (fix) { + sbasePlugin.setPackageVersion(pi.version); + } } else if (packageVersion == -1) { - System.out.println("Warning: the element '" + sbasePlugin.getClass().getSimpleName() + "' does not have a package version set!"); - sbasePlugin.setPackageVersion(pi.version); + if (!silent) { + logger.warn("The element '" + sbasePlugin.getClass().getSimpleName() + "' does not have a package version set!"); + } + if (fix) { + sbasePlugin.setPackageVersion(pi.version); + } } - // System.out.println("DEBUG: element = '" + sbasePlugin.getClass().getSimpleName() + "'. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); - // checking package namespace - if (!elementNamespace.equals(pi.namespace)) { - System.out.println("Warning: the element '" + sbasePlugin.getClass().getSimpleName() + "' does not seems to have" - + " the expected package namespace. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); + if ((elementNamespace == null) || (!elementNamespace.equals(pi.namespace))) { + if (!silent) { + logger.warn("The element '" + sbasePlugin.getClass().getSimpleName() + "' does not seems to have" + + " the expected package namespace. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); + } - if (sbasePlugin instanceof AbstractSBasePlugin) { - // TODO - implement those methods in AbstractSBasePlugin - // ((AbstractSBasePlugin) sbase).unsetNamespace(); - // ((AbstractSBasePlugin) sbase).setNamespace(pi.namespace); + ((AbstractSBasePlugin) sbasePlugin).setNamespace(null); + ((AbstractSBasePlugin) sbasePlugin).setNamespace(pi.namespace); } } @@ -324,7 +327,80 @@ return version; } + + /** + * @param sbase + * @param packageName + * @param packageVersion + * @param elementNamespace + * @param prefixMap + * @param namespaceMap + * @param silent + * @param fix + * @return + */ + private static PackageInfo getPackageInfo(SBase sbase, String packageName, int packageVersion, String elementNamespace, Map<String, PackageInfo> prefixMap, + Map<String, PackageInfo> namespaceMap, boolean silent, boolean fix) { + + PackageInfo pi = prefixMap.get(packageName); + if (pi == null) { + pi = namespaceMap.get(elementNamespace); + } + + if (pi == null) { + // The package might not be enabled on the SBMLDocument. Can happen when cloning part of a model. + if (!silent) { + logger.warn("The package '" + packageName + "' does not seem to be enabled."); + } + SBMLDocument doc = sbase.getSBMLDocument(); + + if (doc != null) { + // Get the package parser + PackageParser packageParser = ParserManager.getManager().getPackageParser(packageName); + + if (packageVersion != -1) { + elementNamespace = packageParser.getNamespaceFor(doc.getLevel(), doc.getVersion(), packageVersion); + } + // if elementNamespace is null there, there is a problem, getting the default namespace. + if (elementNamespace == null) { + if (!silent) { + logger.warn("Could not find a namespace for the package '" + packageName + "' using SBML level '" + + doc.getLevel() + "' version '" + doc.getVersion() + "', package version '" + packageVersion + "'."); + } + elementNamespace = packageParser.getPackageNamespaces().get(packageParser.getPackageNamespaces().size() - 1); // TODO - add a getDefaultNamespace() to PackageParser + } + + // making sure the package is enabled in the SBMLDocument + doc.enablePackage(elementNamespace); + + if (packageParser != null) { + pi = new PackageInfo(); + pi.prefix = packageParser.getPackageName(); + pi.namespace = elementNamespace; + pi.version = extractPackageVersion(elementNamespace); + + prefixMap.put(pi.prefix, pi); + namespaceMap.put(elementNamespace, pi); + + if (logger.isDebugEnabled()) { + logger.debug(pi); + } + } + + } else if (!silent) { + logger.info("Can not found SBMLDocument on the element '" + sbase.getElementName() + "'. Stopping the check"); + } + + // if we were not able to find the package information, we just return. + if (pi == null) { + return null; + } + } + + return pi; + } + } /** Modified: trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -69,6 +69,7 @@ import org.sbml.jsbml.util.StringTools; import org.sbml.jsbml.util.compilers.MathMLXMLStreamCompiler; import org.sbml.jsbml.xml.XMLNode; +import org.sbml.jsbml.xml.parsers.PackageUtil; import org.sbml.jsbml.xml.parsers.ParserManager; import org.sbml.jsbml.xml.parsers.WritingParser; import org.sbml.jsbml.xml.parsers.XMLNodeWriter; @@ -178,6 +179,9 @@ // testDocument.checkConsistency(); // System.out.println(XMLNode.convertXMLNodeToString(testDocument.getModel().getAnnotation().getNonRDFannotation())); + System.out.println("Going to check package version and namespace for all elements."); + PackageUtil.checkPackages(testDocument); + System.out.printf("Starting writing\n"); new SBMLWriter().write(testDocument, jsbmlWriteFileName); @@ -524,13 +528,16 @@ public void write(SBMLDocument sbmlDocument, OutputStream stream, String programName, String programVersion) throws XMLStreamException, SBMLException { - if (!sbmlDocument.isSetLevel() || !sbmlDocument.isSetVersion()) { + if (sbmlDocument == null || !sbmlDocument.isSetLevel() || !sbmlDocument.isSetVersion()) { throw new IllegalArgumentException( "Unable to write SBML output for documents with undefined SBML Level and Version flag."); } Logger logger = Logger.getLogger(SBMLWriter.class); + // check package version and namespace in general and register packages if needed. + PackageUtil.checkPackages(sbmlDocument, true, true); + // Making sure that we use the good XML library System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory"); System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Submodel.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Submodel.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Submodel.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -455,6 +455,7 @@ listOfDeletions.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace listOfDeletions.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'comp' + listOfDeletions.setPackageName(null); listOfDeletions.setPackageName(CompConstants.shortLabel); listOfDeletions.setSBaseListType(ListOf.Type.other); registerChild(listOfDeletions); Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/AbstractFBCSBasePlugin.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/AbstractFBCSBasePlugin.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/AbstractFBCSBasePlugin.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -43,6 +43,7 @@ public AbstractFBCSBasePlugin() { super(); setPackageVersion(-1); + elementNamespace = FBCConstants.namespaceURI; // TODO - removed once the mechanism are in place to set package version and namespace } /** @@ -60,15 +61,9 @@ public AbstractFBCSBasePlugin(SBase sbase) { super(sbase); setPackageVersion(-1); + elementNamespace = FBCConstants.namespaceURI; // TODO - removed once the mechanism are in place to set package version and namespace } - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.SBasePlugin#getElementNamespace() - */ - @Override - public String getElementNamespace() { - return FBCConstants.getNamespaceURI(getLevel(), getVersion(), getPackageVersion()); // TODO - change to return a String attribute that can be changed - } /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#getPackageName() Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -313,15 +313,6 @@ } /** - * TODO: optionally, create additional create methods with more - * variables, for instance "bar" variable - */ - // public GeneProduct createGeneProduct(String id, int bar) { - // GeneProduct geneProduct = createGeneProduct(id); - // geneProduct.setBar(bar); - // return geneProduct; - // } - /** * Gets an element from the {@link #listOfGeneProducts} at the given index. * * @param i the index of the {@link GeneProduct} element to get. @@ -336,7 +327,6 @@ return getListOfGeneProducts().get(i); } - // TODO - if GeneProduct has no id attribute, you should remove this method. /** * Gets an element from the listOfGeneProducts, with the given id. * Modified: trunk/test/org/sbml/jsbml/test/PackageVersionTests.java =================================================================== --- trunk/test/org/sbml/jsbml/test/PackageVersionTests.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/test/org/sbml/jsbml/test/PackageVersionTests.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -22,6 +22,8 @@ package org.sbml.jsbml.test; +import javax.xml.stream.XMLStreamException; + import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; @@ -30,7 +32,14 @@ import org.sbml.jsbml.ListOf; import org.sbml.jsbml.Model; import org.sbml.jsbml.SBMLDocument; +import org.sbml.jsbml.SBMLException; +import org.sbml.jsbml.SBMLWriter; +import org.sbml.jsbml.ext.arrays.ArraysConstants; +import org.sbml.jsbml.ext.arrays.ArraysSBasePlugin; import org.sbml.jsbml.ext.comp.CompConstants; +import org.sbml.jsbml.ext.comp.CompModelPlugin; +import org.sbml.jsbml.ext.comp.CompSBMLDocumentPlugin; +import org.sbml.jsbml.ext.comp.Submodel; import org.sbml.jsbml.ext.distrib.DistribConstants; import org.sbml.jsbml.ext.distrib.util.DistribModelBuilder; import org.sbml.jsbml.ext.fbc.FBCConstants; @@ -57,9 +66,10 @@ @Before public void setUp() { doc = new SBMLDocument(3, 1); + doc.enablePackage(ArraysConstants.namespaceURI_L3V1V1); doc.enablePackage(FBCConstants.namespaceURI_L3V1V1); doc.enablePackage(DistribConstants.namespaceURI_L3V1V1); - doc.enablePackage(QualConstants.namespaceURI_L3V1V1); + doc.enablePackage(QualConstants.namespaceURI_L3V1V1); doc.enablePackage(CompConstants.namespaceURI_L3V1V1); m = doc.createModel("test"); @@ -83,10 +93,25 @@ FunctionDefinition f = m.createFunctionDefinition("f"); DistribModelBuilder.createDistribution(f, "NormalDistribution", new String[] { "mean", "stddev" }, new String[] {"avg", "sd"}); + CompSBMLDocumentPlugin compDoc = (CompSBMLDocumentPlugin) doc.getPlugin("comp"); + compDoc.createExternalModelDefinition("C_EMD1"); + compDoc.createModelDefinition("C_MD1"); + + CompModelPlugin compModel = (CompModelPlugin) m.getPlugin("comp"); + Submodel subModel = compModel.createSubmodel("C_SB1"); + compModel.createPort("C_P1"); + compModel.createReplacedBy(); + compModel.createReplacedElement(); + + ArraysSBasePlugin arraySubModel = (ArraysSBasePlugin) subModel.getPlugin("arrays"); + arraySubModel.createDimension("A_D1"); + arraySubModel.createIndex(); + + // check and fix package version and namespaces - // TODO - update when jsbml will be fixed to set properly package version and namespace - now the fix is done in SBMLCoreParser#processEndDocument + // TODO - update when jsbml will be fixed to set properly package version and namespace - + // now the fix is done in SBMLCoreParser#processEndDocument when reading a file PackageUtil.checkPackages(doc, false, true); - } @@ -99,6 +124,11 @@ FBCModelPlugin fbcModel = ((FBCModelPlugin) m.getPlugin("fbc")); ListOf<FluxBound> fluxBounds = fbcModel.getListOfFluxBounds(); + Assert.assertTrue(fbcModel.getPackageVersion() == 1); + Assert.assertTrue(fbcModel.getPackageName().equals(FBCConstants.shortLabel)); + Assert.assertTrue(fbcModel.getElementNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); + + Assert.assertTrue(fluxBounds.getPackageVersion() == 1); Assert.assertTrue(fluxBounds.getPackageName().equals(FBCConstants.shortLabel)); Assert.assertTrue(fluxBounds.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); @@ -120,7 +150,38 @@ Assert.assertTrue(objective.getPackageName().equals(FBCConstants.shortLabel)); Assert.assertTrue(objective.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); } + } + + /** + * Checks that package version and namespace are set properly after cloning the Model element + * only and writing the new SBMLDocument to String or XML. + * + */ + @Test public void testModelCloning() { + SBMLDocument newDoc = new SBMLDocument(3, 1); + Model clonedModel = m.clone(); + newDoc.setModel(clonedModel); + Assert.assertFalse(newDoc.isPackageEnabled("arrays")); + Assert.assertFalse(newDoc.isPackageEnabled("comp")); + Assert.assertFalse(newDoc.isPackageEnabled("distrib")); + Assert.assertFalse(newDoc.isPackageEnabled("fbc")); + Assert.assertFalse(newDoc.isPackageEnabled("qual")); + + try { + System.out.println(new SBMLWriter().writeSBMLToString(newDoc)); + } catch (SBMLException e) { + e.printStackTrace(); + } catch (XMLStreamException e) { + e.printStackTrace(); + } + + Assert.assertTrue(newDoc.isPackageEnabled("arrays")); + Assert.assertTrue(newDoc.isPackageEnabled("comp")); + Assert.assertTrue(newDoc.isPackageEnabled("distrib")); + Assert.assertTrue(newDoc.isPackageEnabled("fbc")); + + Assert.assertFalse(newDoc.isPackageEnabled("qual")); } } Modified: trunk/test/org/sbml/jsbml/test/UnregisterPackageTests.java =================================================================== --- trunk/test/org/sbml/jsbml/test/UnregisterPackageTests.java 2015-03-31 08:45:35 UTC (rev 2167) +++ trunk/test/org/sbml/jsbml/test/UnregisterPackageTests.java 2015-03-31 12:59:32 UTC (rev 2168) @@ -398,6 +398,9 @@ assertTrue(clonedDoc.findSBase("layout_metaid1") != null); assertTrue(clonedDoc.getModel().findUniqueNamedSBase("layout1") != null); + // the package will be enabled automatically before writing + assertTrue(!clonedDoc.isPackageEnabled("comp")); + try { System.out.println(new SBMLWriter().writeSBMLToString(clonedDoc)); } catch (SBMLException e) { @@ -406,6 +409,7 @@ e.printStackTrace(); } + assertTrue(clonedDoc.isPackageEnabled("comp")); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-03-31 08:45:38
|
Revision: 2167 http://sourceforge.net/p/jsbml/code/2167 Author: niko-rodrigue Date: 2015-03-31 08:45:35 +0000 (Tue, 31 Mar 2015) Log Message: ----------- updated an fbc test file to use the new methods Modified Paths: -------------- trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java Modified: trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java =================================================================== --- trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java 2015-03-31 06:36:12 UTC (rev 2166) +++ trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java 2015-03-31 08:45:35 UTC (rev 2167) @@ -76,14 +76,14 @@ GeneProduct geneProduct = modelPlugin.createGeneProduct("gene1"); geneProduct.setMetaId("meta_gene1"); geneProduct.setName("ETFC"); - geneProduct.setGeneProductIdentifier("2109.2"); + geneProduct.setLabel("2109.2"); geneProduct.addCVTerm(new CVTerm(Qualifier.BQB_IS_ENCODED_BY, "http://identifiers.org/ncbigene/2109")); geneProduct = modelPlugin.createGeneProduct("gene2"); - geneProduct.setGeneProductIdentifier("2108.1"); + geneProduct.setLabel("2108.1"); geneProduct = modelPlugin.createGeneProduct("gene3"); - geneProduct.setGeneProductIdentifier("2109.1"); + geneProduct.setLabel("2109.1"); UnitDefinition ud = builder.buildUnitDefinition("volume", "Volume units"); buildUnit(ud, 1d, -3, Unit.Kind.LITRE, 1d); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-03-31 06:36:21
|
Revision: 2166 http://sourceforge.net/p/jsbml/code/2166 Author: andreas-draeger Date: 2015-03-31 06:36:12 +0000 (Tue, 31 Mar 2015) Log Message: ----------- * Corrected a bug in LogicalOperator: when removing a child association, the pointer to the parent was not set to null. * Renamed the geneProductIdentifier in GeneProduct to label. * Added a new literal to UnitDefinition that identifies extent units. * Updated the SBO. Modified Paths: -------------- trunk/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo trunk/core/src/org/sbml/jsbml/AbstractSBase.java trunk/core/src/org/sbml/jsbml/UnitDefinition.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/LogicalOperator.java Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo 2015-03-30 16:11:24 UTC (rev 2165) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo 2015-03-31 06:36:12 UTC (rev 2166) @@ -1,6 +1,6 @@ format-version: 1.2 -date: 07:10:2014 07:00 -data-version: 09:01:2014 16:13 +date: 31:03:2015 07:00 +data-version: 16:03:2015 16:52 saved-by: SBO community auto-generated-by: SBO Browser (http://www.ebi.ac.uk/sbo/) default-namespace: sbo @@ -3922,21 +3922,21 @@ [Term] id: SBO:0000581 name: Gibbs free energy change -def: "The increase or decrease of the Gibbs free energy of a system. During a\nreaction, this is equal to the change in enthalpy of the system minus the\nchange in the product of the temperature times the entropy of the system: \nDeltaG = DeltaH - T DeltaS\nA negative value indicates that the reaction will be favoured and will\nrelease energy. The magnitude of the value indicates how far the reaction\nis from equilibrium, where there will be no free energy change. The\nstandard unit of measure is kJ/mol.\nsymbol: DeltaG" [src_code:NR] +def: "The increase or decrease of the Gibbs free energy of a system. During a\nreaction, this is equal to the change in enthalpy of the system minus the\nchange in the product of the temperature times the entropy of the system: ΔG = ΔH - T ΔS. A negative value indicates that the reaction will be favoured and will\nrelease energy. The magnitude of the value indicates how far the reaction\nis from equilibrium, where there will be no free energy change. The\nstandard unit of measure is kJ/mol. Symbol: ΔG." [src_code:NR] comment: created in response to \[SF req #3286595\]; is_a: SBO:0000580 ! Gibbs free energy [Term] id: SBO:0000582 -name: standard Gibbs energy of formation -def: "The change in Gibbs free energy associated with the formation of 1 mole of\nsubstance from elements in their standard states under standard conditions\n(1 bar). The standard unit of measure is kJ/mol.\nsymbol: DeltafG(degree)" [src_code:NR] +name: standard Gibbs free energy of formation +def: "The change in Gibbs free energy associated with the formation of 1 mole of substance from elements in their standard states under standard conditions (1 bar). For aqueous solutions, each solute must be present in 1M concentration. The standard unit of measure is kJ/mol. Symbol: ΔGf°." [src_code:NR] comment: created in response to \[SF req #3286595\]; is_a: SBO:0000581 ! Gibbs free energy change [Term] id: SBO:0000583 -name: standard Gibbs energy of reaction -def: "The Gibbs free energy change observed in a thermodynamic system when one\nmole of substance reacts completely, under standard conditions (1 bar).\nThe standard unit of measure is kJ/mol.\nsymbol: ΔG˚" [src_code:NR] +name: standard Gibbs free energy of reaction +def: "The Gibbs free energy change observed in a thermodynamic system when one\nmole of substance reacts completely, under standard conditions (1 bar). For aqueous solutions, each solute must be present in 1M concentration. The standard unit of measure is kJ/mol. Symbol: ΔG°." [src_code:NR] comment: created in response to \[SF req #3286595\]; is_a: SBO:0000581 ! Gibbs free energy change @@ -4120,6 +4120,111 @@ comment: created in response to SF req #101 is_a: SBO:0000607 ! dimer +[Term] +id: SBO:0000610 +name: growth rate +def: "A measure of the rate of growth of an organism, usually in culture. This can be expressed as increase in cell number or, more usually as an increase in dry weight of cells (grams), measured over a unit time period. Usually expressed as hour -1." [SBO:team "http://goldbook.iupac.org/G02709.html"] +is_a: SBO:0000002 ! quantitative systems description parameter + +[Term] +id: SBO:0000611 +name: effective catalytic rate +def: "Under nutrient limited conditions, it may be assumed that enzymes are operating below their maximal capacity (Kcat). Keff represents the lumped turnover rate of a reaction, expressed in units per time." [SBO:team "see supplementary material for http://identifiers.org/pubmed/24084808"] +comment: created in response to \[SF req #104\] +is_a: SBO:0000009 ! kinetic constant + +[Term] +id: SBO:0000612 +name: rate of reaction +def: "The velocity at which a reaction occurs. This may be calculated through the accumulation of a product or consumption of a reactant, and expressed using entity concentrations or amounts per time interval. The rate of reaction may be influenced by temperature, pressure and other factors. Rate of reaction is often referred to as reaction rate or metabolic flux." [src_code:NR] +comment: Created in response to \[SF req #105\]. +is_a: SBO:0000613 ! reaction parameter + +[Term] +id: SBO:0000613 +name: reaction parameter +def: "Parameters that pertain to chemical reactions." [src_code:NR] +comment: Created in response to \[SF req #105\]. +is_a: SBO:0000002 ! quantitative systems description parameter + +[Term] +id: SBO:0000614 +name: rate of reaction (concentration) +def: "Rate of reaction expressed as a change in concentration over time." [src_code:NR] +comment: Created in response to \[SF req #105\]. +is_a: SBO:0000612 ! rate of reaction + +[Term] +id: SBO:0000615 +name: rate of reaction (amount) +def: "Rate of reaction expressed as a change in enumerated quantity over time." [src_code:NR] +comment: Created in response to \[SF req #105\]. +is_a: SBO:0000612 ! rate of reaction + +[Term] +id: SBO:0000616 +name: extent of reaction +def: "The extent of a reaction is a measure of how far a reaction has proceeded towards equilibrium. It is denoted by the Greek letter ξ and is expressed in moles." [src_code:NR] +comment: Created in response to \[SF req #105\]. +is_a: SBO:0000613 ! reaction parameter + +[Term] +id: SBO:0000617 +name: Gibbs free energy of reaction +def: "The Gibbs free energy change observed in a thermodynamic system when a substance undergoes a reaction under non standard conditions. The unit of measure is kJ/mol. Symbol: ΔG." [src_code:NR] +comment: created in response to \[SF req #106\] +is_a: SBO:0000581 ! Gibbs free energy change + +[Term] +id: SBO:0000618 +name: reaction affinity +def: "The negative partial derivative of Gibbs free energy G with respect to extent of reaction at constant pressure and temperature. Affinity is positive for spontaneous reactions in the forward direction. Symbol: ξ." [SBO:team "https://en.wikipedia.org/wiki/Chemical_affinity"] +comment: created in response to \[SF req #106\] +synonym: "thermodynamic driving force" [] +is_a: SBO:0000581 ! Gibbs free energy change + +[Term] +id: SBO:0000619 +name: transformed Gibbs free energy change +def: "A Gibbs free energy that is calculated from the standard Gibbs value (at 298K), and extrapolated to a desired pH and ionic strength, and may be determined at a different temperature. Symbol: ΔG´." [SBO:team "http://www.ncbi.nlm.nih.gov/pubmed/9578607"] +comment: created in response to \[SF req #106\] +is_a: SBO:0000580 ! Gibbs free energy + +[Term] +id: SBO:0000620 +name: transformed standard Gibbs free energy of reaction +def: "A Gibbs free energy of reaction that is calculated from the standard Gibbs value (at 298K), and extrapolated to a desired pH and ionic strength, and may be determined at a different temperature. Symbol ΔG´." [SBO:team "http://www.ncbi.nlm.nih.gov/pubmed/9578607"] +comment: created in response to \[SF req #106\] +is_a: SBO:0000619 ! transformed Gibbs free energy change + +[Term] +id: SBO:0000621 +name: transformed standard Gibbs free energy of formation +def: "A Gibbs free energy of formation that is calculated from the standard Gibbs value (at 298K), and extrapolated to a desired pH and ionic strength, and may be determined at a different temperature. Symbol ΔGf´." [src_code:NR] +comment: created in response to \[SF req #106\] +is_a: SBO:0000619 ! transformed Gibbs free energy change + +[Term] +id: SBO:0000622 +name: transformed Gibbs free energy of reaction +def: "The Gibbs free energy change observed in a thermodynamic system when a substance undergoes a reaction under non standard conditions, which is extrapolated to a desired pH and ionic strength, and may be determined at a different temperature. Symbol: ΔG´." [src_code:NR] +comment: created in response to \[SF req #106\] +is_a: SBO:0000619 ! transformed Gibbs free energy change + +[Term] +id: SBO:0000623 +name: ionic strength +def: "A combined (weighted) measure of the concentration of all electrolytes present in a solution. It is calculated as a half of the sum over all the ions in the solution multiplied by the square of individual ionic valencies. Monovalent electrolytes have a concentration equal to their ionic strength while multivalent electrolytes have greater ionic strength, directly proportional to ionic valency. Symbol: I" [src_code:NR] +comment: created in response to \[SF req #107\] +is_a: SBO:0000002 ! quantitative systems description parameter + +[Term] +id: SBO:0000624 +name: flux balance framework +def: "Modelling approach, typically used for metabolic models, where the flow of metabolites (flux) through a network can be calculated. This approach will generally produce a set of solutions (solution space), which may be reduced using objective functions and constraints on individual fluxes." [src_code:NR] +comment: created in response to \[SF req #108\] +is_a: SBO:0000004 ! modelling framework + [Typedef] id: is_a name: is_a Modified: trunk/core/src/org/sbml/jsbml/AbstractSBase.java =================================================================== --- trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-03-30 16:11:24 UTC (rev 2165) +++ trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-03-31 06:36:12 UTC (rev 2166) @@ -190,7 +190,7 @@ * the name of the package which this SBase element belong to, 'core' by default. */ protected String packageName = "core"; - + /** * the version of the package which this SBase element belong to, '0' by default for core. */ @@ -1158,7 +1158,7 @@ return extensions.get(packageParser.getPackageName()); } - throw new IllegalArgumentException(MessageFormat.format("The package namespace or name ''{0}'' is unknown!!", nameOrUri)); + throw new IllegalArgumentException(MessageFormat.format("The package namespace or name ''{0}'' is unknown!", nameOrUri)); } /* (non-Javadoc) @@ -1360,6 +1360,9 @@ return getParent(); } + /* (non-Javadoc) + * @see org.sbml.jsbml.SBase#getPlugin(java.lang.String) + */ @Override public SBasePlugin getPlugin(String nameOrUri) { @@ -1375,7 +1378,7 @@ } } - throw new IllegalArgumentException(MessageFormat.format("The package namespace or name ''{0}'' is unknown!!", nameOrUri)); + throw new IllegalArgumentException(MessageFormat.format("The package namespace or name ''{0}'' is unknown!", nameOrUri)); } /* (non-Javadoc) @@ -1601,11 +1604,11 @@ // The code below cannot be used as it is, as the package prefix/label can be pass to this method // instead of the namespace URI // TODO - update once the namespace is properly set on plugins -// SBasePlugin extension = extensions.get(packageParser.getPackageName()); -// if (extension != null) { -// return extension.getElementNamespace().equals(nameOrUri); -// } -// return false; + // SBasePlugin extension = extensions.get(packageParser.getPackageName()); + // if (extension != null) { + // return extension.getElementNamespace().equals(nameOrUri); + // } + // return false; } throw new IllegalArgumentException(MessageFormat.format("The package namespace or name ''{0}'' is unknown!", nameOrUri)); @@ -1984,10 +1987,10 @@ @Override public void setPackageVersion(int packageVersion) { int oldPackageVersion = this.packageVersion; - + // TODO - add some checks to see if it agree with the package version of the parent // either SBase or SBasePlugin, if the parent belong to a different package ?? - + this.packageVersion = packageVersion; firePropertyChange(TreeNodeChangeEvent.packageVersion, oldPackageVersion, packageVersion); } @@ -2081,7 +2084,7 @@ public void unregisterChild(SBase sbase) { if (logger.isDebugEnabled()) { - logger.debug("unregister called !! " + sbase.getElementName() + " " + logger.debug("unregister called! " + sbase.getElementName() + " " + (sbase instanceof NamedSBase ? ((NamedSBase) sbase).getId() : "")); } Modified: trunk/core/src/org/sbml/jsbml/UnitDefinition.java =================================================================== --- trunk/core/src/org/sbml/jsbml/UnitDefinition.java 2015-03-30 16:11:24 UTC (rev 2165) +++ trunk/core/src/org/sbml/jsbml/UnitDefinition.java 2015-03-31 06:36:12 UTC (rev 2166) @@ -51,6 +51,11 @@ */ public static final String AREA = "area"; /** + * Identifier of the (for SBML Level 3) {@link UnitDefinition} + * {@code extent}. + */ + public static final String EXTENT = "extent"; + /** * Identifier of the (for SBML Level 2) predefined {@link UnitDefinition} * {@code length}. */ Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java 2015-03-30 16:11:24 UTC (rev 2165) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java 2015-03-31 06:36:12 UTC (rev 2166) @@ -199,7 +199,7 @@ * @return whether {@link #chemicalFormula} is set. */ public boolean isSetChemicalFormula() { - return chemicalFormula != null; + return (chemicalFormula != null) && (chemicalFormula.length() > 0); } /* (non-Javadoc) Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java 2015-03-30 16:11:24 UTC (rev 2165) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java 2015-03-31 06:36:12 UTC (rev 2166) @@ -43,7 +43,7 @@ /** * */ - private String geneProductIdentifier; + private String label; /** * @@ -114,7 +114,7 @@ setPackageVersion(-1); packageName = FBCConstants.shortLabel; } - + /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @@ -124,24 +124,24 @@ return false; } GeneProduct other = (GeneProduct) obj; - if (geneProductIdentifier == null) { - if (other.geneProductIdentifier != null) { + if (label == null) { + if (other.label != null) { return false; } - } else if (!geneProductIdentifier.equals(other.geneProductIdentifier)) { + } else if (!label.equals(other.label)) { return false; } return true; } /** - * Returns the value of geneProductIdentifier + * Returns the value of {@link #label} * - * @return the value of geneProductIdentifier + * @return the value of {@link #label} */ - public String getGeneProductIdentifier() { - if (isSetGeneProductIdentifier()) { - return geneProductIdentifier; + public String getLabel() { + if (isSetLabel()) { + return label; } return ""; } @@ -153,7 +153,7 @@ public int hashCode() { final int prime = 31; int result = super.hashCode(); - result = prime * result + ((geneProductIdentifier == null) ? 0 : geneProductIdentifier.hashCode()); + result = prime * result + ((label == null) ? 0 : label.hashCode()); return result; } @@ -166,12 +166,12 @@ } /** - * Returns whether geneProductIdentifier is set + * Returns whether {@link #label} is set * - * @return whether geneProductIdentifier is set + * @return whether {@link #label} is set */ - public boolean isSetGeneProductIdentifier() { - return geneProductIdentifier != null; + public boolean isSetLabel() { + return label != null; } /* (non-Javadoc) @@ -185,23 +185,23 @@ isAttributeRead = true; if (attributeName.equals(FBCConstants.geneProductIdentifier) || attributeName.equals(FBCConstants.label)) { - setGeneProductIdentifier(value); + setLabel(value); } else { isAttributeRead = false; } } - + return isAttributeRead; } /** - * Sets the value of geneProductIdentifier - * @param geneProductIdentifier + * Sets the value of {@link #label} + * @param label */ - public void setGeneProductIdentifier(String geneProductIdentifier) { - String oldGeneProductIdentifier = this.geneProductIdentifier; - this.geneProductIdentifier = geneProductIdentifier; - firePropertyChange(FBCConstants.geneProductIdentifier, oldGeneProductIdentifier, this.geneProductIdentifier); + public void setLabel(String label) { + String oldLabel = this.label; + this.label = label; + firePropertyChange(FBCConstants.label, oldLabel, this.label); } /* (non-Javadoc) @@ -211,8 +211,8 @@ public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getClass().getSimpleName()); - builder.append(" [geneProductIdentifier="); - builder.append(geneProductIdentifier); + builder.append(" [label="); + builder.append(label); builder.append(", "); builder.append("id="); builder.append(getId()); @@ -227,16 +227,16 @@ } /** - * Unsets the variable geneProductIdentifier + * Unsets the variable {@link #label} * - * @return {@code true}, if geneProductIdentifier was set before, + * @return {@code true}, if {@link #label} was set before, * otherwise {@code false} */ - public boolean unsetGeneProductIdentifier() { - if (isSetGeneProductIdentifier()) { - String oldGeneProductIdentifier = geneProductIdentifier; - geneProductIdentifier = null; - firePropertyChange(FBCConstants.geneProductIdentifier, oldGeneProductIdentifier, geneProductIdentifier); + public boolean unsetLabel() { + if (isSetLabel()) { + String oldLabel = label; + label = null; + firePropertyChange(FBCConstants.label, oldLabel, label); return true; } return false; @@ -257,10 +257,10 @@ attributes.remove("name"); attributes.put(FBCConstants.shortLabel + ":name", getName()); } - if (isSetGeneProductIdentifier()) { - attributes.put(FBCConstants.shortLabel + ":" + FBCConstants.label, getGeneProductIdentifier()); + if (isSetLabel()) { + attributes.put(FBCConstants.shortLabel + ":" + FBCConstants.label, getLabel()); } - + return attributes; } Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/LogicalOperator.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/LogicalOperator.java 2015-03-30 16:11:24 UTC (rev 2165) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/LogicalOperator.java 2015-03-31 06:36:12 UTC (rev 2166) @@ -27,7 +27,6 @@ import javax.swing.tree.TreeNode; import org.sbml.jsbml.AbstractSBase; -import org.sbml.jsbml.util.TreeNodeAdapter; /** * @author Andreas Dräger @@ -81,16 +80,6 @@ } /** - * - */ - private void initDefaults() { - setNamespace(FBCConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace - setPackageVersion(-1); - packageName = FBCConstants.shortLabel; - } - - - /** * Sets the given {@code ListOf<Association>}. If {@link #listOfAssociations} * was defined before and contains some elements, they are all unset. * @@ -116,6 +105,15 @@ return getListOfAssociations().add(association); } + /** + * Identical to calling {@link #addAssociation(Association)}. + * @param child + * @see #addAssociation(Association) + */ + public void addChild(Association child) { + addAssociation(child); + } + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractSBase#clone() */ @@ -264,6 +262,15 @@ } /** + * + */ + private void initDefaults() { + setNamespace(FBCConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + setPackageVersion(-1); + packageName = FBCConstants.shortLabel; + } + + /** * Returns {@code true} if {@link #listOfAssociations} contains at least one element. * * @return {@code true} if {@link #listOfAssociations} contains at least one element, @@ -322,7 +329,7 @@ throw new IndexOutOfBoundsException(Integer.toString(i)); } Association element = getListOfAssociations().remove(i); - (new TreeNodeAdapter(element, this)).fireNodeRemovedEvent(); + element.fireNodeRemovedEvent(); return element; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-03-30 16:11:26
|
Revision: 2165 http://sourceforge.net/p/jsbml/code/2165 Author: niko-rodrigue Date: 2015-03-30 16:11:24 +0000 (Mon, 30 Mar 2015) Log Message: ----------- modified AbstractSBase to be able to change the packageName, needed for ListOf elements + updated the arrays, comp, fbc and distrib packages to make sure the ListOf were set properly + added an utility class to check and fix the package versions and namespaces + this method is called after we read a file from XML to fix the package version and namespace until we implement the full feature where SBase.registerChild will take care of setting everything properly. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/AbstractSBase.java trunk/core/src/org/sbml/jsbml/util/TreeNodeChangeEvent.java trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLCoreParser.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/ArraysSBasePlugin.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompModelPlugin.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBMLDocumentPlugin.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Submodel.java trunk/extensions/distrib/src/org/sbml/jsbml/ext/distrib/DrawFromDistribution.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java trunk/test/org/sbml/jsbml/test/AllTests.java Added Paths: ----------- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java trunk/test/org/sbml/jsbml/test/PackageVersionTests.java Modified: trunk/core/src/org/sbml/jsbml/AbstractSBase.java =================================================================== --- trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -1992,6 +1992,29 @@ firePropertyChange(TreeNodeChangeEvent.packageVersion, oldPackageVersion, packageVersion); } + /** + * Sets the name of the package to which this {@link SBase} belong. + * + * <p>This an internal method that should not be used outside of the main jsbml code + * (core + packages). One class should always belong to the same package. + * You have to know what you are doing when using this method. + * + * @param newPackageName the name of the package to which this {@link SBase} belong. + */ + public void setPackageName(String newPackageName) { + + if ((packageName != null) && (newPackageName != null) && (!packageName.equals(newPackageName))) { + // if we implement proper conversion some days, we need to unset the namespace before changing it. + logger.error(MessageFormat.format("An SBase element cannot belong to two different packages! Current package = ''{0}'', new package = ''{1}''", packageName, newPackageName)); + // throw new IllegalArgumentException(MessageFormat.format("An SBase element cannot belong to two different namespaces ! " + // + "Current namespace = '{0}', new namespace = '{1}' ", elementNamespace, namespace)); + } + String old = packageName; + packageName = newPackageName; + + firePropertyChange(TreeNodeChangeEvent.packageName, old, newPackageName); + } + /* (non-Javadoc) * @see org.sbml.jsbml.SBase#setSBOTerm(int) */ Modified: trunk/core/src/org/sbml/jsbml/util/TreeNodeChangeEvent.java =================================================================== --- trunk/core/src/org/sbml/jsbml/util/TreeNodeChangeEvent.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/core/src/org/sbml/jsbml/util/TreeNodeChangeEvent.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -87,6 +87,10 @@ /** * */ + public static final String packageName = "packageName"; + /** + * + */ public static final String metaId = "metaId"; //$NON-NLS-1$ /** * Added: trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java (rev 0) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -0,0 +1,350 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2014 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ + +package org.sbml.jsbml.xml.parsers; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.sbml.jsbml.AbstractSBase; +import org.sbml.jsbml.SBMLDocument; +import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.AbstractSBasePlugin; +import org.sbml.jsbml.ext.SBasePlugin; + + +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.1 + */ +public class PackageUtil { + + /** + * Log4j logger + */ + private static final transient Logger logger = Logger.getLogger(PackageUtil.class); + + + /** + * Checks the whole {@link SBMLDocument}, including all siblings, to make sure + * that the package version and namespace is set properly. + * + * <p>It will print warnings or errors when problems are found, nothing will be changed. + * + * @param doc the {@link SBMLDocument} to check. + */ + public static void checkPackages(SBMLDocument doc) { + checkPackages(doc, false, false); + } + + /** + * Checks the whole {@link SBMLDocument}, including all siblings, to make sure + * that the package version and namespace is set properly. + * + * <p>The given boolean parameters will indicate if the method will print warnings + * or errors when problems are found, and if it will try to fix problems. + * + * @param doc the {@link SBMLDocument} to check. + * @param silent boolean to indicate if errors and warnings should be shown. + * @param fix boolean to indicate if encountered problems should be fixed. + */ + public static void checkPackages(SBMLDocument doc, boolean silent, boolean fix) { + if (doc == null) { + return; + } + + // getting the list of declared L3 packages from the declared namespaces + // TODO - add a proper method to get this list directly from SBMLdocument? + Map<String, String> declaredNamespaces = doc.getDeclaredNamespaces(); + List<String> packageNamespaces = new ArrayList<String>(); + + if (declaredNamespaces != null && declaredNamespaces.size() > 0) { + for (String xmlns : declaredNamespaces.keySet()) { + if (xmlns.startsWith("xmlns:")) { + String namespace = declaredNamespaces.get(xmlns); + + if (doc.isPackageEnabled(namespace)) { + packageNamespaces.add(namespace); + } + } + } + } + + checkPackages(doc, packageNamespaces, silent, fix); + } + + /** + * Checks the given {@link SBase}, including all it's siblings, to make sure + * that the package version and namespace is set properly. + * + * <p>The given boolean parameters will indicate if the method will print warnings + * or errors when problems are found, and if it will try to fix problems. + * + * @param sbase the {@link SBase} to check. + * @param packageNamespaces the {@link List} of namespaces that are expected to be found SBML L3 packages. + * @param silent boolean to indicate if errors and warnings should be shown. + * @param fix boolean to indicate if encountered problems should be fixed. + */ + public static void checkPackages(SBase sbase, List<String> packageNamespaces, boolean silent, boolean fix) { + if (sbase == null) { + return; + } + if (packageNamespaces == null) { + packageNamespaces = new ArrayList<String>(); + } + + Map<String, PackageInfo> prefixMap = new HashMap<String, PackageInfo>(); + Map<String, PackageInfo> namespaceMap = new HashMap<String, PackageInfo>(); + + for (String namespace : packageNamespaces) { + + // Get the package parser + PackageParser packageParser = ParserManager.getManager().getPackageParser(namespace); + + if (packageParser != null) { + PackageInfo pi = new PackageInfo(); + pi.prefix = packageParser.getPackageName(); + pi.namespace = namespace; + pi.version = extractPackageVersion(namespace); + + prefixMap.put(pi.prefix, pi); + namespaceMap.put(namespace, pi); + + if (logger.isDebugEnabled()) { + logger.debug(pi); + } + } + else { + logger.warn("Package namespace unknow: '" + namespace + "'"); + } + } + + // recursive test for all children if prefix is not "core" + checkPackages(sbase, prefixMap, namespaceMap, silent, fix); + + } + + /** + * Checks the given {@link SBase}, including all it's siblings, to make sure + * that the package version and namespace is set properly. + * + * <p>The given boolean parameters will indicate if the method will print warnings + * or errors when problems are found, and if it will try to fix problems. + * + * @param sbase the {@link SBase} to check. + * @param prefixMap map between package name (or prefix or label) and a {@link PackageInfo} object, + * representing the package name, namespace and version + * @param namespaceMap map between package namespace and a {@link PackageInfo} object, + * representing the package name, namespace and version + * @param silent boolean to indicate if errors and warnings should be shown. + * @param fix boolean to indicate if encountered problems should be fixed. + */ + private static void checkPackages(SBase sbase, Map<String, PackageInfo> prefixMap, + Map<String, PackageInfo> namespaceMap, boolean silent, boolean fix) + { + if (sbase == null) { + return; + } + + // TODO - make use of the silent and fix parameters + + String packageName = sbase.getPackageName(); + String elementNamespace = sbase.getNamespace(); + int packageVersion = sbase.getPackageVersion(); + + if (packageName.equals("core") && packageVersion != 0) { + System.out.println("Warning: the element '" + sbase.getElementName() + "' seems to be part of SBML core but it's package version is not '0'!"); + } // TODO - do we want to check and set the namespace for core elements ? + + // check package name != core + if (!packageName.equals("core")) { + PackageInfo pi = prefixMap.get(packageName); + + if (pi == null) { + // The package might not be enabled on the SBMLDocument + System.out.println("Warning: the package '" + packageName + "' does not seem to be enabled."); + SBMLDocument doc = sbase.getSBMLDocument(); + + // TODO - register package using package version or default namespace + // TODO - and add the package to the maps + if (doc != null) { + // TODO - register package using package version or default namespace + + } else { + System.out.println("Warning: Can not found SBMLDocument on the element '" + sbase.getElementName() + "'. Stopping the check"); + } + } + + // checking package version + if (packageVersion != -1 && packageVersion != pi.version) { + System.out.println("Warning: the element '" + sbase.getElementName() + "' does not seems to have" + + " the expected package version. Found '" + packageVersion + "', expected '" + pi.version + "'"); + // TODO - fix if asked to + } + else if (packageVersion == -1) + { + System.out.println("Warning: the element '" + sbase.getElementName() + "' does not have a package version set!"); + sbase.setPackageVersion(pi.version); + } + + // System.out.println("DEBUG: element = '" + sbase.getElementName() + "'. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); + + // checking package namespace + if (!elementNamespace.equals(pi.namespace)) { + System.out.println("Warning: the element '" + sbase.getElementName() + "' does not seems to have" + + " the expected package namespace. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); + + if (sbase instanceof AbstractSBase) { + ((AbstractSBase) sbase).unsetNamespace(); + ((AbstractSBase) sbase).setNamespace(pi.namespace); + } + } + } + + // check all SBasePlugin + int nbPlugins = sbase.getNumPlugins(); + + if (nbPlugins > 0) { + + for (SBasePlugin sbasePlugin : sbase.getExtensionPackages().values()) { + + // check version and namespace for plugin + packageName = sbasePlugin.getPackageName(); + elementNamespace = sbasePlugin.getElementNamespace(); + packageVersion = sbasePlugin.getPackageVersion(); + + // TODO - checks similar as for SBase, try to refactor into one function + PackageInfo pi = prefixMap.get(packageName); + + if (pi == null) { + // The package might not be enabled on the SBMLDocument + System.out.println("Warning: the package '" + packageName + "' does not seem to be enabled."); + SBMLDocument doc = sbase.getSBMLDocument(); + + // TODO - register package using package version or default namespace + // TODO - and add the package to the maps + if (doc != null) { + // TODO - register package using package version or default namespace + + } else { + System.out.println("Warning: Can not found SBMLDocument on the element '" + sbase.getElementName() + "'. Stopping the check"); + } + continue; + } + + // checking package version + if (packageVersion != -1 && packageVersion != pi.version) { + System.out.println("Warning: the element '" + sbasePlugin.getClass().getSimpleName() + "' does not seems to have" + + " the expected package version. Found '" + packageVersion + "', expected '" + pi.version + "'"); + // TODO - fix if asked to + } + else if (packageVersion == -1) + { + System.out.println("Warning: the element '" + sbasePlugin.getClass().getSimpleName() + "' does not have a package version set!"); + sbasePlugin.setPackageVersion(pi.version); + } + + // System.out.println("DEBUG: element = '" + sbasePlugin.getClass().getSimpleName() + "'. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); + + // checking package namespace + if (!elementNamespace.equals(pi.namespace)) { + System.out.println("Warning: the element '" + sbasePlugin.getClass().getSimpleName() + "' does not seems to have" + + " the expected package namespace. Found '" + elementNamespace + "', expected '" + pi.namespace + "'"); + + + if (sbasePlugin instanceof AbstractSBasePlugin) { + // TODO - implement those methods in AbstractSBasePlugin + // ((AbstractSBasePlugin) sbase).unsetNamespace(); + // ((AbstractSBasePlugin) sbase).setNamespace(pi.namespace); + } + } + + } + + } + + + // check all children + int childCount = sbase.getChildCount(); + + for (int i = 0; i < childCount; i++) { + Object childObj = sbase.getChildAt(i); + + if (childObj instanceof SBase) { + checkPackages((SBase) childObj, prefixMap, namespaceMap, silent, fix); + } + } + } + + /** + * + * @param namespace + * @return + */ + private static int extractPackageVersion(String namespace) { + int versionIndex = namespace.lastIndexOf("version"); + + if (versionIndex == -1) { + return -1; + } + + String versionStr = namespace.substring(versionIndex + 7); + + int version = -1; + + try { + version = Integer.parseInt(versionStr); + } catch (NumberFormatException e) { + e.printStackTrace(); + } + + return version; + } + +} + +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.1 + */ +final class PackageInfo { + + String prefix; + String namespace; + int version; + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "PackageInfo [prefix=" + prefix + ", namespace=" + namespace + + ", version=" + version + "]"; + } +} Property changes on: trunk/core/src/org/sbml/jsbml/xml/parsers/PackageUtil.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLCoreParser.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLCoreParser.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLCoreParser.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -596,6 +596,10 @@ } else { log4jLogger.error("The Model element has not been created."); } + + log4jLogger.debug("Starting to check the package version and namespace for all package elements"); + // checks silently package version and namespace and try to fix any problems encountered. + PackageUtil.checkPackages(sbmlDocument, true, true); } /* (non-Javadoc) Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/ArraysSBasePlugin.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/ArraysSBasePlugin.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/ArraysSBasePlugin.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -156,8 +156,13 @@ public ListOf<Index> getListOfIndices() { if (!isSetListOfIndices()) { listOfIndices = new ListOf<Index>(); - listOfIndices.setNamespace(ArraysConstants.namespaceURI); + listOfIndices.setNamespace(ArraysConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfIndices.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'arrays' + listOfIndices.setPackageName(null); + listOfIndices.setPackageName(ArraysConstants.shortLabel); listOfIndices.setSBaseListType(ListOf.Type.other); + if (isSetExtendedSBase()) { extendedSBase.registerChild(listOfIndices); } @@ -174,8 +179,17 @@ public void setListOfIndices(ListOf<Index> listOfIndices) { unsetListOfIndices(); this.listOfIndices = listOfIndices; - this.listOfIndices.setSBaseListType(ListOf.Type.other); + if (listOfIndices != null) { + listOfIndices.unsetNamespace(); + listOfIndices.setNamespace(ArraysConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfIndices.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'arrays' + listOfIndices.setPackageName(null); + listOfIndices.setPackageName(ArraysConstants.shortLabel); + listOfIndices.setSBaseListType(ListOf.Type.other); + } + if (isSetExtendedSBase()) { extendedSBase.registerChild(this.listOfIndices); } @@ -349,7 +363,11 @@ public ListOf<Dimension> getListOfDimensions() { if (!isSetListOfDimensions()) { listOfDimensions = new ListOf<Dimension>(); - listOfDimensions.setNamespace(ArraysConstants.namespaceURI); + listOfDimensions.setNamespace(ArraysConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDimensions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'arrays' + listOfDimensions.setPackageName(null); + listOfDimensions.setPackageName(ArraysConstants.shortLabel); listOfDimensions.setSBaseListType(ListOf.Type.other); if (isSetExtendedSBase()) { @@ -368,8 +386,17 @@ public void setListOfDimensions(ListOf<Dimension> listOfDimensions) { unsetListOfDimensions(); this.listOfDimensions = listOfDimensions; - this.listOfDimensions.setSBaseListType(ListOf.Type.other); + if (listOfDimensions != null) { + listOfDimensions.unsetNamespace(); + listOfDimensions.setNamespace(ArraysConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDimensions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'arrays' + listOfDimensions.setPackageName(null); + listOfDimensions.setPackageName(ArraysConstants.shortLabel); + listOfDimensions.setSBaseListType(ListOf.Type.other); + } + if (isSetExtendedSBase()) { extendedSBase.registerChild(this.listOfDimensions); } Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompModelPlugin.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompModelPlugin.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompModelPlugin.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -310,7 +310,9 @@ } listOfPorts.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace listOfPorts.setPackageVersion(-1); - // TODO - need to set package name for all ListOf ! + // changing the ListOf package name from 'core' to 'comp' + listOfPorts.setPackageName(null); + listOfPorts.setPackageName(CompConstants.shortLabel); listOfPorts.setSBaseListType(ListOf.Type.other); if (extendedSBase != null) { @@ -333,7 +335,11 @@ } else { listOfSubmodels = new ListOf<Submodel>(); } - listOfSubmodels.setNamespace(CompConstants.namespaceURI); + listOfSubmodels.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSubmodels.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfSubmodels.setPackageName(null); + listOfSubmodels.setPackageName(CompConstants.shortLabel); listOfSubmodels.setSBaseListType(ListOf.Type.other); if (extendedSBase != null) { extendedSBase.registerChild(listOfSubmodels); @@ -561,6 +567,12 @@ this.listOfPorts = listOfPorts; if ((this.listOfPorts != null)) { this.listOfPorts.setSBaseListType(ListOf.Type.other); + listOfPorts.unsetNamespace(); + listOfPorts.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfPorts.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfPorts.setPackageName(null); + listOfPorts.setPackageName(CompConstants.shortLabel); } if (extendedSBase != null) { extendedSBase.registerChild(this.listOfPorts); @@ -576,6 +588,16 @@ public void setListOfSubmodels(ListOf<Submodel> listOfSubmodels) { unsetListOfSubmodels(); this.listOfSubmodels = listOfSubmodels; + if ((this.listOfSubmodels != null)) { + this.listOfSubmodels.setSBaseListType(ListOf.Type.other); + listOfSubmodels.unsetNamespace(); + listOfSubmodels.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfSubmodels.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfSubmodels.setPackageName(null); + listOfSubmodels.setPackageName(CompConstants.shortLabel); + } + if (extendedSBase != null) { extendedSBase.registerChild(this.listOfSubmodels); } Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBMLDocumentPlugin.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBMLDocumentPlugin.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBMLDocumentPlugin.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -141,8 +141,13 @@ } else { listOfExternalModelDefinitions = new ListOf<ExternalModelDefinition>(); } - listOfExternalModelDefinitions.setNamespace(CompConstants.namespaceURI); + listOfExternalModelDefinitions.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfExternalModelDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfExternalModelDefinitions.setPackageName(null); + listOfExternalModelDefinitions.setPackageName(CompConstants.shortLabel); listOfExternalModelDefinitions.setSBaseListType(ListOf.Type.other); + if (extendedSBase != null) { extendedSBase.registerChild(listOfExternalModelDefinitions); } @@ -236,6 +241,16 @@ public void setListOfExternalModelDefinitions(ListOf<ExternalModelDefinition> listOfExternalModelDefinitions) { unsetListOfExternalModelDefinitions(); this.listOfExternalModelDefinitions = listOfExternalModelDefinitions; + + if (listOfExternalModelDefinitions != null) { + listOfExternalModelDefinitions.unsetNamespace(); + listOfExternalModelDefinitions.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfExternalModelDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfExternalModelDefinitions.setPackageName(null); + listOfExternalModelDefinitions.setPackageName(CompConstants.shortLabel); + listOfExternalModelDefinitions.setSBaseListType(ListOf.Type.other); + } if (extendedSBase != null) { extendedSBase.registerChild(this.listOfExternalModelDefinitions); } @@ -416,8 +431,13 @@ } else { listOfModelDefinitions = new ListOf<ModelDefinition>(); } - listOfModelDefinitions.setNamespace(CompConstants.namespaceURI); + listOfModelDefinitions.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfModelDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfModelDefinitions.setPackageName(null); + listOfModelDefinitions.setPackageName(CompConstants.shortLabel); listOfModelDefinitions.setSBaseListType(ListOf.Type.other); + if (extendedSBase != null) { extendedSBase.registerChild(listOfModelDefinitions); } @@ -437,6 +457,16 @@ public void setListOfModelDefinitions(ListOf<ModelDefinition> listOfModelDefinitions) { unsetListOfModelDefinitions(); this.listOfModelDefinitions = listOfModelDefinitions; + + if (listOfModelDefinitions != null) { + listOfModelDefinitions.unsetNamespace(); + listOfModelDefinitions.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfModelDefinitions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfModelDefinitions.setPackageName(null); + listOfModelDefinitions.setPackageName(CompConstants.shortLabel); + listOfModelDefinitions.setSBaseListType(ListOf.Type.other); + } if (extendedSBase != null) { extendedSBase.registerChild(this.listOfModelDefinitions); } Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -355,7 +355,11 @@ } else { listOfReplacedElements = new ListOf<ReplacedElement>(); } - listOfReplacedElements.setNamespace(CompConstants.namespaceURI); + listOfReplacedElements.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfReplacedElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfReplacedElements.setPackageName(null); + listOfReplacedElements.setPackageName(CompConstants.shortLabel); listOfReplacedElements.setSBaseListType(ListOf.Type.other); if (extendedSBase != null) { extendedSBase.registerChild(listOfReplacedElements); @@ -384,6 +388,16 @@ public void setListOfReplacedElements(ListOf<ReplacedElement> listOfReplacedElements) { unsetListOfReplacedElements(); this.listOfReplacedElements = listOfReplacedElements; + + if (listOfReplacedElements != null) { + listOfReplacedElements.unsetNamespace(); + listOfReplacedElements.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfReplacedElements.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfReplacedElements.setPackageName(null); + listOfReplacedElements.setPackageName(CompConstants.shortLabel); + listOfReplacedElements.setSBaseListType(ListOf.Type.other); + } if (extendedSBase != null) { extendedSBase.registerChild(this.listOfReplacedElements); } Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Submodel.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Submodel.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Submodel.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -452,7 +452,10 @@ public ListOf<Deletion> getListOfDeletions() { if (!isSetListOfDeletions()) { listOfDeletions = new ListOf<Deletion>(getLevel(), getVersion()); - listOfDeletions.setNamespace(CompConstants.namespaceURI); + listOfDeletions.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDeletions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfDeletions.setPackageName(CompConstants.shortLabel); listOfDeletions.setSBaseListType(ListOf.Type.other); registerChild(listOfDeletions); } @@ -472,6 +475,17 @@ public void setListOfDeletions(ListOf<Deletion> listOfDeletions) { unsetListOfDeletions(); this.listOfDeletions = listOfDeletions; + + if ((listOfDeletions != null)) { + listOfDeletions.setSBaseListType(ListOf.Type.other); + listOfDeletions.unsetNamespace(); + listOfDeletions.setNamespace(CompConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDeletions.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'comp' + listOfDeletions.setPackageName(null); + listOfDeletions.setPackageName(CompConstants.shortLabel); + } + registerChild(this.listOfDeletions); } Modified: trunk/extensions/distrib/src/org/sbml/jsbml/ext/distrib/DrawFromDistribution.java =================================================================== --- trunk/extensions/distrib/src/org/sbml/jsbml/ext/distrib/DrawFromDistribution.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/extensions/distrib/src/org/sbml/jsbml/ext/distrib/DrawFromDistribution.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -246,7 +246,11 @@ public ListOf<DistribInput> getListOfDistribInputs() { if (!isSetListOfDistribInputs()) { listOfDistribInputs = new ListOf<DistribInput>(); - listOfDistribInputs.setNamespace(DistribConstants.namespaceURI); + listOfDistribInputs.setNamespace(DistribConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDistribInputs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'distrib' + listOfDistribInputs.setPackageName(null); + listOfDistribInputs.setPackageName(DistribConstants.shortLabel); listOfDistribInputs.setSBaseListType(ListOf.Type.other); registerChild(listOfDistribInputs); @@ -264,8 +268,17 @@ public void setListOfDistribInputs(ListOf<DistribInput> listOfDistribInputs) { unsetListOfDistribInputs(); this.listOfDistribInputs = listOfDistribInputs; - this.listOfDistribInputs.setSBaseListType(ListOf.Type.other); + if (listOfDistribInputs != null) { + listOfDistribInputs.unsetNamespace(); + listOfDistribInputs.setNamespace(DistribConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfDistribInputs.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'distrib' + listOfDistribInputs.setPackageName(null); + listOfDistribInputs.setPackageName(DistribConstants.shortLabel); + listOfDistribInputs.setSBaseListType(ListOf.Type.other); + } + registerChild(listOfDistribInputs); } Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -369,7 +369,11 @@ public ListOf<FluxBound> getListOfFluxBounds() { if (!isSetListOfFluxBounds()) { listOfFluxBounds = new ListOf<FluxBound>(); - listOfFluxBounds.setNamespace(FBCConstants.namespaceURI); + listOfFluxBounds.setNamespace(FBCConstants.namespaceURI_L3V1V1); // TODO - removed once the mechanism are in place to set package version and namespace + listOfFluxBounds.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'fbc' + listOfFluxBounds.setPackageName(null); + listOfFluxBounds.setPackageName(FBCConstants.shortLabel); listOfFluxBounds.setSBaseListType(ListOf.Type.other); if (isSetExtendedSBase()) { @@ -387,9 +391,13 @@ public ListOf<GeneProduct> getListOfGeneProducts() { if (!isSetListOfGeneProducts()) { listOfGeneProducts = new ListOf<GeneProduct>(); - listOfGeneProducts.setNamespace(FBCConstants.namespaceURI); + listOfGeneProducts.setNamespace(FBCConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGeneProducts.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'fbc' + listOfGeneProducts.setPackageName(null); + listOfGeneProducts.setPackageName(FBCConstants.shortLabel); listOfGeneProducts.setSBaseListType(ListOf.Type.other); - // TODO - if the class containing this code is not of type SBasePlugin, replace the 3 lines by just "registerChild(listOfGeneProducts);" + if (isSetExtendedSBase()) { extendedSBase.registerChild(listOfGeneProducts); } @@ -406,8 +414,6 @@ public ListOfObjectives getListOfObjectives() { if (!isSetListOfObjectives()) { listOfObjectives = new ListOfObjectives(); - listOfObjectives.setNamespace(FBCConstants.namespaceURI); - listOfObjectives.setSBaseListType(ListOf.Type.other); if (isSetExtendedSBase()) { extendedSBase.registerChild(listOfObjectives); @@ -697,6 +703,16 @@ unsetListOfFluxBounds(); this.listOfFluxBounds = listOfFluxBounds; + if (listOfFluxBounds != null) { + listOfFluxBounds.unsetNamespace(); + listOfFluxBounds.setNamespace(FBCConstants.namespaceURI_L3V1V1); // TODO - removed once the mechanism are in place to set package version and namespace + listOfFluxBounds.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'fbc' + listOfFluxBounds.setPackageName(null); + listOfFluxBounds.setPackageName(FBCConstants.shortLabel); + listOfFluxBounds.setSBaseListType(ListOf.Type.other); + } + if (isSetExtendedSBase()) { extendedSBase.registerChild(this.listOfFluxBounds); } @@ -711,8 +727,17 @@ public void setListOfGeneProducts(ListOf<GeneProduct> listOfGeneProducts) { unsetListOfGeneProducts(); this.listOfGeneProducts = listOfGeneProducts; - this.listOfGeneProducts.setSBaseListType(ListOf.Type.other); - // TODO - if the class containing this code is not of type SBasePlugin, replace the 3 lines by just "registerChild(listOfGeneProducts);" + + if (listOfGeneProducts != null) { + listOfGeneProducts.unsetNamespace(); + listOfGeneProducts.setNamespace(FBCConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + listOfGeneProducts.setPackageVersion(-1); + // changing the ListOf package name from 'core' to 'fbc' + listOfGeneProducts.setPackageName(null); + listOfGeneProducts.setPackageName(FBCConstants.shortLabel); + listOfGeneProducts.setSBaseListType(ListOf.Type.other); + } + if (isSetExtendedSBase()) { extendedSBase.registerChild(this.listOfGeneProducts); } Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -89,6 +89,7 @@ setNamespace(FBCConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace setPackageVersion(-1); packageName = FBCConstants.shortLabel; + setSBaseListType(ListOf.Type.other); } Modified: trunk/test/org/sbml/jsbml/test/AllTests.java =================================================================== --- trunk/test/org/sbml/jsbml/test/AllTests.java 2015-03-26 17:16:22 UTC (rev 2164) +++ trunk/test/org/sbml/jsbml/test/AllTests.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -42,7 +42,8 @@ */ @RunWith(value=Suite.class) @SuiteClasses(value={Tests.class, LibsbmlCompatibilityTests.class, LayoutJUnitTests.class, RenderJUnitTests.class, - UnregisterPackageTests.class, ArraysJUnitTests.class, DisablePackageTests.class, TestL3Dyn.class}) + UnregisterPackageTests.class, ArraysJUnitTests.class, DisablePackageTests.class, TestL3Dyn.class, + PackageVersionTests.class}) public class AllTests { /** Added: trunk/test/org/sbml/jsbml/test/PackageVersionTests.java =================================================================== --- trunk/test/org/sbml/jsbml/test/PackageVersionTests.java (rev 0) +++ trunk/test/org/sbml/jsbml/test/PackageVersionTests.java 2015-03-30 16:11:24 UTC (rev 2165) @@ -0,0 +1,126 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2014 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ + +package org.sbml.jsbml.test; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.sbml.jsbml.FunctionDefinition; +import org.sbml.jsbml.ListOf; +import org.sbml.jsbml.Model; +import org.sbml.jsbml.SBMLDocument; +import org.sbml.jsbml.ext.comp.CompConstants; +import org.sbml.jsbml.ext.distrib.DistribConstants; +import org.sbml.jsbml.ext.distrib.util.DistribModelBuilder; +import org.sbml.jsbml.ext.fbc.FBCConstants; +import org.sbml.jsbml.ext.fbc.FBCModelPlugin; +import org.sbml.jsbml.ext.fbc.FluxBound; +import org.sbml.jsbml.ext.fbc.Objective; +import org.sbml.jsbml.ext.qual.QualConstants; +import org.sbml.jsbml.xml.parsers.PackageUtil; + + +@SuppressWarnings("deprecation") +public class PackageVersionTests { + + private SBMLDocument doc; + private Model m; + + /** + * + */ + @BeforeClass public static void initialSetUp() {} + /** + * + */ + @Before public void setUp() { + doc = new SBMLDocument(3, 1); + + doc.enablePackage(FBCConstants.namespaceURI_L3V1V1); + doc.enablePackage(DistribConstants.namespaceURI_L3V1V1); + doc.enablePackage(QualConstants.namespaceURI_L3V1V1); + doc.enablePackage(CompConstants.namespaceURI_L3V1V1); + + m = doc.createModel("test"); + + m.createReaction("R1"); + m.createSpecies("S1"); + m.createSpecies("S2"); + + FBCModelPlugin fbcModel = (FBCModelPlugin) m.getPlugin("fbc"); + + FluxBound fb1 = fbcModel.createFluxBound("fb1"); + fbcModel.createFluxBound("fb2"); + + fb1.setPackageVersion(1); + + fbcModel.createObjective("fbc_O1"); + + + fb1.setReaction("R1"); + + FunctionDefinition f = m.createFunctionDefinition("f"); + DistribModelBuilder.createDistribution(f, "NormalDistribution", new String[] { "mean", "stddev" }, new String[] {"avg", "sd"}); + + // check and fix package version and namespaces + // TODO - update when jsbml will be fixed to set properly package version and namespace - now the fix is done in SBMLCoreParser#processEndDocument + PackageUtil.checkPackages(doc, false, true); + + } + + + /** + * Checks that package version and namespace are set properly for FBC version 1. + */ + @Test public void testFbcPackageVersion() { + + + FBCModelPlugin fbcModel = ((FBCModelPlugin) m.getPlugin("fbc")); + ListOf<FluxBound> fluxBounds = fbcModel.getListOfFluxBounds(); + + Assert.assertTrue(fluxBounds.getPackageVersion() == 1); + Assert.assertTrue(fluxBounds.getPackageName().equals(FBCConstants.shortLabel)); + Assert.assertTrue(fluxBounds.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); + + for (FluxBound fluxBound : fluxBounds) { + Assert.assertTrue(fluxBound.getPackageVersion() == 1); + Assert.assertTrue(fluxBound.getPackageName().equals(FBCConstants.shortLabel)); + Assert.assertTrue(fluxBound.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); + } + + ListOf<Objective> objectives = fbcModel.getListOfObjectives(); + + Assert.assertTrue(objectives.getPackageVersion() == 1); + Assert.assertTrue(objectives.getPackageName().equals(FBCConstants.shortLabel)); + Assert.assertTrue(objectives.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); + + for (Objective objective : objectives) { + Assert.assertTrue(objective.getPackageVersion() == 1); + Assert.assertTrue(objective.getPackageName().equals(FBCConstants.shortLabel)); + Assert.assertTrue(objective.getNamespace().equals(FBCConstants.namespaceURI_L3V1V1)); + } + + + } +} Property changes on: trunk/test/org/sbml/jsbml/test/PackageVersionTests.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-03-26 17:16:24
|
Revision: 2164 http://sourceforge.net/p/jsbml/code/2164 Author: andreas-draeger Date: 2015-03-26 17:16:22 +0000 (Thu, 26 Mar 2015) Log Message: ----------- Added missing JavaDoc tags and removed unnecessary warning surpression. Modified Paths: -------------- trunk/extensions/distrib/test/org/sbml/jsbml/ext/distrib/test/CreateUncertMLXMLNode.java Modified: trunk/extensions/distrib/test/org/sbml/jsbml/ext/distrib/test/CreateUncertMLXMLNode.java =================================================================== --- trunk/extensions/distrib/test/org/sbml/jsbml/ext/distrib/test/CreateUncertMLXMLNode.java 2015-03-26 17:14:31 UTC (rev 2163) +++ trunk/extensions/distrib/test/org/sbml/jsbml/ext/distrib/test/CreateUncertMLXMLNode.java 2015-03-26 17:16:22 UTC (rev 2164) @@ -19,7 +19,6 @@ * and also available online as <http://sbml.org/Software/JSBML/License>. * ---------------------------------------------------------------------------- */ - package org.sbml.jsbml.ext.distrib.test; import java.io.StringReader; @@ -44,60 +43,71 @@ import org.sbml.jsbml.xml.XMLTriple; +/** + * @author Nicolas Rdodriguez + * @version $Rev$ + * @since 1.1 + * @date 26.03.2015 + */ public class CreateUncertMLXMLNode { - - @SuppressWarnings("deprecation") + + /** + * @param args + * @throws ParseException + * @throws SBMLException + * @throws XMLStreamException + */ public static void main(String[] args) throws ParseException, SBMLException, XMLStreamException { - + String uncertML = "<UncertML xmlns=\"http://www.uncertml.org/3.0\">\n" + - " <NormalDistribution definition=\"http://www.uncertml.org/distributions\">\n" + - " <mean>\n" + - " <var varId=\"avg\"/>" + - " </mean>" + - " <stddev>" + - " <var varId=\"sd\"/>" + - " </stddev>" + - "</NormalDistribution>" + - "</UncertML>"; - + " <NormalDistribution definition=\"http://www.uncertml.org/distributions\">\n" + + " <mean>\n" + + " <var varId=\"avg\"/>" + + " </mean>" + + " <stddev>" + + " <var varId=\"sd\"/>" + + " </stddev>" + + "</NormalDistribution>" + + "</UncertML>"; + SBMLDocument doc = new SBMLDocument(3, 1); Model m = doc.createModel("m"); - + FunctionDefinition f = m.createFunctionDefinition("f"); ASTNode lambda = ASTNode.parseFormula("lamdba(x, y, x + y)", new FormulaParserLL3(new StringReader(""))); // System.out.println(lambda.toMathML()); // not sure how to create lambda from formula !! // f.setMath(lambda); - + Reaction r = m.createReaction("r"); r.createKineticLaw().setMath(ASTNode.parseFormula("f(x, y)")); - + // UncertML element XMLNode xmlNode = new XMLNode(new XMLTriple("UncertML"), new XMLAttributes(), new XMLNamespaces()); xmlNode.addNamespace("http://www.uncertml.org/3.0"); - + // NormalDistribution element XMLNode distNode = new XMLNode(new XMLTriple("NormalDistribution"), new XMLAttributes(), new XMLNamespaces()); distNode.addAttr("definition", "http://www.uncertml.org/distributions"); xmlNode.addChild(distNode); - + // mean element XMLNode meanNode = new XMLNode(new XMLTriple("mean"), new XMLAttributes(), new XMLNamespaces()); distNode.addChild(meanNode); - + // var element XMLNode varNode = new XMLNode(new XMLTriple("var"), new XMLAttributes(), new XMLNamespaces()); varNode.addAttr("varId", "avg"); - meanNode.addChild(varNode); - + meanNode.addChild(varNode); + // stddev element XMLNode stddevNode = new XMLNode(new XMLTriple("stddev"), new XMLAttributes(), new XMLNamespaces()); distNode.addChild(stddevNode); - + // var element varNode = new XMLNode(new XMLTriple("var"), new XMLAttributes(), new XMLNamespaces()); varNode.addAttr("varId", "sd"); - stddevNode.addChild(varNode); - + stddevNode.addChild(varNode); + DistribFunctionDefinitionPlugin dfd = (DistribFunctionDefinitionPlugin) f.getPlugin("distrib"); DrawFromDistribution drawfd = dfd.createDrawFromDistribution(); drawfd.setUncertML(xmlNode); @@ -105,20 +115,21 @@ FunctionDefinition g = m.createFunctionDefinition("g"); dfd = (DistribFunctionDefinitionPlugin) g.getPlugin("distrib"); drawfd = dfd.createDrawFromDistribution(); - + XMLNode uncertMLNode = XMLNode.convertStringToXMLNode(uncertML); drawfd.setUncertML(uncertMLNode); - + String docStr = new TidySBMLWriter().writeSBMLToString(doc); - + System.out.println("Document = \n" + docStr); - + SBMLDocument doc2 = new SBMLReader().readSBMLFromString(docStr); - + // System.out.println("Function f, type = " + r.getKineticLaw().getMath().getType()); - + String docStr2 = new TidySBMLWriter().writeSBMLToString(doc2); - + System.out.println(docStr.equals(docStr2)); } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |