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: <nik...@us...> - 2015-04-30 14:01:40
|
Revision: 2263 http://sourceforge.net/p/jsbml/code/2263 Author: niko-rodrigue Date: 2015-04-30 14:01:37 +0000 (Thu, 30 Apr 2015) Log Message: ----------- working on being able to buid a jar file that would use the old ASTNode class Modified Paths: -------------- branches/astnode2-merging-alternate/build.xml branches/astnode2-merging-alternate/core/build.xml branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/AbstractTreeNode.java Added Paths: ----------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode Removed Paths: ------------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java.mine branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java.r2147 branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java.r2184 branches/astnode2-merging-alternate/test/org/sbml/jsbml/test/AllTests.java.mine branches/astnode2-merging-alternate/test/org/sbml/jsbml/test/AllTests.java.r2147 branches/astnode2-merging-alternate/test/org/sbml/jsbml/test/AllTests.java.r2184 Modified: branches/astnode2-merging-alternate/build.xml =================================================================== --- branches/astnode2-merging-alternate/build.xml 2015-04-25 08:58:06 UTC (rev 2262) +++ branches/astnode2-merging-alternate/build.xml 2015-04-30 14:01:37 UTC (rev 2263) @@ -176,9 +176,12 @@ <property name="prepare.src.target.done" value="true"/> + <echo message="Value of the use-old-astnode property = '${use.old.astnodes}'"/> + <ant dir="${core.base.dir}" inheritAll="false" inheritRefs="false"> - <target name="clean" /> - <target name="jar" /> + <property name="use.old.astnodes" value="${use.old.astnodes}"/> + <target name="clean" /> + <target name="jar" /> </ant> <copy todir="${build.src}"> Modified: branches/astnode2-merging-alternate/core/build.xml =================================================================== --- branches/astnode2-merging-alternate/core/build.xml 2015-04-25 08:58:06 UTC (rev 2262) +++ branches/astnode2-merging-alternate/core/build.xml 2015-04-30 14:01:37 UTC (rev 2263) @@ -186,10 +186,28 @@ excludes="**/.svn*, **/*~, **/*.tgz, **/*.zip"> </fileset> </copy> + + <echo message="Value of the use-old-astnode property in core = '${use.old.astnodes}'"/> + <antcall target="prepare-old-astnode" inheritrefs="true" inheritall="true"/> </target> + <!-- =================================================================== --> + <!-- Prepares the source code to use the old ASTNode class --> + <!-- =================================================================== --> + <target + name="prepare-old-astnode" + description="Prepares the source code to use the old ASTNode class" + if="${use.old.astnodes}" + > + <echo message="Building JSBML core using the old ASTNode class!"/> + <copy file="${build.src}/org/sbml/jsbml/ASTNode.java.oldASTNode" tofile="${build.src}/org/sbml/jsbml/ASTNode.java.newASTNode" overwrite="yes"/> + <copy file="${build.src}/org/sbml/jsbml/ASTNode.java.oldASTNode" tofile="${build.src}/org/sbml/jsbml/ASTNode.java" overwrite="yes"/> + <property name="version" value="${version}-oldASTNode"/> + + </target> + <!-- =================================================================== --> <!-- Modify some files --> <!-- =================================================================== --> @@ -283,6 +301,9 @@ </fileset> </copy> <jar jarfile="${build.dir}/${name}-${version}.jar" basedir="${build.dest}" manifest="${build.dest}/META-INF/MANIFEST.MF"/> + + <echo message="Value of the use-old-astnode property in core = '${use.old.astnodes}'"/> + <antcall target="revert-old-astnode" inheritrefs="true" inheritall="true"/> </target> <!-- =================================================================== --> @@ -351,7 +372,21 @@ </jar> </target> + <!-- =================================================================== --> + <!-- Revert the source code to use the new ASTNode class --> + <!-- =================================================================== --> + <target + name="revert-old-astnode" + description="Prepares the source code to use the new ASTNode class" + if="${use.old.astnodes}" + > + <echo message="Reverting JSBML core using the new ASTNode class!"/> + <copy file="${build.src}/org/sbml/jsbml/ASTNode.java.newASTNode" tofile="${build.src}/org/sbml/jsbml/ASTNode.java" overwrite="yes"/> + <property name="version" value="${version}-oldASTNode"/> + + </target> + <!-- =================================================================== --> <!-- Test the jsbml library --> <!-- =================================================================== --> Deleted: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java.mine =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java.mine 2015-04-25 08:58:06 UTC (rev 2262) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java.mine 2015-04-30 14:01:37 UTC (rev 2263) @@ -1,4315 +0,0 @@ -/* - * $Id: ASTNode.java 2157 2015-03-25 14:00:27Z niko-rodrigue $ - * $URL: svn://svn.code.sf.net/p/jsbml/code/trunk/core/src/org/sbml/jsbml/ASTNode.java $ - * ---------------------------------------------------------------------------- - * 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; - -import java.io.StringReader; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import javax.swing.tree.TreeNode; -import javax.xml.stream.XMLStreamException; - -import org.apache.log4j.Logger; -import org.sbml.jsbml.Unit.Kind; -import org.sbml.jsbml.math.ASTArithmeticOperatorNode; -import org.sbml.jsbml.math.ASTBinaryFunctionNode; -import org.sbml.jsbml.math.ASTBoolean; -import org.sbml.jsbml.math.ASTCSymbolAvogadroNode; -import org.sbml.jsbml.math.ASTCSymbolBaseNode; -import org.sbml.jsbml.math.ASTCSymbolDelayNode; -import org.sbml.jsbml.math.ASTCSymbolNode; -import org.sbml.jsbml.math.ASTCSymbolTimeNode; -import org.sbml.jsbml.math.ASTCiFunctionNode; -import org.sbml.jsbml.math.ASTCiNumberNode; -import org.sbml.jsbml.math.ASTCnExponentialNode; -import org.sbml.jsbml.math.ASTCnIntegerNode; -import org.sbml.jsbml.math.ASTCnNumberNode; -import org.sbml.jsbml.math.ASTCnRationalNode; -import org.sbml.jsbml.math.ASTCnRealNode; -import org.sbml.jsbml.math.ASTConstantNumber; -import org.sbml.jsbml.math.ASTDivideNode; -import org.sbml.jsbml.math.ASTFactory; -import org.sbml.jsbml.math.ASTFunction; -import org.sbml.jsbml.math.ASTHyperbolicNode; -import org.sbml.jsbml.math.ASTLambdaFunctionNode; -import org.sbml.jsbml.math.ASTLogarithmNode; -import org.sbml.jsbml.math.ASTLogicalOperatorNode; -import org.sbml.jsbml.math.ASTMinusNode; -import org.sbml.jsbml.math.ASTNode2; -import org.sbml.jsbml.math.ASTPiecewiseFunctionNode; -import org.sbml.jsbml.math.ASTPlusNode; -import org.sbml.jsbml.math.ASTPowerNode; -import org.sbml.jsbml.math.ASTQualifierNode; -import org.sbml.jsbml.math.ASTRelationalOperatorNode; -import org.sbml.jsbml.math.ASTRootNode; -import org.sbml.jsbml.math.ASTTimesNode; -import org.sbml.jsbml.math.ASTTrigonometricNode; -import org.sbml.jsbml.math.ASTUnaryFunctionNode; -import org.sbml.jsbml.math.ASTUnknown; -import org.sbml.jsbml.math.compiler.ASTNode2Compiler; -import org.sbml.jsbml.math.compiler.ASTNode2Value; -import org.sbml.jsbml.math.compiler.MathMLXMLStreamCompiler; -import org.sbml.jsbml.text.parser.FormulaParser; -import org.sbml.jsbml.text.parser.FormulaParserLL3; -import org.sbml.jsbml.text.parser.IFormulaParser; -import org.sbml.jsbml.text.parser.ParseException; -import org.sbml.jsbml.util.compilers.ASTNodeCompiler; -import org.sbml.jsbml.util.compilers.ASTNodeValue; -import org.sbml.jsbml.util.compilers.FormulaCompiler; -import org.sbml.jsbml.util.compilers.FormulaCompilerLibSBML; -import org.sbml.jsbml.util.compilers.LaTeXCompiler; -import org.sbml.jsbml.util.filters.Filter; -import org.sbml.jsbml.xml.stax.SBMLReader; - -/** - * A node in the Abstract Syntax Tree (AST) representation of a mathematical - * expression. - * - * @author Andreas Dräger - * @author Nicolas Rodriguez - * @author Alexander Dörr - * @since 0.8 - * @version $Rev: 2157 $ - */ -public class ASTNode extends AbstractTreeNode { - - /** - * An enumeration of all possible types that can be represented by an abstract - * syntax tree node. - * - * @author Andreas Dräger - * - */ - public static enum Type { - /** - * If the {@link ASTNode} represents Euler's constant, it should have this - * {@link Type}. - */ - CONSTANT_E, - /** - * If an {@link ASTNode} represents the {@link Boolean} attribute - * {@link Boolean#FALSE} it should have this {@link Type}. - */ - CONSTANT_FALSE, - /** - * If the {@link ASTNode} represents the constant π, it should have - * this {@link Type}. - */ - CONSTANT_PI, - /** - * - */ - CONSTANT_TRUE, - /** - * - */ - CONSTRUCTOR_PIECE, - /** - * - */ - CONSTRUCTOR_OTHERWISE, - /** - * - */ - DIVIDE, - /** - * The type of an {@link ASTNode} containing a reference to a user-defined - * {@link FunctionDefinition}. - */ - FUNCTION, - /** - * - */ - FUNCTION_ABS, - /** - * - */ - FUNCTION_ARCCOS, - /** - * - */ - FUNCTION_ARCCOSH, - /** - * - */ - FUNCTION_ARCCOT, - /** - * - */ - FUNCTION_ARCCOTH, - /** - * - */ - FUNCTION_ARCCSC, - /** - * - */ - FUNCTION_ARCCSCH, - /** - * - */ - FUNCTION_ARCSEC, - /** - * - */ - FUNCTION_ARCSECH, - /** - * - */ - FUNCTION_ARCSIN, - /** - * - */ - FUNCTION_ARCSINH, - /** - * - */ - FUNCTION_ARCTAN, - /** - * - */ - FUNCTION_ARCTANH, - /** - * - */ - FUNCTION_CEILING, - /** - * - */ - FUNCTION_COS, - /** - * - */ - FUNCTION_COSH, - /** - * - */ - FUNCTION_COT, - /** - * - */ - FUNCTION_COTH, - /** - * - */ - FUNCTION_CSC, - /** - * - */ - FUNCTION_CSCH, - /** - * - */ - FUNCTION_DELAY, - /** - * - */ - FUNCTION_EXP, - /** - * - */ - FUNCTION_FACTORIAL, - /** - * - */ - FUNCTION_FLOOR, - /** - * - */ - FUNCTION_LN, - /** - * - */ - FUNCTION_LOG, - /** - * - */ - FUNCTION_PIECEWISE, - /** - * An {@link ASTNode} of this {@link Type} represents a function call of the - * 'pow' function. This function takes two arguments, the base and the - * exponent. Alternatively, also {@link Type#POWER} can be used, which - * represents the simple text symbol '^' to achieve the same effect. - */ - FUNCTION_POWER, - /** - * - */ - FUNCTION_ROOT, - /** - * - */ - FUNCTION_SEC, - /** - * - */ - FUNCTION_SECH, - /** - * - */ - FUNCTION_SELECTOR, - /** - * - */ - FUNCTION_SIN, - /** - * - */ - FUNCTION_SINH, - /** - * - */ - FUNCTION_TAN, - /** - * - */ - FUNCTION_TANH, - /** - * - */ - INTEGER, - /** - * This type describes function definitions: The first n children of a node - * of this type are the arguments, and the last child is the function body. - */ - LAMBDA, - /** - * - */ - LOGICAL_AND, - /** - * - */ - LOGICAL_NOT, - /** - * - */ - LOGICAL_OR, - /** - * - */ - LOGICAL_XOR, - /** - * - */ - MINUS, - /** - * {@link ASTNode}s of this {@link Type} refer to a {@link CallableSBase}. - */ - NAME, - /** - * A type to express Avogadro's number. - */ - NAME_AVOGADRO, - /** - * - */ - NAME_TIME, - /** - * - */ - PLUS, - /** - * This {@link Type} represents an operation with two children: a base and - * an exponent. In textual form, this type is represented by the symbol '^'. - */ - POWER, - /** - * - */ - PRODUCT, - /** - * - */ - QUALIFIER_BVAR, - /** - * - */ - QUALIFIER_DEGREE, - /** - * - */ - QUALIFIER_LOGBASE, - /** - * An {@link ASTNode} of this {@link Type} contains two integer values: a - * numerator and a denominator. - */ - RATIONAL, - /** - * {@link Type} of an {@link ASTNode} that represents a single real value, - * i.e., a double number. - */ - REAL, - /** - * {@link Type} of an {@link ASTNode} with a real value that is split in a - * double mantissa and an integer exponent. - */ - REAL_E, - /** - * An {@link ASTNode} of this {@link Type} represents the relation symbol - * '=' to compare the values of all of its successors in the tree for - * equality. - */ - RELATIONAL_EQ, - /** - * Greater or equal - */ - RELATIONAL_GEQ, - /** - * Greater than - */ - RELATIONAL_GT, - /** - * Less or equal - */ - RELATIONAL_LEQ, - /** - * Less than - */ - RELATIONAL_LT, - /** - * Not equal - */ - RELATIONAL_NEQ, - /** - * - */ - SUM, - /** - * - */ - TIMES, - /** - * - */ - UNKNOWN, - /** - * - */ - VECTOR; - - /** - * Returns the {@link Type} corresponding to the given {@link String}. - * - * @param type - * e.g., sin, asin, exp, and so on. See the specification of the - * MathML subset used in SBML. - * @return The type corresponding to the given {@link String} or - * {@link #UNKNOWN} if no matching can be found. - */ - public static Type getTypeFor(String type) { - // Arithmetic operators - if (type.equals("plus")) { - return PLUS; - } else if (type.equals("minus")) { - return MINUS; - } else if (type.equals("times")) { - return TIMES; - } else if (type.equals("divide")) { - return DIVIDE; - } else if (type.equals("power")) { - return FUNCTION_POWER; - } else if (type.equals("root")) { - return FUNCTION_ROOT; - } else if (type.equals("abs")) { - return FUNCTION_ABS; - } else if (type.equals("exp")) { - return FUNCTION_EXP; - } else if (type.equals("ln")) { - return FUNCTION_LN; - } else if (type.equals("log")) { - return FUNCTION_LOG; - } else if (type.equals("floor")) { - return FUNCTION_FLOOR; - } else if (type.equals("ceiling")) { - return FUNCTION_CEILING; - } else if (type.equals("factorial")) { - return FUNCTION_FACTORIAL; - } - - // Logical operators - else if (type.equals("and") || type.equals("&&")) { - return LOGICAL_AND; - } else if (type.equals("or") || type.equals("||")) { - return LOGICAL_OR; - } else if (type.equals("xor")) { - return LOGICAL_XOR; - } else if (type.equals("not") || type.equals("!")) { - return LOGICAL_NOT; - } - - // Trigonometric operators - else if (type.equals("cos")) { - return FUNCTION_COS; - } else if (type.equals("sin")) { - return FUNCTION_SIN; - } else if (type.equals("tan")) { - return FUNCTION_TAN; - } else if (type.equals("sec")) { - return FUNCTION_SEC; - } else if (type.equals("csc")) { - return FUNCTION_CSC; - } else if (type.equals("cot")) { - return FUNCTION_COT; - } else if (type.equals("sinh")) { - return FUNCTION_SINH; - } else if (type.equals("cosh")) { - return FUNCTION_COSH; - } else if (type.equals("tanh")) { - return FUNCTION_TANH; - } else if (type.equals("sech")) { - return FUNCTION_SECH; - } else if (type.equals("csch")) { - return FUNCTION_CSCH; - } else if (type.equals("coth")) { - return FUNCTION_COTH; - } else if (type.equals("arcsin")) { - return FUNCTION_ARCSIN; - } else if (type.equals("arccos")) { - return FUNCTION_ARCCOS; - } else if (type.equals("arctan")) { - return FUNCTION_ARCTAN; - } else if (type.equals("arcsec")) { - return FUNCTION_ARCSEC; - } else if (type.equals("arccsc")) { - return FUNCTION_ARCCSC; - } else if (type.equals("arccot")) { - return FUNCTION_ARCCOT; - } else if (type.equals("arcsinh")) { - return FUNCTION_ARCSINH; - } else if (type.equals("arccosh")) { - return FUNCTION_ARCCOSH; - } else if (type.equals("arctanh")) { - return FUNCTION_ARCTANH; - } else if (type.equals("arcsech")) { - return FUNCTION_ARCSECH; - } else if (type.equals("arccsch")) { - return FUNCTION_ARCCSCH; - } else if (type.equals("arccoth")) { - return FUNCTION_ARCCOTH; - } - - // Relational operators - else if (type.equals("eq") || type.equals("=")) { - return RELATIONAL_EQ; - } else if (type.equals("neq") || type.equals("!")) { - return RELATIONAL_NEQ; - } else if (type.equals("gt") || type.equals(">")) { - return RELATIONAL_GT; - } else if (type.equals("lt") || type.equals("<")) { - return RELATIONAL_LT; - } else if (type.equals("geq") || type.equals(">=")) { - return RELATIONAL_GEQ; - } else if (type.equals("leq") || type.equals("<=")) { - return RELATIONAL_LEQ; - } - // token: cn, ci, csymbol, sep - // for ci, we have to check if it is a functionDefinition - // for cn, we pass the type attribute to this function to determine the - // proper astNode type - // for csymbol, we pass the definitionURL - else if (type.equalsIgnoreCase("real") || type.equalsIgnoreCase("cn")) { - // we put the type by default to real in case the type attribute is - // not define on the cn element. - return REAL; - } else if (type.equalsIgnoreCase("integer")) { - return INTEGER; - } else if (type.equalsIgnoreCase("e-notation")) { - return REAL_E; - } else if (type.equalsIgnoreCase("rational")) { - return RATIONAL; - } else if (type.equals("ci")) { - return NAME; - } else if (type.equals("csymbol")) { - return UNKNOWN; - } else if (type.equals("sep")) { - return UNKNOWN; - } else if (type.equals(ASTNode.URI_TIME_DEFINITION)) { - return NAME_TIME; - } else if (type.equals(ASTNode.URI_DELAY_DEFINITION)) { - return FUNCTION_DELAY; - } else if (type.equals(ASTNode.URI_AVOGADRO_DEFINITION)) { - return NAME_AVOGADRO; - } - - // general: apply, piecewise, piece, otherwise, lambda, bvar - else if (type.equals("lambda")) { - return LAMBDA; - } else if (type.equals("bvar")) { - // nothing to do, node ignore when parsing - } else if (type.equals("piecewise")) { - return FUNCTION_PIECEWISE; - } else if (type.equals("piece")) { - // nothing to do, node ignore when parsing - } else if (type.equals("otherwise")) { - // nothing to do, node ignore when parsing - } - - // qualifiers: degree, logbase - else if (type.equals("degree")) { - // nothing to do, node ignore when parsing - } else if (type.equals("logbase")) { - // nothing to do, node ignore when parsing - } - - // constants: true, false, notanumber, pi, infinity, exponentiale - else if (type.equals("true")) { - return CONSTANT_TRUE; - } else if (type.equals("false")) { - return CONSTANT_FALSE; - } else if (type.equals("notanumber")) { - return REAL; - } else if (type.equals("pi")) { - return CONSTANT_PI; - } else if (type.equals("infinity")) { - return REAL; - } else if (type.equals("exponentiale")) { - return CONSTANT_E; - } - - // arrays package additional mathML elements - else if (type.equals("selector")) { - return FUNCTION_SELECTOR; - } else if (type.equals("vector")) { - return VECTOR; - } - - // TODO: possible annotations: semantics, annotation, annotation-xml - - return UNKNOWN; - } - - /** - * Checks whether this type is valid for the given SBML Level/Version - * combination. - * - * @jsbml.warning this method is not implemented - * - * @param level - * @param version - * @return whether this type is valid for the given SBML Level/Version - * combination. - */ - public boolean isDefinedIn(int level, int version) { - // TODO - return false; - } - - } - - /** - * Message to indicate that an {@link ASTNode.Type} type has been chosen which - * cannot be used as an operator. - */ - public static final transient String INVALID_OPERATOR_MSG = "Invalid operator %s. The operator must be one of the following constants: PLUS, MINUS, TIMES, DIVIDE, or POWER."; - - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = -1391327698196553142L; - - /** - * The URI for the definition of the csymbol for avogadro. - */ - public static final transient String URI_AVOGADRO_DEFINITION = "http://www.sbml.org/sbml/symbols/avogadro"; - - /** - * The URI for the definition of the csymbol for delay. - */ - public static final transient String URI_DELAY_DEFINITION = "http://www.sbml.org/sbml/symbols/delay"; - - /** - * URI for the definition of MathML. - */ - public static final transient String URI_MATHML_DEFINITION = "http://www.w3.org/1998/Math/MathML"; - - // TODO: check how we set the math in level 1 - - /** - * URI prefix for the definition of MathML, it will be used to write the sbml - * file - */ - public static final String URI_MATHML_PREFIX = ""; - - /** - * The URI for the definition of the csymbol for time. - */ - public static final transient String URI_TIME_DEFINITION = "http://www.sbml.org/sbml/symbols/time"; - - /** - * Creates and returns an {@link ASTNode} that computes the absolute value of - * the given double value. - * - * @param d - * a double value - * @param parent - * the parent {@link ASTNode} - * @return an {@link ASTNode} that computes the absolute value of the given - * double value. - */ - public static ASTNode abs(double d, MathContainer parent) { - ASTUnaryFunctionNode node = new ASTUnaryFunctionNode(Type.FUNCTION_ABS); - node.addChild(new ASTCnRealNode(d)); - node.setParentSBMLObject(parent); - return new ASTNode(node); - } - - /** - * Creates and returns an {@link ASTNode} that computes the absolute value of - * the given integer value. - * - * @param integer - * an integer value - * @param parent - * the parent {@link ASTNode} - * @return an {@link ASTNode} that computes the absolute value of the given - * integer value. - */ - public static ASTNode abs(int integer, MathContainer parent) { - ASTUnaryFunctionNode node = new ASTUnaryFunctionNode(Type.FUNCTION_ABS); - node.addChild(new ASTCnIntegerNode(integer)); - node.setParentSBMLObject(parent); - return new ASTNode(node); - } - - /** - * Creates a new {@link ASTNode} of type {@code operator} and adds the given - * nodes as children. - * - * @param operator - * the type of arithmetic operation - * @param ast - * the children of the new ASTNode - * @return a new {@link ASTNode} of type {@code operator} and adds the given - * nodes as children. - */ - private static ASTNode arithmeticOperation(Type operator, ASTNode... ast) { - ASTNode2[] list = new ASTNode2[ast.length]; - for (int i = 0; i < ast.length; i++) { - list[i] = ast[i].toASTNode2(); - } - return new ASTNode(ASTFactory.arithmeticOperation(operator, list)); - } - - /** - * Creates a new {@link ASTNode} of type MINUS and adds the given nodes as - * children - * - * @param ast - * the children of the new ASTNode - * @return a new {@link ASTNode} of type MINUS and adds the given nodes as - * children - */ - public static ASTNode diff(ASTNode... ast) { - ASTNode2[] ast2 = new ASTNode2[ast.length]; - for (int i = 0; i < ast.length; i++) { - ast2[i] = ast[i].toASTNode2(); - } - ASTNode node = null; - if (ast.length == 2) { - node = new ASTNode(ASTFactory.minus(ast2[0], ast2[1])); - } else { - node = new ASTNode(ASTFactory.diff(ast2)); - } - return node; - } - - /** - * Creates a new {@link ASTNode} of type RELATIONAL_EQ. - * - * @param left - * the left child. - * @param right - * the right child. - * @return a new {@link ASTNode} of type RELATIONAL_EQ. - */ - public static ASTNode eq(ASTNode left, ASTNode right) { - return new ASTNode(ASTFactory.eq(left.toASTNode2(), right.toASTNode2())); - } - - /** - * Returns a new {@link ASTNode} that represents Euler's constant raised by - * the power of the given exponent. - * - * @param exponent - * the exponent - * @return a new {@link ASTNode} that represents Euler's constant raised by - * the power of the given exponent. - */ - public static ASTNode exp(ASTNode exponent) { - return new ASTNode(ASTFactory.exp(exponent.toASTNode2())); - } - - /** - * Returns the formula from the given ASTNode as an SBML Level 1 text-string - * mathematical formula. - * - * - * @param tree - * the root of the ASTNode formula expression tree - * @return the formula from the given AST as an SBML Level 1 text-string - * mathematical formula. The caller owns the returned string and is - * responsible for freeing it when it is no longer needed. - * {@code null} is returned if the given argument is {@code null}. - * @throws SBMLException - * @see #toFormula() - * - */ - public static String formulaToString(ASTNode tree) throws SBMLException { - return tree.toFormula(); - } - - /** - * Creates a new {@link ASTNode} of type DIVIDE with the given nodes as - * children. - * - * @param numerator - * the numerator - * @param denominator - * the denominator - * @return a new {@link ASTNode} of type DIVIDE with the given nodes as - * children. - */ - public static ASTNode frac(ASTNode numerator, ASTNode denominator) { - return new ASTNode(ASTFactory.frac(numerator.toASTNode2(), - denominator.toASTNode2())); - } - - /** - * Creates a new {@link ASTNode} that of type DIVIDE with the given numerator - * and denominator. - * - * @param numerator - * the numerator - * @param denominator - * the denominator - * @return a new {@link ASTNode} that of type DIVIDE with the given numerator - * and denominator. - */ - public static ASTNode frac(int numerator, ASTNode denominator) { - return frac(new ASTNode(numerator, denominator.getParentSBMLObject()), - denominator); - } - - /** - * Creates a new {@link ASTNode} that divides two {@link CallableSBase} - * objects. - * - * @param container - * the parent object - * @param numerator - * the numerator - * @param denominator - * the denominator - * @return a new {@link ASTNode} that divides two {@link CallableSBase} - * objects. - */ - public static ASTNode frac(MathContainer container, CallableSBase numerator, - CallableSBase denominator) { - return frac(new ASTNode(numerator, container), new ASTNode(denominator, - container)); - } - - /** - * Returns a new {@link ASTNode} that of type DIVIDE with the two entities as - * numerator and denominator. - * - * @param container - * the parent object - * @param numeratorId - * the numerator - * @param denominatorId - * the numerator - * @return a new {@link ASTNode} that of type DIVIDE with the two entities as - * numerator and denominator. - */ - public static ASTNode frac(MathContainer container, String numeratorId, - String denominatorId) { - return frac(new ASTNode(numeratorId, container), new ASTNode(denominatorId, - container)); - } - - /** - * Creates an {@link ASTNode} representing greater or equal for the two given - * nodes. - * - * @param left - * the left child. - * @param right - * the right child. - * @return an {@link ASTNode} representing greater or equal. - */ - public static ASTNode geq(ASTNode left, ASTNode right) { - return new ASTNode(ASTFactory.geq(left.toASTNode2(), right.toASTNode2())); - } - - /** - * Creates an {@link ASTNode} representing greater than for the two given left - * and right child. - * - * @param left - * the left child. - * @param right - * the right child. - * @return an {@link ASTNode} representing greater than for the two given left - * and right child. - */ - public static ASTNode gt(ASTNode left, ASTNode right) { - return new ASTNode(ASTFactory.gt(left.toASTNode2(), right.toASTNode2())); - } - - /** - * Creates an {@link ASTNode} representing less or equal for the two given - * left and right child. - * - * @param left - * the left child. - * @param right - * the right child. - * @return an {@link ASTNode} representing less or equal for the two given - * left and right child. - */ - public static ASTNode leq(ASTNode left, ASTNode right) { - return new ASTNode(ASTFactory.leq(left.toASTNode2(), right.toASTNode2())); - } - - /** - * Creates an {@link ASTNode} representing a logarithm to base 10 of the given - * value. - * - * @param value - * the value which is the argument of the logarithm. - * @return an {@link ASTNode} representing a logarithm to base 10 of the given - * value. - */ - public static ASTNode log(ASTNode value) { - return new ASTNode(ASTFactory.log(value.toASTNode2())); - } - - /** - * Creates an {@link ASTNode} that represents the logarithm function with the - * given base and value. The parent SBML object will be taken from the - * {@link ASTNode} value. - * - * @param base - * The basis of this logarithm. Can be null; then a base of 10 will - * be assumed. - * @param value - * Must not be {@code null}. - * @return An {@link ASTNode} representing the logarithm of the given value - * with respect to the given base or to the base 10 if base is - * {@code null}. - */ - public static ASTNode log(ASTNode base, ASTNode value) { - return new ASTNode(ASTFactory.log(base.toASTNode2(), value.toASTNode2())); - } - - /** - * Creates an {@link ASTNode} that performs a less than comparison between two - * {@link ASTNode}s. The parent SBML object of the resulting node will be - * taken from the left node. - * - * @param left - * the left child. - * @param right - * the right child. - * @return an {@link ASTNode} that performs a less than comparison between two - * {@link ASTNode}s. - */ - public static ASTNode lt(ASTNode left, ASTNode right) { - return new ASTNode(ASTFactory.lt(left.toASTNode2(), right.toASTNode2())); - } - - /** - * Creates an {@link ASTNode} that performs a less than comparison between a - * variable and another {@link ASTNode}. The parent SBML object will be taken - * from the given {@link ASTNode}. - * - * @param variable - * the left child. - * @param node - * the right child. - * @return an {@link ASTNode} that performs a less than comparison between a - * variable and another {@link ASTNode}. - */ - public static ASTNode lt(String variable, ASTNode node) { - return lt(new ASTNode(variable, node.getParentSBMLObject()), node); - } - - /** - * Creates an {@link ASTNode} that performs a not equal comparison between two - * {@link ASTNode}s. - * - * @param left - * the left child. - * @param right - * the right child. - * @return an {@link ASTNode} that performs a not equal comparison between two - * {@link ASTNode}s. - */ - public static ASTNode neq(ASTNode left, ASTNode right) { - return new ASTNode(ASTFactory.neq(left.toASTNode2(), right.toASTNode2())); - } - - /** - * Parses a text-string mathematical formula and returns a representation as - * an Abstract Syntax Tree. - * - * <p> - * Support the syntax defined in {@link FormulaParserLL3} which is almost the same syntax as defined in - * <a href="http://sbml.org/Software/libSBML/docs/java-api/org/sbml/libsbml/libsbml.html#parseL3Formula(java.lang.String)"> - * the LibSBML L3 parser</a>. The things not supported for now are the units associated with numbers. - * - * <p> - * Parsing of the various MathML functions and constants are all - * case-sensitive by default: names such as - * {@code Cos} and {@code COS} are not parsed as the MathML cosine - * operator, {@code <cos>}. As well, if you have an SBML entities (species, parameter, ...) that - * has an id identical to one of the supported mathML element, the parser will interpret the String as the - * mathML element and not the SBML entity. - * - * <p> You can change this behaviour by using the {@link FormulaParserLL3#setCaseSensitive(boolean)} - * method and using the {@link ASTNode#parseFormula(String, IFormulaParser)} method instead of this one: -<p><pre><blockquote> - FormulaParserLL3 caseSensitiveParser = new FormulaParserLL3(new StringReader("")); - caseInsensitiveParser.setCaseSensitive(false); - ASTNode n = ASTNode.parseFormula("Cos(x)", caseInsensitiveParser); -</pre></blockquote></p> - * - * <p> This method has a different behaviour since JSBML-1.0 compare to JSBML-0.8. There is a different - * operator precedence, the parsing is now case sensitive for mathML elements and boolean operators are - * now differently interpreted: '&&' and '||' are used instead of 'and' and 'or'.<br> - * If you want to use the parser used in JSBML-0.8, you can do that by using the {@link FormulaParser} - * parser class and using the {@link ASTNode#parseFormula(String, IFormulaParser)} method instead of this one: -<p><pre><blockquote> - FormulaParser oldParser = new FormulaParser(new StringReader("")); - - ASTNode n = ASTNode.parseFormula("x and y", oldParser); -</pre></blockquote></p> - * - * <p> If you are not satisfied with the behavior of the existing parsers, you can create - * your own, you just need to implement the {@link IFormulaParser} interface. - * - * @param formula - * a text-string mathematical formula. - * @return an {@link ASTNode} representing the formula. - * @throws ParseException - * If the given formula is not of valid format or cannot be - * parsed for other reasons. - * @see ASTNode#parseFormula(String, IFormulaParser) - * @see FormulaParserLL3 - * @see FormulaParser - */ - public static ASTNode parseFormula(String formula) throws ParseException { - FormulaParserLL3 parser = new FormulaParserLL3(new StringReader(formula)); - ASTNode result = null; - - try { - result = parser.parse(); - } catch (Throwable e) { - // the javacc parser can throw some TokenMgrError at least - throw new ParseException(e); - } - - return result; - } - - /** - * Parses a text-string mathematical formula and returns a representation as - * an Abstract Syntax Tree. - * - * @param formula - * a text-string mathematical formula. - * @param parser - * a formula parser. - * @return an {@link ASTNode} representing the formula. - * @throws ParseException - * If the given formula is not of valid format or cannot be parsed - * for other reasons. - */ - public static ASTNode parseFormula(String formula, IFormulaParser parser) - throws ParseException { - parser.ReInit(new StringReader(formula)); - ASTNode result = null; - try { - result = parser.parse(); - } catch (Throwable e) { - // The JavaCC parser can throw a TokenMgrError at least - throw new ParseException(); - } - - return result; - } - - /** - * Creates a piecewise {@link ASTNode}. - * - * <p> - * At least one {@link ASTNode} must be given as a child. The parent SBML - * object of this first node will be the parent of the resulting - * {@link ASTNode}. - * - * @param node - * the parent SBML object of this node will be the parent of the - * resulting {@link ASTNode}. - * @param nodes - * the children of the new piecewise ASTNode - * @return a piecewise {@link ASTNode}. - */ - public static ASTNode piecewise(ASTNode node, ASTNode... nodes) { - // TODO: ASTFactory.piecewise() only accepts ASTQualifierNode[] - // A few assumptions are being made here: i.e. that every pair - // of ASTNodes in list nodes consists of a node that has a number - // type and another node that is a relational operator. - ASTQualifierNode qualifier = null; - ASTQualifierNode[] qualifiers = null; - if (node != null && nodes.length > 0) { - - // Construct PIECE node - qualifier = new ASTQualifierNode(Type.CONSTRUCTOR_PIECE); - qualifier.addChild(node.toASTNode2()); - qualifier.addChild(nodes[0].toASTNode2()); - - qualifiers = new ASTQualifierNode[(nodes.length - 2) / 2]; - int j, k = 0; - for (int i = 2; i < nodes.length; i++) { - j = i + 1; - if (j != nodes.length) { - qualifiers[k] = new ASTQualifierNode(Type.CONSTRUCTOR_PIECE); - qualifiers[k].addChild(nodes[i].toASTNode2()); - qualifiers[k].addChild(nodes[j].toASTNode2()); - } else { - qualifiers[k] = new ASTQualifierNode(Type.CONSTRUCTOR_OTHERWISE); - qualifiers[k].addChild(nodes[i].toASTNode2()); - } - k++; - } - } else { - throw new IllegalArgumentException(); - } - return new ASTNode(ASTFactory.piecewise(qualifier, qualifiers)); - } - - /** - * Creates a power {@link ASTNode}. - * - * @param basis - * the basis - * @param exponent - * the exponent - * @return a power {@link ASTNode}. - */ - public static ASTNode pow(ASTNode basis, ASTNode exponent) { - return new ASTNode( - ASTFactory.pow(basis.toASTNode2(), exponent.toASTNode2())); - } - - /** - * Creates a power {@link ASTNode}. - * - * @param basis - * the basis - * @param exponent - * the exponent - * @return a power {@link ASTNode}. - */ - public static ASTNode pow(ASTNode basis, double exponent) { - return new ASTNode(ASTFactory.pow(basis.toASTNode2(), new ASTCnRealNode( - exponent))); - } - - /** - * Creates a power {@link ASTNode}. - * - * @param basis - * the basis - * @param exponent - * the exponent - * @return a power {@link ASTNode}. - */ - public static ASTNode pow(ASTNode basis, int exponent) { - return new ASTNode(ASTFactory.pow(basis.toASTNode2(), new ASTCnIntegerNode( - exponent))); - } - - /** - * Raises the given basis by the power of the given exponent. - * - * @param container - * the parent object - * @param basis - * the basis - * @param exponent - * the exponent - * @return a power {@link ASTNode}. - */ - public static ASTNode pow(MathContainer container, CallableSBase basis, - CallableSBase exponent) { - ASTCSymbolBaseNode ciBasis = basis instanceof FunctionDefinition - ? new ASTCiFunctionNode() - : new ASTCiNumberNode(); - ciBasis.setName(basis.getId()); - ASTCSymbolBaseNode ciExponent = basis instanceof FunctionDefinition - ? new ASTCiFunctionNode() - : new ASTCiNumberNode(); - ciExponent.setName(basis.getId()); - ASTPowerNode pow = ASTFactory.pow(ciBasis, ciExponent); - pow.setParentSBMLObject(container); - return new ASTNode(pow); - } - - /** - * Reads the MathML from the given XML string. - * - * <p> - * Constructs a corresponding abstract syntax tree, and returns a pointer to - * the root of the tree. - * - * @param xml - * the MathML XML string. - * @return an {@link ASTNode} - */ - public static ASTNode readMathMLFromString(String xml) { - try { - return new SBMLReader().readMathML(xml); - } catch (XMLStreamException e) { - e.printStackTrace(); - } - - return null; - } - - /** - * Creates a relational {@link ASTNode} of the given type with the two given - * children left and right. - * <p> - * Sets the parent SBML object of all nodes to the one provided by the left - * child. - * - * @param type - * the type of relational node. - * @param left - * the left child. - * @param right - * the right child. - * @return a relational {@link ASTNode} of the given type with the two given - * children left and right. - */ - private static ASTNode relational(ASTNode.Type type, ASTNode left, - ASTNode right) { - if ((left == null) || (right == null)) { - throw new NullPointerException( - "Cannot create a relational node with null arguments."); - } - return new ASTNode(ASTFactory.relational(type, left.toASTNode2(), - right.toASTNode2())); - } - - /** - * Creates a root {@link ASTNode}. - * - * @param radicand - * the radicand - * @param rootExponent - * the exponent of the root element. - * @return a root {@link ASTNode}. - */ - public static ASTNode root(ASTNode rootExponent, ASTNode radicand) { - return new ASTNode(ASTFactory.root(rootExponent.toASTNode2(), - radicand.toASTNode2())); - } - - /** - * Sets the Parent of the node and its children to the given value - * - * @param node - * the orphan node - * @param parent - * the parent - */ - static void setParentSBMLObject(ASTNode node, MathContainer parent) { - node.toASTNode2().setParentSBMLObject(parent); - } - - /** - * Sets the parent of the node and its children to the given value - * - * @param node - * the orphan node - * @param parent - * the parent - * @param depth - * the current depth in the {@link ASTNode} tree. It is just here for - * testing purposes to track the depth in the tree during the - * process. - */ - private static void setParentSBMLObject(ASTNode node, MathContainer parent, - int depth) { - // TODO: Is using depth for testing still required? Can we remove this - // method? - setParentSBMLObject(node, parent); - } - - /** - * Creates a root {@link ASTNode}. - * - * @param radicand - * @return a root {@link ASTNode}. - */ - public static ASTNode sqrt(ASTNode radicand) { - return new ASTNode(ASTFactory.sqrt(radicand.toASTNode2())); - } - - /** - * Creates a new {@link ASTNode} of type Plus with the given nodes as - * children. - * - * @param ast - * the children nodes. - * @return a new {@link ASTNode} of type Plus with the given nodes as - * children. - */ - public static ASTNode sum(ASTNode... ast) { - ASTNode2[] ast2 = new ASTNode2[ast.length]; - for (int i = 0; i < ast.length; i++) { - ast2[i] = ast[i].toASTNode2(); - } - return new ASTNode(ASTFactory.sum(ast2)); - } - - /** - * Sum of several NamedSBase objects. - * - * @param parent - * the parent - * @param sbase - * @return the sum of several NamedSBase objects. - */ - public static ASTNode sum(MathContainer parent, CallableSBase... sbase) { - ASTCSymbolBaseNode[] ref = new ASTCSymbolBaseNode[sbase.length]; - for (int i = 0; i < sbase.length; i++) { - ref[i] = sbase[i] instanceof FunctionDefinition - ? new ASTCiFunctionNode() - : new ASTCiNumberNode(); - ref[i].setName(sbase[i].getId()); - } - ASTArithmeticOperatorNode sum = ASTFactory.sum(ref); - sum.setParentSBMLObject(parent); - return new ASTNode(sum); - } - - /** - * Creates an {@link ASTNode} of type product and adds the given nodes as - * children. - * - * @param ast - * @return an {@link ASTNode} of type product and adds the given nodes as - * children. - */ - public static ASTNode times(ASTNode... ast) { - ASTNode2[] ast2 = new ASTNode2[ast.length]; - for (int i = 0; i < ast.length; i++) { - ast2[i] = ast[i].toASTNode2(); - } - return new ASTNode(ASTFactory.product(ast2)); - } - - /** - * Multiplies several {@link CallableSBase} objects. - * - * @param parent - * @param sbase - * @return the multiplication of several {@link CallableSBase} objects. - */ - public static ASTNode times(MathContainer parent, CallableSBase... sbase) { - ASTCSymbolBaseNode[] ref = new ASTCSymbolBaseNode[sbase.length]; - for (int i = 0; i < sbase.length; i++) { - ref[i] = sbase[i] instanceof FunctionDefinition - ? new ASTCiFunctionNode() - : new ASTCiNumberNode(); - ref[i].setName(sbase[i].getId()); - } - ASTArithmeticOperatorNode times = ASTFactory.product(ref); - times.setParentSBMLObject(parent); - return new ASTNode(times); - } - - /** - * Creates a new {@link ASTNode} that has exactly one child and which is of - * type minus, i.e., this negates what is encoded in ast. - * - * @param ast - * @return a new {@link ASTNode} that has exactly one child and which is of - * type minus, i.e., this negates what is encoded in ast. - */ - public static ASTNode uMinus(ASTNode ast) { - return new ASTNode(ASTFactory.uMinus(ast.toASTNode2())); - } - - /** - * Creates a new {@link ASTNode} that has exactly one child and which is of - * type minus, i.e., this negates what is encoded in ast. - * - * @param container - * @return a new {@link ASTNode} that has exactly one child and which is of - * type minus, i.e., this negates what is encoded in ast. - */ - public static ASTNode uMinus(MathContainer container) { - if (container instanceof CallableSBase) { - ASTCSymbolBaseNode ci = container instanceof FunctionDefinition - ? new ASTCiFunctionNode() - : new ASTCiNumberNode(); - ci.setName(((CallableSBase) container).getId()); - return new ASTNode(ASTFactory.multiplyWith(ci)); - } - return null; - } - - /** - * A pointer to the {@link ASTNode2} corresponding to the current - * {@link ASTNode} - */ - private ASTNode2 astnode2; - - /** - * A {@link Logger} for this class. - */ - private static transient final Logger logger = Logger - .getLogger(ASTNode.class); - - /** - * Creates a new {@link ASTNode} of unspecified type and without a pointer to - * its containing {@link MathContainer}. - */ - public ASTNode() { - super(); - setType(Type.UNKNOWN); - } - - /** - * Copy constructor; Creates a deep copy of the given {@link ASTNode}. - * - * @param astNode - * the {@link ASTNode} to be copied. - */ - public ASTNode(ASTNode astNode) { - this(); - - if (astNode.isSetASTNode2()) { - astnode2 = astNode.toASTNode2().clone(); - } - } - - /** - * Creates a new {@link ASTNode} of the given {@link ASTNode.Type} but without - * a pointer to its {@link MathContainer}. - * - * @param type - */ - public ASTNode(ASTNode.Type type) { - setType(type); - } - - /** - * Creates and returns a new {@link ASTNode}. - * - * @param type - * the type of the ASTNode to create. - * @param parent - * the parent SBML object. - */ - public ASTNode(ASTNode.Type type, MathContainer parent) { - setType(type); - setParentSBMLObject(this, parent); - } - - /** - * Create a new node of type {@link ASTNode} from the given {@link ASTNode2} - * - * @param node - * {@link ASTNode2} - */ - public ASTNode(ASTNode2 node) { - astnode2 = node; - } - - /** - * Creates and returns a new {@link ASTNode} referring to the given - * {@link CallableSBase}. - * - * @param nsb - */ - public ASTNode(CallableSBase nsb) { - this(ASTNode.Type.NAME); - setVariable(nsb); - } - - /** - * Creates and returns a new {@link ASTNode} referring to the given - * {@link CallableSBase}. - * - * @param nsb - * @param parent - */ - public ASTNode(CallableSBase nsb, MathContainer parent) { - this(ASTNode.Type.NAME, parent); - setVariable(nsb); - } - - /** - * Creates a new {@link ASTNode} representing an operator, i.e., an internal - * node. - * - * @param operator - */ - public ASTNode(char operator) { - this(); - setCharacter(operator); - } - - /** - * Creates a new {@link ASTNode} representing an operator, i.e., an internal - * node. - * - * @param operator - * @param parent - */ - public ASTNode(char operator, MathContainer parent) { - this(parent); - setCharacter(operator); - } - - /** - * Creates and returns a new {@link ASTNode}. - * - * @param real - */ - public ASTNode(double real) { - switch (Double.compare(real, Math.E)) { - case 0 : - astnode2 = new ASTConstantNumber(Math.E); - break; - default : - astnode2 = new ASTCnRealNode(real); - break; - } - } - - /** - * Creates and returns a new {@link ASTNode}. - * - * @param mantissa - * @param exponent - */ - public ASTNode(double mantissa, int exponent) { - astnode2 = new ASTCnExponentialNode(); - ((ASTCnExponentialNode) astnode2).setMantissa(mantissa); - ((ASTCnExponentialNode) astnode2).setExponent(exponent); - } - - /** - * Creates and returns a new {@link ASTNode}. - * - * @param mantissa - * @param exponent - * @param parent - */ - public ASTNode(double mantissa, int exponent, MathContainer parent) { - this(ASTNode.Type.REAL_E, parent); - setValue(mantissa, exponent); - } - - /** - * Creates and returns a new {@link ASTNode}. - * - * @param real - * @param parent - */ - public ASTNode(double real, MathContainer parent) { - this(ASTNode.Type.REAL, parent); - setValue(real); - } - - /** - * Creates and returns a new {@link ASTNode} with the given integer value. - * - * @param integer - */ - public ASTNode(int integer) { - astnode2 = new ASTCnIntegerNode(integer); - } - - /** - * Creates and returns a new {@link ASTNode} with the given integer value for - * the given {@link MathContainer} as its parent SBML object. - * - * @param integer - * @param parent - */ - public ASTNode(int integer, MathContainer parent) { - this(integer, null, parent); - } - - /** - * Creates and returns a new {@link ASTNode} with the given integer value with - * the given associated {@link #unitId} for the given {@link MathContainer} as - * its parent SBML object. - * - * @param integer - * @param unitsID - * @param parent - */ - public ASTNode(int integer, String unitsID, MathContainer parent) { - this(ASTNode.Type.INTEGER, parent); - setValue(integer); - if (unitsID != null) { - setUnits(unitsID); - } - } - - /** - * Creates and returns a new {@link ASTNode}. - * - * By default, the returned node will have a type of {@link Type#UNKNOWN}. The - * calling code should set the node type to something else as soon as possible - * using setType(int) - * - * @param parent - * the parent SBML object - */ - public ASTNode(MathContainer parent) { - this(); - setParentSBMLObject(this, parent); - } - - /** - * Creates and returns a new {@link ASTNode} with the given name. - * - * @param name - * the name of this ASTNode - */ - public ASTNode(String name) { - this(ASTNode.Type.NAME); - setName(name); - } - - /** - * Creates and returns a new {@link ASTNode} with the given name. - * - * @param name - * the name of this ASTNode - * @param parent - * the parent SBML object. - */ - public ASTNode(String name, MathContainer parent) { - this(ASTNode.Type.NAME, parent); - setName(name); - } - - /** - * Adds a child to this node. - * - * @param child - * the node to add as child. - */ - public void addChild(ASTNode child) { - if (isFunction()) { - ((ASTFunction) astnode2).addChild(child.toASTNode2()); - } - } - - /** - * Creates a new node with the type of this node, moves all children of this - * node to this new node, sets the type of this node to the given operator, - * adds the new node as left child of this node and the given {@link ASTNode} - * as the right child of this node. The parentSBMLObject of the whole - * resulting {@link ASTNode} is then set to the parent of this node. - * - * @param operator - * The new type of this node. This has to be one of the following: - * {@link Type#PLUS}, {@link Type#MINUS}, {@link Type#TIMES}, - * {@link Type#DIVIDE}, {@link Type#POWER}, - * {@link Type#FUNCTION_ROOT}. Otherwise an - * {@link IllegalArgumentException} is thrown. - * @param astnode - * The new right child of this node - * @throws IllegalArgumentException - * if - * <ul> - * <li>this {@link ASTNode} is zero ({@link #isZero()}) and the - * given operator is {@link Type#DIVIDE}</li> - * <li>the operator is not one of the following: {@link Type#PLUS}, - * {@link Type#MINUS}, {@link Type#TIMES}, {@link Type#DIVIDE}, - * {@link Type#POWER}, {@link Type#FUNCTION_ROOT}</li> - * </ul> - */ - private void arithmeticOperation(Type operator, ASTNode astnode) { - astnode2 = ASTFactory.arithmeticOperation(operator, astnode.toASTNode2()); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#clone() - */ - @Override - public ASTNode clone() { - return new ASTNode(this); - } - - /** - * Compiles this {@link ASTNode} and returns the result. - * - * @param compiler - * An instance of an {@link ASTNodeCompiler} that provides methods to - * translate this {@link ASTNode} into something different. - * @return Some value wrapped in an {@link ASTNodeValue}. The content of the - * wrapper depends on the {@link ASTNodeCompiler} used to create it. - * However, this {@link ASTNode} will ensure that level and version - * are set appropriately according to this node's parent SBML object. - * @throws SBMLException - * Thrown if an error occurs during the compilation process. - * - */ - public ASTNodeValue compile(ASTNodeCompiler compiler) throws SBMLException { - ASTNodeValue value; - switch (getType()) { - /* - * Numbers - */ - case REAL : - double real = getReal(); - if (Double.isInfinite(real)) { - value = (real > 0d) ? compiler.getPositiveInfinity() : compiler - .getNegativeInfinity(); - } else { - value = compiler.compile(real, getUnits()); - } - break; - case INTEGER : - value = compiler.compile(getInteger(), getUnits()); - break; - /* - * Operators - */ - case POWER : - value = compiler.pow(getLeftChild(), getRightChild()); - break; - case PLUS : - value = compiler.plus(getChildren()); - value.setUIFlag(getChildCount() <= 1); - break; - case MINUS : - if (getChildCount() < 2) { - value = compiler.uMinus(getLeftChild()); - value.setUIFlag(true); - } else { - value = compiler.minus(getChildren()); - value.setUIFlag(false); - } - break; - case TIMES : - value = compiler.times(getChildren()); - value.setUIFlag(getChildCount() <= 1); - break; - case DIVIDE : - int childCount = getChildCount(); - if (childCount != 2) { - throw new SBMLException( - MessageFormat - .format( - "Fractions must have one numerator and one denominator, here {0,number,integer} elements are given.", - childCount)); - } - value = compiler.frac(getLeftChild(), getRightChild()); - break; - case RATIONAL : - value = compiler.frac(getNumerator(), getDenominator()); - break; - case NAME_TIME : - value = compiler.symbolTime(getName()); - break; - case FUNCTION_DELAY : - value = compiler.delay(getName(), getLeftChild(), getRightChild(), - getUnits()); - break; - /* - * Names of identifiers: parameters, functions, species etc. - */ - case NAME : - CallableSBase variable = getVariable(); - - if (variable != null) { - if (variable instanceof FunctionDefinition) { - value = compiler.function((FunctionDefinition) variable, - getChildren()); - } else { - value = compiler.compile(variable); - } - } else { - value = compiler.compile(getName()); - } - break; - /* - * Type: pi, e, true, false, Avogadro - */ - case CONSTANT_PI : - value = compiler.getConstantPi(); - break; - case CONSTANT_E : - value = compiler.getConstantE(); - break; - case CONSTANT_TRUE : - value = compiler.getConstantTrue(); - break; - case CONSTANT_FALSE : - value = compiler.getConstantFalse(); - break; - case NAME_AVOGADRO : - value = compiler.getConstantAvogadro(getName()); - break; - case REAL_E : - value = compiler.compile(getMantissa(), getExponent(), isSetUnits() - ? getUnits() - : null); - break; - /* - * Basic Functions - */ - case FUNCTION_LOG : - if (getChildCount() == 2) { - value = compiler.log(getLeftChild(), getRightChild()); - } else { - value = compiler.log(getRightChild()); - } - break; - case FUNCTION_ABS : - value = compiler.abs(getRightChild()); - break; - case FUNCTION_ARCCOS : - value = compiler.arccos(getLeftChild()); - break; - case FUNCTION_ARCCOSH : - value = compiler.arccosh(getLeftChild()); - break; - case FUNCTION_ARCCOT : - value = compiler.arccot(getLeftChild()); - break; - case FUNCTION_ARCCOTH : - value = compiler.arccoth(getLeftChild()); - break; - case FUNCTION_ARCCSC : - value = compiler.arccsc(getLeftChild()); - break; - case FUNCTION_ARCCSCH : - value = compiler.arccsch(getLeftChild()); - break; - case FUNCTION_ARCSEC : - value = compiler.arcsec(getLeftChild()); - break; - case FUNCTION_ARCSECH : - value = compiler.arcsech(getLeftChild()); - break; - case FUNCTION_ARCSIN : - value = compiler.arcsin(getLeftChild()); - break; -... [truncated message content] |
From: <pd...@us...> - 2015-04-25 08:58:08
|
Revision: 2262 http://sourceforge.net/p/jsbml/code/2262 Author: pdp10 Date: 2015-04-25 08:58:06 +0000 (Sat, 25 Apr 2015) Log Message: ----------- update for parsing correctly files using spatial package v0.90 Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java Modified: trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-04-25 08:57:10 UTC (rev 2261) +++ trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-04-25 08:58:06 UTC (rev 2262) @@ -163,7 +163,7 @@ System.out.println(Calendar.getInstance().getTime()); String fileName = file.getAbsolutePath(); - String jsbmlWriteFileName = fileName.replaceFirst(".xml", "-jsbml.xml"); + String jsbmlWriteFileName = fileName.replaceFirst("\\.xml", "-jsbml.xml"); System.out.printf("Reading %s and writing %s\n", fileName, jsbmlWriteFileName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-25 08:57:21
|
Revision: 2261 http://sourceforge.net/p/jsbml/code/2261 Author: pdp10 Date: 2015-04-25 08:57:10 +0000 (Sat, 25 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/resources/org/sbml/jsbml/ext/spatial/Messages.xml trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field.xml Added Paths: ----------- trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field-jsbml.xml Modified: trunk/extensions/spatial/resources/org/sbml/jsbml/ext/spatial/Messages.xml =================================================================== (Binary files differ) 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-24 08:27:11 UTC (rev 2260) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-25 08:57:10 UTC (rev 2261) @@ -27,9 +27,11 @@ import javax.swing.tree.TreeNode; import javax.xml.stream.XMLStreamException; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; import org.sbml.jsbml.xml.XMLNode; +import org.sbml.jsbml.xml.parsers.SpatialParser; /** @@ -86,6 +88,11 @@ /** * */ + private Logger logger = Logger.getLogger(SampledField.class); + + /** + * + */ public SampledField() { super(); } @@ -219,7 +226,7 @@ * @param numSamples1 */ public void setNumSamples1(int numSamples1) { - int oldNumSamples1 = this.numSamples1; + Integer oldNumSamples1 = this.numSamples1; this.numSamples1 = numSamples1; firePropertyChange(SpatialConstants.numSamples1, oldNumSamples1, this.numSamples1); } @@ -233,7 +240,7 @@ */ public boolean unsetNumSamples1() { if (isSetNumSamples1()) { - int oldNumSamples1 = numSamples1; + Integer oldNumSamples1 = numSamples1; numSamples1 = null; firePropertyChange(SpatialConstants.numSamples1, oldNumSamples1, numSamples1); return true; @@ -271,7 +278,7 @@ * @param numSamples2 */ public void setNumSamples2(int numSamples2) { - int oldNumSamples2 = this.numSamples2; + Integer oldNumSamples2 = this.numSamples2; this.numSamples2 = numSamples2; firePropertyChange(SpatialConstants.numSamples2, oldNumSamples2, this.numSamples2); } @@ -285,7 +292,7 @@ */ public boolean unsetNumSamples2() { if (isSetNumSamples2()) { - int oldNumSamples2 = numSamples2; + Integer oldNumSamples2 = numSamples2; numSamples2 = null; firePropertyChange(SpatialConstants.numSamples2, oldNumSamples2, numSamples2); return true; @@ -324,7 +331,7 @@ * @param numSamples3 */ public void setNumSamples3(int numSamples3) { - int oldNumSamples3 = this.numSamples3; + Integer oldNumSamples3 = this.numSamples3; this.numSamples3 = numSamples3; firePropertyChange(SpatialConstants.numSamples3, oldNumSamples3, this.numSamples3); } @@ -338,7 +345,7 @@ */ public boolean unsetNumSamples3() { if (isSetNumSamples3()) { - int oldNumSamples3 = numSamples3; + Integer oldNumSamples3 = numSamples3; numSamples3 = null; firePropertyChange(SpatialConstants.numSamples3, oldNumSamples3, numSamples3); return true; @@ -785,37 +792,29 @@ public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetNumSamples1()) { - attributes.remove("numSamples1"); attributes.put(SpatialConstants.shortLabel + ":numSamples1", String.valueOf(getNumSamples1())); } - if (isSetNumSamples2()) { - attributes.remove("numSamples2"); attributes.put(SpatialConstants.shortLabel + ":numSamples2", String.valueOf(getNumSamples2())); } if (isSetNumSamples3()) { - attributes.remove("numSamples3"); attributes.put(SpatialConstants.shortLabel + ":numSamples3", String.valueOf(getNumSamples3())); } if (isSetDataType()) { - attributes.remove("dataType"); attributes.put(SpatialConstants.shortLabel + ":dataType", getDataType().toString()); } if (isSetCompression()) { - attributes.remove("compression"); attributes.put(SpatialConstants.shortLabel + ":compression", getCompression().toString()); } if (isSetInterpolation()) { - attributes.remove("interpolation"); attributes.put(SpatialConstants.shortLabel + ":interpolation", getInterpolation().toString()); } if (isSetSamplesLength()) { - attributes.remove("samplesLength"); attributes.put(SpatialConstants.shortLabel + ":samplesLength", String.valueOf(getSamplesLength())); } @@ -832,23 +831,21 @@ try { setNumSamples1(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.numSamples1); + logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.numSamples1, getElementName())); } } else if (attributeName.equals(SpatialConstants.numSamples2)) { try { setNumSamples2(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.numSamples2); + logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.numSamples2, getElementName())); } } else if (attributeName.equals(SpatialConstants.numSamples3)) { try { setNumSamples3(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.numSamples3); + logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.numSamples3, getElementName())); } } @@ -856,28 +853,28 @@ try { setInterpolation(InterpolationKind.valueOf(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.interpolation); + logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.interpolation, getElementName())); } } else if (attributeName.equals(SpatialConstants.compression)) { try { setCompression(CompressionKind.valueOf(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.compression); + logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.compression, getElementName())); } } else if (attributeName.equals(SpatialConstants.samplesLength)) { try { setSamplesLength(String.valueOf(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.samplesLength); + logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.samplesLength, getElementName())); } } else if (attributeName.equals(SpatialConstants.dataType)) { try { setDataType(DataKind.valueOf(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.dataType); + logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.dataType, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-24 08:27:11 UTC (rev 2260) +++ trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-25 08:57:10 UTC (rev 2261) @@ -101,11 +101,15 @@ @Override public void processCharactersOf(String elementName, String characters, Object contextObject) { - if (contextObject instanceof SpatialPoints) { + if (contextObject instanceof SampledField) { + SampledField sampledField = (SampledField) contextObject; + sampledField.append(characters); + } + else if (contextObject instanceof SpatialPoints) { SpatialPoints spatialPoints = (SpatialPoints) contextObject; spatialPoints.append(characters); } - if (contextObject instanceof ParametricObject) { + else if (contextObject instanceof ParametricObject) { ParametricObject parametricObject = (ParametricObject) contextObject; parametricObject.append(characters); } @@ -114,8 +118,24 @@ @Override public void writeCharacters(SBMLObjectForXML xmlObject, Object sbmlElementToWrite) { - // TODO Auto-generated method stub - super.writeCharacters(xmlObject, sbmlElementToWrite); + if(sbmlElementToWrite instanceof SampledField) { + SampledField sampledField = (SampledField) sbmlElementToWrite; + if(sampledField.isSetSamples()) { + xmlObject.setCharacters(sampledField.getSamples()); + } + } + else if(sbmlElementToWrite instanceof SpatialPoints) { + SpatialPoints spatialPoints = (SpatialPoints) sbmlElementToWrite; + if(spatialPoints.isSetArrayData()) { + xmlObject.setCharacters(spatialPoints.getArrayData()); + } + } + else if(sbmlElementToWrite instanceof ParametricObject) { + ParametricObject parametricObject = (ParametricObject) sbmlElementToWrite; + if(parametricObject.isSetPointIndex()) { + xmlObject.setCharacters(parametricObject.getPointIndex()); + } + } } /* (non-Javadoc) Added: trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field-jsbml.xml =================================================================== --- trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field-jsbml.xml (rev 0) +++ trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field-jsbml.xml 2015-04-25 08:57:10 UTC (rev 2261) @@ -0,0 +1,273 @@ +<?xml version='1.0' encoding='UTF-8' standalone='no'?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" xmlns:req="http://www.sbml.org/sbml/level3/version1/req/version1" spatial:required="true" version="1"> + <model> + <spatial:geometry xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain2="Cytosol0" spatial:id="Cytosol_Extracellular_membrane_Cytosol0" spatial:domain1="Cytosol_Extracellular_membrane0"/> + <spatial:adjacentDomains spatial:domain2="Extracellular0" spatial:id="Cytosol_Extracellular_membrane_Extracellular0" spatial:domain1="Cytosol_Extracellular_membrane0"/> + <spatial:adjacentDomains spatial:domain2="Nucleus0" spatial:id="Nucleus_Cytosol_membrane_Nucleus0" spatial:domain1="Nucleus_Cytosol_membrane0"/> + <spatial:adjacentDomains spatial:domain2="Cytosol0" spatial:id="Nucleus_Cytosol_membrane_Cytosol0" spatial:domain1="Nucleus_Cytosol_membrane0"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="x" spatial:unit="um"> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="y" spatial:unit="um"> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomains> + <spatial:domain spatial:id="Extracellular0" spatial:domainType="Extracellular"/> + <spatial:domain spatial:id="Cytosol_Extracellular_membrane0" spatial:domainType="Cytosol_Extracellular_membrane"/> + <spatial:domain spatial:id="Cytosol0" spatial:domainType="Cytosol"/> + <spatial:domain spatial:id="Nucleus_Cytosol_membrane0" spatial:domainType="Nucleus_Cytosol_membrane"/> + <spatial:domain spatial:id="Nucleus0" spatial:domainType="Nucleus"/> + </spatial:listOfDomains> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="Extracellular" spatial:spatialDimensions="3"/> + <spatial:domainType spatial:id="Cytosol_Extracellular_membrane" spatial:spatialDimensions="2"/> + <spatial:domainType spatial:id="Cytosol" spatial:spatialDimensions="3"/> + <spatial:domainType spatial:id="Nucleus_Cytosol_membrane" spatial:spatialDimensions="2"/> + <spatial:domainType spatial:id="Nucleus" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfSampledFieldGeometrys> + <spatial:sampledFieldGeometry spatial:id="mySampledField"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:minValue="0.0" spatial:maxValue="0.0" spatial:id="Extracellular" spatial:domainType="Extracellular" spatial:sampledValue="0.0"/> + <spatial:sampledVolume spatial:minValue="0.0" spatial:maxValue="0.0" spatial:id="Cytosol" spatial:domainType="Cytosol" spatial:sampledValue="128.0"/> + <spatial:sampledVolume spatial:minValue="0.0" spatial:maxValue="0.0" spatial:id="Nucleus" spatial:domainType="Nucleus" spatial:sampledValue="255.0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfSampledFieldGeometrys> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:samplesLength="3440" spatial:numSamples3="1" spatial:id="imgtest" spatial:numSamples1="800" spatial:numSamples2="950">120 218 237 221 193 142 27 57 12 64 193 124 122 255 185 22 216 195 30 54 240 216 238 97 83 20 89 239 154 75 183 168 2 237 96 146 249 243 71 146 36 73 146 36 73 146 36 73 26 217 117 57 3 233 181 15 64 164 215 60 248 144 248 144 238 240 224 67 226 67 226 67 138 229 193 135 196 135 196 135 196 135 148 197 131 15 137 15 137 15 137 15 41 139 7 31 18 31 18 31 82 44 15 62 36 62 36 62 164 88 30 124 72 124 72 124 72 177 60 248 144 248 144 248 144 98 121 240 33 241 33 241 33 197 242 224 67 226 67 226 67 226 67 202 226 193 135 196 135 196 135 20 203 3 16 137 15 137 15 137 15 137 15 169 0 15 62 36 62 36 31 175 36 62 36 62 164 237 62 28 136 100 125 72 124 72 124 72 124 72 124 72 133 121 240 33 241 33 241 33 241 33 101 241 224 67 226 67 186 229 3 16 137 + 15 233 14 15 62 36 62 36 62 36 62 164 52 31 128 72 175 121 240 33 241 33 241 33 241 33 101 241 224 67 250 193 7 32 18 31 18 31 82 176 15 64 164 215 60 248 144 248 144 248 144 248 144 248 144 246 243 224 67 226 67 186 229 3 16 241 193 135 196 135 20 203 131 15 241 193 135 196 135 20 236 3 16 241 193 135 116 135 7 31 226 131 15 137 15 137 15 137 15 137 15 137 15 137 15 169 27 15 62 196 7 32 18 31 18 31 82 26 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 32 18 31 82 48 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 64 196 7 31 18 31 18 31 82 26 15 62 196 7 31 210 45 31 128 8 15 62 36 62 36 62 36 62 164 253 60 248 16 31 128 72 124 72 193 60 248 16 31 124 72 124 72 177 60 248 16 31 124 72 124 72 124 72 89 60 0 17 31 124 136 15 62 164 96 30 124 136 15 62 196 7 31 18 31 82 22 15 62 196 7 31 226 131 15 41 150 7 31 226 13 + 1 15 241 193 135 20 203 131 15 241 193 135 248 224 67 138 229 193 135 248 224 67 124 240 33 197 242 224 67 124 240 33 62 248 144 98 121 240 33 62 248 16 31 124 72 124 72 89 60 248 16 31 124 136 15 62 164 88 30 124 136 15 62 196 7 30 146 245 33 241 33 241 33 241 33 29 201 131 15 241 193 135 248 224 67 138 229 193 135 248 224 67 124 240 33 197 242 224 67 124 240 33 62 248 144 240 144 248 144 248 144 10 243 224 67 124 240 33 62 240 144 172 15 137 15 137 15 169 48 15 62 196 7 31 226 3 15 201 250 144 248 144 248 144 10 243 224 67 124 240 33 60 240 144 248 144 146 120 240 33 62 248 16 31 124 72 177 60 248 16 31 124 8 15 62 36 62 36 62 164 253 60 248 16 31 124 8 15 62 36 62 36 60 36 62 164 194 60 248 16 31 124 136 15 62 164 88 30 124 136 15 62 132 7 31 18 31 18 31 210 126 30 124 136 15 64 132 7 31 226 131 15 41 141 7 31 226 3 16 241 193 135 240 224 67 226 67 42 192 3 16 241 193 135 248 224 67 120 0 34 37 250 0 68 120 0 34 62 0 17 30 128 72 153 62 0 17 31 128 8 15 62 196 7 31 82 26 + 15 62 196 7 30 194 131 15 241 129 135 132 135 196 135 84 214 135 19 22 30 120 136 15 62 132 7 30 18 31 210 102 30 124 136 15 60 132 7 31 226 131 15 9 15 137 15 169 46 15 62 196 7 31 226 131 15 225 193 135 196 135 180 159 7 31 226 131 15 225 193 135 248 224 67 202 226 193 135 248 224 67 120 240 33 62 248 144 178 120 240 33 60 248 16 31 124 8 15 62 196 7 31 210 126 30 124 136 15 62 132 7 31 226 3 16 225 193 135 196 135 84 154 7 31 226 131 15 225 193 135 248 224 67 120 240 33 241 33 85 230 193 135 248 224 67 120 240 33 62 248 16 30 124 72 124 72 149 121 240 33 60 248 16 31 124 8 15 62 196 7 31 210 126 30 124 136 15 62 132 7 31 226 131 15 225 193 135 196 135 84 153 7 31 226 131 15 225 193 135 240 0 68 124 240 33 21 224 193 135 248 224 67 120 240 33 60 248 16 31 124 72 251 121 0 34 60 248 16 31 124 8 15 62 196 7 32 194 131 15 169 54 15 62 196 7 31 194 131 15 241 193 135 240 224 67 120 240 33 241 33 157 201 131 15 225 1 136 248 224 67 120 240 33 60 248 16 31 124 72 165 121 240 33 + 60 0 17 31 124 8 15 62 132 7 31 226 131 15 169 52 15 62 132 7 31 226 131 15 225 1 136 240 224 67 124 240 33 149 230 193 135 248 224 67 120 240 33 60 248 16 31 124 8 15 64 132 7 30 210 161 62 0 17 30 124 8 15 62 132 7 31 194 131 15 225 193 135 240 224 67 58 147 7 31 194 131 15 225 193 135 248 224 67 120 0 34 62 248 16 30 124 72 135 242 224 67 124 240 33 60 0 17 31 124 8 15 62 132 7 31 226 3 16 41 135 199 250 47 62 132 199 223 46 86 52 17 83 211 209 60 214 15 241 161 209 62 214 219 0 209 76 30 235 179 248 208 60 30 235 139 248 208 40 30 235 235 248 208 16 31 235 94 124 168 59 143 245 155 0 81 39 30 255 187 217 235 247 241 161 6 60 214 147 241 161 131 121 172 199 227 67 167 242 88 41 1 162 35 125 172 85 19 136 9 106 16 143 175 133 24 161 70 241 248 18 136 25 106 183 143 149 29 31 58 133 199 218 17 32 58 130 199 218 21 31 42 207 99 109 140 15 225 193 135 78 245 177 214 9 64 12 82 3 215 199 199 64 76 82 35 121 124 8 196 40 53 147 199 103 64 204 82 67 121 0 34 60 126 11 196 56 53 + 149 199 39 64 204 83 201 62 214 58 8 136 121 106 46 143 247 64 12 84 83 63 93 1 34 60 248 16 30 143 1 49 84 77 230 241 14 136 169 42 141 71 73 31 139 15 89 31 55 129 24 171 134 243 224 67 62 93 1 34 60 248 208 161 60 10 251 88 124 104 55 15 62 132 7 31 82 51 30 63 1 49 94 101 240 56 213 7 32 202 224 81 219 135 5 34 60 248 16 30 128 200 151 143 60 32 134 44 60 248 16 30 62 96 9 15 11 68 120 88 32 194 131 15 249 155 93 64 132 7 31 194 227 84 30 126 8 75 201 58 142 226 193 135 240 0 68 120 240 161 242 60 58 249 0 68 211 121 88 32 194 195 2 81 5 30 124 8 143 86 60 252 87 213 194 3 16 225 241 128 15 64 52 155 135 223 38 37 62 44 16 225 97 129 136 15 62 132 7 31 234 227 99 241 33 60 90 250 240 5 93 120 240 33 60 248 80 57 30 189 125 0 162 223 241 56 221 135 5 34 60 248 208 22 30 221 125 0 162 223 240 224 67 120 52 230 241 206 7 32 154 204 195 2 209 99 60 38 248 0 68 147 121 188 245 1 136 238 241 224 67 120 52 231 1 136 158 225 193 135 240 104 207 227 189 15 64 116 205 245 97 129 2 + 32 1 30 131 124 0 130 199 92 30 124 40 158 71 35 31 128 40 156 7 31 194 131 15 64 240 224 131 15 133 234 152 230 3 16 60 198 250 0 68 193 58 230 249 32 4 143 161 60 62 244 1 8 30 51 125 0 162 88 30 51 125 0 130 7 31 128 232 226 131 15 61 198 99 170 15 64 240 152 199 195 2 81 40 143 185 62 0 193 131 15 62 240 224 131 15 61 195 99 176 15 64 240 224 131 15 60 248 240 1 75 143 240 224 67 124 12 226 193 135 172 15 62 132 7 31 218 202 163 163 15 63 97 130 7 31 124 232 121 30 124 8 143 89 60 248 192 131 15 255 196 86 79 235 224 67 120 240 129 7 30 120 124 11 196 117 162 131 15 62 240 224 131 15 60 248 224 67 137 58 186 242 248 16 136 75 133 7 31 124 224 193 7 31 120 224 193 135 210 116 240 33 60 248 224 3 15 60 248 192 131 15 64 148 197 131 15 215 11 15 62 248 192 3 15 62 232 224 131 15 37 241 232 237 99 241 65 7 30 124 224 193 7 31 74 214 193 7 31 120 204 229 193 7 30 124 252 18 136 171 70 199 84 30 22 8 30 124 240 65 7 30 124 40 149 7 31 124 224 193 7 31 120 224 193 7 29 124 248 + 9 69 60 248 224 67 120 240 161 186 60 248 224 3 15 62 0 161 131 15 11 4 15 62 248 192 131 15 62 180 159 7 31 128 208 193 7 31 120 240 193 7 29 124 60 230 3 16 58 70 242 224 131 14 62 248 192 131 15 95 64 232 224 131 15 21 224 193 7 32 120 240 193 7 30 124 240 129 7 31 79 250 0 4 15 62 248 160 131 143 91 62 0 193 131 15 62 232 0 228 150 15 64 240 224 131 15 58 248 224 131 14 62 130 125 0 130 7 31 124 208 193 199 45 31 128 224 193 7 31 120 240 193 7 29 128 4 251 0 4 15 62 248 160 3 16 62 240 224 131 15 58 0 225 131 14 62 10 248 0 4 143 97 64 248 160 131 15 62 232 224 131 15 60 248 216 233 3 16 60 102 1 225 131 14 62 248 160 3 144 4 31 128 224 49 10 8 31 116 240 193 7 29 128 100 248 0 132 14 62 248 192 3 144 59 60 0 161 131 15 62 232 224 227 158 15 64 240 224 131 15 58 248 184 229 3 16 60 166 0 225 131 14 62 98 121 240 129 199 16 32 23 32 116 240 193 7 29 128 240 65 7 32 21 124 0 2 199 8 32 124 176 193 7 31 112 0 194 7 29 124 212 240 1 8 29 19 128 240 65 7 32 124 208 193 71 170 + 15 64 232 232 239 227 226 3 15 64 248 160 3 144 92 31 128 224 193 7 31 116 204 5 114 241 129 7 32 207 248 0 132 142 230 64 248 192 3 16 62 232 0 36 223 7 32 120 244 6 194 7 29 128 240 129 7 32 27 124 0 66 71 107 33 124 224 1 136 15 88 116 16 2 8 29 128 240 65 7 32 190 128 224 65 72 3 31 128 208 209 152 200 197 7 29 128 240 65 7 32 59 120 0 66 71 87 32 49 239 78 135 58 10 137 122 115 58 212 208 72 220 107 211 161 126 66 248 160 3 145 4 30 67 129 184 233 173 149 240 65 7 38 41 60 46 58 212 75 72 240 75 210 161 78 64 46 62 240 0 36 139 199 36 32 238 115 123 33 23 31 120 16 146 200 227 162 67 77 128 60 243 126 116 168 5 145 139 15 60 8 225 131 14 70 170 232 104 15 196 189 29 193 228 226 131 14 70 54 240 184 232 208 225 68 158 125 21 58 244 136 144 171 131 142 166 62 220 207 41 91 228 226 131 14 64 182 241 232 7 196 181 28 35 36 229 21 232 208 153 68 146 94 128 14 157 8 228 226 131 14 66 54 235 104 3 196 53 156 4 228 226 131 13 66 10 232 56 30 136 203 55 141 200 197 7 28 128 20 + 209 113 40 16 247 109 164 144 45 207 13 135 142 0 178 235 185 233 80 113 33 91 159 26 15 85 38 178 253 153 233 80 89 35 21 30 24 14 213 52 82 227 97 217 80 45 33 255 254 121 157 103 165 67 21 132 84 125 82 58 180 153 72 237 231 132 67 58 206 135 193 8 16 58 4 8 30 226 131 14 1 130 135 248 224 67 42 9 196 52 196 7 30 2 132 15 241 193 135 248 192 67 128 240 33 241 33 157 8 196 32 196 7 31 2 132 15 241 1 136 248 224 67 128 0 34 213 246 1 136 0 33 68 124 32 34 64 0 17 31 132 8 16 64 164 51 124 0 34 64 0 17 31 128 8 16 64 196 7 32 2 4 16 201 39 44 201 2 145 44 16 201 2 145 0 225 67 124 240 33 64 248 16 31 124 8 16 64 196 7 31 210 33 64 204 67 124 0 34 64 0 17 32 124 136 15 64 4 8 31 146 5 34 89 32 146 5 34 89 32 18 32 124 136 15 62 4 8 31 226 131 15 1 130 135 248 224 67 170 15 196 40 196 7 30 2 132 15 241 129 135 0 193 67 124 224 33 21 5 98 4 226 3 15 1 66 135 248 192 67 128 240 33 109 255 6 226 252 197 7 40 2 4 17 241 193 136 0 1 69 42 236 3 21 1 194 137 248 128 73 128 16 35 62 + 40 17 32 148 72 131 129 80 34 62 72 17 32 160 136 15 70 4 8 35 226 3 18 1 194 136 248 96 68 128 136 27 64 68 137 248 96 68 128 64 34 62 24 17 32 140 136 15 68 4 8 33 226 67 110 19 32 66 5 16 65 34 62 184 17 32 140 136 15 68 4 8 34 226 131 16 1 34 66 248 16 33 128 8 16 62 4 8 32 2 68 128 148 244 193 12 31 122 33 196 158 1 68 62 137 241 33 64 0 17 32 128 168 236 119 21 183 150 15 217 40 128 8 18 64 132 8 31 2 4 16 17 2 136 0 17 31 128 8 16 66 4 8 32 226 67 132 0 34 66 0 209 195 68 200 225 67 214 11 32 66 4 16 49 194 135 16 1 68 140 0 34 68 248 16 35 2 132 17 1 34 68 0 17 35 128 136 16 64 68 8 32 34 4 16 17 194 135 8 1 68 132 0 34 68 196 135 24 1 68 136 0 34 68 0 17 34 128 136 17 64 196 8 31 98 4 16 33 2 136 16 1 68 66 4 16 33 2 136 16 1 68 132 240 33 66 0 17 33 128 136 16 62 132 8 32 98 4 16 9 23 62 196 8 32 66 132 15 33 2 136 16 225 67 132 0 34 68 248 16 32 128 72 125 133 152 169 16 225 67 132 0 34 66 248 16 34 128 8 17 62 132 8 32 66 4 16 169 35 17 19 20 34 128 8 17 64 68 8 + 32 66 132 15 33 2 136 16 1 68 58 216 136 137 9 17 64 132 8 32 66 4 16 33 2 136 48 225 67 42 111 196 124 68 8 32 66 4 16 33 194 135 16 1 68 132 0 34 149 39 98 40 34 4 16 33 194 135 8 1 68 132 0 34 68 0 145 170 11 49 10 17 2 136 8 225 67 132 240 33 66 240 144 246 11 49 0 17 130 135 8 193 67 132 240 33 66 240 144 246 10 113 228 34 132 15 1 194 135 8 1 68 132 240 33 21 16 226 168 69 8 31 34 132 15 17 2 136 148 6 196 33 139 16 62 68 8 31 34 132 15 41 75 136 195 21 32 128 136 16 62 4 8 31 82 154 16 231 42 66 0 17 33 124 136 16 62 36 64 164 10 68 156 167 8 225 67 132 0 34 5 11 113 148 66 132 15 33 2 136 20 76 196 17 10 17 62 132 8 32 82 48 17 71 39 68 248 144 248 144 98 137 56 50 17 194 135 116 71 136 227 18 34 127 131 224 67 136 88 24 210 55 68 156 138 244 210 136 3 145 94 27 113 24 210 43 37 14 65 146 36 73 146 36 73 146 36 73 146 36 73 146 36 73 146 36 73 82 195 254 1 20 164 156 86 </spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfUnitDefinitions> + <unitDefinition id="substance"> + <listOfUnits> + <unit scale="0" exponent="1" multiplier="1" kind="item"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="volume"> + <listOfUnits> + <unit scale="0" exponent="3" multiplier="1E-6" kind="metre"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="area"> + <listOfUnits> + <unit scale="0" exponent="2" multiplier="1E-6" kind="metre"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="molecules"> + <listOfUnits> + <unit scale="0" exponent="1" multiplier="1" kind="item"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="umol_um3_litre_1"> + <listOfUnits> + <unit scale="0" exponent="1" multiplier="1E-21" kind="mole"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="um3"> + <listOfUnits> + <unit scale="0" exponent="3" multiplier="1E-6" kind="metre"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="um2"> + <listOfUnits> + <unit scale="0" exponent="2" multiplier="1E-6" kind="metre"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="uM_um3_molecules_1"> + <listOfUnits> + <unit scale="0" exponent="1" multiplier="1E-21" kind="dimensionless"/> + <unit scale="0" exponent="-1" multiplier="1" kind="item"/> + <unit scale="0" exponent="1" multiplier="1" kind="mole"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="molecules_um_2_s_1"> + <listOfUnits> + <unit scale="0" exponent="1" multiplier="1E12" kind="dimensionless"/> + <unit scale="0" exponent="1" multiplier="1" kind="item"/> + <unit scale="0" exponent="-2" multiplier="1" kind="metre"/> + <unit scale="0" exponent="-1" multiplier="1" kind="second"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="pA_um_2"> + <listOfUnits> + <unit scale="0" exponent="1" multiplier="1" kind="dimensionless"/> + <unit scale="0" exponent="1" multiplier="1" kind="ampere"/> + <unit scale="0" exponent="-2" multiplier="1" kind="metre"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="uM_um_s_1"> + <listOfUnits> + <unit scale="0" exponent="1" multiplier="1E-9" kind="dimensionless"/> + <unit scale="0" exponent="-2" multiplier="1" kind="metre"/> + <unit scale="0" exponent="1" multiplier="1" kind="mole"/> + <unit scale="0" exponent="-1" multiplier="1" kind="second"/> + </listOfUnits> + </unitDefinition> + </listOfUnitDefinitions> + <listOfCompartments> + <compartment id="Extracellular" constant="true" spatialDimensions="3" name="Extracellular"> + </compartment> + <compartment id="Cytosol_Extracellular_membrane" constant="true" spatialDimensions="2" name="Cytosol_Extracellular_membrane"> + </compartment> + <compartment id="Cytosol" constant="true" spatialDimensions="3" name="Cytosol"> + </compartment> + <compartment id="Nucleus_Cytosol_membrane" constant="true" spatialDimensions="2" name="Nucleus_Cytosol_membrane"> + </compartment> + <compartment id="Nucleus" constant="true" spatialDimensions="3" name="Nucleus"> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species id="s1_nuc" spatial:isSpatial="true" initialConcentration="0" constant="false" hasOnlySubstanceUnits="false" boundaryCondition="false" substanceUnits="molecules" compartment="Nucleus"> + <annotation> + <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell"> + <vcell:VCMLSpecific> + <vcell:Compound Name="s1_2"/> + </vcell:VCMLSpecific> + </vcell:VCellInfo> + </annotation> + </species> + <species id="s1_cyt" spatial:isSpatial="true" initialConcentration="10" constant="false" hasOnlySubstanceUnits="false" boundaryCondition="false" substanceUnits="molecules" compartment="Cytosol"> + <annotation> + <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell"> + <vcell:VCMLSpecific> + <vcell:Compound Name="s1_2"/> + </vcell:VCMLSpecific> + </vcell:VCellInfo> + </annotation> + </species> + <species id="s2_nuc" spatial:isSpatial="true" initialConcentration="5" constant="false" hasOnlySubstanceUnits="false" boundaryCondition="false" substanceUnits="molecules" compartment="Nucleus"> + <annotation> + <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell"> + <vcell:VCMLSpecific> + <vcell:Compound Name="s2_2"/> + </vcell:VCMLSpecific> + </vcell:VCellInfo> + </annotation> + </species> + <species id="s1_EC" spatial:isSpatial="true" initialConcentration="0" constant="false" hasOnlySubstanceUnits="false" boundaryCondition="false" substanceUnits="molecules" compartment="Extracellular"> + <annotation> + <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell"> + <vcell:VCMLSpecific> + <vcell:Compound Name="s1_2"/> + </vcell:VCMLSpecific> + </vcell:VCellInfo> + </annotation> + </species> + </listOfSpecies> + <listOfParameters> + <parameter id="x" value="0"> + <spatial:spatialSymbolReference xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:spatialRef="x"/> + </parameter> + <parameter id="y" value="0"> + <spatial:spatialSymbolReference xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:spatialRef="y"/> + </parameter> + <parameter id="s1_nuc_diff" constant="true" value="10"> + <spatial:diffusionCoefficient xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:variable="s1_nuc"/> + </parameter> + <parameter id="s1_nuc_BC_Xm" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Nucleus" spatial:coordinateBoundary="Xmin" spatial:variable="s1_nuc" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_nuc_BC_Xp" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Nucleus" spatial:coordinateBoundary="Xmax" spatial:variable="s1_nuc" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_nuc_BC_Ym" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Nucleus" spatial:coordinateBoundary="Ymin" spatial:variable="s1_nuc" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_nuc_BC_Yp" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Nucleus" spatial:coordinateBoundary="Ymax" spatial:variable="s1_nuc" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_cyt_diff" constant="true" value="10"> + <spatial:diffusionCoefficient xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:variable="s1_cyt"/> + </parameter> + <parameter id="s1_cyt_BC_Xm" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Cytosol" spatial:coordinateBoundary="Xmin" spatial:variable="s1_cyt" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_cyt_BC_Xp" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Cytosol" spatial:coordinateBoundary="Xmax" spatial:variable="s1_cyt" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_cyt_BC_Ym" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Cytosol" spatial:coordinateBoundary="Ymin" spatial:variable="s1_cyt" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_cyt_BC_Yp" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:coordinateBoundary="Ymax" spatial:variable="s1_cyt" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_EC_diff" constant="true" value="10"> + <spatial:diffusionCoefficient xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:variable="s1_EC"/> + </parameter> + <parameter id="s1_EC_BC_Xm" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Extracellular" spatial:coordinateBoundary="Xmin" spatial:variable="s1_EC" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_EC_BC_Xp" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Extracellular" spatial:coordinateBoundary="Xmax" spatial:variable="s1_EC" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_EC_BC_Ym" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Extracellular" spatial:coordinateBoundary="Ymin" spatial:variable="s1_EC" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="s1_EC_BC_Yp" constant="true" value="0"> + <spatial:boundaryCondition xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" spatial:boundaryDomainType="Extracellular" spatial:coordinateBoundary="Ymax" spatial:variable="s1_EC" spatial:type="DIRICHLET"/> + </parameter> + <parameter id="KMOLE" constant="true" value="0.00166112956810631" units="uM_um3_molecules_1"/> + </listOfParameters> + <listOfRules> + <assignmentRule metaid="CDMT00006" variable="s2_nuc"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <ci> x </ci> + </math> + </assignmentRule> + </listOfRules> + <listOfReactions> + <reaction id="flux1" name="flux1" reversible="true" fast="false"> + <listOfReactants> + <speciesReference species="s1_cyt" stoichiometry="1"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="s1_nuc" stoichiometry="1"/> + </listOfProducts> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <times/> + <cn> 5 </cn> + <ci> s1_cyt </ci> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="I" value="0" units="pA_um_2"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="flux2" name="flux2" reversible="true" fast="false"> + <listOfReactants> + <speciesReference species="s1_cyt" stoichiometry="1"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="s1_EC" stoichiometry="1"/> + </listOfProducts> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <times/> + <cn> 5 </cn> + <ci> s1_cyt </ci> + </apply> + </math> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> \ No newline at end of file Modified: trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field.xml =================================================================== --- trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field.xml 2015-04-24 08:27:11 UTC (rev 2260) +++ trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field.xml 2015-04-25 08:57:10 UTC (rev 2261) @@ -97,7 +97,6 @@ <req:listOfChangedMaths> <req:changedMath req:changedBy="spatial" req:viableWithoutChange="true"/> </req:listOfChangedMaths> - <spatial:spatialSymbolReference spatial:spatialRef="spatial"/> </species> <species id="s1_cyt" compartment="Cytosol" initialConcentration="10" substanceUnits="molecules" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" spatial:isSpatial="true"> <annotation> @@ -110,7 +109,6 @@ <req:listOfChangedMaths> <req:changedMath req:changedBy="spatial" req:viableWithoutChange="true"/> </req:listOfChangedMaths> - <spatial:spatialSymbolReference spatial:spatialRef="spatial"/> </species> <species id="s2_nuc" compartment="Nucleus" initialConcentration="5" substanceUnits="molecules" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" spatial:isSpatial="true"> <annotation> @@ -123,7 +121,6 @@ <req:listOfChangedMaths> <req:changedMath req:changedBy="spatial" req:viableWithoutChange="true"/> </req:listOfChangedMaths> - <spatial:spatialSymbolReference spatial:spatialRef="spatial"/> </species> <species id="s1_EC" compartment="Extracellular" initialConcentration="0" substanceUnits="molecules" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" spatial:isSpatial="true"> <annotation> @@ -136,7 +133,6 @@ <req:listOfChangedMaths> <req:changedMath req:changedBy="spatial" req:viableWithoutChange="true"/> </req:listOfChangedMaths> - <spatial:spatialSymbolReference spatial:spatialRef="spatial"/> </species> </listOfSpecies> <listOfParameters> @@ -147,61 +143,49 @@ <spatial:spatialSymbolReference spatial:id="y"/> </parameter> <parameter id="s1_nuc_diff" value="10" constant="true"> - <spatial:diffusionCoefficient spatial:variable="s1_nuc" spatial:type="isotropic"/> - <spatial:listOfCoordinateReferences> - <spatial:coordinateReference spatial:coordinate="cartesianX"/> - <spatial:coordinateReference spatial:coordinate="cartesianY"/> - </spatial:listOfCoordinateReferences> + <spatial:diffusionCoefficient spatial:variable="s1_nuc" spatial:type="isotropic" spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY"/> </parameter> <parameter id="s1_nuc_BC_Xm" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Xmin" spatial:type="Dirichlet" spatial:boundaryDomainType="Nucleus"/> + <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Xmin" spatial:type="dirichlet" spatial:boundaryDomainType="Nucleus"/> </parameter> <parameter id="s1_nuc_BC_Xp" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Xmax" spatial:type="Dirichlet" spatial:boundaryDomainType="Nucleus"/> + <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Xmax" spatial:type="dirichlet" spatial:boundaryDomainType="Nucleus"/> </parameter> <parameter id="s1_nuc_BC_Ym" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Ymin" spatial:type="Dirichlet" spatial:boundaryDomainType="Nucleus"/> + <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Ymin" spatial:type="dirichlet" spatial:boundaryDomainType="Nucleus"/> </parameter> <parameter id="s1_nuc_BC_Yp" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Ymax" spatial:type="Dirichlet" spatial:boundaryDomainType="Nucleus"/> + <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Ymax" spatial:type="dirichlet" spatial:boundaryDomainType="Nucleus"/> </parameter> <parameter id="s1_cyt_diff" value="10" constant="true"> - <spatial:diffusionCoefficient spatial:variable="s1_cyt" spatial:type="isotropic"/> - <spatial:listOfCoordinateReferences> - <spatial:coordinateReference spatial:coordinate="cartesianX"/> - <spatial:coordinateReference spatial:coordinate="cartesianY"/> - </spatial:listOfCoordinateReferences> + <spatial:diffusionCoefficient spatial:variable="s1_cyt" spatial:type="isotropic" spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY"/> </parameter> <parameter id="s1_cyt_BC_Xm" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Xmin" spatial:type="Dirichlet" spatial:boundaryDomainType="Cytosol"/> + <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Xmin" spatial:type="dirichlet" spatial:boundaryDomainType="Cytosol"/> </parameter> <parameter id="s1_cyt_BC_Xp" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Xmax" spatial:type="Dirichlet" spatial:boundaryDomainType="Cytosol"/> + <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Xmax" spatial:type="dirichlet" spatial:boundaryDomainType="Cytosol"/> </parameter> <parameter id="s1_cyt_BC_Ym" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Ymin" spatial:type="Dirichlet" spatial:boundaryDomainType="Cytosol"/> + <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Ymin" spatial:type="dirichlet" spatial:boundaryDomainType="Cytosol"/> </parameter> <parameter id="s1_cyt_BC_Yp" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Ymax" spatial:type="Dirichlet"/> + <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Ymax" spatial:type="dirichlet"/> </parameter> <parameter id="s1_EC_diff" value="10" constant="true"> - <spatial:diffusionCoefficient spatial:variable="s1_EC" spatial:type="isotropic"/> - <spatial:listOfCoordinateReferences> - <spatial:coordinateReference spatial:coordinate="cartesianX"/> - <spatial:coordinateReference spatial:coordinate="cartesianY"/> - </spatial:listOfCoordinateReferences> + <spatial:diffusionCoefficient spatial:variable="s1_EC" spatial:type="isotropic" spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY"/> </parameter> <parameter id="s1_EC_BC_Xm" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Xmin" spatial:type="Dirichlet" spatial:boundaryDomainType="Extracellular"/> + <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Xmin" spatial:type="dirichlet" spatial:boundaryDomainType="Extracellular"/> </parameter> <parameter id="s1_EC_BC_Xp" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Xmax" spatial:type="Dirichlet" spatial:boundaryDomainType="Extracellular"/> + <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Xmax" spatial:type="dirichlet" spatial:boundaryDomainType="Extracellular"/> </parameter> <parameter id="s1_EC_BC_Ym" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Ymin" spatial:type="Dirichlet" spatial:boundaryDomainType="Extracellular"/> + <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Ymin" spatial:type="dirichlet" spatial:boundaryDomainType="Extracellular"/> </parameter> <parameter id="s1_EC_BC_Yp" value="0" constant="true"> - <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Ymax" spatial:type="Dirichlet" spatial:boundaryDomainType="Extracellular"/> + <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Ymax" spatial:type="dirichlet" spatial:boundaryDomainType="Extracellular"/> </parameter> <parameter id="KMOLE" value="0.00166112956810631" units="uM_um3_molecules_1" constant="true"/> </listOfParameters> @@ -292,7 +276,7 @@ </spatial:sampledFieldGeometry> </spatial:listOfGeometryDefinitions> <spatial:listOfSampledFields> - <spatial:sampledField spatial:id="imgtest" spatial:dataType="uint8" spatial:numSamples1="800" spatial:numSamples2="950" spatial:numSamples3="1" spatial:interpolationType="linear" spatial:compression="deflated" spatial:samplesLength="3440">120 218 237 221 193 142 27 57 12 64 193 124 122 255 185 22 216 195 30 54 240 216 238 97 83 20 89 239 154 75 183 168 2 237 96 146 249 243 71 146 36 73 146 36 73 146 36 73 26 217 117 57 3 233 181 15 64 164 215 60 248 144 248 144 238 240 224 67 226 67 226 67 138 229 193 135 196 135 196 135 196 135 148 197 131 15 137 15 137 15 137 15 41 139 7 31 18 31 18 31 82 44 15 62 36 62 36 62 164 88 30 124 72 124 72 124 72 177 60 248 144 248 144 248 144 98 121 240 33 241 33 241 33 197 242 224 67 226 67 226 67 226 67 202 226 193 135 196 135 196 135 20 203 3 16 137 15 137 15 137 15 137 15 169 0 15 62 36 62 36 31 175 36 62 36 62 164 237 62 28 136 100 125 72 124 72 124 72 124 72 124 72 133 121 240 33 241 33 241 33 241 33 101 241 224 67 226 67 186 229 3 16 137 + <spatial:sampledField spatial:id="imgtest" spatial:dataType="uint8" spatial:numSamples1="800" spatial:numSamples2="950" spatial:numSamples3="1" spatial:interpolation="linear" spatial:compression="deflated" spatial:samplesLength="3440">120 218 237 221 193 142 27 57 12 64 193 124 122 255 185 22 216 195 30 54 240 216 238 97 83 20 89 239 154 75 183 168 2 237 96 146 249 243 71 146 36 73 146 36 73 146 36 73 26 217 117 57 3 233 181 15 64 164 215 60 248 144 248 144 238 240 224 67 226 67 226 67 138 229 193 135 196 135 196 135 196 135 148 197 131 15 137 15 137 15 137 15 41 139 7 31 18 31 18 31 82 44 15 62 36 62 36 62 164 88 30 124 72 124 72 124 72 177 60 248 144 248 144 248 144 98 121 240 33 241 33 241 33 197 242 224 67 226 67 226 67 226 67 202 226 193 135 196 135 196 135 20 203 3 16 137 15 137 15 137 15 137 15 169 0 15 62 36 62 36 31 175 36 62 36 62 164 237 62 28 136 100 125 72 124 72 124 72 124 72 124 72 133 121 240 33 241 33 241 33 241 33 101 241 224 67 226 67 186 229 3 16 137 15 233 14 15 62 36 62 36 62 36 62 164 52 31 128 72 175 121 240 33 241 33 241 33 241 33 101 241 224 67 250 193 7 32 18 31 18 31 82 176 15 64 164 215 60 248 144 248 144 248 144 248 144 248 144 246 243 224 67 226 67 186 229 3 16 241 193 135 196 135 20 203 131 15 241 193 135 196 135 20 236 3 16 241 193 135 116 135 7 31 226 131 15 137 15 137 15 137 15 137 15 137 15 137 15 169 27 15 62 196 7 32 18 31 18 31 82 26 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 32 18 31 82 48 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 64 196 7 31 18 31 18 31 82 26 15 62 196 7 31 210 45 31 128 8 15 62 36 62 36 62 36 62 164 253 60 248 16 31 128 72 124 72 193 60 248 16 31 124 72 124 72 177 60 248 16 31 124 72 124 72 124 72 89 60 0 17 31 124 136 15 62 164 96 30 124 136 15 62 196 7 31 18 31 82 22 15 62 196 7 31 226 131 15 41 150 7 31 226 13 1 15 241 193 135 20 203 131 15 241 193 135 248 224 67 138 229 193 135 248 224 67 124 240 33 197 242 224 67 124 240 33 62 248 144 98 121 240 33 62 248 16 31 124 72 124 72 89 60 248 16 31 124 136 15 62 164 88 30 124 136 15 62 196 7 30 146 245 33 241 33 241 33 241 33 29 201 131 15 241 193 135 248 224 67 138 229 193 135 248 224 67 124 240 33 197 242 224 67 124 240 33 62 248 144 240 144 248 144 248 144 10 243 224 67 124 240 33 62 240 144 172 15 137 15 137 15 169 48 15 62 196 7 31 226 3 15 201 250 144 248 144 248 144 10 243 224 67 124 240 33 60 240 144 248 144 146 120 240 33 62 248 16 31 124 72 177 60 248 16 31 124 8 15 62 36 62 36 62 164 253 60 248 16 31 124 8 15 62 36 62 36 60 36 62 164 194 60 248 16 31 124 136 15 62 164 88 30 124 136 15 62 132 7 31 18 31 18 31 210 126 30 124 136 15 64 132 7 31 226 131 15 41 141 7 31 226 3 16 241 193 135 240 224 67 226 67 42 192 3 16 241 193 135 248 224 67 120 0 34 37 250 0 68 120 0 34 62 0 17 30 128 72 153 62 0 17 31 128 8 15 62 196 7 31 82 26 15 62 196 7 30 194 131 15 241 129 135 132 135 196 135 84 214 135 19 22 30 120 136 15 62 132 7 30 18 31 210 102 30 124 136 15 60 132 7 31 226 131 15 9 15 137 15 169 46 15 62 196 7 31 226 131 15 225 193 135 196 135 180 159 7 31 226 131 15 225 193 135 248 224 67 202 226 193 135 248 224 67 120 240 33 62 248 144 178 120 240 33 60 248 16 31 124 8 15 62 196 7 31 210 126 30 124 136 15 62 132 7 31 226 3 16 225 193 135 196 135 84 154 7 31 226 131 15 225 193 135 248 224 67 120 240 33 241 33 85 230 193 135 248 224 67 120 240 33 62 248 16 30 124 72 124 72 149 121 240 33 60 248 16 31 124 8 15 62 196 7 31 210 126 30 124 136 15 62 132 7 31 226 131 15 225 193 135 196 135 84 153 7 31 226 131 15 225 193 135 240 0 68 124 240 33 21 224 193 135 248 224 67 120 240 33 60 248 16 31 124 72 251 121 0 34 60 248 16 31 124 8 15 62 196 7 32 194 131 15 169 54 15 62 196 7 31 194 131 15 241 193 135 240 224 67 120 240 33 241 33 157 201 131 15 225 1 136 248 224 67 120 240 33 60 248 16 31 124 72 165 121 240 33 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-24 08:27:13
|
Revision: 2260 http://sourceforge.net/p/jsbml/code/2260 Author: pdp10 Date: 2015-04-24 08:27:11 +0000 (Fri, 24 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledVolume.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 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-24 08:22:38 UTC (rev 2259) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-24 08:27:11 UTC (rev 2260) @@ -825,8 +825,7 @@ @Override public boolean readAttribute(String attributeName, String prefix, String value) { - boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) - && (SpatialConstants.shortLabel == prefix); + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.numSamples1)) { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledVolume.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledVolume.java 2015-04-24 08:22:38 UTC (rev 2259) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledVolume.java 2015-04-24 08:27:11 UTC (rev 2260) @@ -395,7 +395,7 @@ SpatialConstants.domainType); } } - if (attributeName.equals(SpatialConstants.sampledValue)) { + else if (attributeName.equals(SpatialConstants.sampledValue)) { try { setSampledValue(StringTools.parseSBMLDouble(value)); } catch (Exception e) { @@ -403,7 +403,7 @@ SpatialConstants.sampledValue); } } - if (attributeName.equals(SpatialConstants.minValue)) { + else if (attributeName.equals(SpatialConstants.minValue)) { try { setMinValue(StringTools.parseSBMLDouble(value)); } catch (Exception e) { @@ -411,7 +411,7 @@ SpatialConstants.minValue); } } - if (attributeName.equals(SpatialConstants.maxValue)) { + else if (attributeName.equals(SpatialConstants.maxValue)) { try { setMaxValue(StringTools.parseSBMLDouble(value)); } catch (Exception e) { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-24 08:22:38 UTC (rev 2259) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-24 08:27:11 UTC (rev 2260) @@ -528,6 +528,11 @@ public static final String spatialRef = "spatialRef"; /** + * + */ + public static final Object listOfSampledFields = "listOfSampledFields"; + + /** * @param level * @param version * @return Modified: trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-24 08:22:38 UTC (rev 2259) +++ trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-24 08:27:11 UTC (rev 2260) @@ -191,7 +191,6 @@ public void processAttribute(String elementName, String attributeName, String value, String uri, String prefix, boolean isLastAttribute, Object contextObject) { - if (contextObject instanceof Species) { Species species = (Species) contextObject; SpatialSpeciesPlugin spatialSpecies = null; @@ -302,7 +301,11 @@ } else if (elementName.equals(SpatialConstants.listOfGeometryDefinitions)) { ListOf<GeometryDefinition> listOfGeometryDefinitions = geometry.getListOfGeometryDefinitions(); return listOfGeometryDefinitions; + } else if (elementName.equals(SpatialConstants.listOfSampledFields)) { + ListOf<SampledField> listOfSampledFields = geometry.getListOfSampledFields(); + return listOfSampledFields; } + } else if (contextObject instanceof CoordinateComponent) { CoordinateComponent cc = (CoordinateComponent) contextObject; if (elementName.equals(SpatialConstants.boundaryMinimum)) { @@ -332,20 +335,7 @@ if (elementName.equals(SpatialConstants.listOfSampledVolumes)){ ListOf<SampledVolume> listOfSampledVolumes = sfg.getListOfSampledVolumes(); return listOfSampledVolumes; - // } else if (elementName.equals(SpatialConstants.sampledField)){ - // SampledField sf = new SampledField(); // SampleField is not a child anymore in 0.88 but just a SIdRef - // sfg.setSampledField(sf); - // return sf; } - // NOTE: This has been moved in the listOf section below. -// } else if (contextObject instanceof SampledField) { - // SampledField sf = (SampledField) contextObject; // No more child in 0.88 - // if (elementName.equals(SpatialConstants.imageData)){ - // ImageData im = new ImageData(); - // sf.setImageData(im); - // // sf.set - // return im; - // } } else if (contextObject instanceof CSGeometry) { CSGeometry csg = (CSGeometry) contextObject; if (elementName.equals(SpatialConstants.listOfCSGObjects)){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-04-24 08:22:46
|
Revision: 2259 http://sourceforge.net/p/jsbml/code/2259 Author: andreas-draeger Date: 2015-04-24 08:22:38 +0000 (Fri, 24 Apr 2015) Log Message: ----------- The JSBML template now also makes use of localization support. Modified Paths: -------------- trunk/dev/eclipse/JSBML_templates.xml Modified: trunk/dev/eclipse/JSBML_templates.xml =================================================================== --- trunk/dev/eclipse/JSBML_templates.xml 2015-04-24 08:07:52 UTC (rev 2258) +++ trunk/dev/eclipse/JSBML_templates.xml 2015-04-24 08:22:38 UTC (rev 2259) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="true" context="java" deleted="false" description="getAllowsChildren-, getChildcount-, getChildAt- methods" enabled="true" name="JSBML_Children">${:import(java.text.MessageFormat, org.sbml.jsbml.ListOf, org.sbml.jsbml.SBase)} @Override -public boolean getAllowsChildren() { +public boolean getAllowsChildren() { return ${true_false}; } @@ -9,7 +9,7 @@ int count = super.getChildCount(); - // TODO: the following must be implemented for each XML child variable + // TODO: the following must be implemented for each XML child variable // if (isSetListOfFoos()) { // count++; // } @@ -17,32 +17,33 @@ return count; } - public TreeNode getChildAt(int index) { - if (index < 0) { - throw new IndexOutOfBoundsException(index + " < 0"); - } + public TreeNode getChildAt(int index) { + if (index < 0) { + throw new IndexOutOfBoundsException(MessageFormat.format( + resourceBundle.getString("IndexSurpassesBoundsException"), index, 0)); + } - int count = super.getChildCount(), pos = 0; - - if (index < count) { - return super.getChildAt(index); - } else { - index -= count; - } + int count = super.getChildCount(), pos = 0; + + if (index < count) { + return super.getChildAt(index); + } else { + index -= count; + } - // TODO: the following must be implemented for each ListOf* variable - // if (isSetListOfFoos()) { - // if (pos == index) { - // return getListOfFoos(); - // } - // pos++; - // } + // TODO: the following must be implemented for each ListOf* variable + // if (isSetListOfFoos()) { + // if (pos == index) { + // return getListOfFoos(); + // } + // pos++; + // } - throw new IndexOutOfBoundsException(MessageFormat.format( - "Index {0,number,integer} >= {1,number,integer}", - index, Math.min(pos, 0))); - } - + throw new IndexOutOfBoundsException(MessageFormat.format( + resourceBundle.getString("IndexExceedsBoundsException"), + index, Math.min(pos, 0))); + } + </template> <template autoinsert="false" context="java" deleted="false" description="Standard constructors for JSBML classes" enabled="true" name="JSBML_Constructors_id_name">/** * Creates an ${enclosing_type} instance @@ -105,7 +106,7 @@ public ${enclosing_type}(${enclosing_type} obj) { super(obj); - // TODO: copy all class attributes, e.g.: + // TODO: copy all class attributes, e.g.: // bar = obj.bar; } @@ -204,10 +205,10 @@ listOf${Field:var}s.setSBaseListType(ListOf.Type.other); // TODO - if the class containing this code is not of type SBasePlugin, replace the 3 lines by just "registerChild(listOf${Field:var}s);" - if (isSetExtendedSBase()) { - extendedSBase.registerChild(listOf${Field:var}s); - } + if (isSetExtendedSBase()) { + extendedSBase.registerChild(listOf${Field:var}s); } + } return listOf${Field:var}s; } @@ -225,7 +226,7 @@ // TODO - if the class containing this code is not of type SBasePlugin, replace the 3 lines by just "registerChild(listOf${Field:var}s);" if (isSetExtendedSBase()) { - extendedSBase.registerChild(this.listOf${Field:var}s); + extendedSBase.registerChild(this.listOf${Field:var}s); } } @@ -416,7 +417,7 @@ if (!isAttributeRead) { isAttributeRead = true; - // TODO: this must be done for each attribute + // TODO: this must be done for each attribute if (attributeName.equals(${constants_class}.${field:var})) { set${Field:var}(StringTools.parseSBMLInt(value)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-04-24 08:07:54
|
Revision: 2258 http://sourceforge.net/p/jsbml/code/2258 Author: andreas-draeger Date: 2015-04-24 08:07:52 +0000 (Fri, 24 Apr 2015) Log Message: ----------- * Updated version number in JSBML class to 1.1-alpha * Finished extracting all user-messages from ASTNode Modified Paths: -------------- trunk/core/resources/org/sbml/jsbml/resources/Messages.xml trunk/core/src/org/sbml/jsbml/ASTNode.java trunk/core/src/org/sbml/jsbml/JSBML.java Modified: trunk/core/resources/org/sbml/jsbml/resources/Messages.xml =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/Messages.xml 2015-04-24 07:38:30 UTC (rev 2257) +++ trunk/core/resources/org/sbml/jsbml/resources/Messages.xml 2015-04-24 08:07:52 UTC (rev 2258) @@ -92,5 +92,10 @@ <entry key="ASTNode.reduceToBinary3">NOT node with {0,number,integer} children left unchanged</entry> <entry key="ASTNode.reduceToBinary4">XOR node with {0,number,integer} children left unchanged</entry> <entry key="ASTNode.reduceToBinary5">{0} node with {1,number,integer} children left unchanged</entry> + <entry key="ASTNode.setType">setType called: typeBefore={0} typeAfter={1}</entry> + <entry key="ASTNode.setUnits1">Unexpected attribute {0}, a unit can only be assigned to literal numbers.</entry> + <entry key="ASTNode.setUnits2">Unexpected attribute {0}, only a valid unit kind or the identifier of a unit definition are allowed here.</entry> + <entry key="ASTNode.setUnits3">Cannot set unit {0} for a numbers in an ASTNode before SBML Level 3.</entry> + <entry key="ASTNode.toString">Could not compile ASTNode to formula: {0}</entry> </properties> \ No newline at end of file Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-04-24 07:38:30 UTC (rev 2257) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-04-24 08:07:52 UTC (rev 2258) @@ -3775,7 +3775,7 @@ String sType = type.toString(); if (logger.isDebugEnabled()) { - logger.debug(MessageFormat.format("setType called: typeBefore={0} typeAfter={1}", this.type, sType)); + logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.setType"), this.type, sType)); } if (sType.startsWith("NAME") || sType.startsWith("CONSTANT")) { @@ -3815,18 +3815,18 @@ public void setUnits(String unitId) { if (!isNumber()) { throw new IllegalArgumentException(MessageFormat.format( - "Unexpected attribute {0}, a unit can only be assigned to literal numbers.", + resourceBundle.getString("ASTNode.setUnits1"), unitId)); } if (parentSBMLObject != null) { if (!Unit.isValidUnit(parentSBMLObject.getModel(), unitId)) { throw new IllegalArgumentException(MessageFormat.format( - "Unexpected attribute {0}, only a valid unit kind or the identifier of a unit definition are allowed here.", + resourceBundle.getString("ASTNode.setUnits2"), unitId)); } if (parentSBMLObject.isSetLevel() && (parentSBMLObject.getLevel() < 3)) { throw new IllegalArgumentException(MessageFormat.format( - "Cannot set unit {0} for a numbers in an ASTNode before SBML Level 3.", + resourceBundle.getString("ASTNode.setUnits3"), unitId)); } } @@ -4104,7 +4104,6 @@ @Override public String toString() { String formula = ""; - String errorMsg = "Could not compile ASTNode to formula: "; try { formula = compile(new FormulaCompiler()).toString(); } catch (SBMLException e) { @@ -4112,15 +4111,15 @@ e.printStackTrace(); if (logger.isDebugEnabled()) { - logger.error(errorMsg, e); + logger.error(MessageFormat.format(resourceBundle.getString("ASTNode.toString"), e.getMessage()), e); } else { // TODO: Do not print this message if parsing the file !!! Or remove it - logger.warn(errorMsg + e.getMessage()); + logger.warn(MessageFormat.format(resourceBundle.getString("ASTNode.toString"), e.getMessage())); } } catch (RuntimeException e) { // added to prevent a crash when we cannot create the formula if (logger.isDebugEnabled()) { - logger.error(errorMsg, e); + logger.error(MessageFormat.format(resourceBundle.getString("ASTNode.toString"), e.getMessage()), e); } } return formula; Modified: trunk/core/src/org/sbml/jsbml/JSBML.java =================================================================== --- trunk/core/src/org/sbml/jsbml/JSBML.java 2015-04-24 07:38:30 UTC (rev 2257) +++ trunk/core/src/org/sbml/jsbml/JSBML.java 2015-04-24 08:07:52 UTC (rev 2258) @@ -80,7 +80,7 @@ /** * The current version number of JSBML. */ - private static final String jsbmlVersion = "1.0-rc1"; // TODO: replace automatically this version number with [BUILD.NUMBER] + private static final String jsbmlVersion = "1.1-alpha"; // TODO: replace automatically this version number with [BUILD.NUMBER] /** * */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-04-24 07:38:40
|
Revision: 2257 http://sourceforge.net/p/jsbml/code/2257 Author: andreas-draeger Date: 2015-04-24 07:38:30 +0000 (Fri, 24 Apr 2015) Log Message: ----------- * extracted more text into an XML file for localization support. * implemented two methods for appending annotations to SBase for improved libSBML compatibility and usability of JSBML. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ASTNode.java trunk/core/src/org/sbml/jsbml/AbstractSBase.java trunk/core/src/org/sbml/jsbml/AbstractTreeNode.java trunk/core/src/org/sbml/jsbml/Annotation.java trunk/core/src/org/sbml/jsbml/Assignment.java trunk/core/src/org/sbml/jsbml/EventAssignment.java trunk/core/src/org/sbml/jsbml/ExplicitRule.java trunk/core/src/org/sbml/jsbml/InitialAssignment.java trunk/core/src/org/sbml/jsbml/SBase.java Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-04-24 07:37:38 UTC (rev 2256) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java 2015-04-24 07:38:30 UTC (rev 2257) @@ -563,12 +563,6 @@ } /** - * Message to indicate that an {@link ASTNode.Type} type has been chosen - * which cannot be used as an operator. - */ - public static final transient String INVALID_OPERATOR_MSG = "Invalid operator {0}. The operator must be one of the following constants: PLUS, MINUS, TIMES, DIVIDE, or POWER."; - - /** * Generated serial version identifier. */ private static final long serialVersionUID = -1391327698196553142L; @@ -668,7 +662,7 @@ return arithmetic; } else { throw new IllegalArgumentException(MessageFormat.format( - INVALID_OPERATOR_MSG, operator)); + resourceBundle.getString("ASTNode.INVALID_OPERATOR_MSG"), operator)); } } @@ -872,8 +866,7 @@ */ public static ASTNode log(ASTNode base, ASTNode value) { if (value == null) { - throw new NullPointerException( - "logarithm cannot be created for null values"); + throw new NullPointerException(resourceBundle.getString("ASTNode.log")); } ASTNode log = new ASTNode(Type.FUNCTION_LOG, value .getParentSBMLObject()); @@ -1159,8 +1152,7 @@ */ private static ASTNode relational(Type type, ASTNode left, ASTNode right) { if ((left == null) || (right == null)) { - throw new NullPointerException( - "Cannot create a relational node with null arguments."); + throw new NullPointerException(resourceBundle.getString("ASTNode.relational")); } ASTNode relational = new ASTNode(type, left.getParentSBMLObject()); relational.addChild(left); @@ -1420,7 +1412,9 @@ parentSBMLObject = null; initDefaults(); - logger.debug("Clone constructor: Origin type = " + astNode.type); + if (logger.isDebugEnabled()) { + logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode1"), astNode.type)); + } setType(astNode.getType()); denominator = astNode.denominator; @@ -1673,7 +1667,7 @@ || (operator == Type.TIMES) || (operator == Type.DIVIDE) || (operator == Type.POWER) || (operator == Type.FUNCTION_ROOT)) { if (astnode.isZero() && (operator == Type.DIVIDE)) { - throw new IllegalArgumentException("Cannot divide by zero."); + throw new IllegalArgumentException(resourceBundle.getString("ASTNode.arithmeticOperation")); } if (!(astnode.isOne() && ((operator == Type.TIMES) || (operator == Type.DIVIDE)))) { /* @@ -1707,7 +1701,7 @@ } } else { throw new IllegalArgumentException(MessageFormat.format( - INVALID_OPERATOR_MSG, operator)); + resourceBundle.getString("ASTNode.INVALID_OPERATOR_MSG"), operator)); } } @@ -1780,8 +1774,7 @@ int childCount = getChildCount(); if (childCount != 2) { throw new SBMLException(MessageFormat.format( - "Fractions must have one numerator and one denominator, here {0,number,integer} elements are given.", - childCount)); + resourceBundle.getString("ASTNode.compile1"), childCount)); } value = compiler.frac(getLeftChild(), getRightChild()); break; @@ -1976,21 +1969,16 @@ value = compiler.function((FunctionDefinition) variable, getChildren()); } else { - logger - .warn("ASTNode of type FUNCTION but the variable is not a FunctionDefinition! (" - + getName() - + ", " - + getParentSBMLObject().getElementName() - + ")"); - throw new SBMLException( - "ASTNode of type FUNCTION but the variable is not a FunctionDefinition! (" - + getName() + ", " + getParentSBMLObject().getElementName() - + ")"); + String message = MessageFormat.format( + resourceBundle.getString("ASTNode.compile2"), + getName(), getParentSBMLObject().getElementName()); + logger.warn(message); + throw new SBMLException(message); // value = compiler.compile(variable); } } else { logger.debug(MessageFormat.format( - "ASTNode of type FUNCTION but the variable is null: ({0}, {1})! Check that your object is linked to a Model.", + resourceBundle.getString("ASTNode.compile3"), getName(), (getParentSBMLObject() != null ? getParentSBMLObject().getElementName() : null))); value = compiler.function(getName(), getChildren()); } @@ -2264,8 +2252,7 @@ break; } } - throw new IllegalArgumentException( - "getCharacter() should be called only when isOperator()."); + throw new IllegalArgumentException(resourceBundle.getString("ASTNode.compile4")); } /** @@ -2338,8 +2325,7 @@ if (isRational()) { return denominator; } - throw new IllegalArgumentException( - "getDenominator() should be called only when getType() == RATIONAL."); + throw new IllegalArgumentException(resourceBundle.getString("ASTNode.getDenominator")); } /** @@ -2353,7 +2339,7 @@ /** * Gets the exponent value of this ASTNode. This function should be called - * only when getType() returns REAL_E or REAL, otherwise an Exception is + * only when {@link #getType()} returns REAL_E or REAL, otherwise an Exception is * thrown. * * @return the value of the exponent of this ASTNode. @@ -2364,8 +2350,7 @@ if (type == Type.REAL || type == Type.REAL_E) { return exponent; } - throw new IllegalArgumentException( - "getExponent() should be called only when getType() == REAL_E or REAL"); + throw new IllegalArgumentException(resourceBundle.getString("ASTNode.getExponent")); } /** @@ -2389,8 +2374,7 @@ if (isInteger()) { return numerator; } - throw new IllegalArgumentException( - "getInteger() should be called only when getType() == INTEGER"); + throw new IllegalArgumentException(resourceBundle.getString("ASTNode.getInteger")); } /** @@ -2443,8 +2427,7 @@ if ((type == Type.REAL) || type == Type.REAL_E) { return mantissa; } - throw new IllegalArgumentException( - "getMantissa() should be called only when getType() == REAL or REAL_E"); + throw new IllegalArgumentException(resourceBundle.getString("ASTNode.getMantissa")); } /** @@ -2460,8 +2443,7 @@ if (!isOperator() && !isNumber()) { return (variable == null) ? name : variable.getId(); } - throw new IllegalArgumentException( - "getName() should be called only when !isNumber() && !isOperator()"); + throw new IllegalArgumentException(resourceBundle.getString("ASTNode.getName")); } /** @@ -2477,8 +2459,7 @@ if (isRational()) { return numerator; } - throw new IllegalArgumentException( - "getNumerator() should be called only when isRational()"); + throw new IllegalArgumentException(resourceBundle.getString("ASTNode.getNumerator")); } /* (non-Javadoc) @@ -2538,8 +2519,7 @@ } else if (isInteger()) { return getInteger(); } - throw new IllegalArgumentException( - "getReal() should be called only when isReal() returns true."); + throw new IllegalArgumentException(resourceBundle.getString("ASTNode.getReal")); } /** @@ -2557,9 +2537,9 @@ if (getVariable() != null) { l.add(getVariable()); } else { - System.err.printf( - "Name of this node is %s but no variable is set.\n", - getName()); + logger.warn(MessageFormat.format( + resourceBundle.getString("ASTNode.getReferencedNamedSBases"), + getName())); } } for (ASTNode child : listOfNodes) { @@ -2666,9 +2646,11 @@ * comprises only the first n children. Child n + 1 is the * expression for the function. */ - logger.debug(MessageFormat.format( - "The name \"{0}\" represented by this node is an argument in a function call, i.e., a placeholder for some other element. No corresponding CallableSBase exists in the model", - getName())); + if (logger.isDebugEnabled()) { + logger.debug(MessageFormat.format( + resourceBundle.getString("ASTNode.getVariable1"), + getName())); + } return variable; } } @@ -2685,7 +2667,7 @@ // in this case the parameter originates from a // different kinetic law. variable = null; - } else if (variable == null) { + } else if ((variable == null) && logger.isDebugEnabled()) { // Could be any L3 package elements // that is not a CallableSBase // TODO: Actually, if something can be addressed in an ASTNode, @@ -2693,12 +2675,12 @@ // package. // variable = m.findNamedSBase(getName()); logger.debug(MessageFormat.format( - "Cannot find any element with id \"{0}\" in the model.", + resourceBundle.getString("ASTNode.getVariable2"), getName())); } - } else { + } else if (logger.isDebugEnabled()) { logger.debug(MessageFormat.format( - "This ASTNode is not yet linked to a model and can therefore not determine its variable \"{0}\".", + resourceBundle.getString("ASTNode.getVariable3"), getName())); } } @@ -2706,7 +2688,7 @@ } return variable; } - throw new RuntimeException("getVariable() should be called only when isVariable() == true."); + throw new RuntimeException(resourceBundle.getString("ASTNode.getVariable4")); } /* (non-Javadoc) @@ -2771,7 +2753,9 @@ */ private void initDefaults() { ASTNode old = this; - logger.debug("initDefaults called! type was " + (type == null ? Type.UNKNOWN : type)); + if (logger.isDebugEnabled()) { + logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.initDefaults"), (type == null ? Type.UNKNOWN : type))); + } type = Type.UNKNOWN; @@ -3460,7 +3444,9 @@ break; case MINUS: // TODO - logger.debug(MessageFormat.format("MINUS node with {0,number,integer} children left unchanged", getChildCount())); + if (logger.isDebugEnabled()) { + logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.reduceToBinary1"), getChildCount())); + } break; case TIMES: ASTNode times = new ASTNode(Type.TIMES, parentSBMLObject); @@ -3475,7 +3461,9 @@ break; case DIVIDE: // TODO - logger.debug(MessageFormat.format("DIVIDE node with {0,number,integer} children left unchanged", getChildCount())); + if (logger.isDebugEnabled()) { + logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.reduceToBinary2"), getChildCount())); + } break; case LOGICAL_AND: ASTNode and = new ASTNode(Type.LOGICAL_AND, parentSBMLObject); @@ -3493,15 +3481,21 @@ break; case LOGICAL_NOT: // TODO - logger.debug(MessageFormat.format("NOT node with {0,number,integer} children left unchanged", getChildCount())); + if (logger.isDebugEnabled()) { + logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.reduceToBinary3"), getChildCount())); + } break; case LOGICAL_XOR: // TODO - logger.debug(MessageFormat.format("XOR node with {0,number,integer} children left unchanged", getChildCount())); + if (logger.isDebugEnabled()) { + logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.reduceToBinary4"), getChildCount())); + } break; default: // TODO - logger.debug(MessageFormat.format("{0} node with {1,number,integer} children left unchanged", getType(), getChildCount())); + if (logger.isDebugEnabled()) { + logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.reduceToBinary5"), getType(), getChildCount())); + } break; } } @@ -3781,7 +3775,7 @@ String sType = type.toString(); if (logger.isDebugEnabled()) { - logger.debug("setType called: typeBefore = " + this.type + " typeAfter= " + sType); + logger.debug(MessageFormat.format("setType called: typeBefore={0} typeAfter={1}", this.type, sType)); } if (sType.startsWith("NAME") || sType.startsWith("CONSTANT")) { Modified: trunk/core/src/org/sbml/jsbml/AbstractSBase.java =================================================================== --- trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-04-24 07:37:38 UTC (rev 2256) +++ trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2015-04-24 07:38:30 UTC (rev 2257) @@ -78,7 +78,7 @@ * */ NotesHTML - }; + } /** * A logger for this class. @@ -88,7 +88,7 @@ /** * Generated serial version identifier. */ - private static final long serialVersionUID = 8781459818293592636L; + private static final long serialVersionUID = 8781459818293592636L;; /** * Returns {@code true} if the level and version combination is a valid one, {@code false} otherwise. @@ -139,6 +139,11 @@ private final Map<String, String> declaredNamespaces; /** + * the namespace which this SBase element belong to. + */ + private String elementNamespace; + + /** * {@link Map} containing the SBML extension object of additional packages * with the appropriate name space of the package. */ @@ -176,17 +181,6 @@ private XMLNode notesXMLNode; /** - * sbo term of the SBML component. Matches the sboTerm XML attribute of an - * element in a SBML file. - */ - private int sboTerm; - - /** - * the namespace which this SBase element belong to. - */ - private String elementNamespace; - - /** * the name of the package which this SBase element belong to, 'core' by default. */ protected String packageName = "core"; @@ -197,6 +191,12 @@ private int packageVersion = 0; /** + * sbo term of the SBML component. Matches the sboTerm XML attribute of an + * element in a SBML file. + */ + private int sboTerm; + + /** * Creates an AbstractSBase instance. * * <p>By default, the sboTerm is -1, the @@ -363,7 +363,6 @@ } } - /* (non-Javadoc) * @see org.sbml.jsbml.SBase#addPlugin(java.lang.String, org.sbml.jsbml.ext.SBasePlugin) */ @@ -372,28 +371,21 @@ addExtension(nameOrUri, sbasePlugin); } - /** - * Sets the XML namespace 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 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 SBase} belong. + /* (non-Javadoc) + * @see org.sbml.jsbml.SBase#appendAnnotation(java.lang.String) */ - public void setNamespace(String namespace) { - if ((elementNamespace != null) && (!elementNamespace.equals(namespace))) { - // if we implement proper conversion some days, we need to unset the namespace before changing it. - logger.error(MessageFormat.format( - resourceBundle.getString("AbstractSBase.setNamespaceExc"), - elementNamespace, namespace)); - // throw new IllegalArgumentException(MessageFormat.format(resourceBundle.getString("AbstractSBase.setNamespaceExc"), elementNamespace, namespace)); - } - String old = elementNamespace; - elementNamespace = namespace; + @Override + public void appendAnnotation(String annotation) throws XMLStreamException { + getAnnotation().appendNonRDFAnnotation(annotation); + } - firePropertyChange(TreeNodeChangeEvent.namespace, old, namespace); + + /* (non-Javadoc) + * @see org.sbml.jsbml.SBase#appendAnnotation(org.sbml.jsbml.xml.XMLNode) + */ + @Override + public void appendAnnotation(XMLNode annotation) { + getAnnotation().appendNonRDFAnnotation(annotation); } /* (non-Javadoc) @@ -787,7 +779,6 @@ @Override public abstract AbstractSBase clone(); - /** * Creates a new {@link History} and associates it with the annotation of * this element. If no {@link Annotation} exists, a new such element is @@ -801,6 +792,7 @@ return getHistory(); } + /* (non-Javadoc) * @see org.sbml.jsbml.SBase#createPlugin(java.lang.String) */ @@ -856,7 +848,6 @@ } } - /* (non-Javadoc) * @see org.sbml.jsbml.AbstractTreeNode#equals(java.lang.Object) */ @@ -910,7 +901,6 @@ } - /* (non-Javadoc) * @see org.sbml.jsbml.SBase#filterCVTerms(org.sbml.jsbml.CVTerm.Qualifier) */ @@ -919,22 +909,7 @@ return getAnnotation().filterCVTerms(qualifier); } - /* (non-Javadoc) - * @see org.sbml.jsbml.SBase#filterCVTerms(org.sbml.jsbml.CVTerm.Qualifier, java.lang.String) - */ - @Override - public List<String> filterCVTerms(CVTerm.Qualifier qualifier, String pattern) { - return filterCVTerms(qualifier, pattern, false); - } - /* (non-Javadoc) - * @see org.sbml.jsbml.SBase#filterCVTerms(org.sbml.jsbml.CVTerm.Qualifier, java.lang.String, boolean) - */ - @Override - public List<String> filterCVTerms(CVTerm.Qualifier qualifier, String pattern, - boolean recursive) { - return filterCVTerms(qualifier, recursive, pattern); - } /* (non-Javadoc) * @see org.sbml.jsbml.SBase#filterCVTerms(org.sbml.jsbml.CVTerm.Qualifier, boolean, java.lang.String[]) @@ -959,6 +934,44 @@ } /* (non-Javadoc) + * @see org.sbml.jsbml.SBase#filterCVTerms(org.sbml.jsbml.CVTerm.Qualifier, java.lang.String) + */ + @Override + public List<String> filterCVTerms(CVTerm.Qualifier qualifier, String pattern) { + return filterCVTerms(qualifier, pattern, false); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.SBase#filterCVTerms(org.sbml.jsbml.CVTerm.Qualifier, java.lang.String, boolean) + */ + @Override + public List<String> filterCVTerms(CVTerm.Qualifier qualifier, String pattern, + boolean recursive) { + return filterCVTerms(qualifier, recursive, pattern); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractTreeNode#fireNodeRemovedEvent() + */ + @Override + public void fireNodeRemovedEvent() { + + TreeNode parent = getParent(); + + if (logger.isDebugEnabled()) { + logger.debug(MessageFormat.format( + resourceBundle.getString("AbstractSBase.fireNodeRemovedEvent"), + this, parent)); + } + + if ((parent != null) && (parent instanceof SBase)) { + ((SBase) parent).unregisterChild(this); + } + + super.fireNodeRemovedEvent(); + } + + /* (non-Javadoc) * @see org.sbml.jsbml.AbstractTreeNode#firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) */ @Override @@ -993,27 +1006,6 @@ } /* (non-Javadoc) - * @see org.sbml.jsbml.AbstractTreeNode#fireNodeRemovedEvent() - */ - @Override - public void fireNodeRemovedEvent() { - - TreeNode parent = getParent(); - - if (logger.isDebugEnabled()) { - logger.debug(MessageFormat.format( - resourceBundle.getString("AbstractSBase.fireNodeRemovedEvent"), - this, parent)); - } - - if ((parent != null) && (parent instanceof SBase)) { - ((SBase) parent).unregisterChild(this); - } - - super.fireNodeRemovedEvent(); - } - - /* (non-Javadoc) * @see javax.swing.tree.TreeNode#getAllowsChildren() */ @Override @@ -1051,7 +1043,7 @@ @Override public TreeNode getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; if (isSetNotes()) { @@ -1183,7 +1175,6 @@ return 0; } - /* (non-Javadoc) * @see org.sbml.jsbml.SBase#getExtensionPackages() */ @@ -1192,6 +1183,7 @@ return extensions; } + /** * Return the index of the first child of type 'Element' for the given {@link XMLNode}. * @@ -1773,7 +1765,6 @@ return false; } - /** * Registers recursively the given {@link SBasePlugin} from the {@link Model} * and {@link SBMLDocument}. @@ -1811,6 +1802,7 @@ return getAnnotation().removeCVTerm(cvTerm); } + /** * Removes the {@link CVTerm} at the given index. * @@ -1838,19 +1830,19 @@ } /* (non-Javadoc) - * @see org.sbml.jsbml.SBase#setAnnotation(org.sbml.jsbml.xml.XMLNode) + * @see org.sbml.jsbml.SBase#setAnnotation(java.lang.String) */ @Override - public void setAnnotation(XMLNode nonRDFAnnotation) { - getAnnotation().setNonRDFAnnotation(nonRDFAnnotation); + public void setAnnotation(String nonRDFAnnotation) throws XMLStreamException { + setAnnotation(XMLNode.convertStringToXMLNode(StringTools.toXMLAnnotationString(nonRDFAnnotation))); } /* (non-Javadoc) - * @see org.sbml.jsbml.SBase#setAnnotation(java.lang.String) + * @see org.sbml.jsbml.SBase#setAnnotation(org.sbml.jsbml.xml.XMLNode) */ @Override - public void setAnnotation(String nonRDFAnnotation) throws XMLStreamException { - setAnnotation(XMLNode.convertStringToXMLNode(StringTools.toXMLAnnotationString(nonRDFAnnotation))); + public void setAnnotation(XMLNode nonRDFAnnotation) { + getAnnotation().setNonRDFAnnotation(nonRDFAnnotation); } /* (non-Javadoc) @@ -1956,6 +1948,30 @@ firePropertyChange(TreeNodeChangeEvent.metaId, oldMetaId, metaId); } + /** + * Sets the XML namespace 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 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 SBase} belong. + */ + public void setNamespace(String namespace) { + if ((elementNamespace != null) && (!elementNamespace.equals(namespace))) { + // if we implement proper conversion some days, we need to unset the namespace before changing it. + logger.error(MessageFormat.format( + resourceBundle.getString("AbstractSBase.setNamespaceExc"), + elementNamespace, namespace)); + // throw new IllegalArgumentException(MessageFormat.format(resourceBundle.getString("AbstractSBase.setNamespaceExc"), elementNamespace, namespace)); + } + String old = elementNamespace; + elementNamespace = namespace; + + firePropertyChange(TreeNodeChangeEvent.namespace, old, namespace); + } + /* (non-Javadoc) * @see org.sbml.jsbml.element.SBase#setNotes(java.lang.String) */ @@ -1977,6 +1993,20 @@ firePropertyChange(TreeNodeChangeEvent.notes, oldNotes, notesXMLNode); } + /* (non-Javadoc) + * @see org.sbml.jsbml.SBase#setPackageVersion(int) + */ + @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); + } + /** * * @param parent @@ -2014,20 +2044,6 @@ } /* (non-Javadoc) - * @see org.sbml.jsbml.SBase#setPackageVersion(int) - */ - @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); - } - - /* (non-Javadoc) * @see org.sbml.jsbml.SBase#setSBOTerm(int) */ @Override @@ -2177,6 +2193,24 @@ } } + @Override + public void unsetExtension(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + + SBasePlugin sbasePlugin = extensions.remove(packageParser.getPackageName()); + firePropertyChange(TreeNodeChangeEvent.extension, sbasePlugin, null); + return; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), + nameOrUri)); + } + /* (non-Javadoc) * @see org.sbml.jsbml.SBase#unsetHistory() */ @@ -2187,6 +2221,7 @@ } } + /* (non-Javadoc) * @see org.sbml.jlibsbml.SBase#unsetMetaId() */ @@ -2197,7 +2232,6 @@ } } - /** * Unsets the namespace that is associated to this {@link SBase}. * @@ -2223,24 +2257,6 @@ } @Override - public void unsetExtension(String nameOrUri) { - - // use always the package name in the map - PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); - - if (packageParser != null) { - - SBasePlugin sbasePlugin = extensions.remove(packageParser.getPackageName()); - firePropertyChange(TreeNodeChangeEvent.extension, sbasePlugin, null); - return; - } - - throw new IllegalArgumentException(MessageFormat.format( - resourceBundle.getString("AbstractSBase.createPlugin"), - nameOrUri)); - } - - @Override public void unsetPlugin(String nameOrUri) { unsetExtension(nameOrUri); } Modified: trunk/core/src/org/sbml/jsbml/AbstractTreeNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/AbstractTreeNode.java 2015-04-24 07:37:38 UTC (rev 2256) +++ trunk/core/src/org/sbml/jsbml/AbstractTreeNode.java 2015-04-24 07:38:30 UTC (rev 2257) @@ -93,7 +93,7 @@ @SuppressWarnings("unchecked") public static int indexOf(TreeNode parent, TreeNode child) { if (child == null) { - throw new IllegalArgumentException("Argument is null."); + throw new IllegalArgumentException(resourceBundle.getString("NullArgument")); } // linear search Enumeration<TreeNode> e = parent.children(); @@ -276,7 +276,7 @@ return getChildAt(index++); } } - throw new NoSuchElementException("Enumeration"); + throw new NoSuchElementException(Enumeration.class.getSimpleName()); } }; } Modified: trunk/core/src/org/sbml/jsbml/Annotation.java =================================================================== --- trunk/core/src/org/sbml/jsbml/Annotation.java 2015-04-24 07:37:38 UTC (rev 2256) +++ trunk/core/src/org/sbml/jsbml/Annotation.java 2015-04-24 07:38:30 UTC (rev 2257) @@ -63,7 +63,7 @@ /** * The RDF syntax name space definition URI. */ - public static final transient String URI_RDF_SYNTAX_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + public static final transient String URI_RDF_SYNTAX_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; //$NON-NLS-1$ /** * Returns a {@link String} which represents the given {@link Qualifier}. @@ -231,10 +231,15 @@ * @param annotation some non RDF annotations. * @throws XMLStreamException */ - public void appendNoRDFAnnotation(String annotation) throws XMLStreamException { + public void appendNonRDFAnnotation(String annotation) throws XMLStreamException { + appendNonRDFAnnotation(XMLNode.convertStringToXMLNode(StringTools.toXMLAnnotationString(annotation))); + } + + /** + * @param annotationToAppend + */ + public void appendNonRDFAnnotation(XMLNode annotationToAppend) { XMLNode oldNonRDFAnnotation = null; - XMLNode annotationToAppend = XMLNode.convertStringToXMLNode(StringTools.toXMLAnnotationString(annotation)); - if (nonRDFannotation == null) { // check if the annotation contain an annotation top level element or not if (!annotationToAppend.getName().equals("annotation")) { @@ -374,7 +379,9 @@ @Override public TreeNode getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format( + resourceBundle.getString("IndexSurpassesBoundsException"), + childIndex, 0)); } int pos = 0; if (isSetHistory()) { Modified: trunk/core/src/org/sbml/jsbml/Assignment.java =================================================================== --- trunk/core/src/org/sbml/jsbml/Assignment.java 2015-04-24 07:37:38 UTC (rev 2256) +++ trunk/core/src/org/sbml/jsbml/Assignment.java 2015-04-24 07:38:30 UTC (rev 2257) @@ -33,26 +33,6 @@ public interface Assignment extends MathContainer { /** - * Error message to indicate that a {@link SpeciesReference} cannot be used - * as the {@link Variable} in this {@link Assignment} because the SBML Level - * < 3. - */ - public static final String ILLEGAL_VARIABLE_EXCEPTION_MSG = "Cannot set SpeciesReference {0} as the Variable in {1} for SBML Level < 3"; - - /** - * Error message to be displayed in case that a {@link Variable} with - * constant property set to {@code true} is to be assigned to this - * {@link Assignment}. - */ - public static final String ILLEGAL_CONSTANT_VARIABLE_MSG = "Cannot set the constant variable {0} as the target of this {1}."; - - /** - * Message to be displayed if no {@link Variable} can be found in the - * associated {@link Model} that would have the desired identifier. - */ - public static final String NO_SUCH_VARIABLE_EXCEPTION_MSG = "Model {0} does not contain any variable with identifier {1}."; - - /** * Returns the variableID of this {@link Assignment}. Returns an empty * {@link String} if it is not set. * Modified: trunk/core/src/org/sbml/jsbml/EventAssignment.java =================================================================== --- trunk/core/src/org/sbml/jsbml/EventAssignment.java 2015-04-24 07:37:38 UTC (rev 2256) +++ trunk/core/src/org/sbml/jsbml/EventAssignment.java 2015-04-24 07:38:30 UTC (rev 2257) @@ -94,7 +94,7 @@ Variable nsb = getModel().findVariable(variable); if (nsb == null) { throw new IllegalArgumentException(MessageFormat.format( - NO_SUCH_VARIABLE_EXCEPTION_MSG, + resourceBundle.getString("Assignment.NO_SUCH_VARIABLE_EXCEPTION_MSG"), m.getId(), variable)); } setVariable(nsb); @@ -218,8 +218,8 @@ if (!variable.isConstant()) { if ((getLevel() < 3) && (variable instanceof SpeciesReference)) { throw new IllegalArgumentException(MessageFormat.format( - ILLEGAL_VARIABLE_EXCEPTION_MSG, variable.getId(), - getElementName())); + resourceBundle.getString("Assignment.ILLEGAL_VARIABLE_EXCEPTION_MSG"), + variable.getId(), getElementName())); } if (variable.isSetId()) { setVariable(variable.getId()); @@ -228,8 +228,8 @@ } } else { throw new IllegalArgumentException(MessageFormat.format( - ILLEGAL_CONSTANT_VARIABLE_MSG, variable.getId(), - getElementName())); + resourceBundle.getString("Assignment.ILLEGAL_CONSTANT_VARIABLE_MSG"), + variable.getId(), getElementName())); } } Modified: trunk/core/src/org/sbml/jsbml/ExplicitRule.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ExplicitRule.java 2015-04-24 07:37:38 UTC (rev 2256) +++ trunk/core/src/org/sbml/jsbml/ExplicitRule.java 2015-04-24 07:38:30 UTC (rev 2257) @@ -501,9 +501,9 @@ public void setVariable(Variable variable) { if (variable != null) { if (variable.isConstant()) { - throw new IllegalArgumentException( - MessageFormat.format(ILLEGAL_CONSTANT_VARIABLE_MSG, - variable.getId(), getElementName())); + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("Assignment.ILLEGAL_CONSTANT_VARIABLE_MSG"), + variable.getId(), getElementName())); } if (isSetUnits() && !(variable instanceof Parameter)) { throw new IllegalArgumentException(MessageFormat.format( @@ -512,8 +512,8 @@ } if ((getLevel() < 3) && (variable instanceof SpeciesReference)) { throw new IllegalArgumentException(MessageFormat.format( - ILLEGAL_VARIABLE_EXCEPTION_MSG, variable.getId(), - getElementName())); + resourceBundle.getString("Assignment.ILLEGAL_VARIABLE_EXCEPTION_MSG"), + variable.getId(), getElementName())); } if (variable.isSetId()) { String oldVariable = variableID; Modified: trunk/core/src/org/sbml/jsbml/InitialAssignment.java =================================================================== --- trunk/core/src/org/sbml/jsbml/InitialAssignment.java 2015-04-24 07:37:38 UTC (rev 2256) +++ trunk/core/src/org/sbml/jsbml/InitialAssignment.java 2015-04-24 07:38:30 UTC (rev 2257) @@ -134,7 +134,8 @@ } if (nsb == null) { throw new IllegalArgumentException(MessageFormat.format( - NO_SUCH_VARIABLE_EXCEPTION_MSG, m.getId(), variable)); + resourceBundle.getString("Assignment.NO_SUCH_VARIABLE_EXCEPTION_MSG"), + m.getId(), variable)); } setVariable(nsb.getId()); } @@ -290,7 +291,8 @@ @Override public void setVariable(Variable variable) { if ((getLevel() < 3) && (variable != null) && (variable instanceof SpeciesReference)) { - throw new IllegalArgumentException(MessageFormat.format(Assignment.ILLEGAL_VARIABLE_EXCEPTION_MSG, + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("Assignment.ILLEGAL_VARIABLE_EXCEPTION_MSG"), variable.getId(), getElementName())); } setVariable(variable != null ? variable.getId() : null); Modified: trunk/core/src/org/sbml/jsbml/SBase.java =================================================================== --- trunk/core/src/org/sbml/jsbml/SBase.java 2015-04-24 07:37:38 UTC (rev 2256) +++ trunk/core/src/org/sbml/jsbml/SBase.java 2015-04-24 07:38:30 UTC (rev 2257) @@ -157,7 +157,7 @@ */ public void addPlugin(String nameOrUri, SBasePlugin sbasePlugin); - /** + /* * Adds an additional name space to the set of name spaces of this * {@link SBase} if the given name space is not yet present within this * {@link SortedSet}. @@ -167,6 +167,55 @@ // protected void setNamespace(String namespace); /** + * Appends the given annotation to the 'annotation' subelement of this object. + * Whereas the SBase 'notes' subelement is a container for content to be shown + * directly to humans, the 'annotation' element is a container for optional + * software-generated content not meant to be shown to humans. Every object + * derived from SBase can have its own value for 'annotation'. The element's + * content type is XML type 'any', allowing essentially arbitrary well-formed + * XML data content. + * SBML places a few restrictions on the organization of the content of + * annotations; these are intended to help software tools read and write the + * data as well as help reduce conflicts between annotations added by + * different tools. Please see the SBML specifications for more details. + * Unlike {@link SBase#setAnnotation(XMLNode)} or + * {@link SBase#setAnnotation(String)}, this method allows other + * annotations to be preserved when an application adds its own data. + * + * @param annotation + * an XML string that is to be copied and appended to the content of + * the 'annotation' subelement of this object + * @throws XMLStreamException + * thrown if the given annotation String cannot be parsed into + * {@link XMLNode} objects. + * @see #appendAnnotation(XMLNode) + */ + public void appendAnnotation(String annotation) throws XMLStreamException; + + + /** + * Appends the given annotation to the 'annotation' subelement of this object. + * Whereas the SBase 'notes' subelement is a container for content to be shown + * directly to humans, the 'annotation' element is a container for optional + * software-generated content not meant to be shown to humans. Every object + * derived from SBase can have its own value for 'annotation'. The element's + * content type is XML type 'any', allowing essentially arbitrary well-formed + * XML data content. + * SBML places a few restrictions on the organization of the content of + * annotations; these are intended to help software tools read and write the + * data as well as help reduce conflicts between annotations added by + * different tools. Please see the SBML specifications for more details. + * Unlike {@link SBase#setAnnotation(XMLNode)} or + * {@link SBase#setAnnotation(String)}, this method allows other + * annotations to be preserved when an application adds its own data. + * + * @param annotation + * an XML structure that is to be copied and appended to the content of + * the 'annotation' subelement of this object + */ + public void appendAnnotation(XMLNode annotation); + + /** * Appends 'notes' to the notes String of this object. * * @param notes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-04-24 07:37:40
|
Revision: 2256 http://sourceforge.net/p/jsbml/code/2256 Author: andreas-draeger Date: 2015-04-24 07:37:38 +0000 (Fri, 24 Apr 2015) Log Message: ----------- Localization support. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/util/TreeNodeAdapter.java Modified: trunk/core/src/org/sbml/jsbml/util/TreeNodeAdapter.java =================================================================== --- trunk/core/src/org/sbml/jsbml/util/TreeNodeAdapter.java 2015-04-24 07:31:32 UTC (rev 2255) +++ trunk/core/src/org/sbml/jsbml/util/TreeNodeAdapter.java 2015-04-24 07:37:38 UTC (rev 2256) @@ -145,7 +145,7 @@ @Override public TreeNode getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } if (isSetUserObject()) { if (userObject instanceof TreeNode) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2015-04-24 07:31:35
|
Revision: 2255 http://sourceforge.net/p/jsbml/code/2255 Author: andreas-draeger Date: 2015-04-24 07:31:32 +0000 (Fri, 24 Apr 2015) Log Message: ----------- * extracted more text into an XML file for localization support. * implemented two methods for appending annotations to SBase for improved libSBML compatibility and usability of JSBML. Modified Paths: -------------- trunk/core/resources/org/sbml/jsbml/resources/Messages.xml trunk/examples/test/src/org/sbml/jsbml/test/TestAnnotation.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/multi/src/org/sbml/jsbml/ext/multi/MultiModelPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualModelPlugin.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/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/Rectangle.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCubicBezier.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/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java Modified: trunk/core/resources/org/sbml/jsbml/resources/Messages.xml =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/Messages.xml 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/core/resources/org/sbml/jsbml/resources/Messages.xml 2015-04-24 07:31:32 UTC (rev 2255) @@ -31,6 +31,8 @@ <entry key="IndexExceedsBoundsException">Index {0,number,integer} >= {1,number,integer}</entry> <entry key="IndexExceedsBoundsException2">Node {0} has no children.</entry> + <entry key="IndexSurpassesBoundsException">Index {0,number,integer} < {0,number,integer}</entry> + <entry key="NullArgument">Argument is null.</entry> <entry key="AbstractMathContainer.toFormula">Could not create infix formula from syntax tree.</entry> <entry key="AbstractMathContainer.inclusion">{0} in {1}</entry> @@ -58,5 +60,37 @@ <entry key="AbstractSBase.emptyNotes">The notes to append are empty!</entry> <entry key="AbstractSBase.invalidNotesStructure">The given 'notes' String does not have the proper structure, excepting the children 'head' and 'body' to the 'html' element.</entry> <entry key="AbstractSBase.problemAddingXMLNode">There was a problem adding the given XMLNode: ''{0}'' to the ''body'' XMLNode.</entry> + + <entry key="Assignment.ILLEGAL_CONSTANT_VARIABLE_MSG">Cannot set the constant variable {0} as the target of this {1}.</entry> + <entry key="Assignment.ILLEGAL_VARIABLE_EXCEPTION_MSG">Cannot set SpeciesReference {0} as the Variable in {1} for SBML Level < 3</entry> + <entry key="Assignment.NO_SUCH_VARIABLE_EXCEPTION_MSG">Model {0} does not contain any variable with identifier {1}.</entry> + + <entry key="ASTNode.INVALID_OPERATOR_MSG">Invalid operator {0}. The operator must be one of the following constants: PLUS, MINUS, TIMES, DIVIDE, or POWER.</entry> + <entry key="ASTNode.log">logarithm cannot be created for null values</entry> + <entry key="ASTNode.relational">Cannot create a relational node with null arguments.</entry> + <entry key="ASTNode1">Clone constructor: Origin type = {0}</entry> + <entry key="ASTNode.arithmeticOperation">Cannot divide by zero.</entry> + <entry key="ASTNode.compile1">Fractions must have one numerator and one denominator, here {0,number,integer} elements are given.</entry> + <entry key="ASTNode.compile2">ASTNode of type FUNCTION but the variable is not a FunctionDefinition! ({0}, {1})</entry> + <entry key="ASTNode.compile3">ASTNode of type FUNCTION but the variable is null: ({0}, {1})! Check that your object is linked to a Model.</entry> + <entry key="ASTNode.compile4">getCharacter() should be called only when isOperator().</entry> + <entry key="ASTNode.getDenominator">getDenominator() should be called only when getType() == RATIONAL.</entry> + <entry key="ASTNode.getExponent">getExponent() should be called only when getType() == REAL_E or REAL</entry> + <entry key="ASTNode.getInteger">getInteger() should be called only when getType() == INTEGER</entry> + <entry key="ASTNode.getMantissa">getMantissa() should be called only when getType() == REAL or REAL_E</entry> + <entry key="ASTNode.getName">getName() should be called only when !isNumber() && !isOperator()</entry> + <entry key="ASTNode.getNumerator">getNumerator() should be called only when isRational()</entry> + <entry key="ASTNode.getReal">getReal() should be called only when isReal() returns true.</entry> + <entry key="ASTNode.getReferencedNamedSBases">Name of this node is {0} but no variable is set.</entry> + <entry key="ASTNode.getVariable1">The name \"{0}\" represented by this node is an argument in a function call, i.e., a placeholder for some other element. No corresponding CallableSBase exists in the model</entry> + <entry key="ASTNode.getVariable2">Cannot find any element with id \"{0}\" in the model.</entry> + <entry key="ASTNode.getVariable3">This ASTNode is not yet linked to a model and can therefore not determine its variable \"{0}\".</entry> + <entry key="ASTNode.getVariable4">getVariable() should be called only when isVariable() == true.</entry> + <entry key="ASTNode.initDefaults">initDefaults called! type was {0}</entry> + <entry key="ASTNode.reduceToBinary1">MINUS node with {0,number,integer} children left unchanged</entry> + <entry key="ASTNode.reduceToBinary2">DIVIDE node with {0,number,integer} children left unchanged</entry> + <entry key="ASTNode.reduceToBinary3">NOT node with {0,number,integer} children left unchanged</entry> + <entry key="ASTNode.reduceToBinary4">XOR node with {0,number,integer} children left unchanged</entry> + <entry key="ASTNode.reduceToBinary5">{0} node with {1,number,integer} children left unchanged</entry> </properties> \ No newline at end of file Modified: trunk/examples/test/src/org/sbml/jsbml/test/TestAnnotation.java =================================================================== --- trunk/examples/test/src/org/sbml/jsbml/test/TestAnnotation.java 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/examples/test/src/org/sbml/jsbml/test/TestAnnotation.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -92,21 +92,21 @@ { cvTerm.addResource("urn:miriam:kegg.compound:" + urn_id); annotation.addCVTerm(cvTerm); - annotation.appendNoRDFAnnotation("http://www.genome.jp/dbget-bin/www_bget?cpd:" + urn_id); + annotation.appendNonRDFAnnotation("http://www.genome.jp/dbget-bin/www_bget?cpd:" + urn_id); } if (urn_id.startsWith("G")) { cvTerm.addResource("urn:miriam:kegg.glycan:" + urn_id); annotation.addCVTerm(cvTerm); - annotation.appendNoRDFAnnotation("<myApp:xxx>http://www.genome.jp/dbget-bin/www_bget?gl:" + urn_id + "</myApp:xxx>"); + annotation.appendNonRDFAnnotation("<myApp:xxx>http://www.genome.jp/dbget-bin/www_bget?gl:" + urn_id + "</myApp:xxx>"); } if (urn_id.contains(".")) { cvTerm.addResource("urn:miriam:ec-code:" + urn_id); annotation.addCVTerm(cvTerm); - annotation.appendNoRDFAnnotation("http://www.genome.jp/dbget-bin/www_bget?ec:" + urn_id); + annotation.appendNonRDFAnnotation("http://www.genome.jp/dbget-bin/www_bget?ec:" + urn_id); } System.out.println("The Annotation is still empty as there is no metaid defined on the species !!"); Modified: trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/ArraysSBasePlugin.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/ArraysSBasePlugin.java 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/ArraysSBasePlugin.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -625,7 +625,7 @@ public TreeNode getChildAt(int childIndex) { if (childIndex < 0){ - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompModelPlugin.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompModelPlugin.java 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompModelPlugin.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -255,7 +255,7 @@ public TreeNode getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; Modified: trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBMLDocumentPlugin.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBMLDocumentPlugin.java 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBMLDocumentPlugin.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -583,7 +583,7 @@ @Override public TreeNode getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModelPlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModelPlugin.java 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiModelPlugin.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -277,7 +277,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -603,7 +603,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualModelPlugin.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -173,7 +173,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/GlobalRenderInformation.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -283,7 +283,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; if (isSetListOfColorDefinitions()) { 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientBase.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -145,7 +145,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; if (isSetListOfGradientStops()) { 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientStop.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -182,7 +182,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; throw new IndexOutOfBoundsException(MessageFormat.format( 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/Image.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -281,7 +281,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; throw new IndexOutOfBoundsException(MessageFormat.format( 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/LineEnding.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -117,7 +117,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; throw new IndexOutOfBoundsException(MessageFormat.format( 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/LinearGradient.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -209,7 +209,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; throw new IndexOutOfBoundsException(MessageFormat.format( 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/LocalRenderInformation.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -275,7 +275,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; if (isSetListOfColorDefinitions()) { 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/Polygon.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -97,7 +97,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; if (isSetListOfElements()) { 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/Rectangle.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -789,7 +789,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; throw new IndexOutOfBoundsException(MessageFormat.format( 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCubicBezier.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -141,7 +141,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; throw new IndexOutOfBoundsException(MessageFormat.format( 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-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -677,7 +677,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; if (isSetListOfColorDefinitions()) { Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderLayoutPlugin.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderLayoutPlugin.java 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderLayoutPlugin.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -108,7 +108,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; if (isSetListOfLocalRenderInformation()) { Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderListOfLayoutsPlugin.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderListOfLayoutsPlugin.java 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderListOfLayoutsPlugin.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -120,7 +120,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; if (isSetListOfGlobalRenderInformation()) { Modified: trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderPoint.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderPoint.java 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderPoint.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -114,7 +114,7 @@ @Override public SBase getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; throw new IndexOutOfBoundsException(MessageFormat.format( Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java 2015-04-23 22:15:38 UTC (rev 2254) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java 2015-04-24 07:31:32 UTC (rev 2255) @@ -327,7 +327,7 @@ @Override public TreeNode getChildAt(int childIndex) { if (childIndex < 0) { - throw new IndexOutOfBoundsException(childIndex + " < 0"); + throw new IndexOutOfBoundsException(MessageFormat.format(resourceBundle.getString("IndexSurpassesBoundsException"), childIndex, 0)); } int pos = 0; if (isSetBoundaryMinimum()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 22:15:41
|
Revision: 2254 http://sourceforge.net/p/jsbml/code/2254 Author: pdp10 Date: 2015-04-23 22:15:38 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java 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-23 20:57:03 UTC (rev 2253) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java 2015-04-23 22:15:38 UTC (rev 2254) @@ -23,8 +23,10 @@ import java.text.MessageFormat; import java.util.Map; +import java.util.regex.Pattern; import org.sbml.jsbml.AbstractSBase; +import org.sbml.jsbml.SBMLException; @@ -111,6 +113,15 @@ return coordinate != null; } + /** + * @param coordinate + */ + public void setCoordinate(String coordinate) { + if (!Pattern.matches("[a-z]*", coordinate)) { + throw new SBMLException("The value is not all lower-case."); + } + setCoordinate(CoordinateKind.valueOf(coordinate.toUpperCase())); + } /** * @param coordinate the coordinate to set @@ -151,7 +162,7 @@ isAttributeRead = true; if (attributeName.equals(SpatialConstants.coordinate)) { try { - setCoordinate(CoordinateKind.valueOf(value)); + setCoordinate(value); } catch (Exception e) { MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ"), value, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 20:57:05
|
Revision: 2253 http://sourceforge.net/p/jsbml/code/2253 Author: pdp10 Date: 2015-04-23 20:57:03 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java 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-23 20:56:42 UTC (rev 2252) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java 2015-04-23 20:57:03 UTC (rev 2253) @@ -231,7 +231,7 @@ @Override public boolean readAttribute(String attributeName, String prefix, String value) { - boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) && (SpatialConstants.shortLabel == prefix); + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.spatialId)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 20:56:50
|
Revision: 2252 http://sourceforge.net/p/jsbml/code/2252 Author: pdp10 Date: 2015-04-23 20:56:42 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java 2015-04-23 20:55:43 UTC (rev 2251) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java 2015-04-23 20:56:42 UTC (rev 2252) @@ -269,8 +269,7 @@ @Override public boolean readAttribute(String attributeName, String prefix, String value) { - boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) - && (SpatialConstants.shortLabel == prefix); + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.domainType)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 20:55:46
|
Revision: 2251 http://sourceforge.net/p/jsbml/code/2251 Author: pdp10 Date: 2015-04-23 20:55:43 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Added TODO in the readAttribute() Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java 2015-04-23 18:42:08 UTC (rev 2250) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java 2015-04-23 20:55:43 UTC (rev 2251) @@ -329,6 +329,7 @@ if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.type)) { + // TODO: In the specs v0.90, the type name begins with capital letter. if (!Pattern.matches("[a-z]*", value)) { throw new SBMLException("The value is not all lower-case."); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2015-04-23 18:42:11
|
Revision: 2250 http://sourceforge.net/p/jsbml/code/2250 Author: kofiav Date: 2015-04-23 18:42:08 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Made changes to the VectorCompiler in order to get a few test cases to pass. Changes only temporary. Modified Paths: -------------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java branches/astnode2-merging-alternate/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-04-23 17:33:46 UTC (rev 2249) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-04-23 18:42:08 UTC (rev 2250) @@ -3970,7 +3970,7 @@ astnode2 = new ASTCSymbolTimeNode(); break; case PLUS : - astnode2 = new ASTArithmeticOperatorNode(Type.PLUS); + astnode2 = new ASTArithmeticOperatorNode(Type.PLUS); break; case POWER: astnode2 = new ASTPowerNode(); Modified: branches/astnode2-merging-alternate/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java =================================================================== --- branches/astnode2-merging-alternate/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-04-23 17:33:46 UTC (rev 2249) +++ branches/astnode2-merging-alternate/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java 2015-04-23 18:42:08 UTC (rev 2250) @@ -3670,8 +3670,11 @@ private void plusRecursive(List<ASTNode> values, ASTNode node) throws IndexOutOfBoundsException, SBMLException{ if (!node.isVector()) { double result = 0; - node.getChildren().clear(); - node.setType(ASTNode.Type.PLUS); + // TODO: Set type was causing a new ASTNode2 object to be created + // and this was preventing the children of the original node + // object from being updated. + //node.getChildren().clear(); + //node.setType(ASTNode.Type.PLUS); if (values.size() > 0) { for (int i = 0; i < values.size(); ++i) { ASTNode value = values.get(i); @@ -3683,7 +3686,9 @@ throw new SBMLException(); } } - node.addChild(new ASTNode(result)); + // TODO: Find a better fix + //node.addChild(new ASTNode(result)); + node.setValue(result); return; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2015-04-23 17:33:48
|
Revision: 2249 http://sourceforge.net/p/jsbml/code/2249 Author: kofiav Date: 2015-04-23 17:33:46 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Fixed bug in ASTNode.setValue() that was causing testVectorMinus() to fail. Modified Paths: -------------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-04-23 15:42:30 UTC (rev 2248) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/ASTNode.java 2015-04-23 17:33:46 UTC (rev 2249) @@ -2815,6 +2815,8 @@ ASTCnRationalNode ast = (ASTCnRationalNode) astnode2; return Double.valueOf(ast.getNumerator() + "/" + ast.getDenominator()); } + } else if (isInteger()) { + return ((ASTCnIntegerNode) astnode2).getNumber(); } return Double.NaN; @@ -4095,9 +4097,12 @@ if (astnode2.getType() == Type.UNKNOWN) { setType(Type.REAL); } - if (astnode2 instanceof ASTCnRealNode) { + if (astnode2.getType() == Type.REAL) { ((ASTCnRealNode) astnode2).setReal(value); } + if (astnode2.getType() == Type.INTEGER) { + ((ASTCnIntegerNode) astnode2).setInteger((int)value); + } // FUNCTION_EXP if (astnode2.getType() == Type.FUNCTION_EXP) { ASTCnRealNode real = new ASTCnRealNode(value); @@ -4118,7 +4123,7 @@ if (astnode2.getType() == Type.UNKNOWN) { setType(Type.REAL_E); } - if (astnode2 instanceof ASTCnExponentialNode) { + if (astnode2.getType() == Type.REAL_E) { ((ASTCnExponentialNode) astnode2).setMantissa(mantissa); ((ASTCnExponentialNode) astnode2).setExponent(exponent); } @@ -4134,7 +4139,7 @@ if (astnode2.getType() == Type.UNKNOWN) { setType(Type.INTEGER); } - if (astnode2 instanceof ASTCnIntegerNode) { + if (astnode2.getType() == Type.INTEGER) { ((ASTCnIntegerNode) astnode2).setInteger(value); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 15:42:33
|
Revision: 2248 http://sourceforge.net/p/jsbml/code/2248 Author: pdp10 Date: 2015-04-23 15:42:30 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 - added spatialRef Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-23 15:42:03 UTC (rev 2247) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-23 15:42:30 UTC (rev 2248) @@ -151,7 +151,7 @@ /** * */ - public static final String spatialId = "spatialId"; + public static final String spatialId = "id"; /** * */ @@ -523,6 +523,11 @@ public static final String arrayDataLength = "arrayDataLength"; /** + * + */ + public static final String spatialRef = "spatialRef"; + + /** * @param level * @param version * @return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 15:42:05
|
Revision: 2247 http://sourceforge.net/p/jsbml/code/2247 Author: pdp10 Date: 2015-04-23 15:42:03 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-23 15:41:33 UTC (rev 2246) +++ trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-23 15:42:03 UTC (rev 2247) @@ -267,6 +267,7 @@ param.addExtension(SpatialConstants.namespaceURI, spatialParam); } + // TODO: CHECK create method. this might be the source of the problem. if (elementName.equals(SpatialConstants.spatialSymbolReference)) { SpatialSymbolReference ssr = new SpatialSymbolReference(); spatialParam.setParamType(ssr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 15:41:36
|
Revision: 2246 http://sourceforge.net/p/jsbml/code/2246 Author: pdp10 Date: 2015-04-23 15:41:33 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 - added spatialRef Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSymbolReference.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSymbolReference.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSymbolReference.java 2015-04-23 15:35:03 UTC (rev 2245) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSymbolReference.java 2015-04-23 15:41:33 UTC (rev 2246) @@ -21,6 +21,10 @@ */ package org.sbml.jsbml.ext.spatial; +import java.util.Map; + +import org.sbml.jsbml.PropertyUndefinedError; + /** * @author Alex Thomas * @author Andreas Dräger @@ -37,15 +41,23 @@ /** * */ + private String spatialRef; + + /** + * + */ public SpatialSymbolReference() { super(); } /** - * @param classvar + * @param ssr */ - public SpatialSymbolReference(SpatialSymbolReference classvar) { - super(classvar); + public SpatialSymbolReference(SpatialSymbolReference ssr) { + super(ssr); + if (ssr.isSetSpatialRef()) { + setSpatialRef(ssr.getSpatialRef()); + } } /** @@ -71,5 +83,84 @@ public boolean equals(Object object) { return super.equals(object); } - + + + /** + * Returns the value of {@link #spatialRef}. + * + * @return the value of {@link #spatialRef}. + */ + public String getSpatialRef() { + //TODO: if variable is boolean, create an additional "isVar" + //TODO: return primitive data type if possible (e.g., int instead of Integer) + if (isSetSpatialRef()) { + return spatialRef; + } + // 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(SpatialConstants.spatialRef, this); + } + + + /** + * Returns whether {@link #spatialRef} is set. + * + * @return whether {@link #spatialRef} is set. + */ + public boolean isSetSpatialRef() { + return this.spatialRef != null; + } + + + /** + * Sets the value of spatialRef + * + * @param spatialRef the value of spatialRef to be set. + */ + public void setSpatialRef(String spatialRef) { + String oldSpatialRef = this.spatialRef; + this.spatialRef = spatialRef; + firePropertyChange(SpatialConstants.spatialRef, oldSpatialRef, this.spatialRef); + } + + + /** + * Unsets the variable spatialRef. + * + * @return {@code true} if spatialRef was set before, otherwise {@code false}. + */ + public boolean unsetSpatialRef() { + if (isSetSpatialRef()) { + String oldSpatialRef = this.spatialRef; + this.spatialRef = null; + firePropertyChange(SpatialConstants.spatialRef, oldSpatialRef, this.spatialRef); + return true; + } + return false; + } + + + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + if (isSetSpatialRef()) { + attributes.remove(SpatialConstants.spatialRef); + attributes.put(SpatialConstants.shortLabel + ":" + SpatialConstants.spatialRef, getSpatialRef()); + } + return attributes; + } + + + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); + if (!isAttributeRead) { + isAttributeRead = true; + System.out.println("SpatialSymbolReference: debug attribute name: " + attributeName); + if (attributeName.equals(SpatialConstants.spatialRef)) { + setSpatialRef(value); + } + else { + isAttributeRead = false; + } + } + return isAttributeRead; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2015-04-23 15:35:06
|
Revision: 2245 http://sourceforge.net/p/jsbml/code/2245 Author: kofiav Date: 2015-04-23 15:35:03 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Fixed bug in FormulaParserASTNode2 (in the math.parser package) that was causing a test to fail. Clarified test case in ASTFactoryTest. Modified Paths: -------------- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/parser/FormulaParserASTNode2.java branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/parser/FormulaParserASTNode2.jj branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTFactoryTest.java Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/parser/FormulaParserASTNode2.java =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/parser/FormulaParserASTNode2.java 2015-04-23 15:15:38 UTC (rev 2244) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/parser/FormulaParserASTNode2.java 2015-04-23 15:35:03 UTC (rev 2245) @@ -370,7 +370,7 @@ node = new ASTUnaryFunctionNode(Type.FUNCTION_ABS); ((ASTUnaryFunctionNode)node).addChild(child); } - if (s.equalsIgnoreCase("factorial")) + else if (s.equalsIgnoreCase("factorial")) { checkSize(arguments, 0); node = new ASTUnaryFunctionNode(Type.FUNCTION_FACTORIAL); Modified: branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/parser/FormulaParserASTNode2.jj =================================================================== --- branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/parser/FormulaParserASTNode2.jj 2015-04-23 15:15:38 UTC (rev 2244) +++ branches/astnode2-merging-alternate/core/src/org/sbml/jsbml/math/parser/FormulaParserASTNode2.jj 2015-04-23 15:35:03 UTC (rev 2245) @@ -493,7 +493,7 @@ node = new ASTUnaryFunctionNode(Type.FUNCTION_ABS); ((ASTUnaryFunctionNode)node).addChild(child); } - if (s.equalsIgnoreCase("factorial")) + else if (s.equalsIgnoreCase("factorial")) { checkSize(arguments, 0); node = new ASTUnaryFunctionNode(Type.FUNCTION_FACTORIAL); Modified: branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTFactoryTest.java =================================================================== --- branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTFactoryTest.java 2015-04-23 15:15:38 UTC (rev 2244) +++ branches/astnode2-merging-alternate/core/test/org/sbml/jsbml/math/test/ASTFactoryTest.java 2015-04-23 15:35:03 UTC (rev 2245) @@ -334,8 +334,10 @@ boolean status = false; try { ASTUnaryFunctionNode abs = (ASTUnaryFunctionNode) ASTFactory.parseFormula("abs(-1)"); - status = abs.getType() == Type.FUNCTION_ABS - && ((ASTCnIntegerNode)abs.getChildAt(0)).getNumber() == -1; + status = abs.getType() == Type.FUNCTION_ABS; + if (status && abs.getChildAt(0).getType() == Type.MINUS) { + status = ((ASTCnIntegerNode)abs.getChildAt(0).getChildAt(0)).getNumber() == 1; + } } catch (ParseException e) { e.printStackTrace(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 15:15:41
|
Revision: 2244 http://sourceforge.net/p/jsbml/code/2244 Author: pdp10 Date: 2015-04-23 15:15:38 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-23 15:15:21 UTC (rev 2243) +++ trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-23 15:15:38 UTC (rev 2244) @@ -336,14 +336,15 @@ // sfg.setSampledField(sf); // return sf; } - } else if (contextObject instanceof SampledField) { + // NOTE: This has been moved in the listOf section below. +// } else if (contextObject instanceof SampledField) { // SampledField sf = (SampledField) contextObject; // No more child in 0.88 // if (elementName.equals(SpatialConstants.imageData)){ // ImageData im = new ImageData(); // sf.setImageData(im); // // sf.set // return im; - // } + // } } else if (contextObject instanceof CSGeometry) { CSGeometry csg = (CSGeometry) contextObject; if (elementName.equals(SpatialConstants.listOfCSGObjects)){ @@ -471,6 +472,11 @@ SampledVolume elem = new SampledVolume(); sfg.addSampledVolume(elem); return elem; + } else if (elementName.equals(SpatialConstants.sampledField)) { + Geometry g = (Geometry) listOf.getParentSBMLObject(); + SampledField elem = new SampledField(); + g.addSampledField(elem); + return elem; } else if (elementName.equals(SpatialConstants.csgPrimitive)) { CSGSetOperator csgso = (CSGSetOperator) listOf.getParentSBMLObject(); CSGPrimitive elem = new CSGPrimitive(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 15:15:23
|
Revision: 2243 http://sourceforge.net/p/jsbml/code/2243 Author: pdp10 Date: 2015-04-23 15:15:21 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 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-23 15:13:13 UTC (rev 2242) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-23 15:15:21 UTC (rev 2243) @@ -553,6 +553,22 @@ return false; } + /** + * Appends the variable data to samples. + * @return {@code true} if data was appended to samples, otherwise {@code false}. + */ + public boolean append(String data) { + if (data == null) { return false; } + if (isSetSamples()) { + String oldSamples = this.samples; + this.samples = this.samples + data; + firePropertyChange(SpatialConstants.samples, oldSamples, this.samples); + } else { + setSamples(data); + } + return true; + } + /** * Returns the value of {@link #samplesLength}. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-04-23 15:13:16
|
Revision: 2242 http://sourceforge.net/p/jsbml/code/2242 Author: niko-rodrigue Date: 2015-04-23 15:13:13 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Did some cleanup of the debug messages in ParserManager + removed a warning in the writeCharaters method in SBMLCoreParser that was not needed + modified SBMLWriter so that it can write xml elements that have some text, like the arrayData in Spatial Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/xml/parsers/ParserManager.java trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLCoreParser.java trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/ParserManager.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/ParserManager.java 2015-04-23 14:56:36 UTC (rev 2241) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/ParserManager.java 2015-04-23 15:13:13 UTC (rev 2242) @@ -68,12 +68,13 @@ */ private Logger logger = Logger.getLogger(ParserManager.class); - private String[] parserDefaults = {"org.sbml.jsbml.xml.parsers.UncertMLXMLNodeReader", + private String[] parserDefaults = + {"org.sbml.jsbml.xml.parsers.UncertMLXMLNodeReader", "org.sbml.jsbml.xml.parsers.SBMLCoreParser", "org.sbml.jsbml.xml.parsers.MathMLStaxParser", "org.sbml.jsbml.xml.parsers.ArraysParser", "org.sbml.jsbml.xml.parsers.CompParser", "org.sbml.jsbml.xml.parsers.DistribParser", "org.sbml.jsbml.xml.parsers.DynParser", "org.sbml.jsbml.xml.parsers.FBCParser", "org.sbml.jsbml.xml.parsers.GroupsParser", "org.sbml.jsbml.xml.parsers.L3LayoutParser", "org.sbml.jsbml.xml.parsers.LayoutParser", "org.sbml.jsbml.xml.parsers.MultiParser", "org.sbml.jsbml.xml.parsers.QualParser", "org.sbml.jsbml.xml.parsers.RenderParser", - "org.sbml.jsbml.xml.parsers.ReqParser", "org.sbml.jsbml.xml.parsers.SpatialParser", "org.sbml.jsbml.xml.parsers.XMLNodeReader", "org.sbml.jsbml.xml.parsers.SBMLCoreParser"}; + "org.sbml.jsbml.xml.parsers.ReqParser", "org.sbml.jsbml.xml.parsers.SpatialParser", "org.sbml.jsbml.xml.parsers.XMLNodeReader"}; /** @@ -114,7 +115,6 @@ String packageName = "core"; classNames.add(readingParser.getClass().getName()); - System.out.println("###DEBUG####; class name = " + readingParser.getClass().getName()); if (readingParser instanceof PackageParser) { packageName = ((PackageParser) readingParser).getPackageName(); @@ -147,7 +147,6 @@ String packageName = "core"; classNames.add(writingParser.getClass().getName()); - System.out.println("###DEBUG####; writer class name = " + writingParser.getClass().getName()); if (writingParser instanceof PackageParser) { packageName = ((PackageParser) writingParser).getPackageName(); @@ -171,7 +170,6 @@ for (String parserClassName : parserDefaults) { if (! classNames.contains(parserClassName)) { - System.out.println("###DEBUG### adding parser '" + parserClassName + "' by hand"); try { Object newInstance = Class.forName(parserClassName).newInstance(); @@ -180,7 +178,6 @@ ReadingParser readingParser = (ReadingParser) newInstance; String packageName = "core"; - System.out.println("###DEBUG####; class name = " + readingParser.getClass().getName()); if (readingParser instanceof PackageParser) { packageName = ((PackageParser) readingParser).getPackageName(); @@ -203,7 +200,6 @@ WritingParser writingParser = (WritingParser) newInstance; String packageName = "core"; - System.out.println("###DEBUG####; writer class name = " + writingParser.getClass().getName()); if (writingParser instanceof PackageParser) { packageName = ((PackageParser) writingParser).getPackageName(); @@ -217,18 +213,23 @@ } } catch (ClassNotFoundException e) { - System.out.println("###DEBUG### problem loading class '" + parserClassName + "': " + e.getMessage()); - // e.printStackTrace(); + if (logger.isDebugEnabled()) { + logger.debug("problem loading class '" + parserClassName + "': " + e.getMessage()); + } } catch (InstantiationException e) { - System.out.println("###DEBUG### problem loading class '" + parserClassName + "': " + e.getMessage()); - // e.printStackTrace(); + if (logger.isDebugEnabled()) { + logger.debug("problem loading class '" + parserClassName + "': " + e.getMessage()); + e.printStackTrace(); + } } catch (IllegalAccessException e) { - System.out.println("###DEBUG### problem loading class '" + parserClassName + "': " + e.getMessage()); - // e.printStackTrace(); + if (logger.isDebugEnabled()) { + logger.debug("problem loading class '" + parserClassName + "': " + e.getMessage()); + e.printStackTrace(); + } } } } @@ -333,7 +334,6 @@ for (String parserClassName : parserDefaults) { if (! classNames.contains(parserClassName)) { - System.out.println("###DEBUG### getReadingParsers - adding parser '" + parserClassName + "' by hand"); try { Object newInstance = Class.forName(parserClassName).newInstance(); @@ -341,26 +341,29 @@ if (newInstance instanceof ReadingParser) { ReadingParser readingParser = (ReadingParser) newInstance; - System.out.println("###DEBUG#### getReadingParsers - class name = " + readingParser.getClass().getName()); - for (String namespaceURI : readingParser.getNamespaces()) { clonedMap.put(namespaceURI, readingParser); } } } catch (ClassNotFoundException e) { - System.out.println("###DEBUG### problem loading class '" + parserClassName + "': " + e.getMessage()); - // e.printStackTrace(); + if (logger.isDebugEnabled()) { + logger.debug("problem loading class '" + parserClassName + "': " + e.getMessage()); + } } catch (InstantiationException e) { - System.out.println("###DEBUG### problem loading class '" + parserClassName + "': " + e.getMessage()); - // e.printStackTrace(); + if (logger.isDebugEnabled()) { + logger.debug("problem loading class '" + parserClassName + "': " + e.getMessage()); + e.printStackTrace(); + } } catch (IllegalAccessException e) { - System.out.println("###DEBUG### problem loading class '" + parserClassName + "': " + e.getMessage()); - // e.printStackTrace(); + if (logger.isDebugEnabled()) { + logger.debug("problem loading class '" + parserClassName + "': " + e.getMessage()); + e.printStackTrace(); + } } } } @@ -421,7 +424,6 @@ for (String parserClassName : parserDefaults) { if (! classNames.contains(parserClassName)) { - System.out.println("###DEBUG### getWritingParsers - adding parser '" + parserClassName + "' by hand"); try { Object newInstance = Class.forName(parserClassName).newInstance(); @@ -429,26 +431,29 @@ if (newInstance instanceof WritingParser) { WritingParser readingParser = (WritingParser) newInstance; - System.out.println("###DEBUG#### getWritingParsers - class name = " + readingParser.getClass().getName()); - for (String namespaceURI : readingParser.getNamespaces()) { clonedMap.put(namespaceURI, readingParser); } } } catch (ClassNotFoundException e) { - System.out.println("###DEBUG### problem loading class '" + parserClassName + "': " + e.getMessage()); - // e.printStackTrace(); + if (logger.isDebugEnabled()) { + logger.debug("problem loading class '" + parserClassName + "': " + e.getMessage()); + } } catch (InstantiationException e) { - System.out.println("###DEBUG### problem loading class '" + parserClassName + "': " + e.getMessage()); - // e.printStackTrace(); + if (logger.isDebugEnabled()) { + logger.debug("problem loading class '" + parserClassName + "': " + e.getMessage()); + e.printStackTrace(); + } } catch (IllegalAccessException e) { - System.out.println("###DEBUG### problem loading class '" + parserClassName + "': " + e.getMessage()); - // e.printStackTrace(); + if (logger.isDebugEnabled()) { + logger.debug("problem loading class '" + parserClassName + "': " + e.getMessage()); + e.printStackTrace(); + } } } } Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLCoreParser.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLCoreParser.java 2015-04-23 14:56:36 UTC (rev 2241) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLCoreParser.java 2015-04-23 15:13:13 UTC (rev 2242) @@ -1249,8 +1249,7 @@ @Override public void writeCharacters(SBMLObjectForXML xmlObject, Object sbmlElementToWrite) { - // The method should never be called ! - log4jLogger.warn("The SBML core XML element should not have any content, everything should be stored as attribute."); + // The SBML core XML element should not have any content, everything should be stored as attribute. } /* (non-Javadoc) Modified: trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-04-23 14:56:36 UTC (rev 2241) +++ trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java 2015-04-23 15:13:13 UTC (rev 2242) @@ -1025,6 +1025,7 @@ childParser.writeElement(childXmlObject, nextObjectToWrite); childParser.writeNamespaces(childXmlObject, nextObjectToWrite); childParser.writeAttributes(childXmlObject, nextObjectToWrite); + childParser.writeCharacters(childXmlObject, nextObjectToWrite); if (!childXmlObject.isSetName()) { logger.error("XML name not set, element ignored!"); @@ -1062,6 +1063,11 @@ indent + indentCount, false); elementIsNested = isClosedAnnotation = true; } + + if (childXmlObject.getCharacters() != null && childXmlObject.getCharacters().trim().length() != 0) { + newOutPutElement.addCharacters(childXmlObject.getCharacters()); + } + if (s.getChildCount() > 0) { // make sure that we'll have line breaks if an element has any sub elements. elementIsNested = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 14:56:39
|
Revision: 2241 http://sourceforge.net/p/jsbml/code/2241 Author: pdp10 Date: 2015-04-23 14:56:36 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 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-23 14:33:54 UTC (rev 2240) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-23 14:56:36 UTC (rev 2241) @@ -69,6 +69,10 @@ /** * */ + private String samples; + /** + * + */ private Integer samplesLength; /** * @@ -106,14 +110,15 @@ if (sf.isSetCompression()) { setCompression(sf.getCompression()); } + if (sf.isSetSamples()) { + setSamples(sf.getSamples()); + } if (sf.isSetSamplesLength()) { setSamplesLength(sf.getSamplesLength()); } if (sf.isSetInterpolation()) { setInterpolation(sf.getInterpolation()); } - - // TODO - data ? } /** @@ -172,6 +177,10 @@ if (equal && isSetSamplesLength()) { equal &= sf.getSamplesLength() == getSamplesLength(); } + equal &= sf.isSetSamples() == isSetSamples(); + if (equal && isSetSamples()) { + equal &= sf.getSamples() == getSamples(); + } equal &= sf.isSetDataType() == isSetDataType(); if (equal && isSetDataType()) { equal &= sf.getDataType().equals(getDataType()); @@ -491,7 +500,59 @@ return false; } + + /** + * Returns the value of {@link #samples}. + * + * @return the value of {@link #samples}. + */ + public String getSamples() { + if (isSetSamples()) { + return samples; + } + // 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(SpatialConstants.samples, this); + } + + /** + * Returns whether {@link #samples} is set. + * + * @return whether {@link #samples} is set. + */ + public boolean isSetSamples() { + return this.samples != null; + } + + + /** + * Sets the value of samples + * + * @param samples the value of samples to be set. + */ + public void setSamples(String samples) { + String oldSamples = this.samples; + this.samples = samples; + firePropertyChange(SpatialConstants.samples, oldSamples, this.samples); + } + + + /** + * Unsets the variable samples. + * + * @return {@code true} if samples was set before, otherwise {@code false}. + */ + public boolean unsetSamples() { + if (isSetSamples()) { + String oldSamples = this.samples; + this.samples = null; + this.samplesLength = null; + firePropertyChange(SpatialConstants.samples, oldSamples, this.samples); + return true; + } + return false; + } + /** * Returns the value of {@link #samplesLength}. * @@ -689,6 +750,10 @@ hashCode += prime * getCompression().hashCode(); } + if (isSetSamples()) { + hashCode += prime * getSamples().hashCode(); + } + if (isSetSamplesLength()) { hashCode += prime * getSamplesLength(); } @@ -733,6 +798,11 @@ attributes.put(SpatialConstants.shortLabel + ":interpolation", getInterpolation().toString()); } + if (isSetSamplesLength()) { + attributes.remove("samplesLength"); + attributes.put(SpatialConstants.shortLabel + ":samplesLength", + String.valueOf(getSamplesLength())); + } return attributes; } @@ -823,6 +893,8 @@ builder.append(compression); builder.append(", samplesLength="); builder.append(samplesLength); + builder.append(", samples="); + builder.append(samples); builder.append(", data="); builder.append(data); builder.append("]"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 14:34:04
|
Revision: 2240 http://sourceforge.net/p/jsbml/code/2240 Author: pdp10 Date: 2015-04-23 14:33:54 +0000 (Thu, 23 Apr 2015) Log Message: ----------- xml example for the spatial package Added Paths: ----------- trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field.xml Added: trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field.xml =================================================================== --- trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field.xml (rev 0) +++ trunk/extensions/spatial/test/org/sbml/jsbml/xml/test/data/spatial/sampled_field.xml 2015-04-23 14:33:54 UTC (rev 2240) @@ -0,0 +1,311 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:req="http://www.sbml.org/sbml/level3/version1/req/version1" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" level="3" version="1" req:required="true" spatial:required="true"> + <model> + <listOfUnitDefinitions> + <unitDefinition id="substance"> + <listOfUnits> + <unit kind="item" exponent="1" scale="0" multiplier="1"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="volume"> + <listOfUnits> + <unit kind="metre" exponent="3" scale="0" multiplier="1e-06"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="area"> + <listOfUnits> + <unit kind="metre" exponent="2" scale="0" multiplier="1e-06"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="molecules"> + <listOfUnits> + <unit kind="item" exponent="1" scale="0" multiplier="1"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="umol_um3_litre_1"> + <listOfUnits> + <unit kind="mole" exponent="1" scale="0" multiplier="1e-21"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="um3"> + <listOfUnits> + <unit kind="metre" exponent="3" scale="0" multiplier="1e-06"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="um2"> + <listOfUnits> + <unit kind="metre" exponent="2" scale="0" multiplier="1e-06"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="uM_um3_molecules_1"> + <listOfUnits> + <unit kind="dimensionless" exponent="1" scale="0" multiplier="1e-21"/> + <unit kind="item" exponent="-1" scale="0" multiplier="1"/> + <unit kind="mole" exponent="1" scale="0" multiplier="1"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="molecules_um_2_s_1"> + <listOfUnits> + <unit kind="dimensionless" exponent="1" scale="0" multiplier="1000000000000"/> + <unit kind="item" exponent="1" scale="0" multiplier="1"/> + <unit kind="metre" exponent="-2" scale="0" multiplier="1"/> + <unit kind="second" exponent="-1" scale="0" multiplier="1"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="pA_um_2"> + <listOfUnits> + <unit kind="dimensionless" exponent="1" scale="0" multiplier="1"/> + <unit kind="ampere" exponent="1" scale="0" multiplier="1"/> + <unit kind="metre" exponent="-2" scale="0" multiplier="1"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="uM_um_s_1"> + <listOfUnits> + <unit kind="dimensionless" exponent="1" scale="0" multiplier="1e-09"/> + <unit kind="metre" exponent="-2" scale="0" multiplier="1"/> + <unit kind="mole" exponent="1" scale="0" multiplier="1"/> + <unit kind="second" exponent="-1" scale="0" multiplier="1"/> + </listOfUnits> + </unitDefinition> + </listOfUnitDefinitions> + <listOfCompartments> + <compartment id="Extracellular" name="Extracellular" spatialDimensions="3" constant="true"> + <spatial:compartmentMapping spatial:id="ExtracellularExtracellular" spatial:domainType="Extracellular" spatial:unitSize="1"/> + </compartment> + <compartment id="Cytosol_Extracellular_membrane" name="Cytosol_Extracellular_membrane" spatialDimensions="2" constant="true"> + <spatial:compartmentMapping spatial:id="Cytosol_Extracellular_membraneCytosol_Extracellular_membrane" spatial:domainType="Cytosol_Extracellular_membrane" spatial:unitSize="1"/> + </compartment> + <compartment id="Cytosol" name="Cytosol" spatialDimensions="3" constant="true"> + <spatial:compartmentMapping spatial:id="CytosolCytosol" spatial:domainType="Cytosol" spatial:unitSize="1"/> + </compartment> + <compartment id="Nucleus_Cytosol_membrane" name="Nucleus_Cytosol_membrane" spatialDimensions="2" constant="true"> + <spatial:compartmentMapping spatial:id="Nucleus_Cytosol_membraneNucleus_Cytosol_membrane" spatial:domainType="Nucleus_Cytosol_membrane" spatial:unitSize="1"/> + </compartment> + <compartment id="Nucleus" name="Nucleus" spatialDimensions="3" constant="true"> + <spatial:compartmentMapping spatial:id="NucleusNucleus" spatial:domainType="Nucleus" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species id="s1_nuc" compartment="Nucleus" initialConcentration="0" substanceUnits="molecules" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" spatial:isSpatial="true"> + <annotation> + <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell"> + <vcell:VCMLSpecific> + <vcell:Compound Name="s1_2"/> + </vcell:VCMLSpecific> + </vcell:VCellInfo> + </annotation> + <req:listOfChangedMaths> + <req:changedMath req:changedBy="spatial" req:viableWithoutChange="true"/> + </req:listOfChangedMaths> + <spatial:spatialSymbolReference spatial:spatialRef="spatial"/> + </species> + <species id="s1_cyt" compartment="Cytosol" initialConcentration="10" substanceUnits="molecules" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" spatial:isSpatial="true"> + <annotation> + <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell"> + <vcell:VCMLSpecific> + <vcell:Compound Name="s1_2"/> + </vcell:VCMLSpecific> + </vcell:VCellInfo> + </annotation> + <req:listOfChangedMaths> + <req:changedMath req:changedBy="spatial" req:viableWithoutChange="true"/> + </req:listOfChangedMaths> + <spatial:spatialSymbolReference spatial:spatialRef="spatial"/> + </species> + <species id="s2_nuc" compartment="Nucleus" initialConcentration="5" substanceUnits="molecules" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" spatial:isSpatial="true"> + <annotation> + <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell"> + <vcell:VCMLSpecific> + <vcell:Compound Name="s2_2"/> + </vcell:VCMLSpecific> + </vcell:VCellInfo> + </annotation> + <req:listOfChangedMaths> + <req:changedMath req:changedBy="spatial" req:viableWithoutChange="true"/> + </req:listOfChangedMaths> + <spatial:spatialSymbolReference spatial:spatialRef="spatial"/> + </species> + <species id="s1_EC" compartment="Extracellular" initialConcentration="0" substanceUnits="molecules" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" spatial:isSpatial="true"> + <annotation> + <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell"> + <vcell:VCMLSpecific> + <vcell:Compound Name="s1_2"/> + </vcell:VCMLSpecific> + </vcell:VCellInfo> + </annotation> + <req:listOfChangedMaths> + <req:changedMath req:changedBy="spatial" req:viableWithoutChange="true"/> + </req:listOfChangedMaths> + <spatial:spatialSymbolReference spatial:spatialRef="spatial"/> + </species> + </listOfSpecies> + <listOfParameters> + <parameter id="x" value="0"> + <spatial:spatialSymbolReference spatial:id="x"/> + </parameter> + <parameter id="y" value="0"> + <spatial:spatialSymbolReference spatial:id="y"/> + </parameter> + <parameter id="s1_nuc_diff" value="10" constant="true"> + <spatial:diffusionCoefficient spatial:variable="s1_nuc" spatial:type="isotropic"/> + <spatial:listOfCoordinateReferences> + <spatial:coordinateReference spatial:coordinate="cartesianX"/> + <spatial:coordinateReference spatial:coordinate="cartesianY"/> + </spatial:listOfCoordinateReferences> + </parameter> + <parameter id="s1_nuc_BC_Xm" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Xmin" spatial:type="Dirichlet" spatial:boundaryDomainType="Nucleus"/> + </parameter> + <parameter id="s1_nuc_BC_Xp" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Xmax" spatial:type="Dirichlet" spatial:boundaryDomainType="Nucleus"/> + </parameter> + <parameter id="s1_nuc_BC_Ym" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Ymin" spatial:type="Dirichlet" spatial:boundaryDomainType="Nucleus"/> + </parameter> + <parameter id="s1_nuc_BC_Yp" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_nuc" spatial:coordinateBoundary="Ymax" spatial:type="Dirichlet" spatial:boundaryDomainType="Nucleus"/> + </parameter> + <parameter id="s1_cyt_diff" value="10" constant="true"> + <spatial:diffusionCoefficient spatial:variable="s1_cyt" spatial:type="isotropic"/> + <spatial:listOfCoordinateReferences> + <spatial:coordinateReference spatial:coordinate="cartesianX"/> + <spatial:coordinateReference spatial:coordinate="cartesianY"/> + </spatial:listOfCoordinateReferences> + </parameter> + <parameter id="s1_cyt_BC_Xm" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Xmin" spatial:type="Dirichlet" spatial:boundaryDomainType="Cytosol"/> + </parameter> + <parameter id="s1_cyt_BC_Xp" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Xmax" spatial:type="Dirichlet" spatial:boundaryDomainType="Cytosol"/> + </parameter> + <parameter id="s1_cyt_BC_Ym" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Ymin" spatial:type="Dirichlet" spatial:boundaryDomainType="Cytosol"/> + </parameter> + <parameter id="s1_cyt_BC_Yp" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_cyt" spatial:coordinateBoundary="Ymax" spatial:type="Dirichlet"/> + </parameter> + <parameter id="s1_EC_diff" value="10" constant="true"> + <spatial:diffusionCoefficient spatial:variable="s1_EC" spatial:type="isotropic"/> + <spatial:listOfCoordinateReferences> + <spatial:coordinateReference spatial:coordinate="cartesianX"/> + <spatial:coordinateReference spatial:coordinate="cartesianY"/> + </spatial:listOfCoordinateReferences> + </parameter> + <parameter id="s1_EC_BC_Xm" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Xmin" spatial:type="Dirichlet" spatial:boundaryDomainType="Extracellular"/> + </parameter> + <parameter id="s1_EC_BC_Xp" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Xmax" spatial:type="Dirichlet" spatial:boundaryDomainType="Extracellular"/> + </parameter> + <parameter id="s1_EC_BC_Ym" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Ymin" spatial:type="Dirichlet" spatial:boundaryDomainType="Extracellular"/> + </parameter> + <parameter id="s1_EC_BC_Yp" value="0" constant="true"> + <spatial:boundaryCondition spatial:variable="s1_EC" spatial:coordinateBoundary="Ymax" spatial:type="Dirichlet" spatial:boundaryDomainType="Extracellular"/> + </parameter> + <parameter id="KMOLE" value="0.00166112956810631" units="uM_um3_molecules_1" constant="true"/> + </listOfParameters> + <listOfReactions> + <reaction id="flux1" name="flux1" reversible="true" fast="false" spatial:isLocal="true"> + <listOfReactants> + <speciesReference species="s1_cyt" stoichiometry="1"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="s1_nuc" stoichiometry="1"/> + </listOfProducts> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <times/> + <cn> 5 </cn> + <ci> s1_cyt </ci> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="I" value="0" units="pA_um_2"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="flux2" name="flux2" reversible="true" fast="false" spatial:isLocal="true"> + <listOfReactants> + <speciesReference species="s1_cyt" stoichiometry="1"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="s1_EC" stoichiometry="1"/> + </listOfProducts> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <times/> + <cn> 5 </cn> + <ci> s1_cyt </ci> + </apply> + </math> + </kineticLaw> + </reaction> + </listOfReactions> + <listOfRules> + <assignmentRule metaid="CDMT00006" variable="s2_nuc"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <ci> x </ci> + </math> + </assignmentRule> + </listOfRules> + <spatial:geometry> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="x" spatial:type="cartesianX" spatial:unit="um"> + <spatial:boundaryMin spatial:id="Xmin" spatial:value="0"/> + <spatial:boundaryMax spatial:id="Xmax" spatial:value="800"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="y" spatial:type="cartesianY" spatial:unit="um"> + <spatial:boundaryMin spatial:id="Ymin" spatial:value="0"/> + <spatial:boundaryMax spatial:id="Ymax" spatial:value="950"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="Extracellular" spatial:spatialDimensions="3"/> + <spatial:domainType spatial:id="Cytosol_Extracellular_membrane" spatial:spatialDimensions="2"/> + <spatial:domainType spatial:id="Cytosol" spatial:spatialDimensions="3"/> + <spatial:domainType spatial:id="Nucleus_Cytosol_membrane" spatial:spatialDimensions="2"/> + <spatial:domainType spatial:id="Nucleus" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:id="Extracellular0" spatial:domainType="Extracellular"/> + <spatial:domain spatial:id="Cytosol_Extracellular_membrane0" spatial:domainType="Cytosol_Extracellular_membrane"/> + <spatial:domain spatial:id="Cytosol0" spatial:domainType="Cytosol"/> + <spatial:domain spatial:id="Nucleus_Cytosol_membrane0" spatial:domainType="Nucleus_Cytosol_membrane"/> + <spatial:domain spatial:id="Nucleus0" spatial:domainType="Nucleus"/> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:id="Cytosol_Extracellular_membrane_Cytosol0" spatial:domain1="Cytosol_Extracellular_membrane0" spatial:domain2="Cytosol0"/> + <spatial:adjacentDomains spatial:id="Cytosol_Extracellular_membrane_Extracellular0" spatial:domain1="Cytosol_Extracellular_membrane0" spatial:domain2="Extracellular0"/> + <spatial:adjacentDomains spatial:id="Nucleus_Cytosol_membrane_Nucleus0" spatial:domain1="Nucleus_Cytosol_membrane0" spatial:domain2="Nucleus0"/> + <spatial:adjacentDomains spatial:id="Nucleus_Cytosol_membrane_Cytosol0" spatial:domain1="Nucleus_Cytosol_membrane0" spatial:domain2="Cytosol0"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="mySampledField"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:id="Extracellular" spatial:domainType="Extracellular" spatial:sampledValue="0" spatial:minValue="0" spatial:maxValue="0"/> + <spatial:sampledVolume spatial:id="Cytosol" spatial:domainType="Cytosol" spatial:sampledValue="128" spatial:minValue="0" spatial:maxValue="0"/> + <spatial:sampledVolume spatial:id="Nucleus" spatial:domainType="Nucleus" spatial:sampledValue="255" spatial:minValue="0" spatial:maxValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:id="imgtest" spatial:dataType="uint8" spatial:numSamples1="800" spatial:numSamples2="950" spatial:numSamples3="1" spatial:interpolationType="linear" spatial:compression="deflated" spatial:samplesLength="3440">120 218 237 221 193 142 27 57 12 64 193 124 122 255 185 22 216 195 30 54 240 216 238 97 83 20 89 239 154 75 183 168 2 237 96 146 249 243 71 146 36 73 146 36 73 146 36 73 26 217 117 57 3 233 181 15 64 164 215 60 248 144 248 144 238 240 224 67 226 67 226 67 138 229 193 135 196 135 196 135 196 135 148 197 131 15 137 15 137 15 137 15 41 139 7 31 18 31 18 31 82 44 15 62 36 62 36 62 164 88 30 124 72 124 72 124 72 177 60 248 144 248 144 248 144 98 121 240 33 241 33 241 33 197 242 224 67 226 67 226 67 226 67 202 226 193 135 196 135 196 135 20 203 3 16 137 15 137 15 137 15 137 15 169 0 15 62 36 62 36 31 175 36 62 36 62 164 237 62 28 136 100 125 72 124 72 124 72 124 72 124 72 133 121 240 33 241 33 241 33 241 33 101 241 224 67 226 67 186 229 3 16 137 + 15 233 14 15 62 36 62 36 62 36 62 164 52 31 128 72 175 121 240 33 241 33 241 33 241 33 101 241 224 67 250 193 7 32 18 31 18 31 82 176 15 64 164 215 60 248 144 248 144 248 144 248 144 248 144 246 243 224 67 226 67 186 229 3 16 241 193 135 196 135 20 203 131 15 241 193 135 196 135 20 236 3 16 241 193 135 116 135 7 31 226 131 15 137 15 137 15 137 15 137 15 137 15 137 15 169 27 15 62 196 7 32 18 31 18 31 82 26 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 62 196 7 32 18 31 82 48 15 62 196 7 31 18 31 82 44 15 62 196 7 31 18 31 82 44 15 64 196 7 31 18 31 18 31 82 26 15 62 196 7 31 210 45 31 128 8 15 62 36 62 36 62 36 62 164 253 60 248 16 31 128 72 124 72 193 60 248 16 31 124 72 124 72 177 60 248 16 31 124 72 124 72 124 72 89 60 0 17 31 124 136 15 62 164 96 30 124 136 15 62 196 7 31 18 31 82 22 15 62 196 7 31 226 131 15 41 150 7 31 226 13 + 1 15 241 193 135 20 203 131 15 241 193 135 248 224 67 138 229 193 135 248 224 67 124 240 33 197 242 224 67 124 240 33 62 248 144 98 121 240 33 62 248 16 31 124 72 124 72 89 60 248 16 31 124 136 15 62 164 88 30 124 136 15 62 196 7 30 146 245 33 241 33 241 33 241 33 29 201 131 15 241 193 135 248 224 67 138 229 193 135 248 224 67 124 240 33 197 242 224 67 124 240 33 62 248 144 240 144 248 144 248 144 10 243 224 67 124 240 33 62 240 144 172 15 137 15 137 15 169 48 15 62 196 7 31 226 3 15 201 250 144 248 144 248 144 10 243 224 67 124 240 33 60 240 144 248 144 146 120 240 33 62 248 16 31 124 72 177 60 248 16 31 124 8 15 62 36 62 36 62 164 253 60 248 16 31 124 8 15 62 36 62 36 60 36 62 164 194 60 248 16 31 124 136 15 62 164 88 30 124 136 15 62 132 7 31 18 31 18 31 210 126 30 124 136 15 64 132 7 31 226 131 15 41 141 7 31 226 3 16 241 193 135 240 224 67 226 67 42 192 3 16 241 193 135 248 224 67 120 0 34 37 250 0 68 120 0 34 62 0 17 30 128 72 153 62 0 17 31 128 8 15 62 196 7 31 82 26 + 15 62 196 7 30 194 131 15 241 129 135 132 135 196 135 84 214 135 19 22 30 120 136 15 62 132 7 30 18 31 210 102 30 124 136 15 60 132 7 31 226 131 15 9 15 137 15 169 46 15 62 196 7 31 226 131 15 225 193 135 196 135 180 159 7 31 226 131 15 225 193 135 248 224 67 202 226 193 135 248 224 67 120 240 33 62 248 144 178 120 240 33 60 248 16 31 124 8 15 62 196 7 31 210 126 30 124 136 15 62 132 7 31 226 3 16 225 193 135 196 135 84 154 7 31 226 131 15 225 193 135 248 224 67 120 240 33 241 33 85 230 193 135 248 224 67 120 240 33 62 248 16 30 124 72 124 72 149 121 240 33 60 248 16 31 124 8 15 62 196 7 31 210 126 30 124 136 15 62 132 7 31 226 131 15 225 193 135 196 135 84 153 7 31 226 131 15 225 193 135 240 0 68 124 240 33 21 224 193 135 248 224 67 120 240 33 60 248 16 31 124 72 251 121 0 34 60 248 16 31 124 8 15 62 196 7 32 194 131 15 169 54 15 62 196 7 31 194 131 15 241 193 135 240 224 67 120 240 33 241 33 157 201 131 15 225 1 136 248 224 67 120 240 33 60 248 16 31 124 72 165 121 240 33 + 60 0 17 31 124 8 15 62 132 7 31 226 131 15 169 52 15 62 132 7 31 226 131 15 225 1 136 240 224 67 124 240 33 149 230 193 135 248 224 67 120 240 33 60 248 16 31 124 8 15 64 132 7 30 210 161 62 0 17 30 124 8 15 62 132 7 31 194 131 15 225 193 135 240 224 67 58 147 7 31 194 131 15 225 193 135 248 224 67 120 0 34 62 248 16 30 124 72 135 242 224 67 124 240 33 60 0 17 31 124 8 15 62 132 7 31 226 3 16 41 135 199 250 47 62 132 199 223 46 86 52 17 83 211 209 60 214 15 241 161 209 62 214 219 0 209 76 30 235 179 248 208 60 30 235 139 248 208 40 30 235 235 248 208 16 31 235 94 124 168 59 143 245 155 0 81 39 30 255 187 217 235 247 241 161 6 60 214 147 241 161 131 121 172 199 227 67 167 242 88 41 1 162 35 125 172 85 19 136 9 106 16 143 175 133 24 161 70 241 248 18 136 25 106 183 143 149 29 31 58 133 199 218 17 32 58 130 199 218 21 31 42 207 99 109 140 15 225 193 135 78 245 177 214 9 64 12 82 3 215 199 199 64 76 82 35 121 124 8 196 40 53 147 199 103 64 204 82 67 121 0 34 60 126 11 196 56 53 + 149 199 39 64 204 83 201 62 214 58 8 136 121 106 46 143 247 64 12 84 83 63 93 1 34 60 248 16 30 143 1 49 84 77 230 241 14 136 169 42 141 71 73 31 139 15 89 31 55 129 24 171 134 243 224 67 62 93 1 34 60 248 208 161 60 10 251 88 124 104 55 15 62 132 7 31 82 51 30 63 1 49 94 101 240 56 213 7 32 202 224 81 219 135 5 34 60 248 16 30 128 200 151 143 60 32 134 44 60 248 16 30 62 96 9 15 11 68 120 88 32 194 131 15 249 155 93 64 132 7 31 194 227 84 30 126 8 75 201 58 142 226 193 135 240 0 68 120 240 161 242 60 58 249 0 68 211 121 88 32 194 195 2 81 5 30 124 8 143 86 60 252 87 213 194 3 16 225 241 128 15 64 52 155 135 223 38 37 62 44 16 225 97 129 136 15 62 132 7 31 234 227 99 241 33 60 90 250 240 5 93 120 240 33 60 248 80 57 30 189 125 0 162 223 241 56 221 135 5 34 60 248 208 22 30 221 125 0 162 223 240 224 67 120 52 230 241 206 7 32 154 204 195 2 209 99 60 38 248 0 68 147 121 188 245 1 136 238 241 224 67 120 52 231 1 136 158 225 193 135 240 104 207 227 189 15 64 116 205 245 97 129 2 + 32 1 30 131 124 0 130 199 92 30 124 40 158 71 35 31 128 40 156 7 31 194 131 15 64 240 224 131 15 133 234 152 230 3 16 60 198 250 0 68 193 58 230 249 32 4 143 161 60 62 244 1 8 30 51 125 0 162 88 30 51 125 0 130 7 31 128 232 226 131 15 61 198 99 170 15 64 240 152 199 195 2 81 40 143 185 62 0 193 131 15 62 240 224 131 15 61 195 99 176 15 64 240 224 131 15 60 248 240 1 75 143 240 224 67 124 12 226 193 135 172 15 62 132 7 31 218 202 163 163 15 63 97 130 7 31 124 232 121 30 124 8 143 89 60 248 192 131 15 255 196 86 79 235 224 67 120 240 129 7 30 120 124 11 196 117 162 131 15 62 240 224 131 15 60 248 224 67 137 58 186 242 248 16 136 75 133 7 31 124 224 193 7 31 120 224 193 135 210 116 240 33 60 248 224 3 15 60 248 192 131 15 64 148 197 131 15 215 11 15 62 248 192 3 15 62 232 224 131 15 37 241 232 237 99 241 65 7 30 124 224 193 7 31 74 214 193 7 31 120 204 229 193 7 30 124 252 18 136 171 70 199 84 30 22 8 30 124 240 65 7 30 124 40 149 7 31 124 224 193 7 31 120 224 193 7 29 124 248 + 9 69 60 248 224 67 120 240 161 186 60 248 224 3 15 62 0 161 131 15 11 4 15 62 248 192 131 15 62 180 159 7 31 128 208 193 7 31 120 240 193 7 29 124 60 230 3 16 58 70 242 224 131 14 62 248 192 131 15 95 64 232 224 131 15 21 224 193 7 32 120 240 193 7 30 124 240 129 7 31 79 250 0 4 15 62 248 160 131 143 91 62 0 193 131 15 62 232 0 228 150 15 64 240 224 131 15 58 248 224 131 14 62 130 125 0 130 7 31 124 208 193 199 45 31 128 224 193 7 31 120 240 193 7 29 128 4 251 0 4 15 62 248 160 3 16 62 240 224 131 15 58 0 225 131 14 62 10 248 0 4 143 97 64 248 160 131 15 62 232 224 131 15 60 248 216 233 3 16 60 102 1 225 131 14 62 248 160 3 144 4 31 128 224 49 10 8 31 116 240 193 7 29 128 100 248 0 132 14 62 248 192 3 144 59 60 0 161 131 15 62 232 224 227 158 15 64 240 224 131 15 58 248 184 229 3 16 60 166 0 225 131 14 62 98 121 240 129 199 16 32 23 32 116 240 193 7 29 128 240 65 7 32 21 124 0 2 199 8 32 124 176 193 7 31 112 0 194 7 29 124 212 240 1 8 29 19 128 240 65 7 32 124 208 193 71 170 + 15 64 232 232 239 227 226 3 15 64 248 160 3 144 92 31 128 224 193 7 31 116 204 5 114 241 129 7 32 207 248 0 132 142 230 64 248 192 3 16 62 232 0 36 223 7 32 120 244 6 194 7 29 128 240 129 7 32 27 124 0 66 71 107 33 124 224 1 136 15 88 116 16 2 8 29 128 240 65 7 32 190 128 224 65 72 3 31 128 208 209 152 200 197 7 29 128 240 65 7 32 59 120 0 66 71 87 32 49 239 78 135 58 10 137 122 115 58 212 208 72 220 107 211 161 126 66 248 160 3 145 4 30 67 129 184 233 173 149 240 65 7 38 41 60 46 58 212 75 72 240 75 210 161 78 64 46 62 240 0 36 139 199 36 32 238 115 123 33 23 31 120 16 146 200 227 162 67 77 128 60 243 126 116 168 5 145 139 15 60 8 225 131 14 70 170 232 104 15 196 189 29 193 228 226 131 14 70 54 240 184 232 208 225 68 158 125 21 58 244 136 144 171 131 142 166 62 220 207 41 91 228 226 131 14 64 182 241 232 7 196 181 28 35 36 229 21 232 208 153 68 146 94 128 14 157 8 228 226 131 14 66 54 235 104 3 196 53 156 4 228 226 131 13 66 10 232 56 30 136 203 55 141 200 197 7 28 128 20 + 209 113 40 16 247 109 164 144 45 207 13 135 142 0 178 235 185 233 80 113 33 91 159 26 15 85 38 178 253 153 233 80 89 35 21 30 24 14 213 52 82 227 97 217 80 45 33 255 254 121 157 103 165 67 21 132 84 125 82 58 180 153 72 237 231 132 67 58 206 135 193 8 16 58 4 8 30 226 131 14 1 130 135 248 224 67 42 9 196 52 196 7 30 2 132 15 241 193 135 248 192 67 128 240 33 241 33 157 8 196 32 196 7 31 2 132 15 241 1 136 248 224 67 128 0 34 213 246 1 136 0 33 68 124 32 34 64 0 17 31 132 8 16 64 164 51 124 0 34 64 0 17 31 128 8 16 64 196 7 32 2 4 16 201 39 44 201 2 145 44 16 201 2 145 0 225 67 124 240 33 64 248 16 31 124 8 16 64 196 7 31 210 33 64 204 67 124 0 34 64 0 17 32 124 136 15 64 4 8 31 146 5 34 89 32 146 5 34 89 32 18 32 124 136 15 62 4 8 31 226 131 15 1 130 135 248 224 67 170 15 196 40 196 7 30 2 132 15 241 129 135 0 193 67 124 224 33 21 5 98 4 226 3 15 1 66 135 248 192 67 128 240 33 109 255 6 226 252 197 7 40 2 4 17 241 193 136 0 1 69 42 236 3 21 1 194 137 248 128 73 128 16 35 62 + 40 17 32 148 72 131 129 80 34 62 72 17 32 160 136 15 70 4 8 35 226 3 18 1 194 136 248 96 68 128 136 27 64 68 137 248 96 68 128 64 34 62 24 17 32 140 136 15 68 4 8 33 226 67 110 19 32 66 5 16 65 34 62 184 17 32 140 136 15 68 4 8 34 226 131 16 1 34 66 248 16 33 128 8 16 62 4 8 32 2 68 128 148 244 193 12 31 122 33 196 158 1 68 62 137 241 33 64 0 17 32 128 168 236 119 21 183 150 15 217 40 128 8 18 64 132 8 31 2 4 16 17 2 136 0 17 31 128 8 16 66 4 8 32 226 67 132 0 34 66 0 209 195 68 200 225 67 214 11 32 66 4 16 49 194 135 16 1 68 140 0 34 68 248 16 35 2 132 17 1 34 68 0 17 35 128 136 16 64 68 8 32 34 4 16 17 194 135 8 1 68 132 0 34 68 196 135 24 1 68 136 0 34 68 0 17 34 128 136 17 64 196 8 31 98 4 16 33 2 136 16 1 68 66 4 16 33 2 136 16 1 68 132 240 33 66 0 17 33 128 136 16 62 132 8 32 98 4 16 9 23 62 196 8 32 66 132 15 33 2 136 16 225 67 132 0 34 68 248 16 32 128 72 125 133 152 169 16 225 67 132 0 34 66 248 16 34 128 8 17 62 132 8 32 66 4 16 169 35 17 19 20 34 128 8 17 64 68 8 + 32 66 132 15 33 2 136 16 1 68 58 216 136 137 9 17 64 132 8 32 66 4 16 33 2 136 48 225 67 42 111 196 124 68 8 32 66 4 16 33 194 135 16 1 68 132 0 34 149 39 98 40 34 4 16 33 194 135 8 1 68 132 0 34 68 0 145 170 11 49 10 17 2 136 8 225 67 132 240 33 66 240 144 246 11 49 0 17 130 135 8 193 67 132 240 33 66 240 144 246 10 113 228 34 132 15 1 194 135 8 1 68 132 240 33 21 16 226 168 69 8 31 34 132 15 17 2 136 148 6 196 33 139 16 62 68 8 31 34 132 15 41 75 136 195 21 32 128 136 16 62 4 8 31 82 154 16 231 42 66 0 17 33 124 136 16 62 36 64 164 10 68 156 167 8 225 67 132 0 34 5 11 113 148 66 132 15 33 2 136 20 76 196 17 10 17 62 132 8 32 82 48 17 71 39 68 248 144 248 144 98 137 56 50 17 194 135 116 71 136 227 18 34 127 131 224 67 136 88 24 210 55 68 156 138 244 210 136 3 145 94 27 113 24 210 43 37 14 65 146 36 73 146 36 73 146 36 73 146 36 73 146 36 73 146 36 73 82 195 254 1 20 164 156 86 </spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 14:19:21
|
Revision: 2239 http://sourceforge.net/p/jsbml/code/2239 Author: pdp10 Date: 2015-04-23 14:19:19 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-23 14:10:42 UTC (rev 2238) +++ trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2015-04-23 14:19:19 UTC (rev 2239) @@ -401,24 +401,14 @@ } else if (contextObject instanceof ParametricGeometry) { ParametricGeometry pg = (ParametricGeometry) contextObject; if (elementName.equals(SpatialConstants.spatialPoints)){ - SpatialPoints spatialPoints = pg.getSpatialPoints(); - return spatialPoints; + SpatialPoints sp = new SpatialPoints(); + pg.setSpatialPoints(sp); + return sp; } else if (elementName.equals(SpatialConstants.listOfParametricObjects)){ ListOf<ParametricObject> listOfParametricObjects = pg.getListOfParametricObjects(); return listOfParametricObjects; } - } else if (contextObject instanceof ParametricObject) { - ParametricObject po = (ParametricObject) contextObject; - if (elementName.equals(SpatialConstants.imageData)){ - // TODO: THIS NEEDS to be updated with the details provided in the spatial package v0.90, - // See ArrayData text child and PointIndex text child - //PolygonObject polygonObject = new PolygonObject(); - //po.setPolygonObject(polygonObject); - //return polygonObject; - } - } - - else if (contextObject instanceof ListOf<?>) { + } else if (contextObject instanceof ListOf<?>) { ListOf<SBase> listOf = (ListOf<SBase>) contextObject; if (elementName.equals(SpatialConstants.coordinateComponent)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |