From: <and...@us...> - 2012-06-11 12:48:04
|
Revision: 1299 http://jsbml.svn.sourceforge.net/jsbml/?rev=1299&view=rev Author: andreas-draeger Date: 2012-06-11 12:47:53 +0000 (Mon, 11 Jun 2012) Log Message: ----------- Solved the problem that sometimes non-English locale was used leading to incorrectly spelled double numbers. Added some missing convenient methods. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ListOf.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ExtendedLayoutModel.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/Point.java Modified: trunk/core/src/org/sbml/jsbml/ListOf.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ListOf.java 2012-06-11 12:40:40 UTC (rev 1298) +++ trunk/core/src/org/sbml/jsbml/ListOf.java 2012-06-11 12:47:53 UTC (rev 1299) @@ -268,9 +268,7 @@ list.setVersion(parent.getVersion()); } list.setSBaseListType(type); - if (parent instanceof AbstractSBase) { - ((AbstractSBase) parent).registerChild(list); - } + parent.registerChild(list); return list; } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java 2012-06-11 12:40:40 UTC (rev 1298) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java 2012-06-11 12:47:53 UTC (rev 1299) @@ -19,6 +19,7 @@ */ package org.sbml.jsbml.ext.layout; +import java.util.Locale; import java.util.Map; import org.sbml.jsbml.AbstractNamedSBase; @@ -287,16 +288,16 @@ } if (isSetDepth()) { - attributes.put(LayoutConstants.shortLabel + ":" - + LayoutConstants.depth, StringTools.toString(depth)); + attributes.put(LayoutConstants.shortLabel + ':' + + LayoutConstants.depth, StringTools.toString(Locale.ENGLISH, depth)); } if (isSetHeight()) { - attributes.put(LayoutConstants.shortLabel + ":" - + LayoutConstants.height, StringTools.toString(height)); + attributes.put(LayoutConstants.shortLabel + ':' + + LayoutConstants.height, StringTools.toString(Locale.ENGLISH, height)); } if (isSetWidth()) { - attributes.put(LayoutConstants.shortLabel + ":" - + LayoutConstants.width, StringTools.toString(width)); + attributes.put(LayoutConstants.shortLabel + ':' + + LayoutConstants.width, StringTools.toString(Locale.ENGLISH, width)); } return attributes; Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ExtendedLayoutModel.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ExtendedLayoutModel.java 2012-06-11 12:40:40 UTC (rev 1298) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ExtendedLayoutModel.java 2012-06-11 12:47:53 UTC (rev 1299) @@ -189,6 +189,14 @@ } /** + * + * @return + */ + public int getLayoutCount() { + return isSetListOfLayouts() ? listOfLayouts.size() : 0; + } + + /** * * @return */ @@ -229,7 +237,7 @@ return false; } - /** + /** * * @param listOfLayouts */ @@ -254,7 +262,7 @@ // TODO Auto-generated method stub return null; } - + /** * Removes the {@link #listOfLayouts} from this {@link Model} and notifies * all registered instances of {@link TreeNodeChangeListener}. @@ -271,7 +279,7 @@ } return false; } - + /* (non-Javadoc) * @see org.sbml.jsbml.ext.SBasePlugin#writeXMLAttributes() */ Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Layout.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Layout.java 2012-06-11 12:40:40 UTC (rev 1298) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Layout.java 2012-06-11 12:47:53 UTC (rev 1299) @@ -158,7 +158,6 @@ */ public void addAdditionalGraphical(GraphicalObject object) { if (object != null) { - registerChild(object); getListOfAdditionalGraphicalObjects().add(object); } } @@ -169,7 +168,6 @@ */ public void addCompartmentGlyph(CompartmentGlyph compartmentGlyph) { if (compartmentGlyph != null) { - registerChild(compartmentGlyph); getListOfCompartmentGlyphs().add(compartmentGlyph); } } @@ -180,7 +178,6 @@ */ public void addReactionGlyph(ReactionGlyph reactionGlyph) { if (reactionGlyph != null) { - registerChild(reactionGlyph); getListOfReactionGlyphs().add(reactionGlyph); } } @@ -191,7 +188,6 @@ */ public void addSpeciesGlyph(SpeciesGlyph speciesGlyph) { if (speciesGlyph != null) { - registerChild(speciesGlyph); getListOfSpeciesGlyphs().add(speciesGlyph); } } @@ -202,7 +198,6 @@ */ public void addTextGlyph(TextGlyph TextGlyph) { if (TextGlyph != null) { - registerChild(TextGlyph); getListOfTextGlyphs().add(TextGlyph); } } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstants.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstants.java 2012-06-11 12:40:40 UTC (rev 1298) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstants.java 2012-06-11 12:47:53 UTC (rev 1299) @@ -87,5 +87,18 @@ public static final String basePoint1 = "basePoint1"; public static final String basePoint2 = "basePoint2"; public static final String reaction = "reaction"; + + /** + * + * @param level + * @param version + * @return + */ + public static String getNamespaceURI(int level, int version) { + if (level < 3) { + return namespaceURI_L2; + } + return namespaceURI; + } } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Point.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Point.java 2012-06-11 12:40:40 UTC (rev 1298) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Point.java 2012-06-11 12:47:53 UTC (rev 1299) @@ -289,7 +289,7 @@ */ @Override public String toString() { - return "Point [" + x + ", " + y + ", " + z + "]"; + return "Point [" + x + ", " + y + ", " + z + ']'; } /* (non-Javadoc) @@ -305,15 +305,15 @@ } if (isSetX()) { - attributes.put(LayoutConstants.shortLabel + ":" + attributes.put(LayoutConstants.shortLabel + ':' + LayoutConstants.x, StringTools.toString(Locale.ENGLISH, x)); } if (isSetY()) { - attributes.put(LayoutConstants.shortLabel + ":" + attributes.put(LayoutConstants.shortLabel + ':' + LayoutConstants.y, StringTools.toString(Locale.ENGLISH, y)); } if (isSetZ()) { - attributes.put(LayoutConstants.shortLabel + ":" + attributes.put(LayoutConstants.shortLabel + ':' + LayoutConstants.z, StringTools.toString(Locale.ENGLISH, z)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |