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...> - 2016-03-15 11:55:58
|
Revision: 2488 http://sourceforge.net/p/jsbml/code/2488 Author: niko-rodrigue Date: 2016-03-15 11:55:55 +0000 (Tue, 15 Mar 2016) Log Message: ----------- added some tests to check that the JSBML reader and writers work properly with UTF-8 characters Modified Paths: -------------- trunk/build.xml trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java trunk/modules/tidy/tidy-build.properties trunk/test/org/sbml/jsbml/test/AllTests.java Added Paths: ----------- trunk/test/org/sbml/jsbml/test/UTF8Tests.java Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2016-03-09 14:35:44 UTC (rev 2487) +++ trunk/build.xml 2016-03-15 11:55:55 UTC (rev 2488) @@ -211,7 +211,7 @@ <target name="compile" description="Compiles the test directory" - depends="prepare-src, package" + depends="prepare-src, package, prepare-tidy" > <javac srcdir="${test.src.dir}" destdir="${build.dest}" @@ -619,7 +619,33 @@ </target> + <!-- =================================================================== --> + <!-- Build a single jsbml module --> + <!-- =================================================================== --> + <target + name="prepare-tidy" + depends="init" + description="Build the tidy jsbml module" + > + <echo>Module jsbml-tidy</echo> + + <ant dir="${tidy.module.base.dir}" inheritAll="false" inheritRefs="false"> + <target name="clean" /> + <target name="jar" /> + </ant> + + <copy todir="${build.src}"> + <fileset dir="${tidy.module.base.dir}/build/src" /> + </copy> + <copy todir="${build.dir}"> + <fileset dir="${tidy.module.base.dir}/build/" includes="*.jar" /> + <fileset dir="${tidy.module.base.dir}/lib/" includes="*.jar" /> + </copy> + + </target> + + <!-- =================================================================== --> <!-- Build the jsbml extensions/packages --> <!-- =================================================================== --> Modified: trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java =================================================================== --- trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java 2016-03-09 14:35:44 UTC (rev 2487) +++ trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java 2016-03-15 11:55:55 UTC (rev 2488) @@ -79,6 +79,7 @@ tidy.setWraplen(200); tidy.setWrapAttVals(false); tidy.setWrapScriptlets(true); + tidy.setLiteralAttribs(true); tidy.setXmlOut(true); tidy.setXmlSpace(true); tidy.setXmlTags(true); Modified: trunk/modules/tidy/tidy-build.properties =================================================================== --- trunk/modules/tidy/tidy-build.properties 2016-03-09 14:35:44 UTC (rev 2487) +++ trunk/modules/tidy/tidy-build.properties 2016-03-15 11:55:55 UTC (rev 2488) @@ -1,6 +1,6 @@ tidy.Name=Tidy SBMLWriter tidy.name=jsbml-tidy -tidy.version=1.2 +tidy.version=1.2.1 tidy.groupId=org.sbml.jsbml.modules -tidy.artifactId=jsbml_modules_tidy +tidy.artifactId=jsbml-tidy Modified: trunk/test/org/sbml/jsbml/test/AllTests.java =================================================================== --- trunk/test/org/sbml/jsbml/test/AllTests.java 2016-03-09 14:35:44 UTC (rev 2487) +++ trunk/test/org/sbml/jsbml/test/AllTests.java 2016-03-15 11:55:55 UTC (rev 2488) @@ -44,7 +44,7 @@ @RunWith(value=Suite.class) @SuiteClasses(value={Tests.class, LibsbmlCompatibilityTests.class, LayoutJUnitTests.class, RenderJUnitTests.class, UnregisterPackageTests.class, ArraysJUnitTests.class, DisablePackageTests.class, TestL3Dyn.class, - PackageVersionTests.class, CompJUnitTests.class}) + PackageVersionTests.class, CompJUnitTests.class, UTF8Tests.class}) public class AllTests { /** Added: trunk/test/org/sbml/jsbml/test/UTF8Tests.java =================================================================== --- trunk/test/org/sbml/jsbml/test/UTF8Tests.java (rev 0) +++ trunk/test/org/sbml/jsbml/test/UTF8Tests.java 2016-03-15 11:55:55 UTC (rev 2488) @@ -0,0 +1,268 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2016 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ + +package org.sbml.jsbml.test; + +import java.io.File; +import java.io.IOException; + +import javax.xml.stream.XMLStreamException; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.sbml.jsbml.Model; +import org.sbml.jsbml.SBMLDocument; +import org.sbml.jsbml.SBMLException; +import org.sbml.jsbml.SBMLReader; +import org.sbml.jsbml.SBMLWriter; +import org.sbml.jsbml.TidySBMLWriter; + + +public class UTF8Tests { + + /** + * + */ + private SBMLDocument doc; + /** + * + */ + private Model m; + + private final static String chineseUTF8 = "份非常简"; + + private final static String cyrilicUTF8 = "name utf-8: ¥¢®¶ÅÑëЉЍ ϓ Ϡ Ж Ѣ Ѩ о҉"; // 𐍈 does not seems to be supported properly + + private String utf8Model = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n" + + "<sbml xmlns=\"http://www.sbml.org/sbml/level3/version1/core\" level=\"3\" version=\"1\">\n" + + " <model id=\"model\" name=\"" + cyrilicUTF8 + "\">\n" + + "<notes>\n<p xmlns=\"http://www.w3.org/1999/xhtml\">\n<pre>" + + "U+00A2 ¢ c2 a2 CENT SIGN\n" + + "U+00A3 £ c2 a3 POUND SIGN\n" + + "U+00A4 ¤ c2 a4 CURRENCY SIGN\n" + + "U+00A5 ¥ c2 a5 YEN SIGN\n" + + "U+00A6 ¦ c2 a6 BROKEN BAR\n" + + "U+00A7 § c2 a7 SECTION SIGN\n" + + "U+00A9 © c2 a9 COPYRIGHT SIGN\n" + + "U+00AA ª c2 aa FEMININE ORDINAL INDICATOR\n" + + "U+00AB « c2 ab LEFT-POINTING DOUBLE ANGLE QUOTATION MARK\n" + + "U+00AC ¬ c2 ac NOT SIGN\n" + + "U+00AE ® c2 ae REGISTERED SIGN\n" + + "U+00B0 ° c2 b0 DEGREE SIGN\n" + + "U+00B1 ± c2 b1 PLUS-MINUS SIGN\n" + + "U+00B2 ² c2 b2 SUPERSCRIPT TWO\n" + + "U+00B3 ³ c2 b3 SUPERSCRIPT THREE\n" + + "U+00B5 µ c2 b5 MICRO SIGN\n" + + "U+00B6 ¶ c2 b6 PILCROW SIGN\n" + + "U+00B9 ¹ c2 b9 SUPERSCRIPT ONE\n" + + "U+00BA º c2 ba MASCULINE ORDINAL INDICATOR\n" + + "U+00BB » c2 bb RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK\n" + + "U+00BC ¼ c2 bc VULGAR FRACTION ONE QUARTER\n" + + "U+00BD ½ c2 bd VULGAR FRACTION ONE HALF\n" + + "U+00BE ¾ c2 be VULGAR FRACTION THREE QUARTERS\n" + + "U+00BF ¿ c2 bf INVERTED QUESTION MARK\n" + + "U+00C0 À c3 80 LATIN CAPITAL LETTER A WITH GRAVE\n" + + "U+00C1 Á c3 81 LATIN CAPITAL LETTER A WITH ACUTE\n" + + "U+00C2 Â c3 82 LATIN CAPITAL LETTER A WITH CIRCUMFLEX\n" + + "U+00C3 Ã c3 83 LATIN CAPITAL LETTER A WITH TILDE\n" + + "U+00C4 Ä c3 84 LATIN CAPITAL LETTER A WITH DIAERESIS\n" + + "U+00C5 Å c3 85 LATIN CAPITAL LETTER A WITH RING ABOVE\n" + + "U+00C6 Æ c3 86 LATIN CAPITAL LETTER AE\n" + + "U+00C7 Ç c3 87 LATIN CAPITAL LETTER C WITH CEDILLA\n" + + "U+00C8 È c3 88 LATIN CAPITAL LETTER E WITH GRAVE\n" + + "U+00C9 É c3 89 LATIN CAPITAL LETTER E WITH ACUTE\n" + + "U+00CA Ê c3 8a LATIN CAPITAL LETTER E WITH CIRCUMFLEX\n" + + "U+00CB Ë c3 8b LATIN CAPITAL LETTER E WITH DIAERESIS\n" + + "U+00CC Ì c3 8c LATIN CAPITAL LETTER I WITH GRAVE\n" + + "U+00CD Í c3 8d LATIN CAPITAL LETTER I WITH ACUTE\n" + + "U+00CE Î c3 8e LATIN CAPITAL LETTER I WITH CIRCUMFLEX\n" + + "U+00CF Ï c3 8f LATIN CAPITAL LETTER I WITH DIAERESIS\n" + + "U+00D0 Ð c3 90 LATIN CAPITAL LETTER ETH\n" + + "U+00D1 Ñ c3 91 LATIN CAPITAL LETTER N WITH TILDE\n" + + "U+00D2 Ò c3 92 LATIN CAPITAL LETTER O WITH GRAVE\n" + + "U+00D3 Ó c3 93 LATIN CAPITAL LETTER O WITH ACUTE\n" + + "U+00D4 Ô c3 94 LATIN CAPITAL LETTER O WITH CIRCUMFLEX\n" + + "U+00D5 Õ c3 95 LATIN CAPITAL LETTER O WITH TILDE\n" + + "U+00D6 Ö c3 96 LATIN CAPITAL LETTER O WITH DIAERESIS\n" + + "U+00D7 × c3 97 MULTIPLICATION SIGN\n" + + "U+00D8 Ø c3 98 LATIN CAPITAL LETTER O WITH STROKE\n" + + "U+00D9 Ù c3 99 LATIN CAPITAL LETTER U WITH GRAVE\n" + + "U+00DA Ú c3 9a LATIN CAPITAL LETTER U WITH ACUTE\n" + + "U+00DB Û c3 9b LATIN CAPITAL LETTER U WITH CIRCUMFLEX\n" + + "U+00DC Ü c3 9c LATIN CAPITAL LETTER U WITH DIAERESIS\n" + + "U+00DD Ý c3 9d LATIN CAPITAL LETTER Y WITH ACUTE\n" + + "U+00DE Þ c3 9e LATIN CAPITAL LETTER THORN\n" + + "U+00DF ß c3 9f LATIN SMALL LETTER SHARP S\n" + + "U+00E0 à c3 a0 LATIN SMALL LETTER A WITH GRAVE\n" + + "U+00E1 á c3 a1 LATIN SMALL LETTER A WITH ACUTE\n" + + "U+00E2 â c3 a2 LATIN SMALL LETTER A WITH CIRCUMFLEX\n" + + "U+00E3 ã c3 a3 LATIN SMALL LETTER A WITH TILDE\n" + + "U+00E4 ä c3 a4 LATIN SMALL LETTER A WITH DIAERESIS\n" + + "U+00E5 å c3 a5 LATIN SMALL LETTER A WITH RING ABOVE\n" + + "U+00E6 æ c3 a6 LATIN SMALL LETTER AE\n" + + "U+00E7 ç c3 a7 LATIN SMALL LETTER C WITH CEDILLA\n" + + "U+00E8 è c3 a8 LATIN SMALL LETTER E WITH GRAVE\n" + + "U+00E9 é c3 a9 LATIN SMALL LETTER E WITH ACUTE\n" + + "U+00EA ê c3 aa LATIN SMALL LETTER E WITH CIRCUMFLEX\n" + + "U+00EB ë c3 ab LATIN SMALL LETTER E WITH DIAERESIS\n" + + "U+00EC ì c3 ac LATIN SMALL LETTER I WITH GRAVE\n" + + "U+00ED í c3 ad LATIN SMALL LETTER I WITH ACUTE\n" + + "U+00EE î c3 ae LATIN SMALL LETTER I WITH CIRCUMFLEX\n" + + "U+00EF ï c3 af LATIN SMALL LETTER I WITH DIAERESIS\n" + + "U+00F0 ð c3 b0 LATIN SMALL LETTER ETH\n" + + "U+00F1 ñ c3 b1 LATIN SMALL LETTER N WITH TILDE\n" + + "U+00F2 ò c3 b2 LATIN SMALL LETTER O WITH GRAVE\n" + + "U+00F3 ó c3 b3 LATIN SMALL LETTER O WITH ACUTE\n" + + "U+00F4 ô c3 b4 LATIN SMALL LETTER O WITH CIRCUMFLEX\n" + + "U+00F5 õ c3 b5 LATIN SMALL LETTER O WITH TILDE\n" + + "U+00F6 ö c3 b6 LATIN SMALL LETTER O WITH DIAERESIS\n" + + "U+00F7 ÷ c3 b7 DIVISION SIGN\n" + + "U+00F8 ø c3 b8 LATIN SMALL LETTER O WITH STROKE\n" + + "U+00F9 ù c3 b9 LATIN SMALL LETTER U WITH GRAVE\n" + + "U+00FA ú c3 ba LATIN SMALL LETTER U WITH ACUTE\n" + + "U+00FB û c3 bb LATIN SMALL LETTER U WITH CIRCUMFLEX\n" + + "U+00FC ü c3 bc LATIN SMALL LETTER U WITH DIAERESIS\n" + + "U+00FD ý c3 bd LATIN SMALL LETTER Y WITH ACUTE\n" + + "U+00FE þ c3 be LATIN SMALL LETTER THORN\n" + + "U+00FF ÿ c3 bf LATIN SMALL LETTER Y WITH DIAERESIS\n" + + "这是一份非常简单的说明书…" + + "</pre></p></notes>\n" + + "</model>" + + "</sbml>"; + + /** + * + */ + @BeforeClass public static void initialSetUp() {} + + + /** + * + */ + @Before public void setUp() { + doc = new SBMLDocument(3, 1); + + m = doc.createModel("test"); + m.setName(cyrilicUTF8); + try { + m.appendNotes("<p xmlns=\"http://www.w3.org/1999/xhtml\">" + chineseUTF8 + " ÆÈÖßæ</p>"); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail(); + } + + m.createCompartment("cell"); + m.createSpecies("S1"); + m.createSpecies("S2"); + + + } + + + /** + * Checks that the reading/writing from a String keep properly the UTF-8 characters. + */ + @Test public void testModelString() { + try { + SBMLDocument d = new SBMLReader().readSBMLFromString(utf8Model); + + String docStr = new SBMLWriter().writeSBMLToString(d); + + Assert.assertTrue(cyrilicUTF8.equals(d.getModel().getName())); + Assert.assertTrue(docStr.contains(chineseUTF8)); + Assert.assertTrue(docStr.contains(cyrilicUTF8)); + Assert.assertTrue(docStr.contains("æ")); + Assert.assertTrue(docStr.contains("Ø")); + Assert.assertTrue(docStr.contains("÷")); + Assert.assertTrue(docStr.contains("©")); + + d = new SBMLReader().readSBMLFromString(utf8Model); + String tidyDocStr = new TidySBMLWriter().writeSBMLToString(d); + + Assert.assertTrue(cyrilicUTF8.equals(d.getModel().getName())); + Assert.assertTrue(tidyDocStr.contains(chineseUTF8)); + Assert.assertTrue(tidyDocStr.contains(cyrilicUTF8)); + Assert.assertTrue(tidyDocStr.contains("æ")); + Assert.assertTrue(tidyDocStr.contains("Ø")); + Assert.assertTrue(tidyDocStr.contains("÷")); + Assert.assertTrue(tidyDocStr.contains("©")); + + d = new SBMLReader().readSBMLFromString(tidyDocStr); + tidyDocStr = new TidySBMLWriter().writeSBMLToString(d); + + Assert.assertTrue(cyrilicUTF8.equals(d.getModel().getName())); + Assert.assertTrue(tidyDocStr.contains(chineseUTF8)); + Assert.assertTrue(tidyDocStr.contains(cyrilicUTF8)); + Assert.assertTrue(tidyDocStr.contains("æ")); + Assert.assertTrue(tidyDocStr.contains("Ø")); + Assert.assertTrue(tidyDocStr.contains("÷")); + Assert.assertTrue(tidyDocStr.contains("©")); + + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail(); + } + } + + /** + * Checks that the writing to a file keep properly the UTF-8 characters. + */ + @Test public void testModelFile() { + + try { + File tmpFile = File.createTempFile("utf8Tests-", ".xml"); + File tmpFile2 = File.createTempFile("utf8Tests-", ".xml"); + + new SBMLWriter().writeSBML(doc, tmpFile); + + SBMLDocument d = new SBMLReader().readSBML(tmpFile); + + String docStr = new SBMLWriter().writeSBMLToString(d); + + Assert.assertTrue(docStr.contains(chineseUTF8)); + Assert.assertTrue(docStr.contains(cyrilicUTF8)); + Assert.assertTrue(docStr.contains("ÆÈÖßæ")); + + new TidySBMLWriter().writeSBMLToFile(d, tmpFile2.getAbsolutePath()); + d = new SBMLReader().readSBML(tmpFile2); + String tidyDocStr = new SBMLWriter().writeSBMLToString(d); + + Assert.assertTrue(cyrilicUTF8.equals(d.getModel().getName())); + Assert.assertTrue(tidyDocStr.contains(chineseUTF8)); + Assert.assertTrue(tidyDocStr.contains(cyrilicUTF8)); + Assert.assertTrue(tidyDocStr.contains("ÆÈÖßæ")); + + } catch (IOException e) { + e.printStackTrace(); + Assert.fail(); + } catch (SBMLException e) { + e.printStackTrace(); + Assert.fail(); + } catch (XMLStreamException e) { + e.printStackTrace(); + Assert.fail(); + } + + } +} Property changes on: trunk/test/org/sbml/jsbml/test/UTF8Tests.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-03-09 14:35:46
|
Revision: 2487 http://sourceforge.net/p/jsbml/code/2487 Author: niko-rodrigue Date: 2016-03-09 14:35:44 +0000 (Wed, 09 Mar 2016) Log Message: ----------- updated the ASTNode.java.oldASTNode and ASTNode.java.newASTNode so that we can run the 'ant dist' target Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ASTNode.java.newASTNode trunk/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java.newASTNode =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java.newASTNode 2016-03-09 13:47:29 UTC (rev 2486) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java.newASTNode 2016-03-09 14:35:44 UTC (rev 2487) @@ -5,7 +5,7 @@ * 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: + * Copyright (C) 2009-2016 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 @@ -25,13 +25,16 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.SortedMap; 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.ext.ASTNodePlugin; import org.sbml.jsbml.math.ASTArithmeticOperatorNode; import org.sbml.jsbml.math.ASTBinaryFunctionNode; import org.sbml.jsbml.math.ASTBoolean; @@ -73,6 +76,7 @@ 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.TreeNodeChangeEvent; import org.sbml.jsbml.util.compilers.ASTNodeCompiler; import org.sbml.jsbml.util.compilers.ASTNodeValue; import org.sbml.jsbml.util.compilers.FormulaCompiler; @@ -80,6 +84,9 @@ import org.sbml.jsbml.util.compilers.LaTeXCompiler; import org.sbml.jsbml.util.compilers.MathMLXMLStreamCompiler; import org.sbml.jsbml.util.filters.Filter; +import org.sbml.jsbml.xml.XMLNode; +import org.sbml.jsbml.xml.parsers.PackageParser; +import org.sbml.jsbml.xml.parsers.ParserManager; import org.sbml.jsbml.xml.stax.SBMLReader; /** @@ -1016,7 +1023,7 @@ * * <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> +<p><blockquote><pre> FormulaParserLL3 caseSensitiveParser = new FormulaParserLL3(new StringReader("")); caseInsensitiveParser.setCaseSensitive(false); ASTNode n = ASTNode.parseFormula("Cos(x)", caseInsensitiveParser); @@ -1024,10 +1031,10 @@ * * <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> + * 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> +<p><blockquote><pre> FormulaParser oldParser = new FormulaParser(new StringReader("")); ASTNode n = ASTNode.parseFormula("x and y", oldParser); @@ -1065,17 +1072,43 @@ } /** - * Parses a text-string mathematical formula and returns a representation as + * Parses a text-string mathematical formula, using the given {@link IFormulaParser} and returns a representation as * an Abstract Syntax Tree. + * + * <p> Support the syntax defined in the {@link IFormulaParser} provided. * + * <p> You can for example use you own parser or use an existing parser with different options. + * + * <p>For example, you can change the behaviour of the {@link FormulaParserLL3} class by using the + * {@link FormulaParserLL3#setCaseSensitive(boolean)} method: +<p><blockquote><pre> + FormulaParserLL3 caseSensitiveParser = new FormulaParserLL3(new StringReader("")); + caseInsensitiveParser.setCaseSensitive(false); + ASTNode n = ASTNode.parseFormula("Cos(x)", caseInsensitiveParser); +</pre></blockquote></p> + * + * <p> You can as well use the {@link FormulaParser} class to get the same parsing behaviour as in JSBML-0.8: +<p><blockquote><pre> + 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 behaviour 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. + * a text-string mathematical formula. * @param parser - * a formula 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. + * If the given formula is not of valid format or cannot be + * parsed for other reasons. + * @see ASTNode#parseFormula(String) + * @see FormulaParserLL3 + * @see FormulaParser */ public static ASTNode parseFormula(String formula, IFormulaParser parser) throws ParseException { @@ -1092,6 +1125,15 @@ } /** + * @param mathML a {@link String} in MathML format. + * @return An {@link ASTNode} representation of the given MathML {@link String}. + * @see #readMathMLFromString(String) + */ + public static ASTNode parseMathML(String mathML) { + return readMathMLFromString(mathML); + } + + /** * Creates a piecewise {@link ASTNode}. * * <p> @@ -1140,6 +1182,8 @@ return new ASTNode(ASTFactory.piecewise(qualifier, qualifiers)); } + // TODO - implement public static ASTNode piecewise(MathContainer parentSBMLObject, ASTNode[] nodes) + /** * Creates a power {@link ASTNode}. * @@ -1476,8 +1520,19 @@ * Child nodes. */ private List<ASTNode> listOfNodes; + + /** + * {@link Map} containing the ASTNode plugin object of additional packages + * with the appropriate name of the package. + */ + private SortedMap<String, ASTNodePlugin> plugins; /** + * XMLNode that will hold the content of the 'semantics' mathML element. + */ + private List<XMLNode> semanticsAnnotationList; + + /** * A {@link Logger} for this class. */ private static transient final Logger logger = Logger @@ -1513,6 +1568,8 @@ } //parent = astNode.getParent(); } + // TODO - clone all elements + // TODO - check changes since rev 2461 to see what need to be added/corrected } /** @@ -2869,6 +2926,9 @@ } else if (astnode2 instanceof ASTCnExponentialNode) { ASTCnExponentialNode ast = (ASTCnExponentialNode) astnode2; + if (Double.isNaN(ast.getMantissa()) || Double.isInfinite(ast.getMantissa())) { + return ast.getMantissa(); + } return Double.valueOf(ast.getMantissa() + "e" + ast.getExponent()); } else if (astnode2 instanceof ASTCnRationalNode) { @@ -4571,5 +4631,419 @@ return astnode2.userObjectKeySet(); } + /** + * Adds the given {@link XMLNode} as a MathML {@code <semantics>} + * element to this {@link ASTNode}. + * + * <p> + * The {@code <semantics>} element is a MathML 2.0 construct + * that can be used to associate additional information with a MathML + * construct. The construct can be used to decorate a MathML expressions with + * a sequence of one or more {@code <annotation>} or + * {@code <annotation-xml>} elements. Each such element contains a + * pair of items; the first is a symbol that acts as an attribute or key, and + * the second is the value associated with the attribute or key. Please refer + * to the MathML 2.0 documentation, particularly the <a target="_blank" + * href="http://www.w3.org/TR/2007/WD-MathML3-20071005/chapter5.html#mixing.semantic.annotations">Section + * 5.2, Semantic Annotations</a> for more information about these constructs. + * + * @param semanticsAnnotation the annotation to add. + * @return the added {@link XMLNode}. + */ + public XMLNode addSemanticsAnnotation(XMLNode semanticsAnnotation) { + if (semanticsAnnotation == null) { + return null; + } + if (semanticsAnnotationList == null) { + semanticsAnnotationList = new ArrayList<XMLNode>(); + } + semanticsAnnotationList.add(semanticsAnnotation); + + return semanticsAnnotation; + } + + /** + * Gets the number of <em>semantic annotation</em> elements inside this node. + * + * <p> + * The <code><semantics></code> element is a MathML 2.0 construct + * that can be used to associate additional information with a MathML + * construct. The construct can be used to decorate a MathML expressions with + * a sequence of one or more <code><annotation></code> or + * <code><annotation-xml></code> elements. Each such element contains a + * pair of items; the first is a symbol that acts as an attribute or key, and + * the second is the value associated with the attribute or key. Please refer + * to the MathML 2.0 documentation, particularly the <a target="_blank" + * href="http://www.w3.org/TR/2007/WD-MathML3-20071005/chapter5.html#mixing.semantic.annotations">Section + * 5.2, Semantic Annotations</a> for more information about these constructs. + * + * @return the number of annotations of this {@link ASTNode}. + * @see ASTNode#addSemanticsAnnotation(XMLNode semanticsAnnotation) + */ + public int getNumSemanticsAnnotations() { + if (semanticsAnnotationList == null) { + return 0; + } + + return semanticsAnnotationList.size(); + } + + /** + * Gets the nth <code><semantics></code> annotation of this node. + * + * <p> + * The <code><semantics></code> element is a MathML 2.0 construct + * that can be used to associate additional information with a MathML + * construct. The construct can be used to decorate a MathML expressions with + * a sequence of one or more <code><annotation></code> or + * <code><annotation-xml></code> elements. Each such element contains a + * pair of items; the first is a symbol that acts as an attribute or key, and + * the second is the value associated with the attribute or key. Please refer + * to the MathML 2.0 documentation, particularly the <a target="_blank" + * href="http://www.w3.org/TR/2007/WD-MathML3-20071005/chapter5.html#mixing.semantic.annotations">Section + * 5.2, Semantic Annotations</a> for more information about these constructs. + * + * @return the nth annotation of this {@link ASTNode}, or <code>null</code> if this node has + * no nth annotation (<code>n ></code> + * {@link ASTNode#getNumSemanticsAnnotations()} + * <code>- 1</code> or n < 0). + * @see ASTNode#addSemanticsAnnotation(XMLNode sAnnotation) + */ + public XMLNode getSemanticsAnnotation(int n) { + if (semanticsAnnotationList == null || n < 0 || (n > (getNumSemanticsAnnotations() -1))) { + return null; + } + + return semanticsAnnotationList.get(n); + } + + /** + * Returns the list of semantics annotations of this node. + * + * @return the list of semantics annotations of this node or null if no semantics annotation are present. + */ + public List<XMLNode> getListOfSemanticsAnnotations() { + return semanticsAnnotationList; + } + + /** + * Return true if this node contain some semantics annotations. + * + * @return true if this node contain some semantics annotations. + * @see #getNumSemanticsAnnotations() + */ + public boolean isSemantics() { + return getNumSemanticsAnnotations() > 0; + } + + // TODO - removeSemanticsAnnotation + // TODO - unsetsemanticsAnnotation + + /** + * Creates a new {@link ASTNodePlugin} for the given package name or URI + * and adds it to this {@link ASTNode}. + * + * <p>If an {@link ASTNodePlugin} was already present in this {@link ASTNode} + * it will be replaced. + * + * @param nameOrUri the package name or URI + * @return a new {@link ASTNodePlugin} for the given package name or URI + */ + public ASTNodePlugin createPlugin(String nameOrUri) { + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + ASTNodePlugin sbasePlugin = packageParser.createPluginFor(this); + addExtension(nameOrUri, sbasePlugin); + return sbasePlugin; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), + nameOrUri)); + } + + /** + * Adds a {@link ASTNodePlugin} object to this {@link ASTNode}. + * + * <p>If a previous {@link ASTNodePlugin} associated with the same package + * was present before, it will be replaced. + * + * @param nameOrUri the name or URI of the package extension. + * @param sbasePlugin the {@link ASTNodePlugin} to add. + */ + public void addExtension(String nameOrUri, ASTNodePlugin sbasePlugin) { + + if (!isPackageEnabled(nameOrUri)) { + enablePackage(nameOrUri); + } + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + + // unset the previous plugin if needed + if (plugins.get(packageParser.getPackageName()) != null) { + unsetPlugin(packageParser.getPackageName()); + } + + plugins.put(packageParser.getPackageName(), sbasePlugin); + + // Making sure that the correct extendedSBase is set in the SBasePlugin + // And that all the ids and metaids are registered + if ((sbasePlugin.getExtendedASTNode() == null) || (sbasePlugin.getExtendedASTNode() != this)) { + // ((ASTNodePlugin) sbasePlugin).setPackageVersion(this); // TODO? + } + + // the package namespace and version will be set in firePropertyChange + firePropertyChange(TreeNodeChangeEvent.addExtension, null, sbasePlugin); + } else { + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.addExtensionExc"), nameOrUri)); + } + } + + /** + * Adds a {@link ASTNodePlugin} object to this {@link ASTNode}. + * + * <p>If a previous {@link ASTNodePlugin} associated with the same package + * was present before, it will be replaced. + * + * @param nameOrUri the name or URI of the package extension. + * @param sbasePlugin the {@link ASTNodePlugin} to add. + * @see #addExtension(String, ASTNodePlugin) + */ + public void addPlugin(String nameOrUri, ASTNodePlugin sbasePlugin) { + addExtension(nameOrUri, sbasePlugin); + } + + /** + * Disables the given SBML Level 3 package on this {@link SBMLDocument}. + * + * @param packageURIOrName a package namespace URI or package name + */ + public void disablePackage(String packageURIOrName) { + enablePackage(packageURIOrName, false); + } + + /** + * Enables the given SBML Level 3 package on this {@link SBMLDocument}. + * + * @param packageURIOrName a package namespace URI or package name + */ + public void enablePackage(String packageURIOrName) { + enablePackage(packageURIOrName, true); + } + + /** + * Enables or disables the given SBML Level 3 package on this + * {@link SBMLDocument}. + * + * @param packageURIOrName + * a package namespace URI or package name + * @param enabled + * a boolean to tell if the package need to be enabled or disabled. It + * {@code true} the package will be enabled, otherwise it will be + * disabled. + */ + public void enablePackage(String packageURIOrName, boolean enabled) { + SBMLDocument doc = getParentSBMLObject().getSBMLDocument(); + + if (doc != null) { + doc.enablePackage(packageURIOrName, enabled); + } else if (logger.isDebugEnabled()) { + logger.debug(resourceBundle.getString("AbstractSBase.enablePackage")); + } + } + + /** + * Returns the {@link ASTNodePlugin} object which matches this package + * name or URI. + * + * @param nameOrUri + * the package name or URI + * @return the {@link ASTNodePlugin} object which matches this package + * name or URI, + * null is returned if nothing matching the name or URI is found. + */ + public ASTNodePlugin getExtension(String nameOrUri) { + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + return plugins.get(packageParser.getPackageName()); + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), nameOrUri)); + } + + /** + * Returns the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + * + * @return the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + */ + public int getExtensionCount() { + + if (plugins != null) { + return plugins.size(); + } + + return 0; + } + +// /** +// * Returns the map containing all the {@link SBasePlugin} extension objects +// * of this {@link SBase}. +// * +// * @return the map containing all the {@link SBasePlugin} extension objects +// * of this {@link SBase}. +// */ +// public Map<String, ASTNodePlugin> getExtensionPackages() { // TODO - remove this method to prevent access to the map directly ?? Or provide a copy of the Map +// return plugins; +// } + + /** + * Returns the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + * + * @return the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + */ + public int getNumPlugins() { + return getExtensionCount(); + } + + /** + * Returns an {@link ASTNodePlugin} for an SBML Level 3 package extension + * with the given package name or URI. + * <p> + * If no {@link ASTNodePlugin} is found for this package, a new + * {@link ASTNodePlugin} is created, added to this {@link ASTNode} and returned. + * + * @param nameOrUri + * the name or URI of the package + * @return an {@link ASTNodePlugin} for an SBML Level 3 package extension + * with the given package name or URI. + */ + public ASTNodePlugin getPlugin(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + ASTNodePlugin plugin = plugins.get(packageParser.getPackageName()); + if (plugin != null) { + return plugin; + } else { + return createPlugin(nameOrUri); + } + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), nameOrUri)); + } + + /** + * Returns {@code true} if this object is extended by other packages. + * + * @return {@code true} if this object is extended by other packages. + */ + public boolean isExtendedByOtherPackages() { + return !plugins.isEmpty(); + } + + /** + * Returns {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}. + * + * @param packageURIOrName + * the name or URI of the package extension. + * @return {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}, {@code false} otherwise. + */ + public boolean isPackageEnabled(String packageURIOrName) { + + SBMLDocument doc = getParentSBMLObject().getSBMLDocument(); // TODO - need to prevent NullPointerException + + if (doc != null) { + return doc.isPackageEnabled(packageURIOrName); + } + + return false; + } + + /** + * Returns {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}. + * + * @param packageURIOrName + * the name or URI of the package extension. + * @return {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}, {@code false} otherwise. + * @libsbml.deprecated + * @see #isPackageEnabled(String) + */ + public boolean isPackageURIEnabled(String packageURIOrName) { + return isPackageEnabled(packageURIOrName); + } + + /** + * Returns {@code true} if an {@link ASTNodePlugin} is defined + * for the given package. + * + * @param nameOrUri the package name or URI + * @return {@code true} if an {@link ASTNodePlugin} is defined + * for the given package. + */ + public boolean isSetPlugin(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + return plugins.get(packageParser.getPackageName()) != null; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), nameOrUri)); + } + + /** + * Unsets the {@link ASTNodePlugin} extension object which matches this package + * name or URI. + * + * @param nameOrUri + * the package name or URI + */ + public void unsetExtension(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + + ASTNodePlugin sbasePlugin = plugins.remove(packageParser.getPackageName()); + firePropertyChange(TreeNodeChangeEvent.extension, sbasePlugin, null); + return; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), + nameOrUri)); + } + + /** + * Unsets the {@link ASTNodePlugin} plugin object which matches this package + * name or URI. + * + * @param nameOrUri + * the package name or URI + * @see #unsetExtension(String) + */ + public void unsetPlugin(String nameOrUri) { + unsetExtension(nameOrUri); + } + } Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode 2016-03-09 13:47:29 UTC (rev 2486) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode 2016-03-09 14:35:44 UTC (rev 2487) @@ -26,12 +26,16 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; import javax.swing.tree.TreeNode; import javax.xml.stream.XMLStreamException; import org.apache.log4j.Logger; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.math.ASTFactory; import org.sbml.jsbml.math.ASTNode2; import org.sbml.jsbml.text.parser.FormulaParser; @@ -48,6 +52,9 @@ import org.sbml.jsbml.util.compilers.MathMLXMLStreamCompiler; import org.sbml.jsbml.util.compilers.UnitsCompiler; import org.sbml.jsbml.util.filters.Filter; +import org.sbml.jsbml.xml.XMLNode; +import org.sbml.jsbml.xml.parsers.PackageParser; +import org.sbml.jsbml.xml.parsers.ParserManager; import org.sbml.jsbml.xml.stax.SBMLReader; /** @@ -373,6 +380,15 @@ */ TIMES, /** + * MathML markup can be combined with other markup languages, and these + * mixing constructions are realized by the semantic annotation elements. + * The semantic annotation elements provide an important tool for making + * associations between alternate representations of an expression, and for + * associating semantic properties and other attributions with a MathML + * expression. + */ + SEMANTICS, + /** * */ UNKNOWN, @@ -639,8 +655,8 @@ * or {@link #IMPLEMENTATION_ASTNODE2}. */ public static final String IMPLEMENTATION_VERSION = IMPLEMENTATION_HISTORIC; - - + + /** * Creates and returns an {@link ASTNode} that computes the absolute value * of the given double value. @@ -985,7 +1001,7 @@ * * <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> +<p><blockquote><pre> FormulaParserLL3 caseSensitiveParser = new FormulaParserLL3(new StringReader("")); caseInsensitiveParser.setCaseSensitive(false); ASTNode n = ASTNode.parseFormula("Cos(x)", caseInsensitiveParser); @@ -993,10 +1009,10 @@ * * <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> + * 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> +<p><blockquote><pre> FormulaParser oldParser = new FormulaParser(new StringReader("")); ASTNode n = ASTNode.parseFormula("x and y", oldParser); @@ -1039,14 +1055,14 @@ * * <p>For example, you can change the behaviour of the {@link FormulaParserLL3} class by using the * {@link FormulaParserLL3#setCaseSensitive(boolean)} method: -<p><pre><blockquote> +<p><blockquote><pre> FormulaParserLL3 caseSensitiveParser = new FormulaParserLL3(new StringReader("")); caseInsensitiveParser.setCaseSensitive(false); ASTNode n = ASTNode.parseFormula("Cos(x)", caseInsensitiveParser); </pre></blockquote></p> * * <p> You can as well use the {@link FormulaParser} class to get the same parsing behaviour as in JSBML-0.8: -<p><pre><blockquote> +<p><blockquote><pre> FormulaParser oldParser = new FormulaParser(new StringReader("")); ASTNode n = ASTNode.parseFormula("x and y", oldParser); @@ -1083,6 +1099,15 @@ } /** + * @param mathML a {@link String} in MathML format. + * @return An {@link ASTNode} representation of the given MathML {@link String}. + * @see #readMathMLFromString(String) + */ + public static ASTNode parseMathML(String mathML) { + return readMathMLFromString(mathML); + } + + /** * Creates a piecewise {@link ASTNode}. * * <p>At least one {@link ASTNode} must be given @@ -1391,6 +1416,12 @@ private String encoding; /** + * XMLNode that will hold the content of the 'semantics' mathML element. + */ + private List<XMLNode> semanticsAnnotationList; + + + /** * Tells if the type attribute of the cn element was set and we need to * write it back or if it is set to the default (REAL). * @@ -1406,7 +1437,8 @@ * A {@link Logger} for this class. */ private static transient final Logger logger = Logger.getLogger(ASTNode.class); - + private static final transient boolean isDebugEnabled = logger.isDebugEnabled(); + /** * The part of a number in scientific format (with an E) that is on the left * side of the E (the prefix of the number). For instance, in the number @@ -1452,6 +1484,12 @@ private CallableSBase variable; /** + * {@link Map} containing the ASTNode plugin object of additional packages + * with the appropriate name of the package. + */ + private SortedMap<String, ASTNodePlugin> plugins; + + /** * Creates a new {@link ASTNode} of unspecified type and without a pointer * to its containing {@link MathContainer}. */ @@ -1485,6 +1523,11 @@ variable = null; // the clone is not linked anymore to any model so we cannot have any 'variable' set numerator = astNode.numerator; unitId = astNode.unitId == null ? null : new String(astNode.unitId); + definitionURL = astNode.definitionURL; + id = astNode.id; + className = astNode.className; + encoding = astNode.encoding; + style = astNode.style; if (astNode.getChildCount() > 0) { for (ASTNode child : astNode.listOfNodes) { @@ -1493,6 +1536,14 @@ listOfNodes.add(c); } } + + if (astNode.semanticsAnnotationList != null) { + semanticsAnnotationList = new ArrayList<XMLNode>(); + + for (XMLNode semanticsAnnotation : astNode.semanticsAnnotationList) { + semanticsAnnotationList.add(semanticsAnnotation.clone()); + } + } } /** @@ -1701,7 +1752,7 @@ * the node to add as child. */ public void addChild(ASTNode child) { - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug(" adding child current node: \n" + astNodeToTree(this, "", "")); logger.debug(" adding child: \n" + astNodeToTree(child, "", "")); } @@ -2237,10 +2288,10 @@ && ast.getDenominator() == getDenominator(); } if ((ast.getType() == Type.REAL_E) && (type == Type.REAL_E)) { - equal &= ast.getMantissa() == getMantissa() + equal &= Double.isNaN(getMantissa()) ? Double.isNaN(ast.getMantissa()) : ast.getMantissa() == getMantissa() && ast.getExponent() == getExponent(); } else if (isReal() && ast.isReal()) { - equal &= ast.getReal() == getReal(); + equal &= Double.isNaN(getReal()) ? Double.isNaN(ast.getReal()) : ast.getReal() == getReal(); } equal &= isSetClassName() == ast.isSetClassName(); @@ -2267,6 +2318,8 @@ if (equal && isSetUnits()) { equal &= getUnits().equals(ast.getUnits()); } + + // TODO - semanticsAnnotationList not part of equals or hashcode ? } return equal; } @@ -2350,6 +2403,8 @@ @Override public TreeNode getChildAt(int i) { return getChild(i); + + // TODO - add semantics XMLNode ?? } /* (non-Javadoc) @@ -2358,6 +2413,8 @@ @Override public int getChildCount() { return listOfNodes == null ? 0 : listOfNodes.size(); + + // TODO - add semantics XMLNode ?? } /** @@ -2579,6 +2636,9 @@ case REAL_E:{ // mantissa * Math.pow(10, getExponent())) ==> this formula does not give exact values. // for example: mantissa = 3.0, exponent = -17 ==> 2.9999999999999994E-17 instead of 3.0E-17 + if (Double.isNaN(mantissa) || Double.isInfinite(mantissa)) { + return mantissa; + } return Double.parseDouble(mantissa + "E" + getExponent()); } case RATIONAL: @@ -2798,6 +2858,12 @@ if (isSetClassName()) { hashCode += prime * getClassName().hashCode(); } + if (isSetUnits()) { + hashCode += prime * getUnits().hashCode(); + } + // TODO - semanticsAnnotationList not part of equals or hashcode ? + + return hashCode; } @@ -2828,7 +2894,7 @@ */ private void initDefaults() { ASTNode old = this; - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.initDefaults"), (type == null ? Type.UNKNOWN : type))); } @@ -2859,6 +2925,10 @@ } variable = null; mantissa = Double.NaN; + + if (plugins == null) { + plugins = new TreeMap<String, ASTNodePlugin>(); + } firePropertyChange(TreeNodeChangeEvent.initialValue, old, this); } @@ -3113,7 +3183,19 @@ || type == Type.RELATIONAL_LT || type == Type.RELATIONAL_NEQ; } + /** + * Return true if this node contain some semantics annotations. + * + * @return true if this node contain some semantics annotations. + * @see #getNumSemanticsAnnotations() + */ + public boolean isSemantics() { + return getNumSemanticsAnnotations() > 0; + } + + + /** * @return */ public boolean isSetClassName() { @@ -3797,7 +3879,6 @@ /** * Sets the Parent of the node to the given value * - * @param node the orphan node * @param parent the parent */ public void setParentSBMLObject(MathContainer parent) { @@ -3826,10 +3907,10 @@ */ public void setType(String typeStr) { // System.out.println("ASTNode: setType(String) called."); - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug("ASTNode: setType(String) called: " + typeStr); } - + Type type = Type.getTypeFor(typeStr); setType(type); if (type != Type.UNKNOWN) { @@ -3863,7 +3944,7 @@ String sType = type.toString(); - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.setType"), this.type, sType)); } @@ -4209,7 +4290,7 @@ // log the exception e.printStackTrace(); - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { 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 @@ -4217,47 +4298,47 @@ } } catch (RuntimeException e) { // added to prevent a crash when we cannot create the formula - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.error(MessageFormat.format(resourceBundle.getString("ASTNode.toString"), e.getMessage()), e); } } return formula; } - - + + /** * Returns a simple String representing the content of the ASTNode. * * @return a simple String representing the content of the ASTNode. */ public String toSimpleString() { - StringBuffer buffer = new StringBuffer("ASTNode [type="); + StringBuffer buffer = new StringBuffer("ASTNode [type="); buffer.append(type); - - if (isInteger()) + + if (isInteger()) { buffer.append(", ").append(getInteger()); } - else if (isReal()) + else if (isReal()) { buffer.append(", ").append(getReal()); - - if (isRational()) + + if (isRational()) { buffer.append(" (").append(getNumerator()).append(" / ").append(getDenominator()); } - else if (exponent != 0) + else if (exponent != 0) { buffer.append(" (").append(getMantissa()).append("e").append(getExponent()); } } - else if (isName()) + else if (isName()) { buffer.append(", name = ").append(getName()); } - - if (definitionURL != null) + + if (definitionURL != null) { buffer.append(", definitionURL = ").append(getDefinitionURL()); } @@ -4265,19 +4346,19 @@ if (unitId != null) { buffer.append(", units = ").append(getUnits()); } - + if (getChildCount() > 0) { buffer.append(", nb children = ").append(getChildCount()); } - + if (isSetUserObjects()) { - buffer.append(", user object keys = ").append(userObjectKeySet()); + buffer.append(", user object keys = ").append(userObjectKeySet()); } - + if (getParent() == null) { buffer.append(", no parent defined"); } - + if (id != null) { buffer.append(", id = ").append(getId()); } @@ -4290,7 +4371,7 @@ if (className != null) { buffer.append(", className = ").append(getClassName()); } - + return buffer.toString(); } @@ -4342,14 +4423,419 @@ * @return a simple tree view of the ASTNode internal */ public static String astNodeToTree(ASTNode n, String tree, String indent) { - tree = tree + indent + n.getType() + " " + + tree = tree + indent + n.getType() + " " + (n.isInteger() ? n.getInteger() : "") + (n.isReal() ? n.getReal() : "") + "\n"; - + for (ASTNode child : n.getChildren()) { tree = astNodeToTree(child, tree, indent + " "); } - + return tree; } + /** + * Adds the given {@link XMLNode} as a MathML {@code <semantics>} + * element to this {@link ASTNode}. + * + * <p> + * The {@code <semantics>} element is a MathML 2.0 construct + * that can be used to associate additional information with a MathML + * construct. The construct can be used to decorate a MathML expressions with + * a sequence of one or more {@code <annotation>} or + * {@code <annotation-xml>} elements. Each such element contains a + * pair of items; the first is a symbol that acts as an attribute or key, and + * the second is the value associated with the attribute or key. Please refer + * to the MathML 2.0 documentation, particularly the <a target="_blank" + * href="http://www.w3.org/TR/2007/WD-MathML3-20071005/chapter5.html#mixing.semantic.annotations">Section + * 5.2, Semantic Annotations</a> for more information about these constructs. + * + * @param semanticsAnnotation the annotation to add. + * @return the added {@link XMLNode}. + */ + public XMLNode addSemanticsAnnotation(XMLNode semanticsAnnotation) { + if (semanticsAnnotation == null) { + return null; + } + if (semanticsAnnotationList == null) { + semanticsAnnotationList = new ArrayList<XMLNode>(); + } + + semanticsAnnotationList.add(semanticsAnnotation); + + return semanticsAnnotation; + } + + /** + * Gets the number of <em>semantic annotation</em> elements inside this node. + * + * <p> + * The <code><semantics></code> element is a MathML 2.0 construct + * that can be used to associate additional information with a MathML + * construct. The construct can be used to decorate a MathML expressions with + * a sequence of one or more <code><annotation></code> or + * <code><annotation-xml></code> elements. Each such element contains a + * pair of items; the first is a symbol that acts as an attribute or key, and + * the second is the value associated with the attribute or key. Please refer + * to the MathML 2.0 documentation, particularly the <a target="_blank" + * href="http://www.w3.org/TR/2007/WD-MathML3-20071005/chapter5.html#mixing.semantic.annotations">Section + * 5.2, Semantic Annotations</a> for more information about these constructs. + * + * @return the number of annotations of this {@link ASTNode}. + * @see ASTNode#addSemanticsAnnotation(XMLNode semanticsAnnotation) + */ + public int getNumSemanticsAnnotations() { + if (semanticsAnnotationList == null) { + return 0; + } + + return semanticsAnnotationList.size(); + } + + /** + * Gets the nth <code><semantics></code> annotation of this node. + * + * <p> + * The <code><semantics></code> element is a MathML 2.0 construct + * that can be used to associate additional information with a MathML + * construct. The construct can be used to decorate a MathML expressions with + * a sequence of one or more <code><annotation></code> or + * <code><annotation-xml></code> elements. Each such element contains a + * pair of items; the first is a symbol that acts as an attribute or key, and + * the second is the value associated with the attribute or key. Please refer + * to the MathML 2.0 documentation, particularly the <a target="_blank" + * href="http://www.w3.org/TR/2007/WD-MathML3-20071005/chapter5.html#mixing.semantic.annotations">Section + * 5.2, Semantic Annotations</a> for more information about these constructs. + * + * @return the nth annotation of this {@link ASTNode}, or <code>null</code> if this node has + * no nth annotation (<code>n ></code> + * {@link ASTNode#getNumSemanticsAnnotations()} + * <code>- 1</code> or n < 0). + * @see ASTNode#addSemanticsAnnotation(XMLNode sAnnotation) + */ + public XMLNode getSemanticsAnnotation(int n) { + if (semanticsAnnotationList == null || n < 0 || (n > (getNumSemanticsAnnotations() -1))) { + return null; + } + + return semanticsAnnotationList.get(n); + } + + /** + * Returns the list of semantics annotations of this node. + * + * @return the list of semantics annotations of this node or null if no semantics annotation are present. + */ + public List<XMLNode> getListOfSemanticsAnnotations() { + return semanticsAnnotationList; + } + + // TODO - removeSemanticsAnnotation + // TODO - unsetsemanticsAnnotation + + /** + * Creates a new {@link ASTNodePlugin} for the given package name or URI + * and adds it to this {@link ASTNode}. + * + * <p>If an {@link ASTNodePlugin} was already present in this {@link ASTNode} + * it will be replaced. + * + * @param nameOrUri the package name or URI + * @return a new {@link ASTNodePlugin} for the given package name or URI + */ + public ASTNodePlugin createPlugin(String nameOrUri) { + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + ASTNodePlugin sbasePlugin = packageParser.createPluginFor(this); + addExtension(nameOrUri, sbasePlugin); + return sbasePlugin; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), + nameOrUri)); + } + + /** + * Adds a {@link ASTNodePlugin} object to this {@link ASTNode}. + * + * <p>If a previous {@link ASTNodePlugin} associated with the same package + * was present before, it will be replaced. + * + * @param nameOrUri the name or URI of the package extension. + * @param sbasePlugin the {@link ASTNodePlugin} to add. + */ + public void addExtension(String nameOrUri, ASTNodePlugin sbasePlugin) { + + if (!isPackageEnabled(nameOrUri)) { + enablePackage(nameOrUri); + } + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + + // unset the previous plugin if needed + if (plugins.get(packageParser.getPackageName()) != null) { + unsetPlugin(packageParser.getPackageName()); + } + + plugins.put(packageParser.getPackageName(), sbasePlugin); + + // Making sure that the correct extendedSBase is set in the SBasePlugin + // And that all the ids and metaids are registered + if ((sbasePlugin.getExtendedASTNode() == null) || (sbasePlugin.getExtendedASTNode() != this)) { + // ((ASTNodePlugin) sbasePlugin).setPackageVersion(this); // TODO? + } + + // the package namespace and version will be set in firePropertyChange + firePropertyChange(TreeNodeChangeEvent.addExtension, null, sbasePlugin); + } else { + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.addExtensionExc"), nameOrUri)); + } + } + + /** + * Adds a {@link ASTNodePlugin} object to this {@link ASTNode}. + * + * <p>If a previous {@link ASTNodePlugin} associated with the same package + * was present before, it will be replaced. + * + * @param nameOrUri the name or URI of the package extension. + * @param sbasePlugin the {@link ASTNodePlugin} to add. + * @see #addExtension(String, ASTNodePlugin) + */ + public void addPlugin(String nameOrUri, ASTNodePlugin sbasePlugin) { + addExtension(nameOrUri, sbasePlugin); + } + + /** + * Disables the given SBML Level 3 package on this {@link SBMLDocument}. + * + * @param packageURIOrName a package namespace URI or package name + */ + public void disablePackage(String packageURIOrName) { + enablePackage(packageURIOrName, false); + } + + /** + * Enables the given SBML Level 3 package on this {@link SBMLDocument}. + * + * @param packageURIOrName a package namespace URI or package name + */ + public void enablePackage(String packageURIOrName) { + enablePackage(packageURIOrName, true); + } + + /** + * Enables or disables the given SBML Level 3 package on this + * {@link SBMLDocument}. + * + * @param packageURIOrName + * a package namespace URI or package name + * @param enabled + * a boolean to tell if the package need to be enabled or disabled. It + * {@code true} the package will be enabled, otherwise it will be + * disabled. + */ + public void enablePackage(String packageURIOrName, boolean enabled) { + SBMLDocument doc = getParentSBMLObject().getSBMLDocument(); + + if (doc != null) { + doc.enablePackage(packageURIOrName, enabled); + } else if (logger.isDebugEnabled()) { + logger.debug(resourceBundle.getString("AbstractSBase.enablePackage")); + } + } + + /** + * Returns the {@link ASTNodePlugin} object which matches this package + * name or URI. + * + * @param nameOrUri + * the package name or URI + * @return the {@link ASTNodePlugin} object which matches this package + * name or URI, + * null is returned if nothing matching the name or URI is found. + */ + public ASTNodePlugin getExtension(String nameOrUri) { + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + return plugins.get(packageParser.getPackageName()); + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), nameOrUri)); + } + + /** + * Returns the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + * + * @return the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + */ + public int getExtensionCount() { + + if (plugins != null) { + return plugins.size(); + } + + return 0; + } + +// /** +// * Returns the map containing all the {@link SBasePlugin} extension objects +// * of this {@link SBase}. +// * +// * @return the map containing all the {@link SBasePlugin} extension objects +// * of this {@link SBase}. +// */ +// public Map<String, ASTNodePlugin> getExtensionPackages() { // TODO - remove this method to prevent access to the map directly ?? Or provide a copy of the Map +// return plugins; +// } + + /** + * Returns the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + * + * @return the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + */ + public int getNumPlugins() { + return getExtensionCount(); + } + + /** + * Returns an {@link ASTNodePlugin} for an SBML Level 3 package extension + * with the given package name or URI. + * <p> + * If no {@link ASTNodePlugin} is found for this package, a new + * {@link ASTNodePlugin} is created, added to this {@link ASTNode} and returned. + * + * @param nameOrUri + * the name or URI of the package + * @return an {@link ASTNodePlugin} for an SBML Level 3 package extension + * with the given package name or URI. + */ + public ASTNodePlugin getPlugin(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + ASTNodePlugin plugin = plugins.get(packageParser.getPackageName()); + if (plugin != null) { + return plugin; + } else { + return createPlugin(nameOrUri); + } + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), nameOrUri)); + } + + /** + * Returns {@code true} if this object is extended by other packages. + * + * @return {@code true} if this object is extended by other packages. + */ + public boolean isExtendedByOtherPackages() { + return !plugins.isEmpty(); + } + + /** + * Returns {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}. + * + * @param packageURIOrName + * the name or URI of the package extension. + * @return {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}, {@code false} otherwise. + */ + public boolean isPackageEnabled(String packageURIOrName) { + + SBMLDocument doc = getParentSBMLObject().getSBMLDocument(); // TODO - need to prevent NullPointerException + + if (doc != null) { + return doc.isPackageEnabled(packageURIOrName); + } + + return false; + } + + /** + * Returns {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}. + * + * @param packageURIOrName + * the name or URI of the package extension. + * @return {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}, {@code false} otherwise. + * @libsbml.deprecated + * @see #isPackageEnabled(String) + */ + public boolean isPackageURIEnabled(String packageURIOrName) { + return isPackageEnabled(packageURIOrName); + } + + /** + * Returns {@code true} if an {@link ASTNodePlugin} is defined + * for the given package. + * + * @param nameOrUri the package name or URI + * @return {@code true} if an {@link ASTNodePlugin} is defined + * for the given package. + */ + public boolean isSetPlugin(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + return plugins.get(packageParser.getPackageName()) != null; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), nameOrUri)); + } + + /** + * Unsets the {@link ASTNodePlugin} extension object which matches this package + * name or URI. + * + * @param nameOrUri + * the package name or URI + */ + public void unsetExtension(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + + ASTNodePlugin sbasePlugin = plugins.remove(packageParser.getPackageName()); + firePropertyChange(TreeNodeChangeEvent.extension, sbasePlugin, null); + return; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), + nameOrUri)); + } + + /** + * Unsets the {@link ASTNodePlugin} plugin object which matches this package + * name or URI. + * + * @param nameOrUri + * the package name or URI + * @see #unsetExtension(String) + */ + public void unsetPlugin(String nameOrUri) { + unsetExtension(nameOrUri); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-03-09 13:47:31
|
Revision: 2486 http://sourceforge.net/p/jsbml/code/2486 Author: niko-rodrigue Date: 2016-03-09 13:47:29 +0000 (Wed, 09 Mar 2016) Log Message: ----------- corrected https://www.pivotaltracker.com/story/show/109522092. In some cases, additional call to ASTNode.setParent and ASTNode.setParentSBMLObject had the consequence to double the number of children of an ASTNode Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/xml/parsers/MathMLStaxParser.java Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/MathMLStaxParser.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/MathMLStaxParser.java 2016-03-09 13:38:36 UTC (rev 2485) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/MathMLStaxParser.java 2016-03-09 13:47:29 UTC (rev 2486) @@ -459,8 +459,6 @@ } else { astNode.setType(elementName); } - astNode.setParent((TreeNode) contextObject); - astNode.setParentSBMLObject(mathContainer); if (setMath) { mathContainer.setMath(astNode); @@ -468,15 +466,6 @@ parentASTNode.addChild(astNode); } - /*else if (astNode.isNumber() || astNode.isConstant() || astNode.getType().equals(ASTNode.Type.NAME) - || astNode.getType().equals(ASTNode.Type.NAME_TIME) || astNode.isInfinity() || astNode.isNaN() - || astNode.isNegInfinity()) - { - return parentASTNode; - } else if () { - - */ - return astNode; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-03-09 13:38:38
|
Revision: 2485 http://sourceforge.net/p/jsbml/code/2485 Author: niko-rodrigue Date: 2016-03-09 13:38:36 +0000 (Wed, 09 Mar 2016) Log Message: ----------- corrected a test that was failing since the changes on the ASTNode formula output Modified Paths: -------------- trunk/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java Modified: trunk/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java =================================================================== --- trunk/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java 2016-03-09 13:36:54 UTC (rev 2484) +++ trunk/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java 2016-03-09 13:38:36 UTC (rev 2485) @@ -1147,7 +1147,7 @@ ASTNode n = e.getChild(1); status = n.getType() == ASTNode.Type.CONSTANT_E; if (status) { - status = n.toFormula().equals("e") && n.getName() == null; + status = n.toFormula().equals("exponentiale") && n.getName() == null; } } } catch (Exception e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-03-09 13:36:57
|
Revision: 2484 http://sourceforge.net/p/jsbml/code/2484 Author: niko-rodrigue Date: 2016-03-09 13:36:54 +0000 (Wed, 09 Mar 2016) Log Message: ----------- corrected the number returned by ASTNode.getreal() in the case of REAL_E, when the mantissa is NaN or infinity + a bit of optimisation by avoiding to call logger.isDebugEnabled() many times when only one is enough Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ASTNode.java trunk/core/src/org/sbml/jsbml/util/SimpleTreeNodeChangeListener.java Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java 2016-03-09 13:32:40 UTC (rev 2483) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java 2016-03-09 13:36:54 UTC (rev 2484) @@ -1437,7 +1437,8 @@ * A {@link Logger} for this class. */ private static transient final Logger logger = Logger.getLogger(ASTNode.class); - + private static final transient boolean isDebugEnabled = logger.isDebugEnabled(); + /** * The part of a number in scientific format (with an E) that is on the left * side of the E (the prefix of the number). For instance, in the number @@ -1751,7 +1752,7 @@ * the node to add as child. */ public void addChild(ASTNode child) { - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug(" adding child current node: \n" + astNodeToTree(this, "", "")); logger.debug(" adding child: \n" + astNodeToTree(child, "", "")); } @@ -2635,6 +2636,9 @@ case REAL_E:{ // mantissa * Math.pow(10, getExponent())) ==> this formula does not give exact values. // for example: mantissa = 3.0, exponent = -17 ==> 2.9999999999999994E-17 instead of 3.0E-17 + if (Double.isNaN(mantissa) || Double.isInfinite(mantissa)) { + return mantissa; + } return Double.parseDouble(mantissa + "E" + getExponent()); } case RATIONAL: @@ -2890,7 +2894,7 @@ */ private void initDefaults() { ASTNode old = this; - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.initDefaults"), (type == null ? Type.UNKNOWN : type))); } @@ -3903,7 +3907,7 @@ */ public void setType(String typeStr) { // System.out.println("ASTNode: setType(String) called."); - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug("ASTNode: setType(String) called: " + typeStr); } @@ -3940,7 +3944,7 @@ String sType = type.toString(); - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug(MessageFormat.format(resourceBundle.getString("ASTNode.setType"), this.type, sType)); } @@ -4286,7 +4290,7 @@ // log the exception e.printStackTrace(); - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { 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 @@ -4294,7 +4298,7 @@ } } catch (RuntimeException e) { // added to prevent a crash when we cannot create the formula - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.error(MessageFormat.format(resourceBundle.getString("ASTNode.toString"), e.getMessage()), e); } } Modified: trunk/core/src/org/sbml/jsbml/util/SimpleTreeNodeChangeListener.java =================================================================== --- trunk/core/src/org/sbml/jsbml/util/SimpleTreeNodeChangeListener.java 2016-03-09 13:32:40 UTC (rev 2483) +++ trunk/core/src/org/sbml/jsbml/util/SimpleTreeNodeChangeListener.java 2016-03-09 13:36:54 UTC (rev 2484) @@ -45,6 +45,7 @@ * A {@link Logger} for this class. */ private static final transient Logger logger = Logger.getLogger(SimpleTreeNodeChangeListener.class); + private static final transient boolean isDebugEnabled = logger.isDebugEnabled(); /** * Creates an {@link TreeNodeChangeListener} that writes all events to the @@ -66,7 +67,7 @@ */ @Override public void nodeAdded(TreeNode treeNode) { - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug(MessageFormat.format("[ADD]\t{0}", saveToString(treeNode))); } } @@ -76,7 +77,7 @@ */ @Override public void nodeRemoved(TreeNodeRemovedEvent evt) { - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { String element = "null", prevParent = "null"; if (evt != null) { element = saveToString(evt.getSource()); @@ -91,7 +92,7 @@ */ @Override public void propertyChange(PropertyChangeEvent evt) { - if (logger.isDebugEnabled()) { + if (isDebugEnabled) { logger.debug(MessageFormat.format("[CHG]\t{0}", saveToString(evt))); } } @@ -131,7 +132,7 @@ } else { sb.append("; oldValue=").append(evt.getOldValue()); } - if (evt.getNewValue() != null && evt.getNewValue() instanceof ASTNode) { + if ((evt.getNewValue() != null) && (evt.getNewValue() instanceof ASTNode)) { sb.append("; newValue=").append(((ASTNode) evt.getNewValue()).toSimpleString()); } else { sb.append("; newValue=").append(evt.getNewValue()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-03-09 13:32:41
|
Revision: 2483 http://sourceforge.net/p/jsbml/code/2483 Author: niko-rodrigue Date: 2016-03-09 13:32:40 +0000 (Wed, 09 Mar 2016) Log Message: ----------- corrected TidySBMLWriter.writeSBMLToString as the output String was wrong Modified Paths: -------------- trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java Modified: trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java =================================================================== --- trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java 2016-03-04 20:43:33 UTC (rev 2482) +++ trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java 2016-03-09 13:32:40 UTC (rev 2483) @@ -646,13 +646,16 @@ // make sure that encoding is UTF-8 try { - OutputStreamWriter out = new OutputStreamWriter(new ByteArrayOutputStream(), "UTF-8"); + ByteArrayOutputStream outputSbml = new ByteArrayOutputStream(); + Writer out = new OutputStreamWriter(outputSbml, "UTF-8"); InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(sbmlDocString.getBytes("UTF-8")), "UTF-8"); - setIndentation(' ', (short) 2); + setIndentation(getIndentationChar(), getIndentationCount()); tidy.parse(in, out); // run tidy, providing an input and output stream - return out.toString(); + String outputSBMLString = outputSbml.toString("UTF-8"); + + return outputSBMLString; } catch (UnsupportedEncodingException e) { throw new SBMLException(e); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2016-03-04 20:43:35
|
Revision: 2482 http://sourceforge.net/p/jsbml/code/2482 Author: andreas-draeger Date: 2016-03-04 20:43:33 +0000 (Fri, 04 Mar 2016) Log Message: ----------- Corrected a bug that NaN values in the spatial dimension attribute were incorrectly used in comparisons when calling setUnits. This happened only in some of the set methods and this bug might have existed since a long time already. Now, we only throw an exception when users attempt to set a unit for a compartment whose spatial dimensions are really equal to 0d. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/Compartment.java Modified: trunk/core/src/org/sbml/jsbml/Compartment.java =================================================================== --- trunk/core/src/org/sbml/jsbml/Compartment.java 2016-02-29 13:27:18 UTC (rev 2481) +++ trunk/core/src/org/sbml/jsbml/Compartment.java 2016-03-04 20:43:33 UTC (rev 2482) @@ -775,13 +775,11 @@ unsetUnits(); return; } - double specDim = getSpatialDimensions(); - if (Double.isNaN(specDim) || (0 < specDim)) { - super.setUnits(units); - } else { + if (0d == getSpatialDimensions()) { throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("Compartment.ERROR_MESSAGE_ZERO_DIM"), "units", getId())); } + super.setUnits(units); } /** @@ -794,12 +792,11 @@ */ @Override public void setUnits(Unit unit) { - if (0 < getSpatialDimensions()) { - super.setUnits(unit); - } else { + if (0d == getSpatialDimensions()) { throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("Compartment.ERROR_MESSAGE_ZERO_DIM"), "unit", getId())); } + super.setUnits(unit); } /** @@ -815,12 +812,11 @@ */ @Override public void setUnits(Unit.Kind unitKind) { - if (0 < getSpatialDimensions()) { - super.setUnits(unitKind); - } else { + if (0d == getSpatialDimensions()) { throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("Compartment.ERROR_MESSAGE_ZERO_DIM"), "unit kind", getId())); } + super.setUnits(unitKind); } /** @@ -1012,7 +1008,7 @@ attributes.put("constant", Boolean.toString(getConstant())); } } - + if (level == 2) { if (isSetCompartmentType()) { attributes.put("compartmentType", getCompartmentType()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2016-02-29 13:27:20
|
Revision: 2481 http://sourceforge.net/p/jsbml/code/2481 Author: andreas-draeger Date: 2016-02-29 13:27:18 +0000 (Mon, 29 Feb 2016) Log Message: ----------- Fixed a bug that causes a class cast exception. Modified Paths: -------------- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java 2016-02-17 11:53:27 UTC (rev 2480) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java 2016-02-29 13:27:18 UTC (rev 2481) @@ -114,7 +114,7 @@ * @return */ public Objective getActiveObjectiveInstance() { - return (Objective) filter(new NameFilter(getActiveObjective())); + return firstHit(new NameFilter(getActiveObjective())); } /* (non-Javadoc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-02-17 11:53:29
|
Revision: 2480 http://sourceforge.net/p/jsbml/code/2480 Author: niko-rodrigue Date: 2016-02-17 11:53:27 +0000 (Wed, 17 Feb 2016) Log Message: ----------- corrected a bug that happened when the SBML RDF contained some additionals attributes or elements. There were conserved when reading but not re-inserted when writing. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/xml/XMLNode.java trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLRDFAnnotationParser.java Modified: trunk/core/src/org/sbml/jsbml/xml/XMLNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/XMLNode.java 2016-02-05 16:51:24 UTC (rev 2479) +++ trunk/core/src/org/sbml/jsbml/xml/XMLNode.java 2016-02-17 11:53:27 UTC (rev 2480) @@ -30,6 +30,7 @@ import javax.xml.stream.XMLStreamException; import org.sbml.jsbml.JSBML; +import org.sbml.jsbml.xml.parsers.SBMLRDFAnnotationParser; import org.sbml.jsbml.xml.parsers.XMLNodeWriter; import org.sbml.jsbml.xml.stax.SBMLReader; @@ -257,8 +258,13 @@ childElements.add(origchildren.clone()); } } - // TODO - clone our jsbml user objects for XMLNode - + // clone our jsbml user objects for XMLNode + if (orig.getUserObject(SBMLRDFAnnotationParser.CUSTOM_RDF) != null) { + putUserObject(SBMLRDFAnnotationParser.CUSTOM_RDF, orig.getUserObject(SBMLRDFAnnotationParser.CUSTOM_RDF)); + } + if (orig.getUserObject(SBMLRDFAnnotationParser.RDF_NODE_COLOR) != null) { + putUserObject(SBMLRDFAnnotationParser.RDF_NODE_COLOR, orig.getUserObject(SBMLRDFAnnotationParser.RDF_NODE_COLOR)); + } } /** Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLRDFAnnotationParser.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLRDFAnnotationParser.java 2016-02-05 16:51:24 UTC (rev 2479) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLRDFAnnotationParser.java 2016-02-17 11:53:27 UTC (rev 2480) @@ -495,40 +495,24 @@ contextObject.getAnnotation().setAbout(descriptionNode.getAttrValue("about", Annotation.URI_RDF_SYNTAX_NS)); descriptionNode.removeAttr("about", Annotation.URI_RDF_SYNTAX_NS); - removeXmlNodeIfEmpty(descriptionNode); + boolean removed = removeXmlNodeIfEmpty(descriptionNode); - // removing the usual namespace declarations - rdfNode.removeNamespace("rdf"); - rdfNode.removeNamespace("dc"); - rdfNode.removeNamespace("dcterms"); - rdfNode.removeNamespace("vcard"); - rdfNode.removeNamespace("vCard"); - rdfNode.removeNamespace("bqbiol"); - rdfNode.removeNamespace("bqmodel"); - // boolean rdfNodeRemoved = - removeXmlNodeIfEmpty(rdfNode); + if (removed) { + int nbChildElements = getNumberOfNonEmptyChildElement(rdfNode); + int nbAttributes = rdfNode.getAttributesLength(); - /* - if (rdfNodeRemoved) - { - // removing white space - int nbChildElements = annotationXMLNode.getChildCount(); - - for (int i = nbChildElements - 1; i >= 0; i--) - { - XMLNode childElement = annotationXMLNode.getChildAt(i); - - if (childElement.isText() && childElement.getCharacters().trim().length() == 0) - { - annotationXMLNode.removeChild(i); // - remove it only if the node before was also empty ? - } - } - if (annotationXMLNode.getChildCount() == 0) - { - annotationXMLNode.removeFromParent(); - } - } // we might need to clean a bit the white space even if the RDF node is not removed - */ + if (nbChildElements > 0 || nbAttributes > 0) { + // removing the usual namespace declarations if the node is empty + rdfNode.removeNamespace("rdf"); + rdfNode.removeNamespace("dc"); + rdfNode.removeNamespace("dcterms"); + rdfNode.removeNamespace("vcard"); + rdfNode.removeNamespace("vCard"); + rdfNode.removeNamespace("bqbiol"); + rdfNode.removeNamespace("bqmodel"); + removeXmlNodeIfEmpty(rdfNode); + } + } } /** @@ -1056,27 +1040,10 @@ return false; } - int nbChildElements = xmlNode.getChildCount(); + int nbChildElements = getNumberOfNonEmptyChildElement(xmlNode); int nbAttributes = xmlNode.getAttributesLength(); int nbNamespaces = xmlNode.getNamespacesLength(); - if (nbChildElements > 0) - { - int nbRealChildElements = 0; - - for (int i = 0 ; i < nbChildElements; i++) - { - XMLNode childElement = xmlNode.getChildAt(i); - - if (childElement.isText() && childElement.getCharacters().trim().length() == 0) - { - continue; - } - nbRealChildElements++; - } - nbChildElements = nbRealChildElements; - } - if (nbChildElements > 0 || nbAttributes > 0 || nbNamespaces > 0) { if (logger.isDebugEnabled()) @@ -1106,6 +1073,41 @@ } /** + * Returns the number of child XMLNode, excluding text XMLNode that + * contains only spaces. + * + * @param xmlNode + * @return the number of child XMLNode, excluding text XMLNode that + * contains only spaces. + */ + public int getNumberOfNonEmptyChildElement(XMLNode xmlNode) { + + if (xmlNode == null) { + return 0; + } + + int nbChildElements = xmlNode.getChildCount(); + int nbRealChildElements = 0; + + if (nbChildElements > 0) + { + + for (int i = 0 ; i < nbChildElements; i++) + { + XMLNode childElement = xmlNode.getChildAt(i); + + if (childElement.isText() && childElement.getCharacters().trim().length() == 0) + { + continue; + } + nbRealChildElements++; + } + } + + return nbRealChildElements; + } + + /** * @param contextObject * @param annotationXMLNode * @return @@ -1118,14 +1120,14 @@ { return null; } - // TODO - make use of the potential XML stores using the CUSTOM_RDF user object for Creator + + // if we want to add a created date or modified date automatically, it would need to be done at the level of the writer, before calling this method. - // TODO : add a created date or modified date automatically ?? Would need to be done at the level of the writer. - // gets or creates the RDF and Description XMLNode if (annotationXMLNode == null) { annotationXMLNode = new XMLNode(new XMLTriple("annotation"), new XMLAttributes()); } + XMLNode rdfNode = getOrCreate(annotationXMLNode, "RDF", Annotation.URI_RDF_SYNTAX_NS, "rdf"); rdfNode.addNamespace(Annotation.URI_RDF_SYNTAX_NS, "rdf"); @@ -1401,7 +1403,7 @@ * @param customRDFXMLNode * @return */ - private XMLNode getOrCreateCVTerm(XMLNode parent, int precedingTermIndex, + private XMLNode getOrCreateWithCustomRDF(XMLNode parent, int precedingTermIndex, String elementName, String cvtermURI, String cvtermPrefix, Object customRDFXMLNode) { int index = precedingTermIndex; @@ -1607,7 +1609,7 @@ for (Creator creator : history.getListOfCreators()) { // rdf:li node - XMLNode liNode = getOrCreate(bagNode, i, "li", Annotation.URI_RDF_SYNTAX_NS, "rdf"); + XMLNode liNode = getOrCreateWithCustomRDF(bagNode, i, "li", Annotation.URI_RDF_SYNTAX_NS, "rdf", creator.getUserObject(CUSTOM_RDF)); liNode.addAttr("parseType", "Resource", Annotation.URI_RDF_SYNTAX_NS, "rdf"); if (creator.isSetFamilyName() || creator.isSetGivenName()) @@ -1729,7 +1731,7 @@ trueIndex = 0; } - qualifierNode = getOrCreateCVTerm(parentNode, trueIndex, cvterm.getQualifier().getElementNameEquivalent(), + qualifierNode = getOrCreateWithCustomRDF(parentNode, trueIndex, cvterm.getQualifier().getElementNameEquivalent(), cvtermURI, cvtermPrefix, cvterm.getUserObject(CUSTOM_RDF)); XMLNode bagNode = getOrCreate(qualifierNode, "Bag", Annotation.URI_RDF_SYNTAX_NS, "rdf"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-02-05 16:51:26
|
Revision: 2479 http://sourceforge.net/p/jsbml/code/2479 Author: niko-rodrigue Date: 2016-02-05 16:51:24 +0000 (Fri, 05 Feb 2016) Log Message: ----------- fixes to the FormulaCompiler classes for the trigonometric operators and for logical operators with one or zero arguments Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java Modified: trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java =================================================================== --- trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java 2016-02-05 16:46:52 UTC (rev 2478) +++ trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java 2016-02-05 16:51:24 UTC (rev 2479) @@ -70,9 +70,19 @@ /** * */ - public static final String FORMULA_ARGUMENT_SEPARATOR = " "; + protected String FORMULA_ARGUMENT_SEPARATOR = " "; /** + * All inverse trigonometric functions may be defined in the infix either using 'arc' as a prefix or simply 'a' + */ + protected String INVERSE_TRIGONOMETRIC_PREFIX = "a"; + + /** + * String used to represent the exponentiale constant + */ + protected String EXPONENTIALE = "exponentiale"; + + /** * Basic method which links several elements with a mathematical operator. * All empty StringBuffer object are excluded. * @@ -340,7 +350,7 @@ */ @Override public ASTNodeValue arccos(ASTNode node) throws SBMLException { - return function("acos", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "cos", node); } /* (non-Javadoc) @@ -348,7 +358,7 @@ */ @Override public ASTNodeValue arccosh(ASTNode node) throws SBMLException { - return function("acosh", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "cosh", node); } /* (non-Javadoc) @@ -356,7 +366,7 @@ */ @Override public ASTNodeValue arccot(ASTNode node) throws SBMLException { - return function("acot", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "cot", node); } /* (non-Javadoc) @@ -364,7 +374,7 @@ */ @Override public ASTNodeValue arccoth(ASTNode node) throws SBMLException { - return function("acoth", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "coth", node); } /* (non-Javadoc) @@ -372,7 +382,7 @@ */ @Override public ASTNodeValue arccsc(ASTNode node) throws SBMLException { - return function("acsc", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "csc", node); } /* (non-Javadoc) @@ -380,7 +390,7 @@ */ @Override public ASTNodeValue arccsch(ASTNode node) throws SBMLException { - return function("acsch", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "csch", node); } /* (non-Javadoc) @@ -388,7 +398,7 @@ */ @Override public ASTNodeValue arcsec(ASTNode node) throws SBMLException { - return function("asec", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "sec", node); } /* (non-Javadoc) @@ -396,7 +406,7 @@ */ @Override public ASTNodeValue arcsech(ASTNode node) throws SBMLException { - return function("asech", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "sech", node); } /* (non-Javadoc) @@ -404,7 +414,7 @@ */ @Override public ASTNodeValue arcsin(ASTNode node) throws SBMLException { - return function("asin", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "sin", node); } /* (non-Javadoc) @@ -412,7 +422,7 @@ */ @Override public ASTNodeValue arcsinh(ASTNode node) throws SBMLException { - return function("asinh", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "sinh", node); } /* (non-Javadoc) @@ -420,7 +430,7 @@ */ @Override public ASTNodeValue arctan(ASTNode node) throws SBMLException { - return function("atan", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "tan", node); } /* (non-Javadoc) @@ -428,7 +438,7 @@ */ @Override public ASTNodeValue arctanh(ASTNode node) throws SBMLException { - return function("atanh", node); + return function(INVERSE_TRIGONOMETRIC_PREFIX + "tanh", node); } /* (non-Javadoc) @@ -738,7 +748,7 @@ */ @Override public ASTNodeValue getConstantE() { - return new ASTNodeValue(Character.toString('e'), this); + return new ASTNodeValue(EXPONENTIALE, this); } /* (non-Javadoc) @@ -770,7 +780,7 @@ */ @Override public ASTNodeValue getNegativeInfinity() { - return new ASTNodeValue(Double.NEGATIVE_INFINITY, this); + return new ASTNodeValue("-INF", this); } /* (non-Javadoc) @@ -778,7 +788,7 @@ */ @Override public ASTNodeValue getPositiveInfinity() { - return new ASTNodeValue(Double.POSITIVE_INFINITY, this); + return new ASTNodeValue("INF", this); } /* (non-Javadoc) @@ -861,22 +871,40 @@ throws SBMLException { StringBuffer value = new StringBuffer(); boolean first = true; - for (ASTNode node : nodes) { - if (!first) { - value.append(operator); - } else { - first = false; + + if ((nodes != null) && (nodes.size() >= 2)) { + for (ASTNode node : nodes) { + if (!first) { + value.append(operator); + } else { + first = false; + } + if (node.getChildCount() > 0) { + append(value, Character.valueOf('('), node.compile(this) + .toString(), Character.valueOf(')')); + } else { + value.append(node.compile(this).toString()); + } } - if (node.getChildCount() > 0) { - append(value, Character.valueOf('('), node.compile(this) - .toString(), Character.valueOf(')')); - } else { - value.append(node.compile(this).toString()); - } + } else { + return logicalOperationFunction(operator, nodes); } + return new ASTNodeValue(value.toString(), this); } + + + protected ASTNodeValue logicalOperationFunction(String operator, List<ASTNode> nodes) { + if (operator.contains("||")) { + operator = "or"; + } else if (operator.contains("&&")) { + operator = "and"; + } + + return function(operator, nodes); + } + /* (non-Javadoc) * @see org.sbml.jsbml.util.compilers.ASTNodeCompiler#lt(org.sbml.jsbml.ASTNode, org.sbml.jsbml.ASTNode) */ Modified: trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java =================================================================== --- trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java 2016-02-05 16:46:52 UTC (rev 2478) +++ trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java 2016-02-05 16:51:24 UTC (rev 2479) @@ -42,8 +42,14 @@ public class FormulaCompilerLibSBML extends FormulaCompiler { + + /** + * + */ + public FormulaCompilerLibSBML() { + INVERSE_TRIGONOMETRIC_PREFIX = "arc"; + } - /* (non-Javadoc) * @see org.sbml.jsbml.util.compilers.ASTNodeCompiler#and(java.util.List) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-02-05 16:46:54
|
Revision: 2478 http://sourceforge.net/p/jsbml/code/2478 Author: niko-rodrigue Date: 2016-02-05 16:46:52 +0000 (Fri, 05 Feb 2016) Log Message: ----------- corrected an encoding problem in the tidy SBML writer that happened when the default JVM encoding was not UTF-8. Now we try to make sure we use UTF-8 when reading and writing + did a bit of refactoring to re-use the code instead of having repetition everywhere Modified Paths: -------------- trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java trunk/modules/tidy/tidy-build.properties Modified: trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java =================================================================== --- trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java 2016-01-29 20:29:36 UTC (rev 2477) +++ trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java 2016-02-05 16:46:52 UTC (rev 2478) @@ -21,15 +21,20 @@ */ package org.sbml.jsbml; +import java.io.BufferedWriter; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileFilter; import java.io.FileNotFoundException; -import java.io.FileWriter; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStreamReader; import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.io.Serializable; -import java.io.StringReader; -import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.io.Writer; import java.util.Calendar; import javax.xml.stream.XMLStreamException; @@ -104,14 +109,8 @@ public static void write(SBMLDocument sbmlDocument, File file, char indentChar, short indentCount) throws XMLStreamException, SBMLException, IOException { - SBMLWriter sbmlWriter = new SBMLWriter(); - sbmlWriter.setIndentationChar(indentChar); - sbmlWriter.setIndentationCount(indentCount); - - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument); - - setIndentation(indentChar, indentCount); - tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream + TidySBMLWriter sbmlWriter = new TidySBMLWriter(indentChar, indentCount); + sbmlWriter.write(sbmlDocument, file); } /** @@ -155,11 +154,8 @@ String programVersion) throws XMLStreamException, SBMLException, IOException { - SBMLWriter sbmlWriter = new SBMLWriter(); - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); - - setIndentation(' ', (short) 2); - tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream + TidySBMLWriter sbmlWriter = new TidySBMLWriter(programName, programVersion); + sbmlWriter.write(sbmlDocument, file); } /** @@ -197,13 +193,8 @@ String programName, String programVersion, char indentChar, short indentCount) throws XMLStreamException, SBMLException, IOException { - SBMLWriter sbmlWriter = new SBMLWriter(); - sbmlWriter.setIndentationChar(indentChar); - sbmlWriter.setIndentationCount(indentCount); - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); - - setIndentation(indentChar, indentCount); - tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream + TidySBMLWriter sbmlWriter = new TidySBMLWriter(programName, programVersion, indentChar, indentCount); + sbmlWriter.write(sbmlDocument, file); } /** @@ -222,13 +213,8 @@ public static void write(SBMLDocument sbmlDocument, OutputStream stream, char indentChar, short indentCount) throws XMLStreamException, SBMLException { - SBMLWriter sbmlWriter = new SBMLWriter(); - sbmlWriter.setIndentationChar(indentChar); - sbmlWriter.setIndentationCount(indentCount); - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument); - - setIndentation(indentChar, indentCount); - tidy.parse(new StringReader(sbmlDocString), stream); // run tidy, providing an input and output stream + TidySBMLWriter sbmlWriter = new TidySBMLWriter(indentChar, indentCount); + sbmlWriter.write(sbmlDocument, stream); } /** @@ -256,11 +242,8 @@ String programName, String programVersion) throws XMLStreamException, SBMLException { - SBMLWriter sbmlWriter = new SBMLWriter(); - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); - - setIndentation(' ', (short) 2); - tidy.parse(new StringReader(sbmlDocString), stream); // run tidy, providing an input and output stream + TidySBMLWriter sbmlWriter = new TidySBMLWriter(programName, programVersion); + sbmlWriter.write(sbmlDocument, stream); } /** @@ -294,13 +277,8 @@ String programName, String programVersion, char indentChar, short indentCount) throws XMLStreamException, SBMLException { - SBMLWriter sbmlWriter = new SBMLWriter(); - sbmlWriter.setIndentationChar(indentChar); - sbmlWriter.setIndentationCount(indentCount); - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); - - setIndentation(indentChar, indentCount); - tidy.parse(new StringReader(sbmlDocString), stream); // run tidy, providing an input and output stream + TidySBMLWriter sbmlWriter = new TidySBMLWriter(programName, programVersion, indentChar, indentCount); + sbmlWriter.write(sbmlDocument, stream); } /** @@ -329,17 +307,8 @@ char indentChar, short indentCount) throws XMLStreamException, FileNotFoundException, SBMLException { - SBMLWriter sbmlWriter = new SBMLWriter(); - sbmlWriter.setIndentationChar(indentChar); - sbmlWriter.setIndentationCount(indentCount); - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument); - - try { - setIndentation(indentChar, indentCount); - tidy.parse(new StringReader(sbmlDocString), new FileWriter(fileName)); // run tidy, providing an input and output stream - } catch (IOException e) { - throw new SBMLException(e); - } + TidySBMLWriter sbmlWriter = new TidySBMLWriter(indentChar, indentCount); + sbmlWriter.writeSBMLToFile(sbmlDocument, fileName); } /** @@ -371,15 +340,8 @@ String programName, String programVersion) throws XMLStreamException, FileNotFoundException, SBMLException { - SBMLWriter sbmlWriter = new SBMLWriter(); - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); - - try { - setIndentation(' ', (short) 2); - tidy.parse(new StringReader(sbmlDocString), new FileWriter(fileName)); // run tidy, providing an input and output stream - } catch (IOException e) { - throw new SBMLException(e); - } + TidySBMLWriter sbmlWriter = new TidySBMLWriter(programName, programVersion); + sbmlWriter.writeSBMLToFile(sbmlDocument, fileName); } /** @@ -418,17 +380,8 @@ short indentCount) throws XMLStreamException, FileNotFoundException, SBMLException { - SBMLWriter sbmlWriter = new SBMLWriter(); - sbmlWriter.setIndentationChar(indentChar); - sbmlWriter.setIndentationCount(indentCount); - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, programName, programVersion); - - try { - setIndentation(indentChar, indentCount); - tidy.parse(new StringReader(sbmlDocString), new FileWriter(fileName)); // run tidy, providing an input and output stream - } catch (IOException e) { - throw new SBMLException(e); - } + TidySBMLWriter sbmlWriter = new TidySBMLWriter(programName, programVersion, indentChar, indentCount); + sbmlWriter.writeSBMLToFile(sbmlDocument, fileName); } /** @@ -536,10 +489,7 @@ public void write(SBMLDocument sbmlDocument, File file) throws XMLStreamException, SBMLException, IOException { - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument); - - setIndentation(' ', (short) 2); - tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream + writeSBML(sbmlDocument, file); } /** @@ -567,8 +517,16 @@ { String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, getProgramName(), getProgramVersion()); - setIndentation(' ', (short) 2); - tidy.parse(new StringReader(sbmlDocString), stream); // run tidy, providing an input and output stream + try { + // make sure that encoding is UTF-8 + Writer out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8")); + InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(sbmlDocString.getBytes("UTF-8")), "UTF-8"); + + setIndentation(getIndentationChar(), getIndentationCount()); + tidy.parse(in, out); // run tidy, providing an input and output stream + } catch (IOException e) { + throw new SBMLException(e); + } } /** @@ -596,13 +554,10 @@ */ @Override public void write(SBMLDocument sbmlDocument, String fileName) - throws XMLStreamException, FileNotFoundException, SBMLException { - - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, getProgramName(), getProgramVersion()); - + throws XMLStreamException, FileNotFoundException, SBMLException + { try { - setIndentation(' ', (short) 2); - tidy.parse(new StringReader(sbmlDocString), new FileWriter(fileName)); // run tidy, providing an input and output stream + writeSBML(sbmlDocument, new File(fileName)); } catch (IOException e) { throw new SBMLException(e); } @@ -633,14 +588,8 @@ public void writeSBML(SBMLDocument sbmlDocument, File file) throws XMLStreamException, SBMLException, IOException { - String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, getProgramName(), getProgramVersion()); - - try { - setIndentation(' ', (short) 2); - tidy.parse(new StringReader(sbmlDocString), new FileWriter(file)); // run tidy, providing an input and output stream - } catch (IOException e) { - throw new SBMLException(e); - } + write(sbmlDocument, new FileOutputStream(file)); + } /** @@ -694,12 +643,19 @@ throws XMLStreamException, SBMLException { String sbmlDocString = sbmlWriter.writeSBMLToString(sbmlDocument, getProgramName(), getProgramVersion()); - StringWriter stringWriter = new StringWriter(); - setIndentation(' ', (short) 2); - tidy.parse(new StringReader(sbmlDocString), stringWriter); // run tidy, providing an input and output stream + // make sure that encoding is UTF-8 + try { + OutputStreamWriter out = new OutputStreamWriter(new ByteArrayOutputStream(), "UTF-8"); + InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(sbmlDocString.getBytes("UTF-8")), "UTF-8"); - return stringWriter.toString(); + setIndentation(' ', (short) 2); + tidy.parse(in, out); // run tidy, providing an input and output stream + + return out.toString(); + } catch (UnsupportedEncodingException e) { + throw new SBMLException(e); + } } /** @@ -776,7 +732,8 @@ System.out.printf("Starting writing\n"); - new TidySBMLWriter().write(testDocument, jsbmlWriteFileName); + TidySBMLWriter.write(testDocument, jsbmlWriteFileName, ' ', (short) 2); + } catch (XMLStreamException e) { e.printStackTrace(); } catch (IOException e) { Modified: trunk/modules/tidy/tidy-build.properties =================================================================== --- trunk/modules/tidy/tidy-build.properties 2016-01-29 20:29:36 UTC (rev 2477) +++ trunk/modules/tidy/tidy-build.properties 2016-02-05 16:46:52 UTC (rev 2478) @@ -1,6 +1,6 @@ tidy.Name=Tidy SBMLWriter tidy.name=jsbml-tidy -tidy.version=1.1 +tidy.version=1.2 tidy.groupId=org.sbml.jsbml.modules tidy.artifactId=jsbml_modules_tidy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2016-01-29 20:29:38
|
Revision: 2477 http://sourceforge.net/p/jsbml/code/2477 Author: andreas-draeger Date: 2016-01-29 20:29:36 +0000 (Fri, 29 Jan 2016) Log Message: ----------- Updated SBO. Modified Paths: -------------- trunk/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo 2016-01-28 20:34:39 UTC (rev 2476) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/SBO_OBO.obo 2016-01-29 20:29:36 UTC (rev 2477) @@ -1,6 +1,6 @@ format-version: 1.2 -date: 14:06:2015 07:00 -data-version: 13:05:2015 13:49 +date: 29:01:2016 07:00 +data-version: 04:12:2015 11:23 saved-by: SBO community auto-generated-by: SBO Browser (http://www.ebi.ac.uk/sbo/) default-namespace: sbo @@ -1317,7 +1317,7 @@ [Term] id: SBO:0000204 -name: dna replication +name: DNA replication def: "Process in which a DNA duplex is transformed into two identical DNA duplexes." [src_code:NR] comment: See GO:0006260\nAdded on 09 August 2006 by Nicolas Le Novere on the suggestion of Emek Demir.\nModified 04 July 2008 by Nick Juty - changed from replication to dna replication is_a: SBO:0000205 ! composite biochemical process @@ -4244,14 +4244,14 @@ name: exchange reaction def: "A modeling process to provide matter influx or efflux to a model, for example to replenish a metabolic network with raw materials (eg carbon / energy sources). Such reactions are conceptual, created solely for modeling purposes, and do not have a physical correspondence. Exchange reactions, often represented as 'R_EX_', can operate in the negative (uptake) direction or positive (secretion) direction. By convention, a negative flux through an exchange reaction represents uptake of the corresponding metabolite, and a positive flux represent discharge." [src_code:NR] comment: Created in response to \[SF req #110\] -is_a: SBO:0000375 ! process +is_a: SBO:0000631 ! pseudoreaction [Term] id: SBO:0000628 name: demand reaction def: "A modeling process analogous to exchange reaction, but which operates upon \"internal\" metabolites. Metabolites that are consumed by these reactions are assumed to be used in intra-cellular processes that are not part of the model. Demand reactions, often represented 'R_DM_', can also deliver metabolites (from intra-cellular processes that are not considered in the model)." [src_code:NR] comment: Created in response to \[SF req #110\]. -is_a: SBO:0000375 ! process +is_a: SBO:0000631 ! pseudoreaction [Term] id: SBO:0000629 @@ -4268,6 +4268,21 @@ synonym: "maintenance energy" [] is_a: SBO:0000395 ! encapsulating process +[Term] +id: SBO:0000631 +name: pseudoreaction +def: "A conceptual process used for modeling purposes, often created solely to complete model structure, with respect to providing inflow or outflow of matter or material. Unlike other reactions, pseudoreactions are not usually subjected to mass balance considerations." [src_code:NR] +comment: Created in response to \[SF req #111\] +is_a: SBO:0000375 ! process + +[Term] +id: SBO:0000632 +name: sink reaction +def: "A modeling process to provide matter influx or efflux to a model, for example to replenish a metabolic network with raw materials (eg carbon / energy sources). Such reactions are conceptual, created solely for modeling purposes, and do not have a physical correspondence. Unlike the analogous demand (SBO:....) reactions, which are usually designated as irreversible, sink reactions always represent a reversible uptake/secretion processes, and act as a metabolite source with no cost to the cell. Sink reactions, also referred to as R_SINK_, are generally used for compounds that are metabolized by the cell but are produced by non-metabolic, un-modeled cellular processes." [SBO:team "identifiers.org/pubmed/20057383"] +comment: Created in response to \[SF req #111\] +synonym: "source/sink" [] +is_a: SBO:0000631 ! pseudoreaction + [Typedef] id: is_a name: is_a This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2016-01-28 20:34:41
|
Revision: 2476 http://sourceforge.net/p/jsbml/code/2476 Author: andreas-draeger Date: 2016-01-28 20:34:39 +0000 (Thu, 28 Jan 2016) Log Message: ----------- Added a few missing convenience functions. Modified Paths: -------------- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java 2016-01-27 14:33:00 UTC (rev 2475) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java 2016-01-28 20:34:39 UTC (rev 2476) @@ -24,6 +24,7 @@ import java.util.Map; import org.sbml.jsbml.ListOf; +import org.sbml.jsbml.util.filters.NameFilter; /** * Unlike other SBML {@link ListOf} classes, {@link ListOfObjectives} adds an additional @@ -91,7 +92,6 @@ setSBaseListType(ListOf.Type.other); } - /* (non-Javadoc) * @see org.sbml.jsbml.ListOf#clone() */ @@ -109,6 +109,17 @@ return isSetActiveObjective() ? activeObjective : ""; } + /** + * Iterates through this list until it finds + * @return + */ + public Objective getActiveObjectiveInstance() { + return (Objective) filter(new NameFilter(getActiveObjective())); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ListOf#getElementName() + */ @Override public String getElementName() { return FBCConstants.listOfObjectives; @@ -149,10 +160,10 @@ /** * This attribute refers to an id of an existing {@link Objective}. This attribute * exists so that multiple objectives are defined in a single model, the model will - * always be well-defined, i.e. there is a single objective function which defines + * always be well-defined, i.e., there is a single objective function which defines * a single optimum. * - * Sets the value of activeObjective + * Sets the value of {@link #activeObjective} * @param activeObjective */ public void setActiveObjective(String activeObjective) { @@ -161,6 +172,14 @@ firePropertyChange(FBCConstants.activeObjective, oldActiveObjective, this.activeObjective); } + /** + * Sets the value of {@link #activeObjective} to the id of the given {@link Objective}. + * @param activeObjective + * @see #setActiveObjective(String) + */ + public void setActiveObjective(Objective activeObjective) { + setActiveObjective(activeObjective.getId()); + } /** * Unsets the variable activeObjective This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-01-27 14:33:02
|
Revision: 2475 http://sourceforge.net/p/jsbml/code/2475 Author: niko-rodrigue Date: 2016-01-27 14:33:00 +0000 (Wed, 27 Jan 2016) Log Message: ----------- corrected the bug reported by Miguel de Alba + several other corrections to the formula output to correct some cases where jsbml divert from the expected output Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java Modified: trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java =================================================================== --- trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java 2016-01-25 20:54:22 UTC (rev 2474) +++ trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java 2016-01-27 14:33:00 UTC (rev 2475) @@ -70,7 +70,7 @@ /** * */ - public static final String FORMULA_ARGUMENT_SEPARATOR = ""; + public static final String FORMULA_ARGUMENT_SEPARATOR = " "; /** * Basic method which links several elements with a mathematical operator. @@ -449,7 +449,9 @@ protected String checkBrackets(ASTNode node) throws SBMLException { String term = node.compile(this).toString(); - if (node.isSum() || node.isDifference() || node.isUMinus()) { + if (node.isSum() || node.isDifference() || node.isUMinus() + || node.isRelational() || node.isLogical()) + { term = brackets(term).toString(); } else if (node.isReal()) { if (node.getReal() < 0d) { @@ -491,11 +493,13 @@ String term = node.compile(this).toString(); - if (node.isRelational() || node.isNumber() || node.isString() + if (node.isNumber() || node.isString() || node.isFunction()) { return term; } + // for node.isRelational() and node.isLogical(), we want to put brackets + return term = brackets(term).toString(); } Modified: trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java =================================================================== --- trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java 2016-01-25 20:54:22 UTC (rev 2474) +++ trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java 2016-01-27 14:33:00 UTC (rev 2475) @@ -63,7 +63,7 @@ return function("eq", ((ASTNode) left.getParent()).getListOfNodes()); } - return new ASTNodeValue(relation(left, " == ", right), this); + return new ASTNodeValue(relation(left, "==", right), this); } /* (non-Javadoc) @@ -86,7 +86,7 @@ return function("geq", ((ASTNode) left.getParent()).getListOfNodes()); } - return new ASTNodeValue(relation(left, " >= ", right), this); + return new ASTNodeValue(relation(left, ">=", right), this); } @@ -101,7 +101,7 @@ return function("gt", ((ASTNode) left.getParent()).getListOfNodes()); } - return new ASTNodeValue(relation(left, " > ", right), this); + return new ASTNodeValue(relation(left, ">", right), this); } @@ -116,7 +116,7 @@ return function("leq", ((ASTNode) left.getParent()).getListOfNodes()); } - return new ASTNodeValue(relation(left, " <= ", right), this); + return new ASTNodeValue(relation(left, "<=", right), this); } @@ -131,7 +131,7 @@ return function("lt", ((ASTNode) left.getParent()).getListOfNodes()); } - return new ASTNodeValue(relation(left, " < ", right), this); + return new ASTNodeValue(relation(left, "<", right), this); } @@ -140,7 +140,7 @@ */ @Override public ASTNodeValue neq(ASTNode left, ASTNode right) throws SBMLException { - return new ASTNodeValue(relation(left, " != ", right), this); + return new ASTNodeValue(relation(left, "!=", right), this); } /* (non-Javadoc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2016-01-25 20:54:25
|
Revision: 2474 http://sourceforge.net/p/jsbml/code/2474 Author: andreas-draeger Date: 2016-01-25 20:54:22 +0000 (Mon, 25 Jan 2016) Log Message: ----------- Added forgotten methods to directly obtain object instances (getXXXInstance() and isSetXXXInstance()) and made isSetSpeciesInstance() in SimpleSpeciesReference more consistent with the rest of the code. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/SimpleSpeciesReference.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxObjective.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductRef.java Modified: trunk/core/src/org/sbml/jsbml/SimpleSpeciesReference.java =================================================================== --- trunk/core/src/org/sbml/jsbml/SimpleSpeciesReference.java 2016-01-25 04:12:26 UTC (rev 2473) +++ trunk/core/src/org/sbml/jsbml/SimpleSpeciesReference.java 2016-01-25 20:54:22 UTC (rev 2474) @@ -57,7 +57,7 @@ } /** - * Creates a SimpleSpeciesReference instance. + * Creates a SimpleSpeciesReference instance. * * @param level the SBML level * @param version the SBML version @@ -89,7 +89,7 @@ } /** - * Creates a SimpleSpeciesReference instance. + * Creates a SimpleSpeciesReference instance. * @param id */ public SimpleSpeciesReference(String id) { @@ -98,7 +98,7 @@ /** * Creates a SimpleSpeciesReference instance. - * + * * @param id * @param level the SBML level * @param version the SBML version @@ -108,7 +108,7 @@ } /** - * Creates a SimpleSpeciesReference instance. + * Creates a SimpleSpeciesReference instance. * * @param id * @param name @@ -189,8 +189,7 @@ * {@link SimpleSpeciesReference} as id is not {@code null}. */ public boolean isSetSpeciesInstance() { - Model m = getModel(); - return m != null ? m.getSpecies(speciesID) != null : false; + return getSpeciesInstance() != null; } /* (non-Javadoc) Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxObjective.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxObjective.java 2016-01-25 04:12:26 UTC (rev 2473) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxObjective.java 2016-01-25 20:54:22 UTC (rev 2474) @@ -26,6 +26,7 @@ import org.sbml.jsbml.AbstractNamedSBase; import org.sbml.jsbml.LevelVersionError; +import org.sbml.jsbml.Model; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.Reaction; import org.sbml.jsbml.UniqueNamedSBase; @@ -203,10 +204,29 @@ * @return the value of reaction */ public String getReaction() { - return reaction; + return isSetReaction() ? reaction : ""; } /** + * @return + */ + public Reaction getReactionInstance() { + if (isSetReaction()) { + Model m = getModel(); + return (m != null) ? m.getReaction(getReaction()) : null; + } + return null; + } + + /** + * + * @return + */ + public boolean isSetReactionInstance() { + return getReactionInstance() != null; + } + + /** * Returns whether reaction is set * * @return whether reaction is set Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductRef.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductRef.java 2016-01-25 04:12:26 UTC (rev 2473) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductRef.java 2016-01-25 20:54:22 UTC (rev 2474) @@ -23,6 +23,7 @@ import java.util.Map; import org.sbml.jsbml.AbstractNamedSBase; +import org.sbml.jsbml.Model; import org.sbml.jsbml.UniqueNamedSBase; /** @@ -148,6 +149,26 @@ return ""; } + /** + * + * @return + */ + public GeneProduct getGeneProductInstance() { + if (isSetGeneProduct()) { + Model m = getModel(); + return (m != null) ?(GeneProduct) m.findNamedSBase(getGeneProduct()) : null; + } + return null; + } + + /** + * + * @return + */ + public boolean isSetGeneProductInstance() { + return getGeneProductInstance() != null; + } + /* (non-Javadoc) * @see java.lang.Object#hashCode() */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2016-01-25 04:12:28
|
Revision: 2473 http://sourceforge.net/p/jsbml/code/2473 Author: andreas-draeger Date: 2016-01-25 04:12:26 +0000 (Mon, 25 Jan 2016) Log Message: ----------- Added forgotten call to change listener. Modified Paths: -------------- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxObjective.java Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxObjective.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxObjective.java 2016-01-24 05:26:20 UTC (rev 2472) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxObjective.java 2016-01-25 04:12:26 UTC (rev 2473) @@ -277,7 +277,6 @@ firePropertyChange(FBCConstants.coefficient, oldCoefficient, this.coefficient); } - /** * * @param reaction @@ -287,12 +286,14 @@ } /** - * Sets the reaction that thie {@link FluxObjective} is associated with in the context + * Sets the reaction that this {@link FluxObjective} is associated with in the context * of the enclosing {@link Objective} class. * @param reaction the reaction to set */ public void setReaction(String reaction) { + String oldReaction = this.reaction; this.reaction = reaction; + firePropertyChange(FBCConstants.reaction, oldReaction, reaction); } /** @@ -328,7 +329,6 @@ return false; } - /* (non-Javadoc) * @see org.sbml.jsbml.element.SBase#writeXMLAttributes() */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2016-01-24 05:26:22
|
Revision: 2472 http://sourceforge.net/p/jsbml/code/2472 Author: andreas-draeger Date: 2016-01-24 05:26:20 +0000 (Sun, 24 Jan 2016) Log Message: ----------- Solved JavaDoc error. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageParser.java Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/PackageParser.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageParser.java 2016-01-21 17:13:20 UTC (rev 2471) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/PackageParser.java 2016-01-24 05:26:20 UTC (rev 2472) @@ -51,11 +51,11 @@ * Creates a new {@link ASTNodePlugin} for the given {@link ASTNode} * and add it to the {@link ASTNodePlugin} map of the {@link ASTNode}. * - * @param sbase - the astNode for which you want to create an {@link ASTNodePlugin} + * @param astNode - the astNode for which you want to create an {@link ASTNodePlugin} * @return a new {@link ASTNodePlugin} corresponding to the given {@link ASTNode}. */ public ASTNodePlugin createPluginFor(ASTNode astNode); - + /** * Gets the namespace for this package that correspond to the given SBML level, version * and the package version. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-01-21 17:13:22
|
Revision: 2471 http://sourceforge.net/p/jsbml/code/2471 Author: niko-rodrigue Date: 2016-01-21 17:13:20 +0000 (Thu, 21 Jan 2016) Log Message: ----------- implemented a new method on MathMLXMLStreamCompiler in order to be able to write the ASTNodePlugins. Writing only attributes for ci element for now Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/util/compilers/MathMLXMLStreamCompiler.java Modified: trunk/core/src/org/sbml/jsbml/util/compilers/MathMLXMLStreamCompiler.java =================================================================== --- trunk/core/src/org/sbml/jsbml/util/compilers/MathMLXMLStreamCompiler.java 2016-01-21 16:34:35 UTC (rev 2470) +++ trunk/core/src/org/sbml/jsbml/util/compilers/MathMLXMLStreamCompiler.java 2016-01-21 17:13:20 UTC (rev 2471) @@ -27,6 +27,7 @@ import java.text.MessageFormat; import java.util.List; import java.util.Locale; +import java.util.Map; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; @@ -38,6 +39,7 @@ import org.sbml.jsbml.SBMLDocument; import org.sbml.jsbml.SBMLException; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.util.StringTools; import org.sbml.jsbml.xml.XMLNode; import org.sbml.jsbml.xml.parsers.XMLNodeWriter; @@ -648,6 +650,12 @@ try { writer.writeCharacters(indent); writer.writeStartElement(ASTNode.URI_MATHML_DEFINITION, "ci"); + + // check if there are any plugins on the ASTNode + if (astNode.getExtensionCount() > 0) { + writePlugins(astNode); + } + writer.writeCharacters(" "); writer.writeCharacters(astNode.getName()); writer.writeCharacters(" "); @@ -662,8 +670,34 @@ } /** + * Writes the attributes of the {@link ASTNodePlugin}s present on the ASTNode. + * * @param astNode */ + private void writePlugins(ASTNode astNode) { + + // TODO - for now only writing the attributes, we will need to revisit if + // one package add elements to mathML elements. + + ASTNodePlugin plugin = astNode.getPlugin("multi"); + Map<String, String> attributes = plugin.writeXMLAttributes(); + + if (attributes.size() > 0) { + for (String attributeKey : attributes.keySet()) { + String attributeValue = attributes.get(attributeKey); + + try { + writer.writeAttribute(attributeKey, attributeValue); + } catch (XMLStreamException e) { + e.printStackTrace(); + } + } + } + } + + /** + * @param astNode + */ private void compileElement(ASTNode astNode) { compileElement(astNode.getType().toString().toLowerCase(), astNode); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-01-21 16:34:37
|
Revision: 2470 http://sourceforge.net/p/jsbml/code/2470 Author: niko-rodrigue Date: 2016-01-21 16:34:35 +0000 (Thu, 21 Jan 2016) Log Message: ----------- implemented AbstractASTNodePlugin in a similar way as AbstractSBasePlugin + added methods on ASTNode to manipulate the plugins, very similar as the ones for SBase Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ASTNode.java trunk/core/src/org/sbml/jsbml/AbstractSBase.java trunk/core/src/org/sbml/jsbml/ext/ASTNodePlugin.java Added Paths: ----------- trunk/core/src/org/sbml/jsbml/ext/AbstractASTNodePlugin.java Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java 2016-01-21 16:28:08 UTC (rev 2469) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java 2016-01-21 16:34:35 UTC (rev 2470) @@ -26,7 +26,10 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; import javax.swing.tree.TreeNode; import javax.xml.stream.XMLStreamException; @@ -50,6 +53,8 @@ import org.sbml.jsbml.util.compilers.UnitsCompiler; import org.sbml.jsbml.util.filters.Filter; import org.sbml.jsbml.xml.XMLNode; +import org.sbml.jsbml.xml.parsers.PackageParser; +import org.sbml.jsbml.xml.parsers.ParserManager; import org.sbml.jsbml.xml.stax.SBMLReader; /** @@ -1478,6 +1483,12 @@ private CallableSBase variable; /** + * {@link Map} containing the ASTNode plugin object of additional packages + * with the appropriate name of the package. + */ + private SortedMap<String, ASTNodePlugin> plugins; + + /** * Creates a new {@link ASTNode} of unspecified type and without a pointer * to its containing {@link MathContainer}. */ @@ -2910,6 +2921,10 @@ } variable = null; mantissa = Double.NaN; + + if (plugins == null) { + plugins = new TreeMap<String, ASTNodePlugin>(); + } firePropertyChange(TreeNodeChangeEvent.initialValue, old, this); } @@ -4510,12 +4525,313 @@ return semanticsAnnotationList; } - public ASTNodePlugin getPlugin(String shortLabel) { - // TODO Auto-generated method stub - return null; - } - // TODO - removeSemanticsAnnotation // TODO - unsetsemanticsAnnotation + /** + * Creates a new {@link ASTNodePlugin} for the given package name or URI + * and adds it to this {@link ASTNode}. + * + * <p>If an {@link ASTNodePlugin} was already present in this {@link ASTNode} + * it will be replaced. + * + * @param nameOrUri the package name or URI + * @return a new {@link ASTNodePlugin} for the given package name or URI + */ + public ASTNodePlugin createPlugin(String nameOrUri) { + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + ASTNodePlugin sbasePlugin = packageParser.createPluginFor(this); + addExtension(nameOrUri, sbasePlugin); + return sbasePlugin; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), + nameOrUri)); + } + + /** + * Adds a {@link ASTNodePlugin} object to this {@link ASTNode}. + * + * <p>If a previous {@link ASTNodePlugin} associated with the same package + * was present before, it will be replaced. + * + * @param nameOrUri the name or URI of the package extension. + * @param sbasePlugin the {@link ASTNodePlugin} to add. + */ + public void addExtension(String nameOrUri, ASTNodePlugin sbasePlugin) { + + if (!isPackageEnabled(nameOrUri)) { + enablePackage(nameOrUri); + } + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + + // unset the previous plugin if needed + if (plugins.get(packageParser.getPackageName()) != null) { + unsetPlugin(packageParser.getPackageName()); + } + + plugins.put(packageParser.getPackageName(), sbasePlugin); + + // Making sure that the correct extendedSBase is set in the SBasePlugin + // And that all the ids and metaids are registered + if ((sbasePlugin.getExtendedASTNode() == null) || (sbasePlugin.getExtendedASTNode() != this)) { + // ((ASTNodePlugin) sbasePlugin).setPackageVersion(this); // TODO? + } + + // the package namespace and version will be set in firePropertyChange + firePropertyChange(TreeNodeChangeEvent.addExtension, null, sbasePlugin); + } else { + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.addExtensionExc"), nameOrUri)); + } + } + + /** + * Adds a {@link ASTNodePlugin} object to this {@link ASTNode}. + * + * <p>If a previous {@link ASTNodePlugin} associated with the same package + * was present before, it will be replaced. + * + * @param nameOrUri the name or URI of the package extension. + * @param sbasePlugin the {@link ASTNodePlugin} to add. + * @see #addExtension(String, ASTNodePlugin) + */ + public void addPlugin(String nameOrUri, ASTNodePlugin sbasePlugin) { + addExtension(nameOrUri, sbasePlugin); + } + + /** + * Disables the given SBML Level 3 package on this {@link SBMLDocument}. + * + * @param packageURIOrName a package namespace URI or package name + */ + public void disablePackage(String packageURIOrName) { + enablePackage(packageURIOrName, false); + } + + /** + * Enables the given SBML Level 3 package on this {@link SBMLDocument}. + * + * @param packageURIOrName a package namespace URI or package name + */ + public void enablePackage(String packageURIOrName) { + enablePackage(packageURIOrName, true); + } + + /** + * Enables or disables the given SBML Level 3 package on this + * {@link SBMLDocument}. + * + * @param packageURIOrName + * a package namespace URI or package name + * @param enabled + * a boolean to tell if the package need to be enabled or disabled. It + * {@code true} the package will be enabled, otherwise it will be + * disabled. + */ + public void enablePackage(String packageURIOrName, boolean enabled) { + SBMLDocument doc = getParentSBMLObject().getSBMLDocument(); + + if (doc != null) { + doc.enablePackage(packageURIOrName, enabled); + } else if (logger.isDebugEnabled()) { + logger.debug(resourceBundle.getString("AbstractSBase.enablePackage")); + } + } + + /** + * Returns the {@link ASTNodePlugin} object which matches this package + * name or URI. + * + * @param nameOrUri + * the package name or URI + * @return the {@link ASTNodePlugin} object which matches this package + * name or URI, + * null is returned if nothing matching the name or URI is found. + */ + public ASTNodePlugin getExtension(String nameOrUri) { + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + return plugins.get(packageParser.getPackageName()); + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), nameOrUri)); + } + + /** + * Returns the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + * + * @return the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + */ + public int getExtensionCount() { + + if (plugins != null) { + return plugins.size(); + } + + return 0; + } + +// /** +// * Returns the map containing all the {@link SBasePlugin} extension objects +// * of this {@link SBase}. +// * +// * @return the map containing all the {@link SBasePlugin} extension objects +// * of this {@link SBase}. +// */ +// public Map<String, ASTNodePlugin> getExtensionPackages() { // TODO - remove this method to prevent access to the map directly ?? Or provide a copy of the Map +// return plugins; +// } + + /** + * Returns the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + * + * @return the number of {@link ASTNodePlugin}s of this {@link ASTNode}. + */ + public int getNumPlugins() { + return getExtensionCount(); + } + + /** + * Returns an {@link ASTNodePlugin} for an SBML Level 3 package extension + * with the given package name or URI. + * <p> + * If no {@link ASTNodePlugin} is found for this package, a new + * {@link ASTNodePlugin} is created, added to this {@link ASTNode} and returned. + * + * @param nameOrUri + * the name or URI of the package + * @return an {@link ASTNodePlugin} for an SBML Level 3 package extension + * with the given package name or URI. + */ + public ASTNodePlugin getPlugin(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + ASTNodePlugin plugin = plugins.get(packageParser.getPackageName()); + if (plugin != null) { + return plugin; + } else { + return createPlugin(nameOrUri); + } + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), nameOrUri)); + } + + /** + * Returns {@code true} if this object is extended by other packages. + * + * @return {@code true} if this object is extended by other packages. + */ + public boolean isExtendedByOtherPackages() { + return !plugins.isEmpty(); + } + + /** + * Returns {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}. + * + * @param packageURIOrName + * the name or URI of the package extension. + * @return {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}, {@code false} otherwise. + */ + public boolean isPackageEnabled(String packageURIOrName) { + + SBMLDocument doc = getParentSBMLObject().getSBMLDocument(); // TODO - need to prevent NullPointerException + + if (doc != null) { + return doc.isPackageEnabled(packageURIOrName); + } + + return false; + } + + /** + * Returns {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}. + * + * @param packageURIOrName + * the name or URI of the package extension. + * @return {@code true} if the given SBML Level 3 package is enabled within + * the containing {@link SBMLDocument}, {@code false} otherwise. + * @libsbml.deprecated + * @see #isPackageEnabled(String) + */ + public boolean isPackageURIEnabled(String packageURIOrName) { + return isPackageEnabled(packageURIOrName); + } + + /** + * Returns {@code true} if an {@link ASTNodePlugin} is defined + * for the given package. + * + * @param nameOrUri the package name or URI + * @return {@code true} if an {@link ASTNodePlugin} is defined + * for the given package. + */ + public boolean isSetPlugin(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + return plugins.get(packageParser.getPackageName()) != null; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), nameOrUri)); + } + + /** + * Unsets the {@link ASTNodePlugin} extension object which matches this package + * name or URI. + * + * @param nameOrUri + * the package name or URI + */ + public void unsetExtension(String nameOrUri) { + + // use always the package name in the map + PackageParser packageParser = ParserManager.getManager().getPackageParser(nameOrUri); + + if (packageParser != null) { + + ASTNodePlugin sbasePlugin = plugins.remove(packageParser.getPackageName()); + firePropertyChange(TreeNodeChangeEvent.extension, sbasePlugin, null); + return; + } + + throw new IllegalArgumentException(MessageFormat.format( + resourceBundle.getString("AbstractSBase.createPlugin"), + nameOrUri)); + } + + /** + * Unsets the {@link ASTNodePlugin} plugin object which matches this package + * name or URI. + * + * @param nameOrUri + * the package name or URI + * @see #unsetExtension(String) + */ + public void unsetPlugin(String nameOrUri) { + unsetExtension(nameOrUri); + } + } Modified: trunk/core/src/org/sbml/jsbml/AbstractSBase.java =================================================================== --- trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2016-01-21 16:28:08 UTC (rev 2469) +++ trunk/core/src/org/sbml/jsbml/AbstractSBase.java 2016-01-21 16:34:35 UTC (rev 2470) @@ -1733,14 +1733,6 @@ if (packageParser != null) { return extensions.get(packageParser.getPackageName()) != null; - // The code below cannot be used as it is, as the package prefix/label can be pass to this method - // instead of the namespace URI - // TODO - update once the namespace is properly set on plugins - // SBasePlugin extension = extensions.get(packageParser.getPackageName()); - // if (extension != null) { - // return extension.getElementNamespace().equals(nameOrUri); - // } - // return false; } throw new IllegalArgumentException(MessageFormat.format( Modified: trunk/core/src/org/sbml/jsbml/ext/ASTNodePlugin.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ext/ASTNodePlugin.java 2016-01-21 16:28:08 UTC (rev 2469) +++ trunk/core/src/org/sbml/jsbml/ext/ASTNodePlugin.java 2016-01-21 16:34:35 UTC (rev 2470) @@ -68,7 +68,7 @@ * * @return the object that is extended by this plug-in. */ - public TreeNode getExtendedSBase(); + public TreeNode getExtendedASTNode(); /** * Returns the SBML level of this plugin object. @@ -144,7 +144,7 @@ * * @return true if an extended TreeNode has been set. */ - public boolean isSetExtendedSBase(); + public boolean isSetExtendedASTNode(); /** * Returns {@code true} if a package version is set, {@code false} otherwise. Added: trunk/core/src/org/sbml/jsbml/ext/AbstractASTNodePlugin.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ext/AbstractASTNodePlugin.java (rev 0) +++ trunk/core/src/org/sbml/jsbml/ext/AbstractASTNodePlugin.java 2016-01-21 16:34:35 UTC (rev 2470) @@ -0,0 +1,361 @@ +/* + * $Id$ + * $URL$ + * + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2016 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext; + +import java.text.MessageFormat; +import java.util.Map; +import java.util.TreeMap; + +import javax.swing.tree.TreeNode; + +import org.apache.log4j.Logger; +import org.sbml.jsbml.ASTNode; +import org.sbml.jsbml.AbstractTreeNode; +import org.sbml.jsbml.SBMLDocument; +import org.sbml.jsbml.SBase; +import org.sbml.jsbml.util.TreeNodeChangeEvent; + +/** + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.2 + */ +public abstract class AbstractASTNodePlugin extends AbstractTreeNode implements ASTNodePlugin { + + /** + * Generated serial version identifier. + */ + private static final long serialVersionUID = 3741496965840142920L; + + /** + * + */ + private static final transient Logger logger = Logger.getLogger(AbstractASTNodePlugin.class); + + /** + * + */ + protected ASTNode extendedASTNode; + + /** + * + */ + protected int packageVersion = -1; + + /** + * + */ + protected String elementNamespace; + + /** + * + */ + public AbstractASTNodePlugin() { + super(); + } + + /** + * @param extendedASTNode + */ + public AbstractASTNodePlugin(ASTNode extendedASTNode) { + this(); + this.extendedASTNode = extendedASTNode; + } + + /** + * This method will need to be further tested + * @param plugin + */ + public AbstractASTNodePlugin(ASTNodePlugin plugin) { + super(plugin); + setPackageVersion(plugin.getPackageVersion()); + setNamespace(plugin.getElementNamespace()); + + // the extendedASTNode will be set when the cloned ASTNodePlugin is added inside an ASTNode + // then the ids of his children will be registered in the correct maps. + extendedASTNode = null; + } + + /* (non-Javadoc) + * @see java.lang.Object#clone() + */ + @Override + public abstract ASTNodePlugin clone(); + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object object) { + // Check all child nodes recursively: + boolean equal = super.equals(object); + return equal; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractTreeNode#fireNodeAddedEvent() + */ + @Override + public void fireNodeAddedEvent() { + // TODO - see if we need to overwrite this method + super.fireNodeAddedEvent(); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractTreeNode#fireNodeRemovedEvent() + */ + @Override + public void fireNodeRemovedEvent() { + // TODO - see if we need to overwrite this method + super.fireNodeRemovedEvent(); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractTreeNode#firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) + */ + @Override + public void firePropertyChange(String propertyName, Object oldValue, + Object newValue) { + + // TODO - check if we need this method for ASTNode + + // TODO - this method is used to add or remove ASTNode or ASTNodePlugin, we should make sure to handle the registration/un-registration + // in those cases. + // the parent need to be set or unset as well (would be done, if we call the registerChild method) + +// if (oldValue != null && oldValue instanceof SBase && isSetExtendedASTNode()) { +// extendedASTNode.unregisterChild((SBase) oldValue); +// } + + // This case is generally handled properly in the setters + // but it would be better and more consistent to handle it there + // if (newValue != null && newValue instanceof SBase && isSetExtendedASTNode()) { + // extendedASTNode.registerChild((SBase) newValue); + // } + + super.firePropertyChange(propertyName, oldValue, newValue); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#getElementNamespace() + */ + @Override + public String getElementNamespace() { + return elementNamespace; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#getExtendedASTNode() + */ + @Override + public ASTNode getExtendedASTNode() { + return extendedASTNode; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#getLevel() + */ + @Override + public int getLevel() { + if (isSetExtendedASTNode()) { + SBase parentSBase = extendedASTNode.getParentSBMLObject(); + + if (parentSBase != null) { + return parentSBase.getLevel(); + } + } + + return -1; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#getPackageVersion() + */ + @Override + public int getPackageVersion() { + return packageVersion; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#getParentSBMLObject() + */ + @Override + public SBase getParentSBMLObject() { // TODO + return (SBase) getParent(); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#getSBMLDocument() + */ + @Override + public SBMLDocument getSBMLDocument() { + if (isSetExtendedASTNode()) { + SBase parentSBase = extendedASTNode.getParentSBMLObject(); + + if (parentSBase != null) { + return parentSBase.getSBMLDocument(); + } + } + + return null; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#getVersion() + */ + @Override + public int getVersion() { + if (isSetExtendedASTNode()) { + SBase parentSBase = extendedASTNode.getParentSBMLObject(); + + if (parentSBase != null) { + return parentSBase.getVersion(); + } + } + + return -1; + } + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + // A constant and arbitrary, sufficiently large prime number: + final int prime = 769; + int hashCode = super.hashCode(); + if (isSetExtendedASTNode()) { + hashCode += prime * getExtendedASTNode().hashCode(); + } + return hashCode; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#isSetExtendedASTNode() + */ + @Override + public boolean isSetExtendedASTNode() { + return extendedASTNode != null; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#isSetPackageVersion() + */ + @Override + public boolean isSetPackageVersion() { + return packageVersion > 0; + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.AbstractTreeNode#removeFromParent() + */ + @Override + public boolean removeFromParent() { + + if (isSetExtendedASTNode()) { + int n = extendedASTNode.getExtensionCount(); + extendedASTNode.unsetExtension(getPackageName()); + + return n > extendedASTNode.getExtensionCount(); + } + + return super.removeFromParent(); + } + + /** + * Sets the XML namespace to which this {@link ASTNodePlugin} 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 ASTNodePlugin} belong. + */ + public void setNamespace(String namespace) { + + if ((elementNamespace != null) && (namespace != null) && (!elementNamespace.equals(namespace))) { + // if we implement proper conversion some days, we need to unset the namespace before changing it. + logger.error(MessageFormat.format("An ASTNodePlugin element cannot belong to two different namespaces! Current namespace = ''{0}'', new namespace = ''{1}''", elementNamespace, namespace)); + } + String old = elementNamespace; + elementNamespace = namespace; + + firePropertyChange(TreeNodeChangeEvent.namespace, old, namespace); + } + + /** + * Sets the extended {@link ASTNode}. + * + * <p>This method should not be called in general but it is necessary + * to use it after cloning an {@link ASTNodePlugin} to be able to set properly + * the new parent/extended {@link ASTNode}. + * + * + * @param extendedASTNode + */ + public void setExtendedASTNode(ASTNode extendedASTNode) { + + // TODO - unregister children if extendedASTNode was not null !!?? + // Or do we throw an exception asking to clone the object instead ?? + ASTNode oldExtendedASTNode = this.extendedASTNode; + this.extendedASTNode = extendedASTNode; + + // changes in AbstractSBase#firePropertyChange might make this code unnecessary but we would need to update all the code + // to remove calls to registerChild that won't be necessary anymore and that would print a warning message + if (getChildCount() > 0) { + for (int i = 0; i < getChildCount(); i++) { + TreeNode child = getChildAt(i); + + if (child instanceof SBase) { + // this.extendedASTNode.registerChild((SBase) child); // TODO - check if we need to do that for ASTNode ? + // At the moment, no package plan to add more that attributes + // TODO - if an error occur, we might have to unregister the first children, from i - 1 down to 0 ? + } + } + } + + firePropertyChange("extendedASTNode", oldExtendedASTNode, extendedASTNode); + } + + /* (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#setPackageVersion(int) + */ + @Override + public void setPackageVersion(int packageVersion) { + int oldVersion = this.packageVersion; + this.packageVersion = packageVersion; + firePropertyChange("packageVersion", oldVersion, packageVersion); + } + + /* + * (non-Javadoc) + * @see org.sbml.jsbml.ext.ASTNodePlugin#writeXMLAttributes() + */ + @Override + public Map<String, String> writeXMLAttributes() { + return new TreeMap<String, String>(); + } + +} Property changes on: trunk/core/src/org/sbml/jsbml/ext/AbstractASTNodePlugin.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-01-21 16:28:11
|
Revision: 2469 http://sourceforge.net/p/jsbml/code/2469 Author: niko-rodrigue Date: 2016-01-21 16:28:08 +0000 (Thu, 21 Jan 2016) Log Message: ----------- corrected the MultiParser class so that the ASTNode multi attributes are read properly and so that it write correctly 'listOfSpeciesTypeComponentIndexes' + made MultiASTNodePlugin extends AbstractASTNodePlugin Modified Paths: -------------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiASTNodePlugin.java trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiASTNodePlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiASTNodePlugin.java 2016-01-21 15:37:40 UTC (rev 2468) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiASTNodePlugin.java 2016-01-21 16:28:08 UTC (rev 2469) @@ -5,7 +5,7 @@ * 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: + * Copyright (C) 2009-2016 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 @@ -24,7 +24,11 @@ import java.util.HashMap; import java.util.Map; +import javax.swing.tree.TreeNode; + +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.SBMLException; +import org.sbml.jsbml.ext.AbstractASTNodePlugin; /** * @@ -32,7 +36,7 @@ * @version $Rev$ * @since 1.1 */ -public class MultiASTNodePlugin { +public class MultiASTNodePlugin extends AbstractASTNodePlugin { /** * @@ -48,9 +52,24 @@ * */ public MultiASTNodePlugin() { - // TODO + super(); } + public MultiASTNodePlugin(MultiASTNodePlugin multiASTNodePlugin) { + super(multiASTNodePlugin); + + if (multiASTNodePlugin.isSetRepresentationType()) { + setRepresentationType(multiASTNodePlugin.getRepresentationType()); + } + if (multiASTNodePlugin.isSetSpeciesReference()) { + setSpeciesReference(multiASTNodePlugin.getSpeciesReference()); + } + } + + public MultiASTNodePlugin(ASTNode astNode) { + super(astNode); + } + /** * Returns the value of {@link #speciesReference}. * @@ -84,7 +103,7 @@ public void setSpeciesReference(String speciesReference) { String oldSpeciesReference = this.speciesReference; this.speciesReference = speciesReference; - // firePropertyChange(MultiConstants.speciesReference, oldSpeciesReference, this.speciesReference); + firePropertyChange(MultiConstants.speciesReference, oldSpeciesReference, this.speciesReference); } @@ -97,7 +116,7 @@ if (isSetSpeciesReference()) { String oldSpeciesReference = speciesReference; speciesReference = null; - // firePropertyChange(MultiConstants.speciesReference, oldSpeciesReference, this.speciesReference); + firePropertyChange(MultiConstants.speciesReference, oldSpeciesReference, this.speciesReference); return true; } return false; @@ -111,13 +130,9 @@ * @return the value of {@link #representationType}. */ public RepresentationType getRepresentationType() { - //TODO: if variable is boolean, create an additional "isVar" - //TODO: return primitive data type if possible (e.g., int instead of Integer) if (isSetRepresentationType()) { return representationType; } - // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. - // throw new PropertyUndefinedError(MultiConstants.representationType, this); return null; } @@ -141,7 +156,7 @@ public void setRepresentationType(RepresentationType representationType) { RepresentationType oldRepresentationType = this.representationType; this.representationType = representationType; - // firePropertyChange(MultiConstants.representationType, oldRepresentationType, this.representationType); + firePropertyChange(MultiConstants.representationType, oldRepresentationType, this.representationType); } @@ -154,7 +169,7 @@ if (isSetRepresentationType()) { RepresentationType oldRepresentationType = representationType; representationType = null; - // firePropertyChange(MultiConstants.representationType, oldRepresentationType, this.representationType); + firePropertyChange(MultiConstants.representationType, oldRepresentationType, this.representationType); return true; } return false; @@ -209,8 +224,8 @@ */ @Override public int hashCode() { - final int prime = 31; - int result = 1; + final int prime = 857; + int result = super.hashCode(); result = prime * result + ((representationType == null) ? 0 : representationType.hashCode()); result = prime * result @@ -227,12 +242,11 @@ if (this == obj) { return true; } - if (obj == null) { + + if (! super.equals(obj)) { return false; } - if (getClass() != obj.getClass()) { - return false; - } + MultiASTNodePlugin other = (MultiASTNodePlugin) obj; if (representationType != other.representationType) { return false; @@ -257,5 +271,40 @@ + ", representationType=" + representationType + "]"; } + @Override + public String getPackageName() { + return MultiConstants.packageName; + } + @Override + public String getPrefix() { + return MultiConstants.packageName; + } + + @Override + public String getURI() { + return getElementNamespace(); + } + + @Override + public TreeNode getChildAt(int childIndex) { + return null; + } + + @Override + public int getChildCount() { + return 0; + } + + @Override + public boolean getAllowsChildren() { + return false; + } + + @Override + public MultiASTNodePlugin clone() { + return new MultiASTNodePlugin(this); + } + + } Modified: trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java 2016-01-21 15:37:40 UTC (rev 2468) +++ trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java 2016-01-21 16:28:08 UTC (rev 2469) @@ -44,6 +44,7 @@ import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.multi.IntraSpeciesReaction; +import org.sbml.jsbml.ext.multi.MultiASTNodePlugin; import org.sbml.jsbml.ext.multi.MultiCompartmentPlugin; import org.sbml.jsbml.ext.multi.MultiConstants; import org.sbml.jsbml.ext.multi.MultiModelPlugin; @@ -152,7 +153,7 @@ } } else if (contextObject instanceof ASTNode) { contextObject = ((ASTNode) contextObject).getPlugin(getShortLabel()); - } // TODO - ASTNode2 ? + } // TODO - ASTNode2 when it is used for reading. super.processAttribute(elementName, attributeName, value, uri, prefix, isLastAttribute, contextObject); } @@ -281,7 +282,9 @@ if (xmlObject.isSetName() && xmlObject.getName().equals("listOfBindingSiteSpeciesTypes")) { xmlObject.setName(MultiConstants.listOfSpeciesTypes); } - + else if (xmlObject.isSetName() && xmlObject.getName().equals("listOfSpeciesTypeComponentIndexs")) { + xmlObject.setName(MultiConstants.listOfSpeciesTypeComponentIndexes); + } // listOfIntraSpeciesReactions cannot happen as core ListOf don't depend on the first element for their name. if (logger.isDebugEnabled()) { @@ -343,7 +346,7 @@ public ASTNodePlugin createPluginFor(ASTNode astNode) { if (astNode != null) { - return null; // TODO + return new MultiASTNodePlugin(astNode); } return null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-01-21 15:37:42
|
Revision: 2468 http://sourceforge.net/p/jsbml/code/2468 Author: niko-rodrigue Date: 2016-01-21 15:37:40 +0000 (Thu, 21 Jan 2016) Log Message: ----------- corrected the MultiSpeciesPlugin 'readAttribute' method as it was not reading any atttributes Modified Paths: -------------- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java Modified: trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java 2016-01-19 13:52:26 UTC (rev 2467) +++ trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesPlugin.java 2016-01-21 15:37:40 UTC (rev 2468) @@ -648,18 +648,13 @@ @Override public boolean readAttribute(String attributeName, String prefix, String value) { - boolean isAttributeRead = true; - if (!isAttributeRead) { + if (attributeName.equals(MultiConstants.speciesType)) { + setSpeciesType(value); + return true; + } - if (attributeName.equals(MultiConstants.speciesType)) { - setSpeciesType(value); - } - else { - isAttributeRead = false; - } - } - return isAttributeRead; + return false; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-01-19 13:52:30
|
Revision: 2467 http://sourceforge.net/p/jsbml/code/2467 Author: niko-rodrigue Date: 2016-01-19 13:52:26 +0000 (Tue, 19 Jan 2016) Log Message: ----------- added a new method in the PackageParser interface to create an ASTNodePlugin from a given ASTNode Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ASTNode.java trunk/core/src/org/sbml/jsbml/xml/parsers/AbstractReaderWriter.java trunk/core/src/org/sbml/jsbml/xml/parsers/PackageParser.java trunk/core/test/org/sbml/jsbml/test/TestInfixReadingWriting.java trunk/extensions/arrays/src/org/sbml/jsbml/xml/parsers/ArraysParser.java trunk/extensions/comp/src/org/sbml/jsbml/xml/parsers/CompParser.java trunk/extensions/distrib/src/org/sbml/jsbml/xml/parsers/DistribParser.java trunk/extensions/dyn/src/org/sbml/jsbml/xml/parsers/DynParser.java trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java trunk/extensions/groups/src/org/sbml/jsbml/xml/parsers/GroupsParser.java trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/LayoutParser.java trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java trunk/extensions/qual/src/org/sbml/jsbml/xml/parsers/QualParser.java trunk/extensions/render/src/org/sbml/jsbml/xml/parsers/RenderParser.java trunk/extensions/req/src/org/sbml/jsbml/xml/parsers/ReqParser.java trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -32,6 +32,7 @@ import javax.xml.stream.XMLStreamException; import org.apache.log4j.Logger; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.math.ASTFactory; import org.sbml.jsbml.math.ASTNode2; import org.sbml.jsbml.text.parser.FormulaParser; @@ -4509,6 +4510,11 @@ return semanticsAnnotationList; } + public ASTNodePlugin getPlugin(String shortLabel) { + // TODO Auto-generated method stub + return null; + } + // TODO - removeSemanticsAnnotation // TODO - unsetsemanticsAnnotation Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/AbstractReaderWriter.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/AbstractReaderWriter.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/AbstractReaderWriter.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -36,6 +36,7 @@ import org.sbml.jsbml.ListOf; import org.sbml.jsbml.SBMLDocument; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.util.ListOfWithName; import org.sbml.jsbml.xml.XMLAttributes; @@ -92,6 +93,10 @@ { isAttributeRead = ((SBasePlugin) contextObject).readAttribute(attributeName, prefix, value); } + else if (contextObject instanceof ASTNodePlugin) + { + isAttributeRead = ((ASTNodePlugin) contextObject).readAttribute(attributeName, prefix, value); + } if (!isAttributeRead) { logger.warn(MessageFormat.format( Modified: trunk/core/src/org/sbml/jsbml/xml/parsers/PackageParser.java =================================================================== --- trunk/core/src/org/sbml/jsbml/xml/parsers/PackageParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/core/src/org/sbml/jsbml/xml/parsers/PackageParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -23,7 +23,9 @@ import java.util.List; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; /** @@ -46,6 +48,15 @@ public SBasePlugin createPluginFor(SBase sbase); /** + * Creates a new {@link ASTNodePlugin} for the given {@link ASTNode} + * and add it to the {@link ASTNodePlugin} map of the {@link ASTNode}. + * + * @param sbase - the astNode for which you want to create an {@link ASTNodePlugin} + * @return a new {@link ASTNodePlugin} corresponding to the given {@link ASTNode}. + */ + public ASTNodePlugin createPluginFor(ASTNode astNode); + + /** * Gets the namespace for this package that correspond to the given SBML level, version * and the package version. * Modified: trunk/core/test/org/sbml/jsbml/test/TestInfixReadingWriting.java =================================================================== --- trunk/core/test/org/sbml/jsbml/test/TestInfixReadingWriting.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/core/test/org/sbml/jsbml/test/TestInfixReadingWriting.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -149,7 +149,7 @@ System.out.println("\n"); if (different) { - differences.add("input= '" + infixInput + "', output = '" + infixOutput + "' (expected output = '" + infixExpectedOutput + "')"); + differences.add("input= '" + infixInput + "', output = '" + infixOutput + "' (expected output = '" + infixExpectedOutput + "') (" + fileName + ")"); } if (different && (infixInput.indexOf("%") == -1) && (infixExpectedOutput.indexOf("arc") == -1)) { difference2s.add("input= '" + infixInput + "', output = '" + infixOutput + "' (expected output = '" + infixExpectedOutput + "')"); Modified: trunk/extensions/arrays/src/org/sbml/jsbml/xml/parsers/ArraysParser.java =================================================================== --- trunk/extensions/arrays/src/org/sbml/jsbml/xml/parsers/ArraysParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/arrays/src/org/sbml/jsbml/xml/parsers/ArraysParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -26,8 +26,10 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.arrays.ArraysConstants; import org.sbml.jsbml.ext.arrays.ArraysSBasePlugin; @@ -181,5 +183,12 @@ xmlObject.setName(ArraysConstants.listOfIndices); } } + + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } Modified: trunk/extensions/comp/src/org/sbml/jsbml/xml/parsers/CompParser.java =================================================================== --- trunk/extensions/comp/src/org/sbml/jsbml/xml/parsers/CompParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/comp/src/org/sbml/jsbml/xml/parsers/CompParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -31,12 +31,14 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.JSBML; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.Model; import org.sbml.jsbml.SBMLDocument; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.comp.CompConstants; import org.sbml.jsbml.ext.comp.CompModelPlugin; @@ -370,5 +372,11 @@ return null; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } Modified: trunk/extensions/distrib/src/org/sbml/jsbml/xml/parsers/DistribParser.java =================================================================== --- trunk/extensions/distrib/src/org/sbml/jsbml/xml/parsers/DistribParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/distrib/src/org/sbml/jsbml/xml/parsers/DistribParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -32,6 +32,7 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.FunctionDefinition; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.SBMLDocument; @@ -39,6 +40,7 @@ import org.sbml.jsbml.SBMLReader; import org.sbml.jsbml.SBMLWriter; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.distrib.DistribConstants; import org.sbml.jsbml.ext.distrib.DistribFunctionDefinitionPlugin; @@ -400,5 +402,11 @@ } return null; } + + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } } Modified: trunk/extensions/dyn/src/org/sbml/jsbml/xml/parsers/DynParser.java =================================================================== --- trunk/extensions/dyn/src/org/sbml/jsbml/xml/parsers/DynParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/dyn/src/org/sbml/jsbml/xml/parsers/DynParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -27,6 +27,7 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.Compartment; import org.sbml.jsbml.Event; @@ -35,6 +36,7 @@ import org.sbml.jsbml.ListOf; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.dyn.DynCompartmentPlugin; import org.sbml.jsbml.ext.dyn.DynConstants; @@ -331,4 +333,10 @@ return null; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } Modified: trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -32,6 +32,7 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.Model; import org.sbml.jsbml.Reaction; @@ -41,6 +42,7 @@ import org.sbml.jsbml.SBMLWriter; import org.sbml.jsbml.SBase; import org.sbml.jsbml.Species; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.fbc.And; import org.sbml.jsbml.ext.fbc.FBCConstants; @@ -535,4 +537,10 @@ return null; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } Modified: trunk/extensions/groups/src/org/sbml/jsbml/xml/parsers/GroupsParser.java =================================================================== --- trunk/extensions/groups/src/org/sbml/jsbml/xml/parsers/GroupsParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/groups/src/org/sbml/jsbml/xml/parsers/GroupsParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -26,9 +26,11 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.Model; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.groups.Group; import org.sbml.jsbml.ext.groups.GroupsConstants; @@ -217,4 +219,10 @@ return null; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } Modified: trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -56,10 +56,12 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.Model; import org.sbml.jsbml.SBMLDocument; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.layout.BoundingBox; import org.sbml.jsbml.ext.layout.CompartmentGlyph; @@ -527,4 +529,10 @@ return null; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } Modified: trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/LayoutParser.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/LayoutParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/LayoutParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -33,6 +33,7 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.Annotation; import org.sbml.jsbml.JSBML; @@ -40,6 +41,7 @@ import org.sbml.jsbml.Model; import org.sbml.jsbml.SBMLDocument; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.layout.BoundingBox; import org.sbml.jsbml.ext.layout.CompartmentGlyph; @@ -866,4 +868,10 @@ return false; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } Modified: trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java =================================================================== --- trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -30,6 +30,7 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.Compartment; import org.sbml.jsbml.JSBML; @@ -40,6 +41,7 @@ import org.sbml.jsbml.SimpleSpeciesReference; import org.sbml.jsbml.Species; import org.sbml.jsbml.SpeciesReference; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.multi.IntraSpeciesReaction; import org.sbml.jsbml.ext.multi.MultiCompartmentPlugin; @@ -148,8 +150,10 @@ if (!(contextObject instanceof SBMLDocument)) { contextObject = ((SBase) contextObject).getPlugin(getShortLabel()); } - } - + } else if (contextObject instanceof ASTNode) { + contextObject = ((ASTNode) contextObject).getPlugin(getShortLabel()); + } // TODO - ASTNode2 ? + super.processAttribute(elementName, attributeName, value, uri, prefix, isLastAttribute, contextObject); } @@ -335,5 +339,14 @@ return null; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + if (astNode != null) { + return null; // TODO + } + + return null; + } + } Modified: trunk/extensions/qual/src/org/sbml/jsbml/xml/parsers/QualParser.java =================================================================== --- trunk/extensions/qual/src/org/sbml/jsbml/xml/parsers/QualParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/qual/src/org/sbml/jsbml/xml/parsers/QualParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -29,9 +29,11 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.Model; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.qual.FunctionTerm; import org.sbml.jsbml.ext.qual.Input; @@ -333,5 +335,10 @@ return null; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } } Modified: trunk/extensions/render/src/org/sbml/jsbml/xml/parsers/RenderParser.java =================================================================== --- trunk/extensions/render/src/org/sbml/jsbml/xml/parsers/RenderParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/render/src/org/sbml/jsbml/xml/parsers/RenderParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -26,8 +26,10 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.layout.BoundingBox; import org.sbml.jsbml.ext.layout.Layout; @@ -317,4 +319,10 @@ return false; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } Modified: trunk/extensions/req/src/org/sbml/jsbml/xml/parsers/ReqParser.java =================================================================== --- trunk/extensions/req/src/org/sbml/jsbml/xml/parsers/ReqParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/req/src/org/sbml/jsbml/xml/parsers/ReqParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -28,8 +28,10 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.SBase; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.req.ReqConstants; import org.sbml.jsbml.ext.req.ReqSBasePlugin; @@ -214,4 +216,11 @@ return null; } + + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2016-01-19 12:55:54 UTC (rev 2466) +++ trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java 2016-01-19 13:52:26 UTC (rev 2467) @@ -26,6 +26,7 @@ import org.apache.log4j.Logger; import org.mangosdk.spi.ProviderFor; +import org.sbml.jsbml.ASTNode; import org.sbml.jsbml.Compartment; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.Model; @@ -33,6 +34,7 @@ import org.sbml.jsbml.Reaction; import org.sbml.jsbml.SBase; import org.sbml.jsbml.Species; +import org.sbml.jsbml.ext.ASTNodePlugin; import org.sbml.jsbml.ext.SBasePlugin; import org.sbml.jsbml.ext.spatial.AdjacentDomains; import org.sbml.jsbml.ext.spatial.AdvectionCoefficient; @@ -606,4 +608,10 @@ return null; } + @Override + public ASTNodePlugin createPluginFor(ASTNode astNode) { + // This package does not extends ASTNode + return null; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2016-01-19 12:55:57
|
Revision: 2466 http://sourceforge.net/p/jsbml/code/2466 Author: niko-rodrigue Date: 2016-01-19 12:55:54 +0000 (Tue, 19 Jan 2016) Log Message: ----------- added the ASTNodePlugin class Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ext/SBasePlugin.java Added Paths: ----------- trunk/core/src/org/sbml/jsbml/ext/ASTNodePlugin.java Added: trunk/core/src/org/sbml/jsbml/ext/ASTNodePlugin.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ext/ASTNodePlugin.java (rev 0) +++ trunk/core/src/org/sbml/jsbml/ext/ASTNodePlugin.java 2016-01-19 12:55:54 UTC (rev 2466) @@ -0,0 +1,195 @@ +/* + * $Id$ + * $URL$ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2016 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ + +package org.sbml.jsbml.ext; + +import java.util.Map; + +import javax.swing.tree.TreeNode; + +import org.sbml.jsbml.ASTNode; +import org.sbml.jsbml.SBMLDocument; +import org.sbml.jsbml.SBase; +import org.sbml.jsbml.math.ASTNode2; +import org.sbml.jsbml.util.TreeNodeWithChangeSupport; + + +/** + * Defines the methods necessary for an {@link ASTNode} or {@link ASTNode2} Plugin. When a SBML level 3 is + * extending one of the mathML elements with additional attributes or child + * elements, a {@link ASTNodePlugin} is created to serve as a place holder for + * these new attributes or elements. + * + * @author Nicolas Rodriguez + * @version $Rev$ + * @since 1.2 + */ +public interface ASTNodePlugin extends TreeNodeWithChangeSupport { + + /** + * Creates a new instance of {@link ASTNodePlugin} from this {@link ASTNodePlugin}. + * + * @return a new instance of {@link ASTNodePlugin} from this {@link ASTNodePlugin}. + */ + public ASTNodePlugin clone(); + + @Override + public boolean equals(Object obj); + + /** + * Returns the XML namespace (URI) of the package extension of this plugin object. + * + * @return the URI of the package extension of this plugin object. + * @see #getURI() + */ + public String getElementNamespace(); + + /** + * Returns the object that is extended by this plug-in. + * + * @return the object that is extended by this plug-in. + */ + public TreeNode getExtendedSBase(); + + /** + * Returns the SBML level of this plugin object. + * + * @return the SBML level of this plugin object. + * @see SBase#getLevel() + */ + public int getLevel(); + + /** + * Returns the package name of this plugin object. + * + * @return the package name of this plugin object. + */ + public String getPackageName(); + + /** + * Returns the package version of the package extension of this plugin object. + * + * @return the package version of the package extension of this plugin object. + */ + public int getPackageVersion(); + + + /** + * Returns the parent {@link SBase} object to which this plugin object is connected. + * + * @return the parent {@link SBase} object to which this plugin object is connected. + */ + public SBase getParentSBMLObject(); + + /** + * Returns the prefix of the package extension of this plugin object. + * + * @return the prefix of the package extension of this plugin object. + */ + public String getPrefix(); + + /** + * Returns the parent {@link SBMLDocument} of this plugin object. + * + * @return the parent {@link SBMLDocument} object of this plugin object. + */ + public SBMLDocument getSBMLDocument(); + + /** + * Gets the URI to which this element belongs to. + * For example, all elements that belong to SBML Level 3 + * Version 1 Core must have the URI + * 'http://www.sbml.org/sbml/level3/version1/core'; all + * elements that belong to Layout Extension Version 1 for + * SBML Level 3 Version 1 Core must would have the URI + * 'http://www.sbml.org/sbml/level3/version1/layout/version1/'. + * + * @return the URI for this element + * @see #getElementNamespace() + */ + public String getURI(); + + /** + * Returns the SBML version of this plugin object. + * + * @return the SBML version of this plugin object. + * @see SBase#getVersion() + */ + public int getVersion(); + + @Override + public int hashCode(); + + /** + * Checks whether an extended TreeNode has been set. + * + * @return true if an extended TreeNode has been set. + */ + public boolean isSetExtendedSBase(); + + /** + * Returns {@code true} if a package version is set, {@code false} otherwise. + * + * @return {@code true} if a package version is set, {@code false} otherwise. + */ + public abstract boolean isSetPackageVersion(); + + /** + * Reads and sets the attribute if it is know from this {@link SBasePlugin}. + * + * @param attributeName + * localName of the XML attribute + * @param prefix + * prefix of the XML attribute + * @param value + * value of the XML attribute + * @return {@code true} if the attribute has been successfully read. + */ + public boolean readAttribute(String attributeName, String prefix, String value); + + /** + * Sets the package version. + * + * @param packageVersion the packageVersion to set + */ + public abstract void setPackageVersion(int packageVersion); + + /** + * Returns a {@link Map} containing the XML attributes of this object. + * + * @return a {@link Map} containing the XML attributes of this object. + */ + public Map<String, String> writeXMLAttributes(); + + // /** + // * Sets the XML namespace to which this element belongs to. + // * For example, all elements that belong to SBML Level 3 Version 1 Core + // * must set the namespace to 'http://www.sbml.org/sbml/level3/version1/core'; + // * all elements that belong to Layout Extension Version 1 for SBML Level 3 + // * Version 1 Core must set the namespace to + // * 'http://www.sbml.org/sbml/level3/version1/layout/version1/' + // * @param uri + // * @return boolean indicating success/failure of the function. The possible values returned by this function are: + // */ + // public boolean setElementNamespace(String uri); + +} Property changes on: trunk/core/src/org/sbml/jsbml/ext/ASTNodePlugin.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/core/src/org/sbml/jsbml/ext/SBasePlugin.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ext/SBasePlugin.java 2016-01-12 21:18:13 UTC (rev 2465) +++ trunk/core/src/org/sbml/jsbml/ext/SBasePlugin.java 2016-01-19 12:55:54 UTC (rev 2466) @@ -29,10 +29,10 @@ import org.sbml.jsbml.util.TreeNodeWithChangeSupport; /** - * Defines the methods necessary for an SBase Plugin. When a SBML level 3 is + * Defines the methods necessary for an {@link SBase} Plugin. When an SBML level 3 package is * extending one of the core SBML elements with additional attributes or child - * elements, a {@link SBasePlugin} is created to serve as a place holder for - * there new attributes or elements. + * elements, an {@link SBasePlugin} is created to serve as a place holder for + * these new attributes or elements. * * @author Nicolas Rodriguez * @version $Rev$ @@ -47,17 +47,14 @@ */ public SBasePlugin clone(); - /** - * - * @param obj - * @return - */ @Override public boolean equals(Object obj); /** * Returns the XML namespace (URI) of the package extension of this plugin object. + * * @return the URI of the package extension of this plugin object. + * @see #getURI() */ public String getElementNamespace(); @@ -69,20 +66,23 @@ public SBase getExtendedSBase(); /** + * Returns the SBML level of this plugin object. * - * @return + * @return the SBML level of this plugin object. * @see SBase#getLevel() */ public int getLevel(); /** * Returns the package name of this plugin object. + * * @return the package name of this plugin object. */ public String getPackageName(); /** * Returns the package version of the package extension of this plugin object. + * * @return the package version of the package extension of this plugin object. */ public int getPackageVersion(); @@ -97,54 +97,54 @@ /** * Returns the prefix of the package extension of this plugin object. + * * @return the prefix of the package extension of this plugin object. */ public String getPrefix(); /** * Returns the parent {@link SBMLDocument} of this plugin object. + * * @return the parent {@link SBMLDocument} object of this plugin object. */ public SBMLDocument getSBMLDocument(); /** * Gets the URI to which this element belongs to. + * * For example, all elements that belong to SBML Level 3 - * Version 1 Core must would have the URI + * Version 1 Core must have the URI * 'http://www.sbml.org/sbml/level3/version1/core'; all * elements that belong to Layout Extension Version 1 for - * SBML Level 3 Version 1 Core must would have the URI + * SBML Level 3 Version 1 Core must have the URI * 'http://www.sbml.org/sbml/level3/version1/layout/version1/' - * Unlike getElementNamespace, this function first returns - * the URI for this element by looking into the SBMLNamespaces - * object of the document with the its package name. - * If not found it will return the result of getElementNamespace + * * @return the URI for this element + * @see #getElementNamespace() */ public String getURI(); /** + * Returns the SBML version of this plugin object. * - * @return + * @return the SBML version of this plugin object. * @see SBase#getVersion() */ public int getVersion(); - /** - * - * @return - */ @Override public int hashCode(); /** * Check whether an extended SBase has been set. * - * @return + * @return true if an extended SBase has been set. */ public boolean isSetExtendedSBase(); /** + * Returns {@code true} if a package version is set, {@code false} otherwise. + * * @return {@code true} if a package version is set, {@code false} otherwise. */ public abstract boolean isSetPackageVersion(); @@ -163,6 +163,8 @@ public boolean readAttribute(String attributeName, String prefix, String value); /** + * Sets the package version. + * * @param packageVersion the packageVersion to set */ public abstract void setPackageVersion(int packageVersion); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2016-01-12 21:18:22
|
Revision: 2465 http://sourceforge.net/p/jsbml/code/2465 Author: andreas-draeger Date: 2016-01-12 21:18:13 +0000 (Tue, 12 Jan 2016) Log Message: ----------- Updated year to 2016 in all license headers. Modified Paths: -------------- trunk/LICENSE.txt trunk/NEWS.txt trunk/README.txt trunk/build.xml trunk/core/build.xml trunk/core/pom.xml trunk/core/resources/log4j.properties trunk/core/resources/org/sbml/jsbml/resources/Messages.xml trunk/core/resources/org/sbml/jsbml/resources/cfg/ASTNodeTokens.xml trunk/core/resources/org/sbml/jsbml/resources/cfg/Alias2SBO.cfg trunk/core/resources/org/sbml/jsbml/resources/cfg/HTML_CharEncodingTable.txt trunk/core/resources/org/sbml/jsbml/resources/cfg/Messages.xml trunk/core/resources/org/sbml/jsbml/resources/cfg/SBMLCoreElements.xml trunk/core/resources/org/sbml/jsbml/resources/cfg/SBMLElementsLevel1Version1.xml trunk/core/resources/org/sbml/jsbml/resources/cfg/annotationParsers.xml trunk/core/src/org/sbml/jsbml/ASTNode.java trunk/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode trunk/core/src/org/sbml/jsbml/AbstractMathContainer.java trunk/core/src/org/sbml/jsbml/AbstractNamedSBase.java trunk/core/src/org/sbml/jsbml/AbstractNamedSBaseWithUnit.java trunk/core/src/org/sbml/jsbml/AbstractSBase.java trunk/core/src/org/sbml/jsbml/AbstractTreeNode.java trunk/core/src/org/sbml/jsbml/AlgebraicRule.java trunk/core/src/org/sbml/jsbml/Annotation.java trunk/core/src/org/sbml/jsbml/AnnotationElement.java trunk/core/src/org/sbml/jsbml/Assignment.java trunk/core/src/org/sbml/jsbml/AssignmentRule.java trunk/core/src/org/sbml/jsbml/CVTerm.java trunk/core/src/org/sbml/jsbml/CallableSBase.java trunk/core/src/org/sbml/jsbml/Compartment.java trunk/core/src/org/sbml/jsbml/CompartmentType.java trunk/core/src/org/sbml/jsbml/CompartmentalizedSBase.java trunk/core/src/org/sbml/jsbml/Constraint.java trunk/core/src/org/sbml/jsbml/Creator.java trunk/core/src/org/sbml/jsbml/Delay.java trunk/core/src/org/sbml/jsbml/Event.java trunk/core/src/org/sbml/jsbml/EventAssignment.java trunk/core/src/org/sbml/jsbml/ExplicitRule.java trunk/core/src/org/sbml/jsbml/FunctionDefinition.java trunk/core/src/org/sbml/jsbml/History.java trunk/core/src/org/sbml/jsbml/IdentifierException.java trunk/core/src/org/sbml/jsbml/InitialAssignment.java trunk/core/src/org/sbml/jsbml/JSBML.java trunk/core/src/org/sbml/jsbml/KineticLaw.java trunk/core/src/org/sbml/jsbml/LevelVersionError.java trunk/core/src/org/sbml/jsbml/ListOf.java trunk/core/src/org/sbml/jsbml/LocalParameter.java trunk/core/src/org/sbml/jsbml/MathContainer.java trunk/core/src/org/sbml/jsbml/Model.java trunk/core/src/org/sbml/jsbml/ModifierSpeciesReference.java trunk/core/src/org/sbml/jsbml/NamedSBase.java trunk/core/src/org/sbml/jsbml/NamedSBaseWithDerivedUnit.java trunk/core/src/org/sbml/jsbml/Parameter.java trunk/core/src/org/sbml/jsbml/Priority.java trunk/core/src/org/sbml/jsbml/PropertyException.java trunk/core/src/org/sbml/jsbml/PropertyNotAvailableException.java trunk/core/src/org/sbml/jsbml/PropertyUndefinedError.java trunk/core/src/org/sbml/jsbml/Quantity.java trunk/core/src/org/sbml/jsbml/QuantityWithUnit.java trunk/core/src/org/sbml/jsbml/RateRule.java trunk/core/src/org/sbml/jsbml/Reaction.java trunk/core/src/org/sbml/jsbml/Rule.java trunk/core/src/org/sbml/jsbml/SBMLDocument.java trunk/core/src/org/sbml/jsbml/SBMLError.java trunk/core/src/org/sbml/jsbml/SBMLErrorLog.java trunk/core/src/org/sbml/jsbml/SBMLException.java trunk/core/src/org/sbml/jsbml/SBMLInputConverter.java trunk/core/src/org/sbml/jsbml/SBMLOutputConverter.java trunk/core/src/org/sbml/jsbml/SBMLReader.java trunk/core/src/org/sbml/jsbml/SBMLTypeUndefinedException.java trunk/core/src/org/sbml/jsbml/SBMLWriter.java trunk/core/src/org/sbml/jsbml/SBO.java trunk/core/src/org/sbml/jsbml/SBase.java trunk/core/src/org/sbml/jsbml/SBaseWithDerivedUnit.java trunk/core/src/org/sbml/jsbml/SBaseWithUnit.java trunk/core/src/org/sbml/jsbml/SimpleSpeciesReference.java trunk/core/src/org/sbml/jsbml/Species.java trunk/core/src/org/sbml/jsbml/SpeciesReference.java trunk/core/src/org/sbml/jsbml/SpeciesType.java trunk/core/src/org/sbml/jsbml/StoichiometryMath.java trunk/core/src/org/sbml/jsbml/Symbol.java trunk/core/src/org/sbml/jsbml/Trigger.java trunk/core/src/org/sbml/jsbml/UniqueNamedSBase.java trunk/core/src/org/sbml/jsbml/Unit.java trunk/core/src/org/sbml/jsbml/UnitDefinition.java trunk/core/src/org/sbml/jsbml/Variable.java trunk/core/src/org/sbml/jsbml/ext/AbstractSBasePlugin.java trunk/core/src/org/sbml/jsbml/ext/SBasePlugin.java trunk/core/src/org/sbml/jsbml/ext/package-info.java trunk/core/src/org/sbml/jsbml/math/compiler/UnitException.java trunk/core/src/org/sbml/jsbml/ontology/Term.java trunk/core/src/org/sbml/jsbml/ontology/Triple.java trunk/core/src/org/sbml/jsbml/package-info.java trunk/core/src/org/sbml/jsbml/resources/Resource.java trunk/core/src/org/sbml/jsbml/resources/package-info.java trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.java trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParser.jj trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParserConstants.java trunk/core/src/org/sbml/jsbml/text/parser/CobraFormulaParserTokenManager.java trunk/core/src/org/sbml/jsbml/text/parser/FormulaParser.java trunk/core/src/org/sbml/jsbml/text/parser/FormulaParser.jj trunk/core/src/org/sbml/jsbml/text/parser/FormulaParserConstants.java trunk/core/src/org/sbml/jsbml/text/parser/FormulaParserLL3.java trunk/core/src/org/sbml/jsbml/text/parser/FormulaParserLL3.jj trunk/core/src/org/sbml/jsbml/text/parser/FormulaParserLL3Constants.java trunk/core/src/org/sbml/jsbml/text/parser/FormulaParserLL3TokenManager.java trunk/core/src/org/sbml/jsbml/text/parser/FormulaParserTokenManager.java trunk/core/src/org/sbml/jsbml/text/parser/IFormulaParser.java trunk/core/src/org/sbml/jsbml/text/parser/ParseException.java trunk/core/src/org/sbml/jsbml/text/parser/SimpleCharStream.java trunk/core/src/org/sbml/jsbml/text/parser/Token.java trunk/core/src/org/sbml/jsbml/text/parser/TokenMgrError.java trunk/core/src/org/sbml/jsbml/text/parser/package-info.java trunk/core/src/org/sbml/jsbml/util/Detail.java trunk/core/src/org/sbml/jsbml/util/DocumentFactory.java trunk/core/src/org/sbml/jsbml/util/IdManager.java trunk/core/src/org/sbml/jsbml/util/JAXPFacade.java trunk/core/src/org/sbml/jsbml/util/ListOfWithName.java trunk/core/src/org/sbml/jsbml/util/Maths.java trunk/core/src/org/sbml/jsbml/util/Message.java trunk/core/src/org/sbml/jsbml/util/ModelBuilder.java trunk/core/src/org/sbml/jsbml/util/NodeWriter.java trunk/core/src/org/sbml/jsbml/util/NotImplementedException.java trunk/core/src/org/sbml/jsbml/util/Option.java trunk/core/src/org/sbml/jsbml/util/Pair.java trunk/core/src/org/sbml/jsbml/util/ProgressListener.java trunk/core/src/org/sbml/jsbml/util/ResourceManager.java trunk/core/src/org/sbml/jsbml/util/SAX2Parser.java trunk/core/src/org/sbml/jsbml/util/SBMLtools.java trunk/core/src/org/sbml/jsbml/util/SimpleTreeNodeChangeListener.java trunk/core/src/org/sbml/jsbml/util/StringTools.java trunk/core/src/org/sbml/jsbml/util/SubModel.java trunk/core/src/org/sbml/jsbml/util/TreeNodeAdapter.java trunk/core/src/org/sbml/jsbml/util/TreeNodeChangeEvent.java trunk/core/src/org/sbml/jsbml/util/TreeNodeChangeListener.java trunk/core/src/org/sbml/jsbml/util/TreeNodeRemovedEvent.java trunk/core/src/org/sbml/jsbml/util/TreeNodeWithChangeSupport.java trunk/core/src/org/sbml/jsbml/util/ValuePair.java trunk/core/src/org/sbml/jsbml/util/XMLResourceBundleControl.java trunk/core/src/org/sbml/jsbml/util/compilers/ASTNodeCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/ASTNodeValue.java trunk/core/src/org/sbml/jsbml/util/compilers/FindUnitsCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerLibSBML.java trunk/core/src/org/sbml/jsbml/util/compilers/FormulaCompilerNoPiecewise.java trunk/core/src/org/sbml/jsbml/util/compilers/HTMLFormula.java trunk/core/src/org/sbml/jsbml/util/compilers/LaTeXCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/LibSBMLFormulaCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/MathMLCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/MathMLXMLStreamCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/UnitException.java trunk/core/src/org/sbml/jsbml/util/compilers/UnitsCompiler.java trunk/core/src/org/sbml/jsbml/util/compilers/package-info.java trunk/core/src/org/sbml/jsbml/util/filters/AndFilter.java trunk/core/src/org/sbml/jsbml/util/filters/AssignmentVariableFilter.java trunk/core/src/org/sbml/jsbml/util/filters/BoundaryConditionFilter.java trunk/core/src/org/sbml/jsbml/util/filters/CVTermFilter.java trunk/core/src/org/sbml/jsbml/util/filters/Filter.java trunk/core/src/org/sbml/jsbml/util/filters/IdenticalUnitDefinitionFilter.java trunk/core/src/org/sbml/jsbml/util/filters/NameFilter.java trunk/core/src/org/sbml/jsbml/util/filters/OrFilter.java trunk/core/src/org/sbml/jsbml/util/filters/SBOFilter.java trunk/core/src/org/sbml/jsbml/util/filters/SpeciesReferenceFilter.java trunk/core/src/org/sbml/jsbml/util/filters/XMLNodeFilter.java trunk/core/src/org/sbml/jsbml/util/filters/package-info.java trunk/core/src/org/sbml/jsbml/util/package-info.java trunk/core/src/org/sbml/jsbml/validator/ModelOverdeterminedException.java trunk/core/src/org/sbml/jsbml/validator/OverdeterminationValidator.java trunk/core/src/org/sbml/jsbml/validator/SBMLValidator.java trunk/core/src/org/sbml/jsbml/validator/SyntaxChecker.java trunk/core/src/org/sbml/jsbml/validator/package-info.java trunk/core/src/org/sbml/jsbml/xml/XMLAttributes.java trunk/core/src/org/sbml/jsbml/xml/XMLException.java trunk/core/src/org/sbml/jsbml/xml/XMLNamespaces.java trunk/core/src/org/sbml/jsbml/xml/XMLNode.java trunk/core/src/org/sbml/jsbml/xml/XMLToken.java trunk/core/src/org/sbml/jsbml/xml/XMLTriple.java trunk/core/src/org/sbml/jsbml/xml/package-info.java trunk/core/src/org/sbml/jsbml/xml/parsers/AbstractReaderWriter.java trunk/core/src/org/sbml/jsbml/xml/parsers/AnnotationReader.java trunk/core/src/org/sbml/jsbml/xml/parsers/AnnotationWriter.java trunk/core/src/org/sbml/jsbml/xml/parsers/MathMLParser.java trunk/core/src/org/sbml/jsbml/xml/parsers/MathMLStaxParser.java trunk/core/src/org/sbml/jsbml/xml/parsers/PackageParser.java trunk/core/src/org/sbml/jsbml/xml/parsers/ParserManager.java trunk/core/src/org/sbml/jsbml/xml/parsers/ReadingParser.java trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLCoreParser.java trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLLevel1Rule.java trunk/core/src/org/sbml/jsbml/xml/parsers/SBMLRDFAnnotationParser.java trunk/core/src/org/sbml/jsbml/xml/parsers/WritingParser.java trunk/core/src/org/sbml/jsbml/xml/parsers/XMLNodeReader.java trunk/core/src/org/sbml/jsbml/xml/parsers/XMLNodeWriter.java trunk/core/src/org/sbml/jsbml/xml/parsers/package-info.java trunk/core/src/org/sbml/jsbml/xml/stax/DateProcessor.java trunk/core/src/org/sbml/jsbml/xml/stax/SBMLObjectForXML.java trunk/core/src/org/sbml/jsbml/xml/stax/SBMLReader.java trunk/core/src/org/sbml/jsbml/xml/stax/SBMLWriter.java trunk/core/src/org/sbml/jsbml/xml/stax/XMLLogger.java trunk/core/src/org/sbml/jsbml/xml/stax/package-info.java trunk/core/src/org/sbml/jsbml/xml/xstream/converter/MessageConverter.java trunk/core/src/org/sbml/jsbml/xml/xstream/converter/SBMLErrorConverter.java trunk/core/src/org/sbml/jsbml/xml/xstream/converter/package-info.java trunk/core/src/overview.html trunk/core/test/org/sbml/jsbml/math/test/ASTNodeFormulaToStringTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTNodeInfixParsingTest.java trunk/core/test/org/sbml/jsbml/math/test/ASTNodeTest.java trunk/core/test/org/sbml/jsbml/math/test/TestInfixOperatorPrecedence.java trunk/core/test/org/sbml/jsbml/math/test/package-info.java trunk/core/test/org/sbml/jsbml/test/HashCodeTest.java trunk/core/test/org/sbml/jsbml/test/IdRegistrationTest.java trunk/core/test/org/sbml/jsbml/test/PerformanceTest.java trunk/core/test/org/sbml/jsbml/test/PerformanceTestPureStax.java trunk/core/test/org/sbml/jsbml/test/RemoveFromModelTest.java trunk/core/test/org/sbml/jsbml/test/RemoveFromParentTest.java trunk/core/test/org/sbml/jsbml/test/TestSemanticsMathML.java trunk/core/test/org/sbml/jsbml/test/TreeSearchTest.java trunk/core/test/org/sbml/jsbml/test/UserObjectTest.java trunk/core/test/org/sbml/jsbml/test/package-info.java trunk/core/test/org/sbml/jsbml/test/sbml/TestCVTerms.java trunk/core/test/org/sbml/jsbml/test/sbml/TestCompartment.java trunk/core/test/org/sbml/jsbml/test/sbml/TestEvent.java trunk/core/test/org/sbml/jsbml/test/sbml/TestIncompatibilities.java trunk/core/test/org/sbml/jsbml/test/sbml/TestL3Parameter.java trunk/core/test/org/sbml/jsbml/test/sbml/TestModel.java trunk/core/test/org/sbml/jsbml/test/sbml/TestParameter.java trunk/core/test/org/sbml/jsbml/test/sbml/TestReaction.java trunk/core/test/org/sbml/jsbml/test/sbml/TestReadFromFile1.java trunk/core/test/org/sbml/jsbml/test/sbml/TestReadFromFile5.java trunk/core/test/org/sbml/jsbml/test/sbml/TestSBase.java trunk/core/test/org/sbml/jsbml/test/sbml/TestSpecies.java trunk/core/test/org/sbml/jsbml/test/sbml/TestUnitSimplification.java trunk/core/test/org/sbml/jsbml/xml/test/CVTermTests.java trunk/core/test/org/sbml/jsbml/xml/test/CheckConsistencyTests.java trunk/core/test/org/sbml/jsbml/xml/test/GetNotesStringTests.java trunk/core/test/org/sbml/jsbml/xml/test/LibsbmlCompatibilityTests.java trunk/core/test/org/sbml/jsbml/xml/test/NestedCVTermTests.java trunk/core/test/org/sbml/jsbml/xml/test/SBML_L1VxTests.java trunk/core/test/org/sbml/jsbml/xml/test/SBML_L2V1Test.java trunk/core/test/org/sbml/jsbml/xml/test/TestAbstractNamedSBaseWithUnits.java trunk/core/test/org/sbml/jsbml/xml/test/Tests.java trunk/core/test/org/sbml/jsbml/xml/test/UnregisterTests.java trunk/core/test/org/sbml/jsbml/xml/test/XMLTokenTest.java trunk/dev/README.txt trunk/dev/java.java trunk/dev/maven/pom.xml trunk/examples/resources/org/sbml/jsbml/gui/UserMessages.xml trunk/examples/sbmlbargraph/LICENSE.txt trunk/examples/sbmlbargraph/build.xml trunk/examples/sbmlbargraph/src/org/sbml/bargraph/AboutPane.java trunk/examples/sbmlbargraph/src/org/sbml/bargraph/Config.java trunk/examples/sbmlbargraph/src/org/sbml/bargraph/Dialog.java trunk/examples/sbmlbargraph/src/org/sbml/bargraph/Log.java trunk/examples/sbmlbargraph/src/org/sbml/bargraph/LogFormatter.java trunk/examples/sbmlbargraph/src/org/sbml/bargraph/Main.java trunk/examples/sbmlbargraph/src/org/sbml/bargraph/MainWindow.java trunk/examples/sbmlbargraph/src/org/sbml/bargraph/SBMLStats.java trunk/examples/sbmlbargraph/src/org/sbml/bargraph/VerifiableFile.java trunk/examples/sbmlbargraph/src/org/sbml/bargraph/Version.java trunk/examples/test/src/org/sbml/jsbml/ext/spatial/test/SpatialTestModelWriter.java trunk/examples/test/src/org/sbml/jsbml/gui/JSBMLvisualizer.java trunk/examples/test/src/org/sbml/jsbml/gui/JTreeOfSBML.java trunk/examples/test/src/org/sbml/jsbml/gui/SBMLFileFilter.java trunk/examples/test/src/org/sbml/jsbml/gui/package-info.java trunk/examples/test/src/org/sbml/jsbml/test/AddNamespace.java trunk/examples/test/src/org/sbml/jsbml/test/CharsetTest.java trunk/examples/test/src/org/sbml/jsbml/test/EventTest.java trunk/examples/test/src/org/sbml/jsbml/test/FilterTest.java trunk/examples/test/src/org/sbml/jsbml/test/FormulaTest.java trunk/examples/test/src/org/sbml/jsbml/test/ListTest.java trunk/examples/test/src/org/sbml/jsbml/test/ListenerTest.java trunk/examples/test/src/org/sbml/jsbml/test/MathMLSpecialTest.java trunk/examples/test/src/org/sbml/jsbml/test/MathMLTest.java trunk/examples/test/src/org/sbml/jsbml/test/PriorityTest.java trunk/examples/test/src/org/sbml/jsbml/test/RecursiveSBMLDocumentExploration.java trunk/examples/test/src/org/sbml/jsbml/test/SBMLWriterTest.java trunk/examples/test/src/org/sbml/jsbml/test/SBOtest.java trunk/examples/test/src/org/sbml/jsbml/test/SpeciesAnnotationTest.java trunk/examples/test/src/org/sbml/jsbml/test/SubModelTest.java trunk/examples/test/src/org/sbml/jsbml/test/T1.java trunk/examples/test/src/org/sbml/jsbml/test/TestAnnotation.java trunk/examples/test/src/org/sbml/jsbml/test/TestClone.java trunk/examples/test/src/org/sbml/jsbml/test/TestFunctionDefinition.java trunk/examples/test/src/org/sbml/jsbml/test/TestFunctionDefinition2.java trunk/examples/test/src/org/sbml/jsbml/test/TestLocalParameterIdentification.java trunk/examples/test/src/org/sbml/jsbml/test/TestNotes.java trunk/examples/test/src/org/sbml/jsbml/test/TestSBMLDocumentClone.java trunk/examples/test/src/org/sbml/jsbml/test/ToyModelTest.java trunk/examples/test/src/org/sbml/jsbml/test/UnitDefinitionTest.java trunk/examples/test/src/org/sbml/jsbml/test/ValidateSBML.java trunk/examples/test/src/org/sbml/jsbml/xml/test/FormulaParserLL3Test.java trunk/examples/test/src/org/sbml/jsbml/xml/test/FormulaParserTest.java trunk/examples/test/src/org/sbml/jsbml/xml/test/MathMLTest.java trunk/extensions/arrays/build.xml trunk/extensions/arrays/pom.xml trunk/extensions/arrays/resources/org/sbml/jsbml/ext/arrays/validator/constraints/Messages.xml trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/ArraysConstants.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/ArraysSBasePlugin.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/Dimension.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/Index.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/ArraysCompiler.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/StaticallyComputableCompiler.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/VectorCompiler.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/compiler/package-info.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/flattening/ArraysFlattening.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/flattening/package-info.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/package-info.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/util/ArraysMath.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/util/package-info.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/ArraysMathValidator.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/ArraysValidator.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/DimensionValidator.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/ExtendedSBaseValidator.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/IndexValidator.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysConstraint.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/ArraysMathCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionArrayDimCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/DimensionSizeCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexArrayDimCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/IndexAttributesCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/SBaseWithDimensionCheck.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/constraints/package-info.java trunk/extensions/arrays/src/org/sbml/jsbml/ext/arrays/validator/package-info.java trunk/extensions/arrays/src/org/sbml/jsbml/xml/parsers/ArraysParser.java trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/ArrayExtensionTest.java trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/ArraysJUnitTests.java trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/ArraysValidationTest.java trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/ArraysWriteTest.java trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/CompilerTest.java trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/FlatteningTest.java trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/MathTest.java trunk/extensions/arrays/test/org/sbml/jsbml/ext/arrays/test/package-info.java trunk/extensions/comp/build.xml trunk/extensions/comp/pom.xml trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/AbstractNamedSBaseRef.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompConstants.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompModelPlugin.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBMLDocumentPlugin.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/CompSBasePlugin.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Deletion.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ExternalModelDefinition.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ModelDefinition.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Port.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedBy.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/ReplacedElement.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/SBaseRef.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/Submodel.java trunk/extensions/comp/src/org/sbml/jsbml/ext/comp/package-info.java trunk/extensions/comp/src/org/sbml/jsbml/xml/parsers/CompParser.java trunk/extensions/comp/test/org/sbml/jsbml/ext/comp/test/CompJUnitTests.java trunk/extensions/comp/test/org/sbml/jsbml/ext/comp/test/TestModelDefinitionCloning.java trunk/extensions/distrib/build.xml trunk/extensions/distrib/pom.xml trunk/extensions/distrib/src/org/sbml/jsbml/ext/distrib/DistribConstants.java trunk/extensions/distrib/src/org/sbml/jsbml/ext/distrib/DistribFunctionDefinitionPlugin.java trunk/extensions/distrib/src/org/sbml/jsbml/ext/distrib/DistribInput.java trunk/extensions/distrib/src/org/sbml/jsbml/ext/distrib/DrawFromDistribution.java trunk/extensions/distrib/src/org/sbml/jsbml/xml/parsers/DistribParser.java trunk/extensions/distrib/src/org/sbml/jsbml/xml/parsers/UncertMLXMLNodeReader.java trunk/extensions/dyn/build.xml trunk/extensions/dyn/pom.xml trunk/extensions/dyn/resources/org/sbml/jsbml/ext/dyn/Messages.xml trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/CBO.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynCompartmentPlugin.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynConstants.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynElement.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynEventPlugin.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/DynSBasePlugin.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/SpatialComponent.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/SpatialKind.java trunk/extensions/dyn/src/org/sbml/jsbml/ext/dyn/package-info.java trunk/extensions/dyn/src/org/sbml/jsbml/xml/parsers/DynParser.java trunk/extensions/dyn/test/org/sbml/jsbml/ext/dyn/test/TestL3Dyn.java trunk/extensions/fbc/build.xml trunk/extensions/fbc/pom.xml trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/AbstractFBCSBasePlugin.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/And.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Association.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCConstants.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCList.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCReactionPlugin.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCSpeciesPlugin.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxBound.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FluxObjective.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProduct.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductAssociation.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/GeneProductRef.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/ListOfObjectives.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/LogicalOperator.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Or.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/package-info.java trunk/extensions/fbc/src/org/sbml/jsbml/xml/parsers/FBCParser.java trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCVersion2Test.java trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/FBCWritingTest.java trunk/extensions/fbc/test/org/sbml/jsbml/ext/fbc/test/package-info.java trunk/extensions/groups/build.xml trunk/extensions/groups/pom.xml trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Group.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsConstants.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/GroupsModelPlugin.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/ListOfMemberConstraint.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/Member.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/MemberConstraint.java trunk/extensions/groups/src/org/sbml/jsbml/ext/groups/package-info.java trunk/extensions/groups/src/org/sbml/jsbml/xml/parsers/GroupsParser.java trunk/extensions/groups/test/org/sbml/jsbml/ext/groups/test/TestL3groups.java trunk/extensions/layout/build.xml trunk/extensions/layout/pom.xml trunk/extensions/layout/resources/org/sbml/jsbml/resources/cfg/SBMLLayoutElements.xml trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/AbstractReferenceGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/BoundingBox.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CubicBezier.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Curve.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CurveSegment.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GeneralGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GraphicalObject.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Layout.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstants.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutModelPlugin.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LineSegment.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/NamedSBaseReferenceFilter.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Point.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReferenceGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceRole.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/TextGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/package-info.java trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/LayoutParser.java trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/LayoutExtentionTest.java trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/LayoutJUnitTests.java trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/LayoutTest.java trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/SpeciesReferenceGlyphTest.java trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/TestL3Layout.java trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/TestSpeciesReferenceGlyphCurve.java trunk/extensions/layout/test/org/sbml/jsbml/ext/layout/test/TextGlyphTest.java trunk/extensions/multi/build.xml trunk/extensions/multi/pom.xml trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingSiteSpeciesType.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/BindingStatus.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/InSpeciesTypeBond.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiCompartmentPlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/MultiConstants.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/multi/src/org/sbml/jsbml/ext/multi/MultiSpeciesReferencePlugin.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/OutwardBindingSite.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/PossibleSpeciesFeatureValue.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/Relation.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/RepresentationType.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeatureType.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesFeatureValue.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesType.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/SpeciesTypeInstance.java trunk/extensions/multi/src/org/sbml/jsbml/ext/multi/package-info.java trunk/extensions/multi/src/org/sbml/jsbml/xml/parsers/MultiParser.java trunk/extensions/pom.xml trunk/extensions/qual/build.xml trunk/extensions/qual/pom.xml trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/FunctionTerm.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Input.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/InputTransitionEffect.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Output.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/OutputTransitionEffect.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualConstants.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualList.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualModelPlugin.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualitativeModel.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/QualitativeSpecies.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Sign.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/Transition.java trunk/extensions/qual/src/org/sbml/jsbml/ext/qual/package-info.java trunk/extensions/qual/src/org/sbml/jsbml/xml/parsers/QualParser.java trunk/extensions/qual/test/org/sbml/jsbml/ext/qual/test/BuildToyModelTest.java trunk/extensions/qual/test/org/sbml/jsbml/ext/qual/test/QualExample.java trunk/extensions/render/build.xml trunk/extensions/render/pom.xml trunk/extensions/render/src/org/sbml/jsbml/ext/render/AbstractRenderPlugin.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/ColorDefinition.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Ellipse.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/FontFamily.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/FontRenderStyle.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GlobalRenderInformation.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientBase.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GradientStop.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive1D.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/GraphicalPrimitive2D.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Image.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/LineEnding.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/LinearGradient.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/LocalRenderInformation.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/LocalStyle.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Point3D.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Polygon.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RadialGradient.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Rectangle.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderConstants.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCubicBezier.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderCurve.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderGroup.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderInformationBase.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderLayoutPlugin.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderListOfLayoutsPlugin.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/RenderPoint.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Style.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Text.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/TextAnchor.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Transformation.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/Transformation2D.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/VTextAnchor.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/XMLTools.java trunk/extensions/render/src/org/sbml/jsbml/ext/render/package-info.java trunk/extensions/render/src/org/sbml/jsbml/xml/parsers/RenderParser.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/ColorDefinitionTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/CurveTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/EllipseTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/GraphicalPrimitive1DTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/GraphicalPrimitive2DTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/GroupTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/ImageTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/LinearGradientTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/PolygonTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/RectangleTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/RenderCubicBezierTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/RenderJUnitTests.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/RenderWriteTest.java trunk/extensions/render/test/org/sbml/jsbml/ext/render/test/TextTest.java trunk/extensions/req/build.xml trunk/extensions/req/pom.xml trunk/extensions/req/src/org/sbml/jsbml/ext/req/ChangedMath.java trunk/extensions/req/src/org/sbml/jsbml/ext/req/ReqConstants.java trunk/extensions/req/src/org/sbml/jsbml/ext/req/ReqSBasePlugin.java trunk/extensions/req/src/org/sbml/jsbml/xml/parsers/ReqParser.java trunk/extensions/spatial/build.xml trunk/extensions/spatial/pom.xml trunk/extensions/spatial/resources/org/sbml/jsbml/ext/spatial/Messages.xml trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdjacentDomains.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Boundary.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryConditionKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGHomogeneousTransformation.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGNode.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPseudoPrimitive.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTransformation.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DomainType.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/FunctionKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InterpolationKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/MixedGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonObject.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PrimitiveKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledVolume.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SetOperation.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialCompartmentPlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialNamedSBase.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialParameterPlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSpeciesPlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSymbolReference.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/package-info.java trunk/extensions/spatial/src/org/sbml/jsbml/xml/parsers/SpatialParser.java trunk/extensions/spatial/test/org/sbml/jsbml/ext/spatial/SpatialTest.java trunk/modules/android/AndroidManifest.xml trunk/modules/android/pom.xml trunk/modules/celldesigner/build.xml trunk/modules/celldesigner/pom.xml trunk/modules/celldesigner/resources/org/sbml/jsbml/celldesigner/Messages.xml trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/AbstractCellDesignerPlugin.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/AbstractCellDesignerPluginAction.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/CDPropertyChangeVis.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/CellDesignerConstants.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/GUIErrorConsole.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/LayoutConverter.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/LayoutPluginChangeListener.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/PluginChangeListener.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/PluginSBMLReader.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/PluginSBMLWriter.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/PluginSBaseEventUtils.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/PluginUtils.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/RenderConverter.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/SBMLDocumentWorker.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/SBMLLayoutVisualizer.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/SBMLStructureVisualizer.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/libsbml/LibSBMLConstants.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/libsbml/LibSBMLReader.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/libsbml/LibSBMLUtils.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/libsbml/LibSBMLWriter.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/libsbml/package-info.java trunk/modules/celldesigner/src/org/sbml/jsbml/celldesigner/package-info.java trunk/modules/celldesigner/src/overview.html trunk/modules/celldesigner/test/org/sbml/jsbml/celldesigner/CellDesignerTest.java trunk/modules/celldesigner/test/org/sbml/jsbml/celldesigner/CellDesignerTestAction.java trunk/modules/celldesigner/test/org/sbml/jsbml/celldesigner/SBMLExportPlugin.java trunk/modules/celldesigner/test/org/sbml/jsbml/celldesigner/SBMLExportPluginAction.java trunk/modules/celldesigner/test/org/sbml/jsbml/celldesigner/SBMLTreeVisualizationPlugin.java trunk/modules/celldesigner/test/org/sbml/jsbml/celldesigner/SBMLTreeVisualizationPluginAction.java trunk/modules/celldesigner/test/org/sbml/jsbml/celldesigner/SimpleCellDesignerPlugin.java trunk/modules/celldesigner/test/org/sbml/jsbml/celldesigner/SimpleCellDesignerPluginAction.java trunk/modules/celldesigner/test/org/sbml/jsbml/celldesigner/TestCDplugin.java trunk/modules/compare/build.xml trunk/modules/compare/pom.xml trunk/modules/compare/test/org/sbml/jsbml/test/ReactionReadTest.java trunk/modules/compare/test/org/sbml/jsbml/test/SBMLReaderTest.java trunk/modules/libSBMLcompat/build.xml trunk/modules/libSBMLcompat/pom.xml trunk/modules/libSBMLcompat/src/org/sbml/libsbml/Compartment.java trunk/modules/libSBMLcompat/src/org/sbml/libsbml/ListOfSpecies.java trunk/modules/libSBMLcompat/src/org/sbml/libsbml/Model.java trunk/modules/libSBMLcompat/src/org/sbml/libsbml/SBMLDocument.java trunk/modules/libSBMLcompat/src/org/sbml/libsbml/SBMLReader.java trunk/modules/libSBMLcompat/src/org/sbml/libsbml/Species.java trunk/modules/libSBMLcompat/src/org/sbml/libsbml/package-info.java trunk/modules/libSBMLio/build.xml trunk/modules/libSBMLio/pom.xml trunk/modules/libSBMLio/resources/org/sbml/jsbml/xml/libsbml/Messages.xml trunk/modules/libSBMLio/src/org/sbml/jsbml/xml/libsbml/LibSBMLChangeListener.java trunk/modules/libSBMLio/src/org/sbml/jsbml/xml/libsbml/LibSBMLConstants.java trunk/modules/libSBMLio/src/org/sbml/jsbml/xml/libsbml/LibSBMLReader.java trunk/modules/libSBMLio/src/org/sbml/jsbml/xml/libsbml/LibSBMLUtils.java trunk/modules/libSBMLio/src/org/sbml/jsbml/xml/libsbml/LibSBMLWriter.java trunk/modules/libSBMLio/src/org/sbml/jsbml/xml/libsbml/package-info.java trunk/modules/libSBMLio/src/overview.html trunk/modules/libSBMLio/test/org/sbml/jsbml/xml/libsbml/SimpleApplication.java trunk/modules/libSBMLio/test/org/sbml/jsbml/xml/libsbml/test/LibSBMLChangeListenerTest.java trunk/modules/libSBMLio/test/org/sbml/jsbml/xml/libsbml/test/LibSBMLioTest.java trunk/modules/libSBMLio/test/org/sbml/jsbml/xml/libsbml/test/package-info.java trunk/modules/pom.xml trunk/modules/tidy/README.txt trunk/modules/tidy/build.xml trunk/modules/tidy/pom.xml trunk/modules/tidy/src/org/sbml/jsbml/TidySBMLWriter.java trunk/overview.html trunk/pom.xml trunk/stylesheet.css trunk/test/org/sbml/jsbml/test/AllTests.java trunk/test/org/sbml/jsbml/test/DisablePackageTests.java trunk/test/org/sbml/jsbml/test/UnregisterPackageTests.java Modified: trunk/LICENSE.txt =================================================================== --- trunk/LICENSE.txt 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/LICENSE.txt 2016-01-12 21:18:13 UTC (rev 2465) @@ -1,6 +1,6 @@ Licensing and Distribution Terms for JSBML -Copyright (C) 2009-2015 jointly by the following organizations: +Copyright (C) 2009-2016 jointly by the following organizations: 1. The University of Tuebingen, Germany 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK 3. The California Institute of Technology, Pasadena, CA, USA Modified: trunk/NEWS.txt =================================================================== --- trunk/NEWS.txt 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/NEWS.txt 2016-01-12 21:18:13 UTC (rev 2465) @@ -28,7 +28,7 @@ =========================================================================== -Version 1.1 (09-12-2015) +Version 1.1 (09-12-2016) =========================================================================== * New Features: @@ -72,7 +72,7 @@ reported the problem. =========================================================================== -Version 1.1-beta1 (12-10-2015) +Version 1.1-beta1 (12-10-2016) =========================================================================== * New Features: Modified: trunk/README.txt =================================================================== --- trunk/README.txt 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/README.txt 2016-01-12 21:18:13 UTC (rev 2465) @@ -143,7 +143,7 @@ Licensing and Distribution Terms for JSBML: -Copyright (C) 2009-2015 jointly by the following organizations: +Copyright (C) 2009-2016 jointly by the following organizations: 1. The University of Tuebingen, Germany 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK 3. The California Institute of Technology, Pasadena, CA, USA Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/build.xml 2016-01-12 21:18:13 UTC (rev 2465) @@ -6,7 +6,7 @@ This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. - Copyright (C) 2009-2015 jointly by the following organizations: + Copyright (C) 2009-2016 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 Modified: trunk/core/build.xml =================================================================== --- trunk/core/build.xml 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/build.xml 2016-01-12 21:18:13 UTC (rev 2465) @@ -6,7 +6,7 @@ This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. - Copyright (C) 2009-2015 jointly by the following organizations: + Copyright (C) 2009-2016 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 Modified: trunk/core/pom.xml =================================================================== --- trunk/core/pom.xml 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/pom.xml 2016-01-12 21:18:13 UTC (rev 2465) @@ -6,7 +6,7 @@ This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. - Copyright (C) 2009-2015 jointly by the following organizations: + Copyright (C) 2009-2016 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 Modified: trunk/core/resources/log4j.properties =================================================================== --- trunk/core/resources/log4j.properties 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/resources/log4j.properties 2016-01-12 21:18:13 UTC (rev 2465) @@ -5,7 +5,7 @@ # This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> # for the latest version of JSBML and more information about SBML. # -# Copyright (C) 2009-2015 jointly by the following organizations: +# Copyright (C) 2009-2016 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 Modified: trunk/core/resources/org/sbml/jsbml/resources/Messages.xml =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/Messages.xml 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/resources/org/sbml/jsbml/resources/Messages.xml 2016-01-12 21:18:13 UTC (rev 2465) @@ -8,7 +8,7 @@ This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. - Copyright (C) 2009-2015 jointly by the following organizations: + Copyright (C) 2009-2016 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 Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/ASTNodeTokens.xml =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/ASTNodeTokens.xml 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/ASTNodeTokens.xml 2016-01-12 21:18:13 UTC (rev 2465) @@ -8,7 +8,7 @@ This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. - Copyright (C) 2009-2015 jointly by the following organizations: + Copyright (C) 2009-2016 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 Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/Alias2SBO.cfg =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/Alias2SBO.cfg 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/Alias2SBO.cfg 2016-01-12 21:18:13 UTC (rev 2465) @@ -5,7 +5,7 @@ # This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> # for the latest version of JSBML and more information about SBML. # -# Copyright (C) 2009-2015 jointly by the following organizations: +# Copyright (C) 2009-2016 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 Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/HTML_CharEncodingTable.txt =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/HTML_CharEncodingTable.txt 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/HTML_CharEncodingTable.txt 2016-01-12 21:18:13 UTC (rev 2465) @@ -5,7 +5,7 @@ # This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> # for the latest version of JSBML and more information about SBML. # -# Copyright (C) 2009-2015 jointly by the following organizations: +# Copyright (C) 2009-2016 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 Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/Messages.xml =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/Messages.xml 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/Messages.xml 2016-01-12 21:18:13 UTC (rev 2465) @@ -8,7 +8,7 @@ This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. - Copyright (C) 2009-2015 jointly by the following organizations: + Copyright (C) 2009-2016 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 Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/SBMLCoreElements.xml =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/SBMLCoreElements.xml 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/SBMLCoreElements.xml 2016-01-12 21:18:13 UTC (rev 2465) @@ -8,7 +8,7 @@ This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. - Copyright (C) 2009-2015 jointly by the following organizations: + Copyright (C) 2009-2016 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 Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/SBMLElementsLevel1Version1.xml =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/SBMLElementsLevel1Version1.xml 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/SBMLElementsLevel1Version1.xml 2016-01-12 21:18:13 UTC (rev 2465) @@ -8,7 +8,7 @@ This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. - Copyright (C) 2009-2015 jointly by the following organizations: + Copyright (C) 2009-2016 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 Modified: trunk/core/resources/org/sbml/jsbml/resources/cfg/annotationParsers.xml =================================================================== --- trunk/core/resources/org/sbml/jsbml/resources/cfg/annotationParsers.xml 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/resources/org/sbml/jsbml/resources/cfg/annotationParsers.xml 2016-01-12 21:18:13 UTC (rev 2465) @@ -8,7 +8,7 @@ This file is part of JSBML. Please visit http://sbml.org/Software/JSBML for the latest version of JSBML and more information about SBML. - Copyright (C) 2009-2015 jointly by the following organizations: + Copyright (C) 2009-2016 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 Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java 2016-01-12 21:18:13 UTC (rev 2465) @@ -5,7 +5,7 @@ * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> * for the latest version of JSBML and more information about SBML. * - * Copyright (C) 2009-2015 jointly by the following organizations: + * Copyright (C) 2009-2016 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 Modified: trunk/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode =================================================================== --- trunk/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/src/org/sbml/jsbml/ASTNode.java.oldASTNode 2016-01-12 21:18:13 UTC (rev 2465) @@ -5,7 +5,7 @@ * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> * for the latest version of JSBML and more information about SBML. * - * Copyright (C) 2009-2015 jointly by the following organizations: + * Copyright (C) 2009-2016 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 Modified: trunk/core/src/org/sbml/jsbml/AbstractMathContainer.java =================================================================== --- trunk/core/src/org/sbml/jsbml/AbstractMathContainer.java 2016-01-11 15:03:07 UTC (rev 2464) +++ trunk/core/src/org/sbml/jsbml/AbstractMathContainer.java 2016-01-12 21:18:13 UTC (rev 2465) @@ -5,7 +5,7 @@ * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> * for the latest version of JSBML and more information about SBML. * - * Copyright (C) 2009-2015 jointly by the following organizations: + * Copyright (C) 2009-2016 jointly by the following organizations: * 1. The University of Tuebingen, Germa... [truncated message content] |
From: <and...@us...> - 2016-01-11 15:03:10
|
Revision: 2464 http://sourceforge.net/p/jsbml/code/2464 Author: andreas-draeger Date: 2016-01-11 15:03:07 +0000 (Mon, 11 Jan 2016) Log Message: ----------- Created some additional convenient methods for working with FBC. Modified Paths: -------------- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java 2016-01-11 14:47:58 UTC (rev 2463) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/FBCModelPlugin.java 2016-01-11 15:03:07 UTC (rev 2464) @@ -200,31 +200,79 @@ return geneProduct; } - /** - * Creates a new Objective element and adds it to the ListOfObjectives list - * @return + * Creates a new {@link Objective} element and adds it to the + * {@link #listOfObjectives}. + * @return the newly created {@link Objective} element or {@code null} if the + * operation fails. + * @see #createObjective(String) */ public Objective createObjective() { return createObjective(null); } - /** - * Creates a new {@link Objective} element and adds it to the ListOfObjectives - * list + * Creates a new {@link Objective} element and adds it to the + * {@link #listOfObjectives}. * * @param id - * @return a new {@link Objective} element + * the identifier for the {@link Objective} of type SId, can be + * {@code null}. + * @return the newly created {@link Objective} element or {@code null} if the + * operation fails. + * @see #createObjective(String, Objective.Type) */ public Objective createObjective(String id) { - Objective objective = new Objective(id); - addObjective(objective); - return objective; + return createObjective(id, null); } + /** + * Creates a new {@link Objective} element and adds it to the + * {@link #listOfObjectives}. + * + * @param id + * the identifier for the {@link Objective} of type SId, can be + * {@code null}. + * @param type + * the type of the {@link Objective}, i.e., maximize or minimize. + * @return the newly created {@link Objective} element or {@code null} if the + * operation fails. + * @see #createObjective(String, String, Objective.Type) + */ + public Objective createObjective(String id, Objective.Type type) { + return createObjective(id, null, type); + } /** + * Creates a new {@link Objective} element and adds it to the + * {@link #listOfObjectives}. + * + * @param id + * the identifier for the {@link Objective} of type SId, can be + * {@code null}. + * @param name + * the name of the objective that is to be created, can be {@code null} + * . + * @param type + * the type of the {@link Objective}, i.e., maximize or minimize. + * @return the newly created {@link Objective} element or {@code null} if the + * operation fails. + */ + public Objective createObjective(String id, String name, Objective.Type type) { + Objective objective = new Objective(getLevel(), getVersion()); + if (id != null) { + objective.setId(id); + } + if (name != null) { + objective.setName(name); + } + if (type != null) { + objective.setType(type); + } + return addObjective(objective) ? objective : null; + } + + /** * Gets the {@code activeObjective}. * <p>If the {@code activeObjective} is not defined, an empty String is returned. * Modified: trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java =================================================================== --- trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java 2016-01-11 14:47:58 UTC (rev 2463) +++ trunk/extensions/fbc/src/org/sbml/jsbml/ext/fbc/Objective.java 2016-01-11 15:03:07 UTC (rev 2464) @@ -29,6 +29,7 @@ import org.sbml.jsbml.AbstractNamedSBase; import org.sbml.jsbml.LevelVersionError; import org.sbml.jsbml.ListOf; +import org.sbml.jsbml.Reaction; import org.sbml.jsbml.SBMLException; import org.sbml.jsbml.UniqueNamedSBase; import org.sbml.jsbml.util.filters.NameFilter; @@ -230,26 +231,58 @@ * Creates a new {@link FluxObjective} element and adds it to the ListOfFluxObjectives list * * @param id the id for the new {@link FluxObjective} - * @return a new {@link FluxObjective} element + * @return the newly created {@link FluxObjective} element or {@code null} if + * the operation failed. */ public FluxObjective createFluxObjective(String id) { return createFluxObjective(id, null); } /** - * * @param id * @param name - * @return + * @return the newly created {@link FluxObjective} element or {@code null} if + * the operation failed. */ public FluxObjective createFluxObjective(String id, String name) { - FluxObjective fluxObjective = new FluxObjective(id, name, getLevel(), getVersion()); - getListOfFluxObjectives().add(fluxObjective); - return fluxObjective; + return createFluxObjective(id, name, Double.NaN, (Reaction) null); } + /** + * + * @param id + * @param name the name of the flux objective to be created, can be {@code null}. + * @param coefficient + * @param reaction + * @return the newly created {@link FluxObjective} element or {@code null} if + * the operation failed. + */ + public FluxObjective createFluxObjective(String id, String name, double coefficient, + Reaction reaction) { + return createFluxObjective(id, name, coefficient, reaction != null ? reaction.getId() : null); + } + /** + * @param id + * @param name + * @param coefficient + * @param rId + * @return the newly created {@link FluxObjective} element or {@code null} if + * the operation failed. + */ + public FluxObjective createFluxObjective(String id, String name, double coefficient, + String rId) { + FluxObjective fluxObjective = new FluxObjective(id, name, getLevel(), getVersion()); + if (!Double.isNaN(coefficient)) { + fluxObjective.setCoefficient(coefficient); + } + if (rId != null) { + fluxObjective.setReaction(rId); + } + return getListOfFluxObjectives().add(fluxObjective) ? fluxObjective : null; + } + /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @@ -332,7 +365,7 @@ listOfFluxObjectives.setPackageName(null); listOfFluxObjectives.setPackageName(FBCConstants.shortLabel); listOfFluxObjectives.setSBaseListType(ListOf.Type.other); - + registerChild(listOfFluxObjectives); } return listOfFluxObjectives; @@ -378,6 +411,9 @@ packageName = FBCConstants.shortLabel; } + /* (non-Javadoc) + * @see org.sbml.jsbml.NamedSBase#isIdMandatory() + */ @Override public boolean isIdMandatory() { return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |