From: <and...@us...> - 2012-06-10 07:02:05
|
Revision: 1296 http://jsbml.svn.sourceforge.net/jsbml/?rev=1296&view=rev Author: andreas-draeger Date: 2012-06-10 07:01:58 +0000 (Sun, 10 Jun 2012) Log Message: ----------- Renamed LayoutConstant to LayoutConstants because there are multiple constants within this class. Changed the default return type of the conversion method from Class<? extends SBase> to the listOf type from "none" to "other", because this is necessary for the packages. If some SBase is given, the listOf type should be "other", not "none". The default listOf type should still be "none", but not if a specific Class is given that is derived from SBase. Modified Paths: -------------- trunk/core/src/org/sbml/jsbml/ListOf.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/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/ExtendedLayoutModel.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/NamedSBaseGlyph.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/SpeciesGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/TextGlyph.java trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java Added Paths: ----------- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstants.java Removed Paths: ------------- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstant.java Modified: trunk/core/src/org/sbml/jsbml/ListOf.java =================================================================== --- trunk/core/src/org/sbml/jsbml/ListOf.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/core/src/org/sbml/jsbml/ListOf.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -171,9 +171,6 @@ return listOfModifiers; } else if (type.equals(Parameter.class)) { return listOfParameters; - } else if (type.equals(SpeciesReference.class)) { - // Can be reactant or product! - return other; } else if (type.equals(Reaction.class)) { return listOfReactions; } else if (type.equals(Rule.class)) { @@ -187,7 +184,7 @@ } else if (type.equals(Unit.class)) { return listOfUnits; } - return none; + return other; } /** Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/BoundingBox.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/BoundingBox.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/BoundingBox.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -55,7 +55,7 @@ * */ public BoundingBox() { - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -248,7 +248,7 @@ if (isSetId()) { attributes.remove("id"); - attributes.put(LayoutConstant.shortLabel + ":id", getId()); + attributes.put(LayoutConstants.shortLabel + ":id", getId()); } if (isSetName()) { // Problem !!! no name defined officially Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CompartmentGlyph.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -121,7 +121,7 @@ if (!isAttributeRead) { - if (attributeName.equals(LayoutConstant.compartment)) { + if (attributeName.equals(LayoutConstants.compartment)) { setCompartment(value); } else { return false; @@ -164,8 +164,8 @@ Map<String, String> attributes = super.writeXMLAttributes(); if (isSetCompartment()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.compartment, getCompartment()); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.compartment, getCompartment()); } return attributes; Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Curve.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Curve.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Curve.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -61,9 +61,9 @@ */ public Curve() { super(); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); - listOfCurveSegments.addNamespace(LayoutConstant.namespaceURI); + listOfCurveSegments.addNamespace(LayoutConstants.namespaceURI); listOfCurveSegments.setSBaseListType(ListOf.Type.other); registerChild(listOfCurveSegments); } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CurveSegment.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CurveSegment.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/CurveSegment.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -51,7 +51,7 @@ */ public CurveSegment() { super(); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** 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-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Dimensions.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -54,7 +54,7 @@ * */ public Dimensions() { - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -96,7 +96,7 @@ */ public Dimensions(int level, int version) { super(level, version); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -107,7 +107,7 @@ */ public Dimensions(String id, int level, int version) { super(id, level, version); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /* (non-Javadoc) @@ -221,15 +221,15 @@ { //isAttributeRead = true; - if(attributeName.equals(LayoutConstant.width)) + if(attributeName.equals(LayoutConstants.width)) { setWidth(StringTools.parseSBMLDouble(value)); } - else if(attributeName.equals(LayoutConstant.height)) + else if(attributeName.equals(LayoutConstants.height)) { setHeight(StringTools.parseSBMLDouble(value)); } - else if(attributeName.equals(LayoutConstant.depth)) + else if(attributeName.equals(LayoutConstants.depth)) { setDepth(StringTools.parseSBMLDouble(value)); } @@ -251,7 +251,7 @@ public void setDepth(double depth) { Double oldDepth = this.depth; this.depth = depth; - firePropertyChange(LayoutConstant.depth, oldDepth, this.depth); + firePropertyChange(LayoutConstants.depth, oldDepth, this.depth); } /** @@ -261,7 +261,7 @@ public void setHeight(double height) { Double oldHeight = this.height; this.height = height; - firePropertyChange(LayoutConstant.height, oldHeight, this.height); + firePropertyChange(LayoutConstants.height, oldHeight, this.height); } /** @@ -271,7 +271,7 @@ public void setWidth(double width) { Double oldWidth = this.width; this.width = width; - firePropertyChange(LayoutConstant.width, oldWidth, this.width); + firePropertyChange(LayoutConstants.width, oldWidth, this.width); } /* (non-Javadoc) @@ -283,20 +283,20 @@ if (isSetId()) { attributes.remove("id"); - attributes.put(LayoutConstant.shortLabel + ":id", getId()); + attributes.put(LayoutConstants.shortLabel + ":id", getId()); } if (isSetDepth()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.depth, StringTools.toString(depth)); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.depth, StringTools.toString(depth)); } if (isSetHeight()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.height, StringTools.toString(height)); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.height, StringTools.toString(height)); } if (isSetWidth()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.width, StringTools.toString(width)); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.width, StringTools.toString(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-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ExtendedLayoutModel.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -124,7 +124,7 @@ */ private void createListOfLayout() { listOfLayouts = new ListOf<Layout>(); - listOfLayouts.addNamespace(LayoutConstant.namespaceURI); + listOfLayouts.addNamespace(LayoutConstants.namespaceURI); listOfLayouts.setSBaseListType(ListOf.Type.other); model.registerChild(listOfLayouts); } Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GraphicalObject.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GraphicalObject.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/GraphicalObject.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -51,7 +51,7 @@ */ public GraphicalObject() { super(); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -70,7 +70,7 @@ */ public GraphicalObject(int level, int version) { super(level, version); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -78,7 +78,7 @@ */ public GraphicalObject(String id) { super(id); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -89,7 +89,7 @@ */ public GraphicalObject(String id, int level, int version) { super(id, level, version); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /* (non-Javadoc) @@ -250,7 +250,7 @@ if (isSetId()) { attributes.remove("id"); - attributes.put(LayoutConstant.shortLabel + ":id", getId()); + attributes.put(LayoutConstants.shortLabel + ":id", getId()); } return attributes; 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-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Layout.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -600,7 +600,7 @@ public ListOf<GraphicalObject> getListOfAdditionalGraphicalObjects() { if (!isSetListOfAdditionalGraphicalObjects()) { listOfAdditionalGraphicalObjects = ListOf.newInstance(this, GraphicalObject.class); - listOfAdditionalGraphicalObjects.addNamespace(LayoutConstant.namespaceURI); + listOfAdditionalGraphicalObjects.addNamespace(LayoutConstants.namespaceURI); } return listOfAdditionalGraphicalObjects; } @@ -612,7 +612,7 @@ public ListOf<CompartmentGlyph> getListOfCompartmentGlyphs() { if (!isSetListOfCompartmentGlyphs()) { listOfCompartmentGlyphs = ListOf.newInstance(this, CompartmentGlyph.class); - listOfCompartmentGlyphs.addNamespace(LayoutConstant.namespaceURI); + listOfCompartmentGlyphs.addNamespace(LayoutConstants.namespaceURI); } return listOfCompartmentGlyphs; } @@ -625,7 +625,7 @@ public ListOf<ReactionGlyph> getListOfReactionGlyphs() { if (!isSetListOfReactionGlyphs()) { listOfReactionGlyphs = ListOf.newInstance(this, ReactionGlyph.class); - listOfReactionGlyphs.addNamespace(LayoutConstant.namespaceURI); + listOfReactionGlyphs.addNamespace(LayoutConstants.namespaceURI); } return listOfReactionGlyphs; } @@ -637,7 +637,7 @@ public ListOf<SpeciesGlyph> getListOfSpeciesGlyphs() { if (!isSetListOfSpeciesGlyphs()) { listOfSpeciesGlyphs = ListOf.newInstance(this, SpeciesGlyph.class); - listOfSpeciesGlyphs.addNamespace(LayoutConstant.namespaceURI); + listOfSpeciesGlyphs.addNamespace(LayoutConstants.namespaceURI); } return listOfSpeciesGlyphs; } @@ -649,7 +649,7 @@ public ListOf<TextGlyph> getListOfTextGlyphs() { if (!isSetListOfTextGlyphs()) { listOfTextGlyphs = ListOf.newInstance(this, TextGlyph.class); - listOfTextGlyphs.addNamespace(LayoutConstant.namespaceURI); + listOfTextGlyphs.addNamespace(LayoutConstants.namespaceURI); } return listOfTextGlyphs; } @@ -721,7 +721,7 @@ * */ private void initDefault() { - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /* (non-Javadoc) Deleted: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstant.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstant.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstant.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -1,87 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2012 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.layout; - -public class LayoutConstant { - - /** - * The namespace URI of this parser. - */ - public static final String namespaceURI = "http://www.sbml.org/sbml/level3/version1/layout/version1"; - public static final String namespaceURI_L2 = "http://projects.eml.org/bcb/sbml/level2"; - - public static final String shortLabel = "layout"; - - public static final String listOfLayouts = "listOfLayouts"; - public static final String listOfCompartmentGlyphs = "listOfCompartmentGlyphs"; - public static final String listOfSpeciesGlyphs = "listOfSpeciesGlyphs"; - public static final String listOfReactionGlyphs = "listOfReactionGlyphs"; - public static final String listOfTextGlyphs = "listOfTextGlyphs"; - public static final String listOfAdditionalGraphicalObjects = "listOfAdditionalGraphicalObjects"; - public static final String listOfCurveSegments = "listOfCurveSegments"; - public static final String listOfSpeciesReferenceGlyphs = "listOfSpeciesReferenceGlyphs"; - - public static final String layout = "layout"; - public static final String compartmentGlyph = "compartmentGlyph"; - public static final String speciesGlyph = "speciesGlyph"; - public static final String reactionGlyph = "reactionGlyph"; - public static final String textGlyph = "textGlyph"; - public static final String speciesReferenceGlyph = "speciesReferenceGlyph"; - public static final String boundingBox = "boundingBox"; - public static final String position = "position"; - public static final String dimensions = "dimensions"; - public static final String start = "start"; - public static final String end = "end"; - public static final String curve = "curve"; - public static final String curveSegment = "curveSegment"; - - // Attribute names of the Point XML type - public static final String x = "x"; - public static final String y = "y"; - public static final String z = "z"; - - // Attribute names of the Dimensions XML type - public static final String depth = "depth"; - public static final String width = "width"; - public static final String height = "height"; - - // Attribute names of the CompartmentGlyph XML type - public static final String compartment = "compartment"; - - // Attribute names of the speciesGlyph XML type - public static final String species = "species"; - - // Attribute names of the textGlyph XML type - public static final String graphicalObject = "graphicalObject"; - public static final String text = "text"; - public static final String originOfText = "originOfText"; - - // Attribute names of the speciesReferenceGlyph XML type - public static final String speciesReference = "speciesReference"; - public static final String role = "role"; - - - public static final String basePoint1 = "basePoint1"; - public static final String basePoint2 = "basePoint2"; - public static final String reaction = "reaction"; - - - -} Copied: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstants.java (from rev 1293, trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstant.java) =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstants.java (rev 0) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/LayoutConstants.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -0,0 +1,91 @@ +/* + * $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-2012 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.layout; + +/** + * + * @author + * @version $Rev$ + * @since 1.0 + */ +public class LayoutConstants { + + /** + * The namespace URI of this parser. + */ + public static final String namespaceURI = "http://www.sbml.org/sbml/level3/version1/layout/version1"; + public static final String namespaceURI_L2 = "http://projects.eml.org/bcb/sbml/level2"; + + public static final String shortLabel = "layout"; + + public static final String listOfLayouts = "listOfLayouts"; + public static final String listOfCompartmentGlyphs = "listOfCompartmentGlyphs"; + public static final String listOfSpeciesGlyphs = "listOfSpeciesGlyphs"; + public static final String listOfReactionGlyphs = "listOfReactionGlyphs"; + public static final String listOfTextGlyphs = "listOfTextGlyphs"; + public static final String listOfAdditionalGraphicalObjects = "listOfAdditionalGraphicalObjects"; + public static final String listOfCurveSegments = "listOfCurveSegments"; + public static final String listOfSpeciesReferenceGlyphs = "listOfSpeciesReferenceGlyphs"; + + public static final String layout = "layout"; + public static final String compartmentGlyph = "compartmentGlyph"; + public static final String speciesGlyph = "speciesGlyph"; + public static final String reactionGlyph = "reactionGlyph"; + public static final String textGlyph = "textGlyph"; + public static final String speciesReferenceGlyph = "speciesReferenceGlyph"; + public static final String boundingBox = "boundingBox"; + public static final String position = "position"; + public static final String dimensions = "dimensions"; + public static final String start = "start"; + public static final String end = "end"; + public static final String curve = "curve"; + public static final String curveSegment = "curveSegment"; + + // Attribute names of the Point XML type + public static final String x = "x"; + public static final String y = "y"; + public static final String z = "z"; + + // Attribute names of the Dimensions XML type + public static final String depth = "depth"; + public static final String width = "width"; + public static final String height = "height"; + + // Attribute names of the CompartmentGlyph XML type + public static final String compartment = "compartment"; + + // Attribute names of the speciesGlyph XML type + public static final String species = "species"; + + // Attribute names of the textGlyph XML type + public static final String graphicalObject = "graphicalObject"; + public static final String text = "text"; + public static final String originOfText = "originOfText"; + + // Attribute names of the speciesReferenceGlyph XML type + public static final String speciesReference = "speciesReference"; + public static final String role = "role"; + + + public static final String basePoint1 = "basePoint1"; + public static final String basePoint2 = "basePoint2"; + public static final String reaction = "reaction"; + +} Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/NamedSBaseGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/NamedSBaseGlyph.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/NamedSBaseGlyph.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -184,7 +184,7 @@ * */ public void unsetNamedSBase() { - setNamedSBase(null); + setNamedSBase((String) null); } } 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-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/Point.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -57,7 +57,7 @@ */ public Point() { super(); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); x = y = z = Double.NaN; } @@ -96,7 +96,7 @@ */ public Point(int level, int version) { super(level, version); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); x = y = z = Double.NaN; } @@ -235,14 +235,14 @@ isAttributeRead = true; - if (attributeName.equals(LayoutConstant.x)) { + if (attributeName.equals(LayoutConstants.x)) { setX(StringTools.parseSBMLDouble(value)); } - else if(attributeName.equals(LayoutConstant.y)) + else if(attributeName.equals(LayoutConstants.y)) { setY(StringTools.parseSBMLDouble(value)); } - else if(attributeName.equals(LayoutConstant.z)) + else if(attributeName.equals(LayoutConstants.z)) { setZ(StringTools.parseSBMLDouble(value)); } @@ -261,7 +261,7 @@ public void setX(double x) { Double oldX = this.x; this.x = x; - firePropertyChange(LayoutConstant.x, oldX, this.x); + firePropertyChange(LayoutConstants.x, oldX, this.x); } /** @@ -271,7 +271,7 @@ public void setY(double y) { Double oldY = this.y; this.y = y; - firePropertyChange(LayoutConstant.y, oldY, this.y); + firePropertyChange(LayoutConstants.y, oldY, this.y); } /** @@ -281,7 +281,7 @@ public void setZ(double z) { Double oldZ = this.z; this.z = z; - firePropertyChange(LayoutConstant.z, oldZ, this.z); + firePropertyChange(LayoutConstants.z, oldZ, this.z); } /* (non-Javadoc) @@ -301,20 +301,20 @@ if (isSetId()) { attributes.remove("id"); - attributes.put(LayoutConstant.shortLabel + ":id", getId()); + attributes.put(LayoutConstants.shortLabel + ":id", getId()); } if (isSetX()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.x, StringTools.toString(Locale.ENGLISH, x)); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.x, StringTools.toString(Locale.ENGLISH, x)); } if (isSetY()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.y, StringTools.toString(Locale.ENGLISH, y)); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.y, StringTools.toString(Locale.ENGLISH, y)); } if (isSetZ()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.z, StringTools.toString(Locale.ENGLISH, z)); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.z, StringTools.toString(Locale.ENGLISH, z)); } return attributes; Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/ReactionGlyph.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -56,7 +56,7 @@ */ public ReactionGlyph() { super(); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -198,7 +198,7 @@ public ListOf<SpeciesReferenceGlyph> getListOfSpeciesReferenceGlyphs() { if (!isSetListOfSpeciesReferencesGlyph()) { listOfSpeciesReferencesGlyph = new ListOf<SpeciesReferenceGlyph>(); - listOfSpeciesReferencesGlyph.addNamespace(LayoutConstant.namespaceURI); + listOfSpeciesReferencesGlyph.addNamespace(LayoutConstants.namespaceURI); listOfSpeciesReferencesGlyph.setSBaseListType(ListOf.Type.other); registerChild(listOfSpeciesReferencesGlyph); } @@ -302,7 +302,7 @@ * @param reaction */ public void setReaction(String reaction) { - setNamedSBase(reaction, LayoutConstant.reaction); + setNamedSBase(reaction, LayoutConstants.reaction); } /** @@ -331,8 +331,8 @@ Map<String, String> attributes = super.writeXMLAttributes(); if (isSetReaction()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.reaction, getReaction()); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.reaction, getReaction()); } return attributes; Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesGlyph.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesGlyph.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -165,10 +165,10 @@ if (isSetId()) { attributes.remove("id"); - attributes.put(LayoutConstant.shortLabel + ":id", getId()); + attributes.put(LayoutConstants.shortLabel + ":id", getId()); } if (isSetSpecies()) { - attributes.put(LayoutConstant.shortLabel + ":species", getSpecies()); + attributes.put(LayoutConstants.shortLabel + ":species", getSpecies()); } return attributes; Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/SpeciesReferenceGlyph.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -267,21 +267,21 @@ isAttributeRead = true; - if(attributeName.equals(LayoutConstant.speciesReference)) + if(attributeName.equals(LayoutConstants.speciesReference)) { setSpeciesReference(value); } - else if(attributeName.equals(LayoutConstant.speciesGlyph)) + else if(attributeName.equals(LayoutConstants.speciesGlyph)) { setSpeciesGlyph(value); } - else if(attributeName.equals(LayoutConstant.role)) + else if(attributeName.equals(LayoutConstants.role)) { try { setRole(SpeciesReferenceRole.valueOf(value.toUpperCase())); } catch (Exception e) { throw new SBMLException("Could not recognized the value '" + value - + "' for the attribute " + LayoutConstant.role + + "' for the attribute " + LayoutConstants.role + " on the 'SpeciesReferenceGlyph' element."); } } @@ -301,7 +301,7 @@ public void setCurve(Curve curve) { Curve oldCurve = this.curve; this.curve = curve; - firePropertyChange(LayoutConstant.curve, oldCurve, this.role); + firePropertyChange(LayoutConstants.curve, oldCurve, this.role); registerChild(this.curve); } @@ -312,7 +312,7 @@ public void setRole(SpeciesReferenceRole valueOf) { SpeciesReferenceRole oldRole = this.role; this.role = valueOf; - firePropertyChange(LayoutConstant.role, oldRole, this.role); + firePropertyChange(LayoutConstants.role, oldRole, this.role); } /** @@ -322,7 +322,7 @@ public void setSpeciesGlyph(String speciesGlyph) { String oldValue = this.speciesGlyph; this.speciesGlyph = speciesGlyph; - firePropertyChange(LayoutConstant.speciesGlyph, oldValue, this.speciesGlyph); + firePropertyChange(LayoutConstants.speciesGlyph, oldValue, this.speciesGlyph); } /** @@ -338,7 +338,7 @@ * @param speciesReference */ public void setSpeciesReference(String speciesReference) { - setNamedSBase(speciesReference, LayoutConstant.speciesReference); + setNamedSBase(speciesReference, LayoutConstants.speciesReference); } /** @@ -356,16 +356,16 @@ Map<String, String> attributes = super.writeXMLAttributes(); if (isSetSpeciesGlyph()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.speciesGlyph, speciesGlyph); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.speciesGlyph, speciesGlyph); } if (isSetSpeciesReference()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.speciesReference, getSpeciesReference()); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.speciesReference, getSpeciesReference()); } if (isSetSpeciesReferenceRole()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.role, role.toString().toLowerCase()); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.role, role.toString().toLowerCase()); } return attributes; Modified: trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/TextGlyph.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/TextGlyph.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/ext/layout/TextGlyph.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -54,7 +54,7 @@ */ public TextGlyph() { super(); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -64,7 +64,7 @@ */ public TextGlyph(int level, int version) { super(level, version); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -73,7 +73,7 @@ */ public TextGlyph(String id) { super(id); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -84,7 +84,7 @@ */ public TextGlyph(String id, int level, int version) { super(id, level, version); - addNamespace(LayoutConstant.namespaceURI); + addNamespace(LayoutConstants.namespaceURI); } /** @@ -210,15 +210,15 @@ if(!isAttributeRead) { - if(attributeName.equals(LayoutConstant.graphicalObject)) + if(attributeName.equals(LayoutConstants.graphicalObject)) { setGraphicalObject(value); } - else if(attributeName.equals(LayoutConstant.text)) + else if(attributeName.equals(LayoutConstants.text)) { setText(value); } - else if(attributeName.equals(LayoutConstant.originOfText)) + else if(attributeName.equals(LayoutConstants.originOfText)) { setOriginOfText(value); } @@ -240,7 +240,7 @@ public void setGraphicalObject(String graphicalObject) { String oldValue = this.graphicalObject; this.graphicalObject = graphicalObject; - firePropertyChange(LayoutConstant.graphicalObject, oldValue, this.graphicalObject); + firePropertyChange(LayoutConstants.graphicalObject, oldValue, this.graphicalObject); } /** @@ -266,7 +266,7 @@ public void setText(String text) { String oldText = this.text; this.text = text; - firePropertyChange(LayoutConstant.text, oldText, this.text); + firePropertyChange(LayoutConstants.text, oldText, this.text); } /* (non-Javadoc) @@ -277,16 +277,16 @@ Map<String, String> attributes = super.writeXMLAttributes(); if (isSetGraphicalObject()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.graphicalObject, graphicalObject); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.graphicalObject, graphicalObject); } if (isSetText()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.text, text); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.text, text); } if (isSetOriginOfText()) { - attributes.put(LayoutConstant.shortLabel + ":" - + LayoutConstant.originOfText, getOriginOfText()); + attributes.put(LayoutConstants.shortLabel + ":" + + LayoutConstants.originOfText, getOriginOfText()); } return attributes; Modified: trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java =================================================================== --- trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java 2012-06-10 06:46:51 UTC (rev 1295) +++ trunk/extensions/layout/src/org/sbml/jsbml/xml/parsers/L3LayoutParser.java 2012-06-10 07:01:58 UTC (rev 1296) @@ -19,30 +19,30 @@ */ package org.sbml.jsbml.xml.parsers; -import static org.sbml.jsbml.ext.layout.LayoutConstant.basePoint1; -import static org.sbml.jsbml.ext.layout.LayoutConstant.basePoint2; -import static org.sbml.jsbml.ext.layout.LayoutConstant.boundingBox; -import static org.sbml.jsbml.ext.layout.LayoutConstant.compartmentGlyph; -import static org.sbml.jsbml.ext.layout.LayoutConstant.curve; -import static org.sbml.jsbml.ext.layout.LayoutConstant.curveSegment; -import static org.sbml.jsbml.ext.layout.LayoutConstant.dimensions; -import static org.sbml.jsbml.ext.layout.LayoutConstant.end; -import static org.sbml.jsbml.ext.layout.LayoutConstant.layout; -import static org.sbml.jsbml.ext.layout.LayoutConstant.listOfAdditionalGraphicalObjects; -import static org.sbml.jsbml.ext.layout.LayoutConstant.listOfCompartmentGlyphs; -import static org.sbml.jsbml.ext.layout.LayoutConstant.listOfCurveSegments; -import static org.sbml.jsbml.ext.layout.LayoutConstant.listOfLayouts; -import static org.sbml.jsbml.ext.layout.LayoutConstant.listOfReactionGlyphs; -import static org.sbml.jsbml.ext.layout.LayoutConstant.listOfSpeciesGlyphs; -import static org.sbml.jsbml.ext.layout.LayoutConstant.listOfSpeciesReferenceGlyphs; -import static org.sbml.jsbml.ext.layout.LayoutConstant.listOfTextGlyphs; -import static org.sbml.jsbml.ext.layout.LayoutConstant.namespaceURI; -import static org.sbml.jsbml.ext.layout.LayoutConstant.position; -import static org.sbml.jsbml.ext.layout.LayoutConstant.reactionGlyph; -import static org.sbml.jsbml.ext.layout.LayoutConstant.speciesGlyph; -import static org.sbml.jsbml.ext.layout.LayoutConstant.speciesReferenceGlyph; -import static org.sbml.jsbml.ext.layout.LayoutConstant.start; -import static org.sbml.jsbml.ext.layout.LayoutConstant.textGlyph; +import static org.sbml.jsbml.ext.layout.LayoutConstants.basePoint1; +import static org.sbml.jsbml.ext.layout.LayoutConstants.basePoint2; +import static org.sbml.jsbml.ext.layout.LayoutConstants.boundingBox; +import static org.sbml.jsbml.ext.layout.LayoutConstants.compartmentGlyph; +import static org.sbml.jsbml.ext.layout.LayoutConstants.curve; +import static org.sbml.jsbml.ext.layout.LayoutConstants.curveSegment; +import static org.sbml.jsbml.ext.layout.LayoutConstants.dimensions; +import static org.sbml.jsbml.ext.layout.LayoutConstants.end; +import static org.sbml.jsbml.ext.layout.LayoutConstants.layout; +import static org.sbml.jsbml.ext.layout.LayoutConstants.listOfAdditionalGraphicalObjects; +import static org.sbml.jsbml.ext.layout.LayoutConstants.listOfCompartmentGlyphs; +import static org.sbml.jsbml.ext.layout.LayoutConstants.listOfCurveSegments; +import static org.sbml.jsbml.ext.layout.LayoutConstants.listOfLayouts; +import static org.sbml.jsbml.ext.layout.LayoutConstants.listOfReactionGlyphs; +import static org.sbml.jsbml.ext.layout.LayoutConstants.listOfSpeciesGlyphs; +import static org.sbml.jsbml.ext.layout.LayoutConstants.listOfSpeciesReferenceGlyphs; +import static org.sbml.jsbml.ext.layout.LayoutConstants.listOfTextGlyphs; +import static org.sbml.jsbml.ext.layout.LayoutConstants.namespaceURI; +import static org.sbml.jsbml.ext.layout.LayoutConstants.position; +import static org.sbml.jsbml.ext.layout.LayoutConstants.reactionGlyph; +import static org.sbml.jsbml.ext.layout.LayoutConstants.speciesGlyph; +import static org.sbml.jsbml.ext.layout.LayoutConstants.speciesReferenceGlyph; +import static org.sbml.jsbml.ext.layout.LayoutConstants.start; +import static org.sbml.jsbml.ext.layout.LayoutConstants.textGlyph; import java.util.ArrayList; @@ -62,7 +62,7 @@ import org.sbml.jsbml.ext.layout.ExtendedLayoutModel; import org.sbml.jsbml.ext.layout.GraphicalObject; import org.sbml.jsbml.ext.layout.Layout; -import org.sbml.jsbml.ext.layout.LayoutConstant; +import org.sbml.jsbml.ext.layout.LayoutConstants; import org.sbml.jsbml.ext.layout.Position; import org.sbml.jsbml.ext.layout.ReactionGlyph; import org.sbml.jsbml.ext.layout.SpeciesGlyph; @@ -90,11 +90,11 @@ * @return the namespaceURI of this parser. */ public String getNamespaceURI() { - return LayoutConstant.namespaceURI; + return LayoutConstants.namespaceURI; } public String getShortLabel() { - return LayoutConstant.shortLabel; + return LayoutConstants.shortLabel; } private Logger logger = Logger.getLogger(L3LayoutParser.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |