From: <nik...@us...> - 2014-12-10 14:08:00
|
Revision: 2101 http://sourceforge.net/p/jsbml/code/2101 Author: niko-rodrigue Date: 2014-12-10 14:07:48 +0000 (Wed, 10 Dec 2014) Log Message: ----------- only the package shortlabel should be used to get extension/plugin objects. Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSpeciesPlugin.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2014-12-09 19:27:27 UTC (rev 2100) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2014-12-10 14:07:48 UTC (rev 2101) @@ -113,7 +113,7 @@ Model model = getModel(); - SpatialModelPlugin m = (SpatialModelPlugin) model.getExtension(SpatialConstants.packageName); + SpatialModelPlugin m = (SpatialModelPlugin) model.getExtension(SpatialConstants.shortLabel); //TODO: Get the correct element in geometry using the spid return m.getGeometry(); } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSpeciesPlugin.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSpeciesPlugin.java 2014-12-09 19:27:27 UTC (rev 2100) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialSpeciesPlugin.java 2014-12-10 14:07:48 UTC (rev 2101) @@ -268,7 +268,7 @@ // // for (Parameter p: params) { // SpatialParameterPlugin paramPlugin = - // (SpatialParameterPlugin) p.getExtension(SpatialConstants.packageName); + // (SpatialParameterPlugin) p.getExtension(SpatialConstants.shortLabel); // // if (paramPlugin != null) { // ParameterType paramType = paramPlugin.getParamType(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-21 13:00:39
|
Revision: 2194 http://sourceforge.net/p/jsbml/code/2194 Author: pdp10 Date: 2015-04-21 13:00:30 +0000 (Tue, 21 Apr 2015) Log Message: ----------- Removed the String compartment from CompartmentMapping, as this class is now a field of SpatialCompartmentPluging in the package spatial, version 0.90. Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialCompartmentPlugin.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java 2015-04-21 12:59:30 UTC (rev 2193) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java 2015-04-21 13:00:30 UTC (rev 2194) @@ -30,7 +30,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -44,11 +45,6 @@ /** * */ - private String compartment; - - /** - * - */ private String domainType; /** @@ -70,9 +66,6 @@ public CompartmentMapping(CompartmentMapping cm) { super(cm); - if (cm.isSetCompartment()) { - compartment = new String(cm.getCompartment()); - } if (cm.isSetDomainType()) { domainType = new String(cm.getDomainType()); } @@ -117,10 +110,6 @@ if (equal) { CompartmentMapping cm = (CompartmentMapping) object; - equal &= cm.isSetCompartment() == isSetCompartment(); - if (equal && isSetCompartment()) { - equal &= cm.getCompartment().equals(getCompartment()); - } equal &= cm.isSetDomainType() == isSetDomainType(); if (equal && isSetDomainType()) { equal &= cm.getDomainType().equals(getDomainType()); @@ -133,56 +122,8 @@ return equal; } - /** - * Returns the value of compartment - * - * @return the value of compartment - */ - public String getCompartment() { - if (isSetCompartment()) { - return compartment; - } - // This is necessary if we cannot return null here. - throw new PropertyUndefinedError(SpatialConstants.compartment, this); - } /** - * Returns whether compartment is set - * - * @return whether compartment is set - */ - public boolean isSetCompartment() { - return compartment != null; - } - - - /** - * Sets the value of compartment - * @param compartment - */ - public void setCompartment(String compartment) { - String oldCompartment = this.compartment; - this.compartment = compartment; - firePropertyChange(SpatialConstants.compartment, oldCompartment, this.compartment); - } - - /** - * Unsets the variable compartment - * - * @return {@code true}, if compartment was set before, - * otherwise {@code false} - */ - public boolean unsetCompartment() { - if (isSetCompartment()) { - String oldCompartment = compartment; - compartment = null; - firePropertyChange(SpatialConstants.compartment, oldCompartment, compartment); - return true; - } - return false; - } - - /** * Returns the value of domainType * * @return the value of domainType @@ -307,11 +248,8 @@ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1319;//Changed, it was 983 int hashCode = super.hashCode(); - if (isSetCompartment()) { - hashCode += prime * getCompartment().hashCode(); - } if (isSetDomainType()) { hashCode += prime * getDomainType().hashCode(); } @@ -325,10 +263,6 @@ @Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); - if (isSetCompartment()) { - attributes.remove("compartment"); - attributes.put(SpatialConstants.shortLabel + ":compartment", getCompartment()); - } if (isSetDomainType()) { attributes.remove("domainType"); attributes.put(SpatialConstants.shortLabel + ":domainType", @@ -349,10 +283,7 @@ && (SpatialConstants.shortLabel == prefix); if (!isAttributeRead) { isAttributeRead = true; - if (attributeName.equals(SpatialConstants.compartment)) { - setCompartment(value); - } - else if (attributeName.equals(SpatialConstants.domainType)) { + if (attributeName.equals(SpatialConstants.domainType)) { setDomainType(value); } else if (attributeName.equals(SpatialConstants.unitSize)) { @@ -372,9 +303,7 @@ @Override public String toString() { StringBuilder builder = new StringBuilder(); - builder.append("CompartmentMapping [compartment="); - builder.append(compartment); - builder.append(", domainType="); + builder.append("CompartmentMapping [domainType="); builder.append(domainType); builder.append(", unitSize="); builder.append(unitSize); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialCompartmentPlugin.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialCompartmentPlugin.java 2015-04-21 12:59:30 UTC (rev 2193) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialCompartmentPlugin.java 2015-04-21 13:00:30 UTC (rev 2194) @@ -22,6 +22,7 @@ package org.sbml.jsbml.ext.spatial; import java.text.MessageFormat; +import java.util.Map; import org.sbml.jsbml.Compartment; import org.sbml.jsbml.ListOf; @@ -29,7 +30,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -198,5 +200,54 @@ throw new IndexOutOfBoundsException(MessageFormat.format( "Index {0,number,integer} >= {1,number,integer}", index,pos)); } + + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + if (isSetCompartmentMapping()) { + attributes.remove("compartmentMapping"); + attributes.put(SpatialConstants.shortLabel + ":compartmentMapping", + getCompartmentMapping()); + } + return attributes; + } + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) + && (SpatialConstants.shortLabel == prefix); + if (!isAttributeRead) { + isAttributeRead = true; + if (attributeName.equals(SpatialConstants.compartmentMapping)) { + setCompartmentMapping(value); + } + else { + isAttributeRead = false; + } + } + return isAttributeRead; + } + + @Override + public int hashCode() { + final int prime = 1259; + int hashCode = super.hashCode(); + if (isSetCompartmentMapping()) { + hashCode += prime * getCompartmentMapping().hashCode(); + } + return hashCode; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("SpatialCompartmentPlugin [compartmentMapping="); + builder.append(compartmentMapping); + builder.append("]"); + return builder.toString(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-21 13:25:57
|
Revision: 2197 http://sourceforge.net/p/jsbml/code/2197 Author: pdp10 Date: 2015-04-21 13:25:49 +0000 (Tue, 21 Apr 2015) Log Message: ----------- update for 0.90 spatial specs Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java 2015-04-21 13:15:20 UTC (rev 2196) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java 2015-04-21 13:25:49 UTC (rev 2197) @@ -33,7 +33,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -103,6 +104,11 @@ this.spatialId = spatialId; } + @Override + public AbstractSpatialNamedSBase clone() { + return new AbstractSpatialNamedSBase(this); + } + /** * Initializes the default values using the namespace. */ Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.java 2015-04-21 13:15:20 UTC (rev 2196) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialSBasePlugin.java 2015-04-21 13:25:49 UTC (rev 2197) @@ -31,6 +31,7 @@ /** * * @author Alex Thomas + * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 * @date Jan 22, 2014 @@ -65,6 +66,11 @@ initDefaults(); } + @Override + public AbstractSpatialSBasePlugin clone() { + return new AbstractSpatialSBasePlugin(this); + } + /** * Initializes the default values using the namespace. */ @@ -139,5 +145,10 @@ SBMLDocument doc = getSBMLDocument(); return doc != null ? doc.getModel() : null; } + + @Override + public String toString() { + return super.toString(); + } } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java 2015-04-21 13:15:20 UTC (rev 2196) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java 2015-04-21 13:25:49 UTC (rev 2197) @@ -39,14 +39,13 @@ /** * Generated serial version identifier. */ - private static final long serialVersionUID = 8982184068116596444L; - + private static final long serialVersionUID = 8982184068116596444L; + /** * */ private CoordinateKind coordinate; - /** * */ Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticGeometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticGeometry.java 2015-04-21 13:15:20 UTC (rev 2196) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticGeometry.java 2015-04-21 13:25:49 UTC (rev 2197) @@ -24,6 +24,7 @@ import java.text.MessageFormat; import java.util.Collection; import java.util.List; +import java.util.Map; import javax.swing.tree.TreeNode; @@ -33,7 +34,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -283,5 +285,49 @@ } return equal; } + + @Override + public int hashCode() { + final int prime = 1039;//Change this prime number + int hashCode = super.hashCode(); + if (isSetListOfAnalyticVolumes()) { + hashCode += prime * getListOfAnalyticVolumes().hashCode(); + } + return hashCode; + } + + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + if (isSetListOfAnalyticVolumes()) { + attributes.put(SpatialConstants.shortLabel + ":listOfAnalyticVolumes", getListOfAnalyticVolumes().toString()); + } + return attributes; + } + + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) + && (SpatialConstants.shortLabel == prefix); + if (!isAttributeRead) { + isAttributeRead = true; + if (attributeName.equals(SpatialConstants.listOfAnalyticVolumes)) { + try { + setListOfAnalyticVolumes(listOfAnalyticVolumes.valueOf(value)); + } catch (Exception e) { + MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ"), value, + SpatialConstants.listOfAnalyticVolumes); + } + } + else { + isAttributeRead = false; + } + } + return isAttributeRead; + } + + } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java 2015-04-21 13:15:20 UTC (rev 2196) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java 2015-04-21 13:25:49 UTC (rev 2197) @@ -35,7 +35,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -110,6 +111,9 @@ if (node.isSetFunctionType()) { functionType = node.getFunctionType(); } + if (node.isSetDomainType()) { + domainType = node.getDomainType(); + } } /** @@ -372,7 +376,7 @@ */ @Override public int hashCode() { - final int prime = 431;//Change this prime number + final int prime = 1093;//Changed. It was 431 int hashCode = super.hashCode(); if (isSetSpatialId()) { hashCode += prime * getSpatialId().hashCode(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java 2015-04-21 13:15:20 UTC (rev 2196) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java 2015-04-21 13:25:49 UTC (rev 2197) @@ -37,7 +37,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -451,7 +452,13 @@ } if (isSetUnits()) { hashCode += prime * getUnits().hashCode(); - } + } + if (isSetBoundaryMaximum()) { + hashCode += prime * getBoundaryMaximum()().hashCode(); + } + if (isSetBoundaryMinimum()) { + hashCode += prime * getBoundaryMinimum()().hashCode(); + } return hashCode; } @@ -502,6 +509,14 @@ attributes.remove("unit"); attributes.put(SpatialConstants.shortLabel+":unit", getUnits()); } + if (isSetBoundaryMaximum()()) { + attributes.remove("boundaryMaximum"); + attributes.put(SpatialConstants.shortLabel+":boundaryMaximum", getBoundaryMaximum()()); + } + if (isSetBoundaryMinimum()()) { + attributes.remove("boundaryMinimum"); + attributes.put(SpatialConstants.shortLabel+":boundaryMinimum", getBoundaryMinimum()()); + } return attributes; } @@ -532,6 +547,22 @@ SpatialConstants.unit); } } + else if (attributeName.equals(SpatialConstants.boundaryMaximum)) { + try { + setBoundaryMaximum(value); + } catch (Exception e) { + MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, + SpatialConstants.boundaryMaximum); + } + } + else if (attributeName.equals(SpatialConstants.boundaryMinimum)) { + try { + setBoundaryMinimum(value); + } catch (Exception e) { + MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, + SpatialConstants.boundaryMinimum); + } + } else { isAttributeRead = false; } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java 2015-04-21 13:15:20 UTC (rev 2196) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java 2015-04-21 13:25:49 UTC (rev 2197) @@ -32,6 +32,7 @@ /** * @author Alex Thomas * @author Andreas Dräger + * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 * @date 09.09.2011 @@ -121,7 +122,7 @@ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1373;//Changed, it was 983 int hashCode = super.hashCode(); if (isSetCoordinate()) { hashCode += prime * getCoordinate().hashCode(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-04-21 13:15:20 UTC (rev 2196) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-04-21 13:25:49 UTC (rev 2197) @@ -60,7 +60,7 @@ /** * Refers to species object that the parameter is associated with */ - private String speciesRef; + private String speciesRef; // TODO Check whether this is the correct name. /** * Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-21 13:15:20 UTC (rev 2196) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-21 13:25:49 UTC (rev 2197) @@ -352,10 +352,13 @@ * */ public static final String listOfGeometryDefinitions = "listOfGeometryDefinitions"; - /** * */ + public static final String listOfAnalyticVolumes = "listOfAnalyticVolumes"; + /** + * + */ public static final String coordinateComponent = "coordinateComponent"; /** * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-21 15:40:07
|
Revision: 2203 http://sourceforge.net/p/jsbml/code/2203 Author: pdp10 Date: 2015-04-21 15:40:05 +0000 (Tue, 21 Apr 2015) Log Message: ----------- update for package spatial v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGHomogeneousTransformation.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/DiffusionCoefficient.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DomainType.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGHomogeneousTransformation.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGHomogeneousTransformation.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGHomogeneousTransformation.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -29,6 +29,7 @@ /** * @author Alex-Thomas + * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 * @date Jan 20, 2014 @@ -99,8 +100,20 @@ return new CSGHomogeneousTransformation(this); } - @Override + public int hashCode() { + final int prime = 1697; + int hashCode = super.hashCode(); + if (isSetForwardTransformation()) { + hashCode += prime * getForwardTransformation().hashCode(); + } + if (isSetReverseTransformation()) { + hashCode += prime * getReverseTransformation().hashCode(); + } + return hashCode; + } + + @Override public boolean equals(Object object) { boolean equal = super.equals(object); if (equal) { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -79,19 +79,15 @@ */ public CSGObject(CSGObject csgo) { super(csgo); - if (csgo.isSetDomainType()) { - domainType = new String(csgo.getDomainType()); + setDomainType(csgo.getDomainType()); } - if (csgo.isSetOrdinal()) { - ordinal = new Integer(csgo.getOrdinal()); + setOrdinal(csgo.getOrdinal()); } - if (csgo.isSetCSGNode()) { setCSGNode((CSGNode) csgo.getCSGNode().clone()); } - } @@ -303,7 +299,7 @@ @Override public int hashCode() { - final int prime = 1999;//Change this prime number + final int prime = 1669; int hashCode = super.hashCode(); if (isSetOrdinal()) { hashCode += prime * getOrdinal(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -103,12 +103,9 @@ */ public CSGPrimitive(CSGPrimitive csgp) { super(csgp); - - if (csgp.isSetPrimitiveType()) { - primitiveType = csgp.getPrimitiveType(); + setPrimitiveType(csgp.getPrimitiveType()); } - } @@ -213,7 +210,7 @@ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1081; int hashCode = super.hashCode(); if (isSetPrimitiveType()) { hashCode += prime * getPrimitiveType().hashCode(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPseudoPrimitive.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPseudoPrimitive.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPseudoPrimitive.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -64,11 +64,9 @@ */ public CSGPseudoPrimitive(CSGPseudoPrimitive csgp) { super(csgp); - if (csgp.isSetCsgObjectRef()) { - csgObjectRef = new String(csgp.getCsgObjectRef()); + setCsgObjectRef(csgp.getCsgObjectRef()); } - } @@ -166,7 +164,7 @@ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1741; int hashCode = super.hashCode(); if (isSetCsgObjectRef()) { hashCode += prime * getCsgObjectRef().hashCode(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -29,6 +29,7 @@ /** * @author Alex Thomas + * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 * @date Jan 20, 2014 @@ -70,17 +71,19 @@ public CSGRotation(CSGRotation csgt) { super(csgt); if (csgt.isSetRotateAxisX()) { - rotateAxisX = new Double(csgt.getRotateAxisX()); + setRotateAxisX(csgt.getRotateAxisX()); } if (csgt.isSetRotateAxisY()) { - rotateAxisY = new Double(csgt.getRotateAxisY()); + setRotateAxisY(csgt.getRotateAxisY()); } if (csgt.isSetRotateAxisZ()) { - rotateAxisZ = new Double(csgt.getRotateAxisZ()); + setRotateAxisZ(csgt.getRotateAxisZ()); } + if (csgt.isSetRotateAngleInRadians()) { + setRotateAngleInRadians(csgt.getRotateAngleInRadians()); + } } - /** * @param level * @param version @@ -345,7 +348,7 @@ @Override public int hashCode() { - final int prime = 313;//Change this prime number + final int prime = 1787; int hashCode = super.hashCode(); if (isSetRotateAxisX()) { hashCode += prime * getRotateAxisX(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -30,6 +30,7 @@ /** * @author Alex Thomas + * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 * @date Jan 20, 2014 @@ -68,13 +69,13 @@ public CSGScale(CSGScale csgt) { super(csgt); if (csgt.isSetScaleX()) { - scaleX = new Double(csgt.getScaleX()); + setScaleX(csgt.getScaleX()); } if (csgt.isSetScaleY()) { - scaleY = new Double(csgt.getScaleY()); + setScaleY(csgt.getScaleY()); } if (csgt.isSetScaleZ()) { - scaleZ = new Double(csgt.getScaleZ()); + setScaleZ(csgt.getScaleZ()); } } @@ -288,7 +289,7 @@ @Override public int hashCode() { - final int prime = 313;//Change this prime number + final int prime = 1777; int hashCode = super.hashCode(); if (isSetScaleX()) { hashCode += prime * getScaleX(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -36,6 +36,7 @@ /** * @author Alex Thomas + * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 * @date Jan 20, 2014 @@ -105,15 +106,15 @@ } if (csgso.isSetOperationType()) { - operationType = csgso.getOperationType(); + setOperationType(csgso.getOperationType()); } if (csgso.isSetComplementA()) { - complementA = new String(csgso.getComplementA()); + setComplementA(csgso.getComplementA()); } if (csgso.isSetComplementB()) { - complementB = new String(csgso.getComplementB()); + setComplementB(csgso.getComplementB()); } } @@ -638,7 +639,7 @@ */ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1861; int hashCode = super.hashCode(); if (isSetOperationType()) { hashCode += prime * getOperationType().hashCode(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTransformation.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTransformation.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTransformation.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -29,6 +29,7 @@ /** * @author Alex-Thomas + * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 * @date Jan 20, 2014 Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -29,6 +29,7 @@ /** * @author Alex-Thomas + * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 * @date Jan 20, 2014 @@ -66,13 +67,13 @@ public CSGTranslation(CSGTranslation csgt) { super(csgt); if (csgt.isSetTranslateX()) { - translateX = new Double(csgt.getTranslateX()); + setTranslateX(csgt.getTranslateX()); } if (csgt.isSetTranslateY()) { - translateY = new Double(csgt.getTranslateY()); + setTranslateY(csgt.getTranslateY()); } if (csgt.isSetTranslateZ()) { - translateZ = new Double(csgt.getTranslateZ()); + setTranslateZ(csgt.getTranslateZ()); } } @@ -286,7 +287,7 @@ @Override public int hashCode() { - final int prime = 313;//Change this prime number + final int prime = 1693; int hashCode = super.hashCode(); if (isSetTranslateX()) { hashCode += prime * getTranslateX(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -92,15 +92,15 @@ super(diffCoeff); if (diffCoeff.isSetDiffusionKind()) { - diffusionKind = diffCoeff.getDiffusionKind(); + setDiffusionKind(diffCoeff.getDiffusionKind()); } if (diffCoeff.isSetCoordinateReference1()) { - coordinateReference1 = diffCoeff.getCoordinateReference1(); + setCoordinateReference1(diffCoeff.getCoordinateReference1()); } if (diffCoeff.isSetCoordinateReference2()) { - coordinateReference2 = diffCoeff.getCoordinateReference2(); + setCoordinateReference2(diffCoeff.getCoordinateReference2()); } } @@ -314,7 +314,7 @@ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1531; int hashCode = super.hashCode(); if (isSetDiffusionKind()) { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -96,7 +96,7 @@ setListOfInteriorPoints(dm.getListOfInteriorPoints().clone()); } if (dm.isSetDomainType()) { - domainType = new String(dm.getDomainType()); + setDomainType(dm.getDomainType()); } } @@ -359,11 +359,14 @@ */ @Override public int hashCode() { - final int prime = 1531;//Change this prime number + final int prime = 1571; int hashCode = super.hashCode(); if (isSetDomainType()) { hashCode += prime * getDomainType().hashCode(); } + if (isSetListOfInteriorPoints()) { + hashCode += prime * getListOfInteriorPoints().hashCode(); + } return hashCode; } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DomainType.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DomainType.java 2015-04-21 15:04:20 UTC (rev 2202) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DomainType.java 2015-04-21 15:40:05 UTC (rev 2203) @@ -62,7 +62,7 @@ public DomainType(DomainType sb) { super(sb); if (sb.isSetSpatialDimensions()) { - spatialDimensions = Integer.valueOf(sb.getSpatialDimensions()); + setSpatialDimensions(sb.getSpatialDimensions()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-22 08:09:46
|
Revision: 2204 http://sourceforge.net/p/jsbml/code/2204 Author: pdp10 Date: 2015-04-22 08:09:38 +0000 (Wed, 22 Apr 2015) Log Message: ----------- update for spatial package v0.90 Modified Paths: -------------- 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/ImageData.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/MixedGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-04-21 15:40:05 UTC (rev 2203) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-04-22 08:09:38 UTC (rev 2204) @@ -37,7 +37,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -112,25 +113,28 @@ * @param sb */ public Geometry(Geometry sb) { - super(sb); - if (sb.isSetCoordinateSystem()) { - setCoordinateSystem(sb.getCoordinateSystem()); - } + super(sb); + if (sb.isSetListOfCoordinateComponents()) { + setListOfCoordinateComponents(sb.getListOfCoordinateComponents().clone()); + } + if (sb.isSetListOfDomainTypes()) { + setListOfDomainTypes(sb.getListOfDomainTypes().clone()); + } + if (sb.isSetListOfDomains()) { + setListOfDomains(sb.getListOfDomains().clone()); + } if (sb.isSetListOfAdjacentDomains()) { setListOfAdjacentDomains(sb.getListOfAdjacentDomains().clone()); } - if (sb.isSetListOfDomains()) { - setListOfDomains(sb.getListOfDomains().clone()); - } - if (sb.isSetListOfDomainTypes()) { - setListOfDomainTypes(sb.getListOfDomainTypes().clone()); - } if (sb.isSetListOfGeometryDefinitions()) { setListOfGeometryDefinitions(sb.getListOfGeometryDefinitions().clone()); } if (sb.isSetListOfSampledFields()) { setListOfSampledFields(sb.getListOfSampledFields().clone()); } + if (sb.isSetCoordinateSystem()) { + setCoordinateSystem(sb.getCoordinateSystem()); + } } /** @@ -196,7 +200,6 @@ if (equal && isSetListOfSampledFields()) { equal &= gm.getListOfSampledFields() == getListOfSampledFields(); } - } return equal; } @@ -529,7 +532,7 @@ * Creates a new GeometryDefinition element and adds it to the ListOfGeometryDefinitions list * @return */ - public SampledFieldGeometry createSampledFieldGeometryn() { + public SampledFieldGeometry createSampledFieldGeometry() { return createSampledFieldGeometry(null); } @@ -1237,16 +1240,6 @@ attributes.remove("coordinateSystem"); attributes.put(SpatialConstants.shortLabel + ':' + SpatialConstants.coordinateSystem, coordinateSystem.toString()); } - if (isSetSBOTerm()) { - attributes.remove(TreeNodeChangeEvent.sboTerm); - attributes.put(SpatialConstants.shortLabel + ":" + TreeNodeChangeEvent.sboTerm, getSBOTermID()); - } - if (isSetMetaId()) { - attributes.remove(TreeNodeChangeEvent.metaId); - attributes.put(SpatialConstants.shortLabel + ":" + TreeNodeChangeEvent.metaId, getMetaId()); - } - //TODO: Not sure why sboTerm and metaId are written here...? - return attributes; } @@ -1260,6 +1253,24 @@ if (isSetCoordinateSystem()) { hashCode += prime * coordinateSystem.hashCode(); } + if (isSetListOfAdjacentDomains()) { + hashCode += prime * listOfAdjacentDomains.hashCode(); + } + if (isSetListOfCoordinateComponents()) { + hashCode += prime * listOfCoordinateComponents.hashCode(); + } + if (isSetListOfDomains()) { + hashCode += prime * listOfDomains.hashCode(); + } + if (isSetListOfDomainTypes()) { + hashCode += prime * listOfDomainTypes.hashCode(); + } + if (isSetListOfGeometryDefinitions()) { + hashCode += prime * listOfGeometryDefinitions.hashCode(); + } + if (isSetListOfSampledFields()) { + hashCode += prime * listOfSampledFields.hashCode(); + } return hashCode; } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java 2015-04-21 15:40:05 UTC (rev 2203) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java 2015-04-22 08:09:38 UTC (rev 2204) @@ -170,7 +170,7 @@ */ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1559; int hashCode = super.hashCode(); if (isSetIsActive()) { hashCode += prime * getIsActive().hashCode(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ImageData.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ImageData.java 2015-04-21 15:40:05 UTC (rev 2203) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ImageData.java 2015-04-22 08:09:38 UTC (rev 2204) @@ -34,7 +34,8 @@ * @author Alex Thomas * @author Andreas Dräger * @since 1.0 - * @version $Rev$ + * @version $Rev$ + * @deprecated */ public class ImageData extends AbstractSBase { @@ -46,11 +47,11 @@ /** * */ - private Integer samplesLength; + private Integer samplesLength; // TODO: is this field really required?? /** * */ - private Integer samples[]; + private Integer[] samples; /** * @@ -71,11 +72,11 @@ public ImageData(ImageData im) { super(im); if (im.isSetSamples()) { - samples = im.getSamples().clone(); + setSamples(im.getSamples().clone()); samplesLength = samples.length; } if (im.isSetDataType()) { - dataType = new String(im.getDataType()); + setDataType(im.getDataType()); } } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java 2015-04-21 15:40:05 UTC (rev 2203) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java 2015-04-22 08:09:38 UTC (rev 2204) @@ -35,7 +35,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -341,7 +342,7 @@ */ @Override public int hashCode() { - final int prime = 509;//Change this prime number + final int prime = 1627; int hashCode = super.hashCode(); if (isSetCoord1()) { hashCode += prime * getCoord1(); @@ -360,25 +361,14 @@ public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetCoord1()) { - attributes.remove("coord1"); attributes.put(SpatialConstants.shortLabel + ":coord1", String.valueOf(getCoord1())); } if (isSetCoord2()) { - attributes.remove("coord2"); attributes.put(SpatialConstants.shortLabel + ":coord2", String.valueOf(getCoord2())); } if (isSetCoord3()) { - attributes.remove("coord3"); attributes.put(SpatialConstants.shortLabel + ":coord3", String.valueOf(getCoord3())); } - if (isSetSBOTerm()) { - attributes.remove(TreeNodeChangeEvent.sboTerm); - attributes.put(SpatialConstants.shortLabel + ":" + TreeNodeChangeEvent.sboTerm, getSBOTermID()); - } - if (isSetMetaId()) { - attributes.remove(TreeNodeChangeEvent.metaId); - attributes.put(SpatialConstants.shortLabel + ":" + TreeNodeChangeEvent.metaId, getMetaId()); - } return attributes; } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/MixedGeometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/MixedGeometry.java 2015-04-21 15:40:05 UTC (rev 2203) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/MixedGeometry.java 2015-04-22 08:09:38 UTC (rev 2204) @@ -121,6 +121,19 @@ return equal; } + @Override + public int hashCode() { + final int prime = 1543; + int hashCode = super.hashCode(); + if (isSetListOfGeometryDefinitions()) { + hashCode += prime * getListOfGeometryDefinitions().hashCode(); + } + if (isSetListOfOrdinalMappings()) { + hashCode += prime * getListOfOrdinalMappings().hashCode(); + } + return hashCode; + } + /** * Returns {@code true}, if listOfGeometryDefinitions contains at least one element. * Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java 2015-04-21 15:40:05 UTC (rev 2203) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java 2015-04-22 08:09:38 UTC (rev 2204) @@ -67,7 +67,7 @@ super(om); if (om.isSetGeometryDefinition()) { - setGeometryDefinition(new String(om.getGeometryDefinition())); + setGeometryDefinition(om.getGeometryDefinition()); } if (om.isSetOrdinal()) { setOrdinal(om.getOrdinal()); @@ -228,7 +228,7 @@ */ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 2039; int hashCode = super.hashCode(); if (isSetOrdinal()) { hashCode += prime * getOrdinal(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-04-21 15:40:05 UTC (rev 2203) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-04-22 08:09:38 UTC (rev 2204) @@ -87,10 +87,10 @@ public ParameterType(ParameterType ref) { super(ref); if (ref.isSetSpId()) { - spId = new String(ref.getSpId()); + setSpId(ref.getSpId()); } if (ref.isSetSpeciesReference()) { - speciesRef = new String(ref.getSpeciesReference()); + setSpeciesReference(ref.getSpeciesReference()); } } @@ -280,7 +280,7 @@ */ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1901; int hashCode = super.hashCode(); if (isSetSpId()) { hashCode += prime * getSpId().hashCode(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nik...@us...> - 2015-04-22 09:58:02
|
Revision: 2206 http://sourceforge.net/p/jsbml/code/2206 Author: niko-rodrigue Date: 2015-04-22 09:57:59 +0000 (Wed, 22 Apr 2015) Log Message: ----------- corrected the spatial package classes to avoid NullPointerException when setting int/Integer, double/Double or boolean/Boolean (because of the auto-boxing) Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Boundary.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.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/CSGTranslation.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.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/InteriorPoint.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticGeometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticGeometry.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticGeometry.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -24,7 +24,6 @@ import java.text.MessageFormat; import java.util.Collection; import java.util.List; -import java.util.Map; import javax.swing.tree.TreeNode; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Boundary.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Boundary.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Boundary.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -126,7 +126,7 @@ * @param value */ public void setValue(double value) { - double oldValue = this.value; + Double oldValue = this.value; this.value = value; firePropertyChange(SpatialConstants.value, oldValue, this.value); } @@ -140,7 +140,7 @@ */ public boolean unsetValue() { if (isSetValue()) { - double oldValue = value; + Double oldValue = value; value = null; firePropertyChange(SpatialConstants.value, oldValue, value); return true; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -224,7 +224,7 @@ * @param ordinal */ public void setOrdinal(int ordinal) { - int oldOrdinal = this.ordinal; + Integer oldOrdinal = this.ordinal; this.ordinal = ordinal; firePropertyChange(SpatialConstants.ordinal, oldOrdinal, this.ordinal); } @@ -238,7 +238,7 @@ */ public boolean unsetOrdinal() { if (isSetOrdinal()) { - int oldOrdinal = ordinal; + Integer oldOrdinal = ordinal; ordinal = null; firePropertyChange(SpatialConstants.ordinal, oldOrdinal, ordinal); return true; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -168,7 +168,7 @@ * @param rotateAxisX */ public void setRotateAxisX(double rotateAxisX) { - double oldRotateAxisX = this.rotateAxisX; + Double oldRotateAxisX = this.rotateAxisX; this.rotateAxisX = rotateAxisX; firePropertyChange(SpatialConstants.rotateAxisX, oldRotateAxisX, this.rotateAxisX); } @@ -182,7 +182,7 @@ */ public boolean unsetRotateAxisX() { if (isSetRotateAxisX()) { - double oldRotateAxisX = rotateAxisX; + Double oldRotateAxisX = rotateAxisX; rotateAxisX = null; firePropertyChange(SpatialConstants.rotateAxisX, oldRotateAxisX, rotateAxisX); return true; @@ -220,7 +220,7 @@ * @param rotateAxisY */ public void setRotateAxisY(double rotateAxisY) { - double oldRotateAxisY = this.rotateAxisY; + Double oldRotateAxisY = this.rotateAxisY; this.rotateAxisY = rotateAxisY; firePropertyChange(SpatialConstants.rotateAxisY, oldRotateAxisY, this.rotateAxisY); } @@ -234,7 +234,7 @@ */ public boolean unsetRotateAxisY() { if (isSetRotateAxisY()) { - double oldRotateAxisY = rotateAxisY; + Double oldRotateAxisY = rotateAxisY; rotateAxisY = null; firePropertyChange(SpatialConstants.rotateAxisY, oldRotateAxisY, rotateAxisY); return true; @@ -272,7 +272,7 @@ * @param rotateAxisZ */ public void setRotateAxisZ(double rotateAxisZ) { - double oldRotateAxisZ = this.rotateAxisZ; + Double oldRotateAxisZ = this.rotateAxisZ; this.rotateAxisZ = rotateAxisZ; firePropertyChange(SpatialConstants.rotateAxisZ, oldRotateAxisZ, this.rotateAxisZ); } @@ -286,7 +286,7 @@ */ public boolean unsetRotateAxisZ() { if (isSetRotateAxisZ()) { - double oldRotateAxisZ = rotateAxisZ; + Double oldRotateAxisZ = rotateAxisZ; rotateAxisZ = null; firePropertyChange(SpatialConstants.rotateAxisZ, oldRotateAxisZ, rotateAxisZ); return true; @@ -324,7 +324,7 @@ * @param rotateAngleInRadians */ public void setRotateAngleInRadians(double rotateAngleInRadians) { - double oldRotateAngleInRadians = this.rotateAngleInRadians; + Double oldRotateAngleInRadians = this.rotateAngleInRadians; this.rotateAngleInRadians = rotateAngleInRadians; firePropertyChange(SpatialConstants.rotateAngleInRadians, oldRotateAngleInRadians, this.rotateAngleInRadians); } @@ -338,7 +338,7 @@ */ public boolean unsetRotateAngleInRadians() { if (isSetRotateAngleInRadians()) { - double oldRotateAngleInRadians = rotateAngleInRadians; + Double oldRotateAngleInRadians = rotateAngleInRadians; rotateAngleInRadians = null; firePropertyChange(SpatialConstants.rotateAngleInRadians, oldRotateAngleInRadians, rotateAngleInRadians); return true; @@ -370,20 +370,16 @@ public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetRotateAxisX()) { - attributes.remove("rotateAxisX"); - attributes.put(SpatialConstants.shortLabel + ":rotateAxisX", String.valueOf(getRotateAxisX())); + attributes.put(SpatialConstants.shortLabel + ":rotateAxisX", rotateAxisX.toString()); } if (isSetRotateAxisY()) { - attributes.remove("rotateAxisY"); - attributes.put(SpatialConstants.shortLabel + ":rotateAxisY", String.valueOf(getRotateAxisY())); + attributes.put(SpatialConstants.shortLabel + ":rotateAxisY", rotateAxisY.toString()); } if (isSetRotateAxisZ()) { - attributes.remove("rotateAxisZ"); - attributes.put(SpatialConstants.shortLabel + ":rotateAxisZ", String.valueOf(getRotateAxisZ())); + attributes.put(SpatialConstants.shortLabel + ":rotateAxisZ", rotateAxisZ.toString()); } if (isSetRotateAngleInRadians()) { - attributes.remove("rotateAngleInRadians"); - attributes.put(SpatialConstants.shortLabel + ":rotateAngleInRadians", String.valueOf(getRotateAngleInRadians())); + attributes.put(SpatialConstants.shortLabel + ":rotateAngleInRadians", rotateAngleInRadians.toString()); } return attributes; } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -160,7 +160,7 @@ * @param scaleX */ public void setScaleX(double scaleX) { - double oldScaleX = this.scaleX; + Double oldScaleX = this.scaleX; this.scaleX = scaleX; firePropertyChange(SpatialConstants.scaleX, oldScaleX, this.scaleX); } @@ -174,7 +174,7 @@ */ public boolean unsetScaleX() { if (isSetScaleX()) { - double oldScaleX = scaleX; + Double oldScaleX = scaleX; scaleX = null; firePropertyChange(SpatialConstants.scaleX, oldScaleX, scaleX); return true; @@ -212,7 +212,7 @@ * @param scaleY */ public void setScaleY(double scaleY) { - double oldScaleY = this.scaleY; + Double oldScaleY = this.scaleY; this.scaleY = scaleY; firePropertyChange(SpatialConstants.scaleY, oldScaleY, this.scaleY); } @@ -226,7 +226,7 @@ */ public boolean unsetScaleY() { if (isSetScaleY()) { - double oldScaleY = scaleY; + Double oldScaleY = scaleY; scaleY = null; firePropertyChange(SpatialConstants.scaleY, oldScaleY, scaleY); return true; @@ -264,7 +264,7 @@ * @param scaleZ */ public void setScaleZ(double scaleZ) { - double oldScaleZ = this.scaleZ; + Double oldScaleZ = this.scaleZ; this.scaleZ = scaleZ; firePropertyChange(SpatialConstants.scaleZ, oldScaleZ, this.scaleZ); } @@ -278,7 +278,7 @@ */ public boolean unsetScaleZ() { if (isSetScaleZ()) { - double oldScaleZ = scaleZ; + Double oldScaleZ = scaleZ; scaleZ = null; firePropertyChange(SpatialConstants.scaleZ, oldScaleZ, scaleZ); return true; @@ -308,16 +308,13 @@ public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetScaleX()) { - attributes.remove("scaleX"); - attributes.put(SpatialConstants.shortLabel + ":scaleX", String.valueOf(getScaleX())); + attributes.put(SpatialConstants.shortLabel + ":scaleX", scaleX.toString()); } if (isSetScaleY()) { - attributes.remove("scaleY"); - attributes.put(SpatialConstants.shortLabel + ":scaleY", String.valueOf(getScaleY())); + attributes.put(SpatialConstants.shortLabel + ":scaleY", scaleY.toString()); } if (isSetScaleZ()) { - attributes.remove("scaleZ"); - attributes.put(SpatialConstants.shortLabel + ":scaleZ", String.valueOf(getScaleZ())); + attributes.put(SpatialConstants.shortLabel + ":scaleZ", scaleZ.toString()); } return attributes; } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -158,7 +158,7 @@ * @param translateX */ public void setTranslateX(double translateX) { - double oldTranslateX = this.translateX; + Double oldTranslateX = this.translateX; this.translateX = translateX; firePropertyChange(SpatialConstants.translateX, oldTranslateX, this.translateX); } @@ -172,7 +172,7 @@ */ public boolean unsetTranslateX() { if (isSetTranslateX()) { - double oldTranslateX = translateX; + Double oldTranslateX = translateX; translateX = null; firePropertyChange(SpatialConstants.translateX, oldTranslateX, translateX); return true; @@ -210,7 +210,7 @@ * @param translateY */ public void setTranslateY(double translateY) { - double oldTranslateY = this.translateY; + Double oldTranslateY = this.translateY; this.translateY = translateY; firePropertyChange(SpatialConstants.translateY, oldTranslateY, this.translateY); } @@ -224,7 +224,7 @@ */ public boolean unsetTranslateY() { if (isSetTranslateY()) { - double oldTranslateY = translateY; + Double oldTranslateY = translateY; translateY = null; firePropertyChange(SpatialConstants.translateY, oldTranslateY, translateY); return true; @@ -262,7 +262,7 @@ * @param translateZ */ public void setTranslateZ(double translateZ) { - double oldTranslateZ = this.translateZ; + Double oldTranslateZ = this.translateZ; this.translateZ = translateZ; firePropertyChange(SpatialConstants.translateZ, oldTranslateZ, this.translateZ); } @@ -276,7 +276,7 @@ */ public boolean unsetTranslateZ() { if (isSetTranslateZ()) { - double oldTranslateZ = translateZ; + Double oldTranslateZ = translateZ; translateZ = null; firePropertyChange(SpatialConstants.translateZ, oldTranslateZ, translateZ); return true; @@ -306,16 +306,13 @@ public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetTranslateX()) { - attributes.remove("translateX"); - attributes.put(SpatialConstants.shortLabel + ":translateX", String.valueOf(getTranslateX())); + attributes.put(SpatialConstants.shortLabel + ":translateX", translateX.toString()); } if (isSetTranslateY()) { - attributes.remove("translateY"); - attributes.put(SpatialConstants.shortLabel + ":translateY", String.valueOf(getTranslateY())); + attributes.put(SpatialConstants.shortLabel + ":translateY", translateY.toString()); } if (isSetTranslateZ()) { - attributes.remove("translateZ"); - attributes.put(SpatialConstants.shortLabel + ":translateZ", String.valueOf(getTranslateZ())); + attributes.put(SpatialConstants.shortLabel + ":translateZ", translateZ.toString()); } return attributes; } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -23,7 +23,6 @@ import java.util.Map; -import org.sbml.jsbml.Compartment; import org.sbml.jsbml.Model; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; @@ -215,7 +214,7 @@ */ public boolean unsetUnitSize() { if (isSetUnitSize()) { - double oldUnitSize = unitSize; + Double oldUnitSize = unitSize; unitSize = null; firePropertyChange(SpatialConstants.unitSize, oldUnitSize, unitSize); return true; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -32,7 +32,6 @@ import org.sbml.jsbml.ListOf; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; -import org.sbml.jsbml.util.TreeNodeChangeEvent; import org.sbml.jsbml.util.filters.NameFilter; /** Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -144,7 +144,7 @@ * @param isActive */ public void setIsActive(boolean isActive) { - boolean oldIsActive = this.isActive; + Boolean oldIsActive = this.isActive; this.isActive = isActive; firePropertyChange(SpatialConstants.isActive, oldIsActive, this.isActive); } @@ -157,7 +157,7 @@ */ public boolean unsetIsActive() { if (isSetIsActive()) { - boolean oldIsActive = isActive; + Boolean oldIsActive = isActive; isActive = null; firePropertyChange(SpatialConstants.isActive, oldIsActive, isActive); return true; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -31,7 +31,6 @@ import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; import org.sbml.jsbml.util.StringTools; -import org.sbml.jsbml.util.TreeNodeChangeEvent; /** * @author Alex Thomas @@ -198,12 +197,7 @@ * @param coord1 */ public void setCoord1(double coord1) { - Double oldCoord1; - if (isSetCoord1()) { - oldCoord1 = this.coord1; - } else { - oldCoord1 = null; - } + Double oldCoord1 = this.coord1; this.coord1 = coord1; firePropertyChange(SpatialConstants.coord1, oldCoord1, this.coord1); } @@ -217,7 +211,7 @@ */ public boolean unsetCoord1() { if (isSetCoord1()) { - double oldCoord1 = coord1; + Double oldCoord1 = coord1; coord1 = null; firePropertyChange(SpatialConstants.coord1, oldCoord1, coord1); return true; @@ -253,12 +247,7 @@ * @param coord2 */ public void setCoord2(double coord2) { - Double oldCoord2; - if (isSetCoord2()) { - oldCoord2 = this.coord2; - } else { - oldCoord2 = null; - } + Double oldCoord2 = this.coord2; this.coord2 = coord2; firePropertyChange(SpatialConstants.coord2, oldCoord2, this.coord2); } @@ -272,7 +261,7 @@ */ public boolean unsetCoord2() { if (isSetCoord2()) { - double oldCoord2 = coord2; + Double oldCoord2 = coord2; coord2 = null; firePropertyChange(SpatialConstants.coord2, oldCoord2, coord2); return true; @@ -309,12 +298,7 @@ * @param coord3 */ public void setCoord3(double coord3) { - Double oldCoord3; - if (isSetCoord3()) { - oldCoord3 = coord1; - } else { - oldCoord3 = null; - } + Double oldCoord3 = coord1; this.coord3 = coord3; firePropertyChange(SpatialConstants.coord3, oldCoord3, this.coord3); } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -153,7 +153,7 @@ * @param ordinal */ public void setOrdinal(int ordinal) { - int oldOrdinal = this.ordinal; + Integer oldOrdinal = this.ordinal; this.ordinal = ordinal; firePropertyChange(SpatialConstants.ordinal, oldOrdinal, this.ordinal); } @@ -167,7 +167,7 @@ */ public boolean unsetOrdinal() { if (isSetOrdinal()) { - int oldOrdinal = ordinal; + Integer oldOrdinal = ordinal; ordinal = null; firePropertyChange(SpatialConstants.ordinal, oldOrdinal, ordinal); return true; @@ -246,11 +246,9 @@ public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetOrdinal()) { - attributes.remove("ordinal"); - attributes.put(SpatialConstants.shortLabel + ":ordinal", String.valueOf(getOrdinal())); + attributes.put(SpatialConstants.shortLabel + ":ordinal", ordinal.toString()); } if (isSetGeometryDefinition()) { - attributes.remove("geometryDefinition"); attributes.put(SpatialConstants.shortLabel + ":geometryDefinition", getGeometryDefinition()); } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-04-22 08:36:22 UTC (rev 2205) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-04-22 09:57:59 UTC (rev 2206) @@ -298,11 +298,9 @@ public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetSpId()) { - attributes.remove("spatialRef"); attributes.put(SpatialConstants.shortLabel + ":spatialRef", getSpId()); } if (isSetSpeciesReference()) { - attributes.remove("variable"); attributes.put(SpatialConstants.shortLabel + ":variable", String.valueOf(getSpeciesReference())); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-22 13:16:06
|
Revision: 2209 http://sourceforge.net/p/jsbml/code/2209 Author: pdp10 Date: 2015-04-22 13:15:55 +0000 (Wed, 22 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- 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/PolygonObject.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoint.java Added Paths: ----------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricGeometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricGeometry.java 2015-04-22 11:47:04 UTC (rev 2208) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricGeometry.java 2015-04-22 13:15:55 UTC (rev 2209) @@ -31,7 +31,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -40,7 +41,7 @@ /** * */ - ListOf<SpatialPoint> listOfSpatialPoints; + ListOf<SpatialPoints> listOfSpatialPoints; /** * */ @@ -121,6 +122,18 @@ return equal; } + @Override + public int hashCode() { + final int prime = 1999; + int hashCode = super.hashCode(); + if (isSetListOfParametricObjects()) { + hashCode += prime * getListOfParametricObjects().hashCode(); + } + if (isSetListOfSpatialPoints()) { + hashCode += prime * getListOfSpatialPoints().hashCode(); + } + return hashCode; + } /** * Returns {@code true}, if listOfParametricObjects contains at least one element. @@ -281,9 +294,9 @@ * * @return the listOfSpatialPoints */ - public ListOf<SpatialPoint> getListOfSpatialPoints() { + public ListOf<SpatialPoints> getListOfSpatialPoints() { if (!isSetListOfSpatialPoints()) { - listOfSpatialPoints = new ListOf<SpatialPoint>(getLevel(), + listOfSpatialPoints = new ListOf<SpatialPoints>(getLevel(), getVersion()); listOfSpatialPoints.setNamespace(SpatialConstants.namespaceURI); listOfSpatialPoints.setSBaseListType(ListOf.Type.other); @@ -299,7 +312,7 @@ * * @param listOfSpatialPoints */ - public void setListOfSpatialPoints(ListOf<SpatialPoint> listOfSpatialPoints) { + public void setListOfSpatialPoints(ListOf<SpatialPoints> listOfSpatialPoints) { unsetListOfSpatialPoints(); this.listOfSpatialPoints = listOfSpatialPoints; registerChild(this.listOfSpatialPoints); @@ -315,7 +328,7 @@ */ public boolean unsetListOfSpatialPoints() { if (isSetListOfSpatialPoints()) { - ListOf<SpatialPoint> oldSpatialPoints = listOfSpatialPoints; + ListOf<SpatialPoints> oldSpatialPoints = listOfSpatialPoints; listOfSpatialPoints = null; oldSpatialPoints.fireNodeRemovedEvent(); return true; @@ -325,27 +338,27 @@ /** - * Adds a new {@link SpatialPoint} to the listOfSpatialPoints. + * Adds a new {@link SpatialPoints} to the listOfSpatialPoints. * <p>The listOfSpatialPoints is initialized if necessary. * - * @param spatialPoint the element to add to the list + * @param spatialPoints the element to add to the list * @return true (as specified by {@link Collection#add}) */ - public boolean addSpatialPoint(SpatialPoint spatialPoint) { - return getListOfSpatialPoints().add(spatialPoint); + public boolean addSpatialPoints(SpatialPoints spatialPoints) { + return getListOfSpatialPoints().add(spatialPoints); } /** * Removes an element from the listOfSpatialPoints. * - * @param spatialPoint the element to be removed from the list + * @param spatialPoints the element to be removed from the list * @return true if the list contained the specified element * @see List#remove(Object) */ - public boolean removeSpatialPoint(SpatialPoint spatialPoint) { + public boolean removeSpatialPoints(SpatialPoints spatialPoints) { if (isSetListOfSpatialPoints()) { - return getListOfSpatialPoints().remove(spatialPoint); + return getListOfSpatialPoints().remove(spatialPoints); } return false; } @@ -358,7 +371,7 @@ * @throws IndexOutOfBoundsException if the listOf is not set or * if the index is out of bound (index < 0 || index > list.size) */ - public void removeSpatialPoint(int i) { + public void removeSpatialPoints(int i) { if (!isSetListOfSpatialPoints()) { throw new IndexOutOfBoundsException(Integer.toString(i)); } @@ -370,31 +383,31 @@ /* - * TODO: if the ID is mandatory for SpatialPoint objects, + * TODO: if the ID is mandatory for SpatialPoints objects, * one should also add this methods */ - //public void removeSpatialPoint(String id) { + //public void removeSpatialPoints(String id) { // getListOfSpatialPoints().removeFirst(new NameFilter(id)); //} /** - * Creates a new SpatialPoint element and adds it to the ListOfSpatialPoints list + * Creates a new SpatialPoints element and adds it to the ListOfSpatialPoints list * @return */ - public SpatialPoint createSpatialPoint() { - return createSpatialPoint(null); + public SpatialPoints createSpatialPoints() { + return createSpatialPoints(null); } /** - * Creates a new {@link SpatialPoint} element and adds it to the ListOfSpatialPoints list + * Creates a new {@link SpatialPoints} element and adds it to the ListOfSpatialPoints list * @param id * - * @return a new {@link SpatialPoint} element + * @return a new {@link SpatialPoints} element */ - public SpatialPoint createSpatialPoint(String id) { - SpatialPoint spatialPoint = new SpatialPoint(id, getLevel(), getVersion()); - addSpatialPoint(spatialPoint); - return spatialPoint; + public SpatialPoints createSpatialPoints(String id) { + SpatialPoints spatialPoints = new SpatialPoints(getLevel(), getVersion()); + addSpatialPoints(spatialPoints); + return spatialPoints; } /* (non-Javadoc) Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-04-22 11:47:04 UTC (rev 2208) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-04-22 13:15:55 UTC (rev 2209) @@ -24,14 +24,14 @@ import java.text.MessageFormat; import java.util.Map; -import javax.swing.tree.TreeNode; - import org.sbml.jsbml.PropertyUndefinedError; +import org.sbml.jsbml.util.StringTools; /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -55,6 +55,36 @@ QUADRILATERAL; } + public enum CompressionKind { + /** + * + */ + UNCOMPRESSED, + /** + * + */ + DEFLATED, + /** + * + */ + BASE64; + } + + public enum DataKind { + /** + * + */ + UINT8, + /** + * + */ + UINT16, + /** + * + */ + UINT32; + } + /** * */ @@ -66,7 +96,17 @@ /** * */ - private PolygonObject polygonObject; + private CompressionKind compression; + /** + * + */ + private Integer pointIndexLength; + /** + * + */ + private DataKind dataType; + + /** * Generated serial version identifier. */ @@ -84,19 +124,21 @@ */ public ParametricObject(ParametricObject po) { super(po); - if (po.isSetDomainType()) { - domainType = new String(po.getDomainType()); + setDomainType(po.getDomainType()); } - if (po.isSetPolygonType()) { setPolygonType(po.getPolygonType()); } - - if (po.isSetPolygonObject()) { - setPolygonObject(po.getPolygonObject().clone()); + if (po.isSetCompression()) { + setCompression(po.getCompression()); } - + if (po.isSetPointIndexLength()) { + setPointIndexLength(po.getPointIndexLength()); + } + if (po.isSetDataType()) { + setDataType(po.getDataType()); + } } @@ -136,16 +178,22 @@ if (equal && isSetDomainType()) { equal &= po.getDomainType().equals(getDomainType()); } - equal &= po.isSetPolygonType() == isSetPolygonType(); if (equal && isSetPolygonType()) { equal &= po.getPolygonType().equals(getPolygonType()); } - - equal &= po.isSetPolygonObject() == isSetPolygonObject(); - if (equal && isSetPolygonObject()) { - equal &= po.getPolygonObject().equals(getPolygonObject()); + equal &= po.isSetCompression() == isSetCompression(); + if (equal && isSetCompression()) { + equal &= po.getCompression().equals(getCompression()); } + equal &= po.isSetPointIndexLength() == isSetPointIndexLength(); + if (equal && isSetPointIndexLength()) { + equal &= po.getPointIndexLength() == getPointIndexLength(); + } + equal &= po.isSetDataType() == isSetDataType(); + if (equal && isSetDataType()) { + equal &= po.getDataType().equals(getDataType()); + } } return equal; } @@ -233,7 +281,7 @@ return domainType != null; } - + /** * Sets the value of domain * @param domain @@ -261,100 +309,182 @@ return false; } + + /** - * Returns the value of polygonObject + * Returns the value of compression. * - * @return the value of polygonObject + * @return the value of compression. */ - public PolygonObject getPolygonObject() { - if (isSetPolygonObject()) { - return polygonObject; + public CompressionKind getCompression() { + if (isSetCompression()) { + return compression; } - // This is necessary if we cannot return null here. - throw new PropertyUndefinedError(SpatialConstants.polygonObject, this); + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(SpatialConstants.compression, this); } /** - * Returns whether polygonObject is set + * Returns whether compression is set. * - * @return whether polygonObject is set + * @return whether compression is set. */ - public boolean isSetPolygonObject() { - return polygonObject != null; + public boolean isSetCompression() { + return this.compression != null; } + /** + * Sets the value of compression + * @param compression + */ + public void setCompression(String compression) { + setCompression(CompressionKind.valueOf(compression)); + } /** - * Sets the value of polygonObject - * @param polygonObject + * Sets the value of compression + * + * @param compression the value of compression to be set. */ - public void setPolygonObject(PolygonObject polygonObject) { - PolygonObject oldPolygonObject = this.polygonObject; - this.polygonObject = polygonObject; - firePropertyChange(SpatialConstants.polygonObject, oldPolygonObject, this.polygonObject); + public void setCompression(CompressionKind compression) { + CompressionKind oldCompression = this.compression; + this.compression = compression; + firePropertyChange(SpatialConstants.compression, oldCompression, this.compression); } /** - * Unsets the variable polygonObject + * Unsets the variable compression. * - * @return {@code true}, if polygonObject was set before, - * otherwise {@code false} + * @return {@code true} if compression was set before, otherwise {@code false}. */ - public boolean unsetPolygonObject() { - if (isSetPolygonObject()) { - PolygonObject oldPolygonObject = polygonObject; - polygonObject = null; - firePropertyChange(SpatialConstants.polygonObject, oldPolygonObject, polygonObject); + public boolean unsetCompression() { + if (isSetCompression()) { + CompressionKind oldCompression = this.compression; + this.compression = null; + firePropertyChange(SpatialConstants.compression, oldCompression, this.compression); return true; } return false; } + + + /** + * Returns the value of pointIndexLength. + * + * @return the value of pointIndexLength. + */ + public int getPointIndexLength() { + if (isSetPointIndexLength()) { + return pointIndexLength.intValue(); + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(SpatialConstants.pointIndexLength, this); + } - @Override - public boolean getAllowsChildren() { - return true; + /** + * Returns whether pointIndexLength is set. + * + * @return whether pointIndexLength is set. + */ + public boolean isSetPointIndexLength() { + return this.pointIndexLength != null; } - @Override - public int getChildCount() { - int count = super.getChildCount(); - if (isSetPolygonObject()) { - count++; - } - return count; + /** + * Sets the value of pointIndexLength + * + * @param pointIndexLength the value of pointIndexLength to be set. + */ + public void setPointIndexLength(int pointIndexLength) { + Integer oldPointIndexLength = this.pointIndexLength; + this.pointIndexLength = pointIndexLength; + firePropertyChange(SpatialConstants.pointIndexLength, oldPointIndexLength, this.pointIndexLength); } - @Override - public TreeNode getChildAt(int index) { - if (index < 0) { - throw new IndexOutOfBoundsException(index + " < 0"); + /** + * Unsets the variable pointIndexLength. + * + * @return {@code true} if pointIndexLength was set before, otherwise {@code false}. + */ + public boolean unsetPointIndexLength() { + if (isSetPointIndexLength()) { + Integer oldPointIndexLength = this.pointIndexLength; + this.pointIndexLength = null; + firePropertyChange(SpatialConstants.pointIndexLength, oldPointIndexLength, this.pointIndexLength); + return true; } - int count = super.getChildCount(), pos = 0; - if (index < count) { - return super.getChildAt(index); - } else { - index -= count; + return false; + } + + + /** + * Returns the value of dataType. + * + * @return the value of dataType. + */ + public DataKind getDataType() { + if (isSetDataType()) { + return dataType; } - if (isSetPolygonObject()) { - if (pos == index) { - return getPolygonObject(); - } - pos++; + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(SpatialConstants.dataType, this); + } + + + /** + * Returns whether dataType is set. + * + * @return whether dataType is set. + */ + public boolean isSetDataType() { + return this.dataType != null; + } + + /** + * Sets the value of dataType + * @param dataType + */ + public void setDataType(String dataType) { + setDataType(DataKind.valueOf(dataType)); + } + + /** + * Sets the value of dataType + * + * @param dataType the value of dataType to be set. + */ + public void setDataType(DataKind dataType) { + DataKind oldDataType = this.dataType; + this.dataType = dataType; + firePropertyChange(SpatialConstants.dataType, oldDataType, this.dataType); + } + + + /** + * Unsets the variable dataType. + * + * @return {@code true} if dataType was set before, otherwise {@code false}. + */ + public boolean unsetDataType() { + if (isSetDataType()) { + DataKind oldDataType = this.dataType; + this.dataType = null; + firePropertyChange(SpatialConstants.dataType, oldDataType, this.dataType); + return true; } - throw new IndexOutOfBoundsException(MessageFormat.format( - "Index {0,number,integer} >= {1,number,integer}", index, - +Math.min(pos, 0))); + return false; } + @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 2003; int hashCode = super.hashCode(); if (isSetDomainType()) { hashCode += prime * getDomainType().hashCode(); @@ -362,6 +492,15 @@ if (isSetPolygonType()) { hashCode += prime * getPolygonType().hashCode(); } + if (isSetCompression()) { + hashCode += prime * getCompression().hashCode(); + } + if (isSetPointIndexLength()) { + hashCode += prime * getPointIndexLength(); + } + if (isSetDataType()) { + hashCode += prime * getDataType().hashCode(); + } return hashCode; } @@ -373,12 +512,26 @@ attributes.remove("domainType"); attributes.put(SpatialConstants.shortLabel + ":domainType", getDomainType()); } - if (isSetPolygonType()) { attributes.remove("polygonType"); attributes.put(SpatialConstants.shortLabel + ":polygonType", getPolygonType().toString()); } + if (isSetCompression()) { + attributes.remove("compression"); + attributes.put(SpatialConstants.shortLabel + ":compression", + getCompression().toString()); + } + if (isSetPointIndexLength()) { + attributes.remove("pointIndexLength"); + attributes.put(SpatialConstants.shortLabel + ":pointIndexLength", + String.valueOf(getPointIndexLength())); + } + if (isSetDataType()) { + attributes.remove("dataType"); + attributes.put(SpatialConstants.shortLabel + ":dataType", + getDataType().toString()); + } return attributes; } @@ -398,7 +551,6 @@ SpatialConstants.domainType); } } - else if (attributeName.equals(SpatialConstants.polygonType)) { try { setPolygonType(value); @@ -406,6 +558,27 @@ MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); } } + else if (attributeName.equals(SpatialConstants.compression)) { + try { + setCompression(value); + } catch (Exception e) { + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + } + } + else if (attributeName.equals(SpatialConstants.pointIndexLength)) { + try { + setPointIndexLength(StringTools.parseSBMLInt(value)); + } catch (Exception e) { + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + } + } + else if (attributeName.equals(SpatialConstants.dataType)) { + try { + setDataType(value); + } catch (Exception e) { + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + } + } else { isAttributeRead = false; } @@ -424,6 +597,12 @@ builder.append(polygonType); builder.append(", domain="); builder.append(domainType); + builder.append(", compression="); + builder.append(compression); + builder.append(", pointIndexLength="); + builder.append(pointIndexLength); + builder.append(", dataType="); + builder.append(dataType); builder.append("]"); return builder.toString(); } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonObject.java 2015-04-22 11:47:04 UTC (rev 2208) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonObject.java 2015-04-22 13:15:55 UTC (rev 2209) @@ -36,6 +36,7 @@ * @version $Rev$ * @since 1.0 * @date Jan 21, 2014 + * @deprecated */ public class PolygonObject extends AbstractSBase { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-22 11:47:04 UTC (rev 2208) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-22 13:15:55 UTC (rev 2209) @@ -461,10 +461,14 @@ */ public static final String listOfParametricObjects = "listOfParametricObjects"; /** - * + * @deprecated */ public static final String spatialPoint = "spatialPoint"; /** + * + */ + public static final String spatialPoints = "spatialPoints"; + /** * */ public static final String parametricObject = "parametricObject"; @@ -507,8 +511,17 @@ * */ public static final String data = "data"; + /** + * + */ + public static final String pointIndexLength = "pointIndexLength"; /** + * + */ + public static final String arrayDataLength = "arrayDataLength"; + + /** * @param level * @param version * @return Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoint.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoint.java 2015-04-22 11:47:04 UTC (rev 2208) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoint.java 2015-04-22 13:15:55 UTC (rev 2209) @@ -31,7 +31,8 @@ * @author Alex Thomas * @author Andreas Dräger * @since 1.0 - * @version $Rev$ + * @version $Rev$ + * @deprecated */ public class SpatialPoint extends AbstractSpatialNamedSBase { Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java 2015-04-22 13:15:55 UTC (rev 2209) @@ -0,0 +1,432 @@ +/* + * $Id: SpatialPoints.java 0 2015-04-22 04:50:45Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +import java.text.MessageFormat; +import java.util.Map; + +import org.sbml.jsbml.AbstractSBase; +import org.sbml.jsbml.PropertyUndefinedError; +import org.sbml.jsbml.util.StringTools; + + +/** + * @author Piero Dalle Pezze + * @since 1.0 + * @version $Rev: 0 $ + */ +public class SpatialPoints extends AbstractSBase { + + /** + * + */ + private static final long serialVersionUID = -3467717442431545263L; + + + public enum CompressionKind { + /** + * + */ + UNCOMPRESSED, + /** + * + */ + DEFLATED, + /** + * + */ + BASE64; + } + + public enum DataKind { + /** + * + */ + UINT8, + /** + * + */ + UINT16, + /** + * + */ + UINT32, + /** + * + */ + FLOAT, + /** + * + */ + DOUBLE; + } + + /** + * + */ + private CompressionKind compression; + /** + * + */ + private Integer arrayDataLength; + /** + * + */ + private DataKind dataType; + + + + + /** + * Creates an SpatialPoints instance + */ + public SpatialPoints() { + super(); + initDefaults(); + } + + /** + * Creates a SpatialPoints instance with a level and version. + * + * @param level SBML Level + * @param version SBML Version + */ + public SpatialPoints(int level, int version) { + super(level, version); + } + + + /** + * Clone constructor + */ + public SpatialPoints(SpatialPoints sp) { + super(sp); + if (sp.isSetCompression()) { + setCompression(sp.getCompression()); + } + if (sp.isSetArrayDataLength()) { + setArrayDataLength(sp.getArrayDataLength()); + } + if (sp.isSetDataType()) { + setDataType(sp.getDataType()); + } + } + + + /** + * clones this class + */ + public SpatialPoints clone() { + return new SpatialPoints(this); + } + + @Override + public boolean equals(Object object) { + boolean equal = super.equals(object); + if (equal) { + SpatialPoints sp = (SpatialPoints) object; + + equal &= sp.isSetCompression() == isSetCompression(); + if (equal && isSetCompression()) { + equal &= sp.getCompression().equals(getCompression()); + } + equal &= sp.isSetArrayDataLength() == isSetArrayDataLength(); + if (equal && isSetArrayDataLength()) { + equal &= sp.getArrayDataLength() == getArrayDataLength(); + } + equal &= sp.isSetDataType() == isSetDataType(); + if (equal && isSetDataType()) { + equal &= sp.getDataType().equals(getDataType()); + } + } + return equal; + } + + /** + * Initializes the default values using the namespace. + */ + public void initDefaults() { + setNamespace(SpatialConstants.namespaceURI); // TODO - removed once the mechanism are in place to set package version and namespace + packageName = SpatialConstants.shortLabel; + setPackageVersion(-1); + } + + /** + * Returns the value of compression. + * + * @return the value of compression. + */ + public CompressionKind getCompression() { + if (isSetCompression()) { + return compression; + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(SpatialConstants.compression, this); + } + + + /** + * Returns whether compression is set. + * + * @return whether compression is set. + */ + public boolean isSetCompression() { + return this.compression != null; + } + + /** + * Sets the value of compression + * @param compression + */ + public void setCompression(String compression) { + setCompression(CompressionKind.valueOf(compression)); + } + + /** + * Sets the value of compression + * + * @param compression the value of compression to be set. + */ + public void setCompression(CompressionKind compression) { + CompressionKind oldCompression = this.compression; + this.compression = compression; + firePropertyChange(SpatialConstants.compression, oldCompression, this.compression); + } + + + /** + * Unsets the variable compression. + * + * @return {@code true} if compression was set before, otherwise {@code false}. + */ + public boolean unsetCompression() { + if (isSetCompression()) { + CompressionKind oldCompression = this.compression; + this.compression = null; + firePropertyChange(SpatialConstants.compression, oldCompression, this.compression); + return true; + } + return false; + } + + + /** + * Returns the value of arrayDataLength. + * + * @return the value of arrayDataLength. + */ + public int getArrayDataLength() { + if (isSetArrayDataLength()) { + return arrayDataLength.intValue(); + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(SpatialConstants.arrayDataLength, this); + } + + + /** + * Returns whether arrayDataLength is set. + * + * @return whether arrayDataLength is set. + */ + public boolean isSetArrayDataLength() { + return this.arrayDataLength != null; + } + + + /** + * Sets the value of arrayDataLength + * + * @param arrayDataLength the value of arrayDataLength to be set. + */ + public void setArrayDataLength(int arrayDataLength) { + Integer oldArrayDataLength = this.arrayDataLength; + this.arrayDataLength = arrayDataLength; + firePropertyChange(SpatialConstants.arrayDataLength, oldArrayDataLength, this.arrayDataLength); + } + + + /** + * Unsets the variable arrayDataLength. + * + * @return {@code true} if arrayDataLength was set before, otherwise {@code false}. + */ + public boolean unsetArrayDataLength() { + if (isSetArrayDataLength()) { + Integer oldArrayDataLength = this.arrayDataLength; + this.arrayDataLength = null; + firePropertyChange(SpatialConstants.arrayDataLength, oldArrayDataLength, this.arrayDataLength); + return true; + } + return false; + } + + + /** + * Returns the value of dataType. + * + * @return the value of dataType. + */ + public DataKind getDataType() { + if (isSetDataType()) { + return dataType; + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(SpatialConstants.dataType, this); + } + + + /** + * Returns whether dataType is set. + * + * @return whether dataType is set. + */ + public boolean isSetDataType() { + return this.dataType != null; + } + + /** + * Sets the value of dataType + * @param dataType + */ + public void setDataType(String dataType) { + setDataType(DataKind.valueOf(dataType)); + } + + /** + * Sets the value of dataType + * + * @param dataType the value of dataType to be set. + */ + public void setDataType(DataKind dataType) { + DataKind oldDataType = this.dataType; + this.dataType = dataType; + firePropertyChange(SpatialConstants.dataType, oldDataType, this.dataType); + } + + + /** + * Unsets the variable dataType. + * + * @return {@code true} if dataType was set before, otherwise {@code false}. + */ + public boolean unsetDataType() { + if (isSetDataType()) { + DataKind oldDataType = this.dataType; + this.dataType = null; + firePropertyChange(SpatialConstants.dataType, oldDataType, this.dataType); + return true; + } + return false; + } + + + + @Override + public int hashCode() { + final int prime = 2011; + int hashCode = super.hashCode(); + if (isSetCompression()) { + hashCode += prime * getCompression().hashCode(); + } + if (isSetArrayDataLength()) { + hashCode += prime * getArrayDataLength(); + } + if (isSetDataType()) { + hashCode += prime * getDataType().hashCode(); + } + return hashCode; + } + + @Override + public Map<String, String> writeXMLAttributes() { + Map<String, String> attributes = super.writeXMLAttributes(); + if (isSetCompression()) { + attributes.remove("compression"); + attributes.put(SpatialConstants.shortLabel + ":compression", + getCompression().toString()); + } + if (isSetArrayDataLength()) { + attributes.remove("arrayDataLength"); + attributes.put(SpatialConstants.shortLabel + ":arrayDataLength", + String.valueOf(getArrayDataLength())); + } + if (isSetDataType()) { + attributes.remove("dataType"); + attributes.put(SpatialConstants.shortLabel + ":dataType", + getDataType().toString()); + } + + return attributes; + } + + + @Override + public boolean readAttribute(String attributeName, String prefix, String value) { + boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) + && (SpatialConstants.shortLabel == prefix); + if (attributeName.equals(SpatialConstants.compression)) { + try { + setCompression(value); + } catch (Exception e) { + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + } + } + else if (attributeName.equals(SpatialConstants.arrayDataLength)) { + try { + setArrayDataLength(StringTools.parseSBMLInt(value)); + } catch (Exception e) { + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + } + } + else if (attributeName.equals(SpatialConstants.dataType)) { + try { + setDataType(value); + } catch (Exception e) { + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + } + } + else { + isAttributeRead = false; + } + return isAttributeRead; + } + + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("ParametricObject [compression="); + builder.append(compression); + builder.append(", arrayDataLength="); + builder.append(arrayDataLength); + builder.append(", dataType="); + builder.append(dataType); + builder.append("]"); + return builder.toString(); + } + + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-22 13:20:47
|
Revision: 2211 http://sourceforge.net/p/jsbml/code/2211 Author: pdp10 Date: 2015-04-22 13:20:39 +0000 (Wed, 22 Apr 2015) Log Message: ----------- removed class SpatialPoint. This is replaced with SpatialPoints following the update in spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java Removed Paths: ------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoint.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-22 13:16:42 UTC (rev 2210) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-22 13:20:39 UTC (rev 2211) @@ -461,10 +461,6 @@ */ public static final String listOfParametricObjects = "listOfParametricObjects"; /** - * @deprecated - */ - public static final String spatialPoint = "spatialPoint"; - /** * */ public static final String spatialPoints = "spatialPoints"; Deleted: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoint.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoint.java 2015-04-22 13:16:42 UTC (rev 2210) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoint.java 2015-04-22 13:20:39 UTC (rev 2211) @@ -1,469 +0,0 @@ -/* - * $Id$ - * $URL$ - * ---------------------------------------------------------------------------- - * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> - * for the latest version of JSBML and more information about SBML. - * - * Copyright (C) 2009-2015 jointly by the following organizations: - * 1. The University of Tuebingen, Germany - * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK - * 3. The California Institute of Technology, Pasadena, CA, USA - * 4. The University of California, San Diego, La Jolla, CA, USA - * 5. The Babraham Institute, Cambridge, UK - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. A copy of the license agreement is provided - * in the file named "LICENSE.txt" included with this software distribution - * and also available online as <http://sbml.org/Software/JSBML/License>. - * ---------------------------------------------------------------------------- - */ -package org.sbml.jsbml.ext.spatial; - -import java.text.MessageFormat; -import java.util.Map; - -import org.sbml.jsbml.PropertyUndefinedError; -import org.sbml.jsbml.util.StringTools; - -/** - * @author Alex Thomas - * @author Andreas Dräger - * @since 1.0 - * @version $Rev$ - * @deprecated - */ -public class SpatialPoint extends AbstractSpatialNamedSBase { - - /** - * - */ - private String domain; - - /** - * - */ - private Double coord1; - /** - * - */ - private Double coord2; - /** - * - */ - private Double coord3; - - /** - * Generated serial version identifier. - */ - private static final long serialVersionUID = -1171421071571874086L; - - /** - * - */ - public SpatialPoint() { - super(); - } - - /** - * @param sp - */ - public SpatialPoint(SpatialPoint sp) { - super(sp); - - - if (sp.isSetDomain()) { - domain = new String(sp.getDomain()); - } - - if (sp.isSetCoord1()) { - coord1 = new Double(sp.getCoord1()); - } - - if (sp.isSetCoord2()) { - coord2 = new Double(sp.getCoord2()); - } - - if (sp.isSetCoord3()) { - coord3 = new Double(sp.getCoord3()); - } - } - - - /** - * @param level - * @param version - */ - public SpatialPoint(int level, int version) { - super(level, version); - } - - - /** - * - * @param id - * @param level - * @param version - */ - public SpatialPoint(String id, int level, int version) { - super(id, level, version); - } - - - @Override - public SpatialPoint clone() { - return new SpatialPoint(this); - } - - - @Override - public boolean equals(Object object) { - boolean equal = super.equals(object); - if (equal) { - SpatialPoint sp = (SpatialPoint) object; - - equal &= sp.isSetDomain() == isSetDomain(); - if (equal && isSetDomain()) { - equal &= sp.getDomain().equals(getDomain()); - } - - equal &= sp.isSetCoord1() == isSetCoord1(); - if (equal && isSetCoord1()) { - equal &= sp.getCoord1() == getCoord1(); - } - - equal &= sp.isSetCoord2() == isSetCoord2(); - if (equal && isSetCoord2()) { - equal &= sp.getCoord2() == getCoord2(); - } - - equal &= sp.isSetCoord3() == isSetCoord3(); - if (equal && isSetCoord3()) { - equal &= sp.getCoord3() == getCoord3(); - } - //TODO: add equal statements for each attribute and class - } - return equal; - } - - /** - * Returns the value of coord1 - * - * @return the value of coord1 - */ - public double getCoord1() { - if (isSetCoord1()) { - return coord1; - } - //TODO: This is necessary if we cannot return null here. - throw new PropertyUndefinedError(SpatialConstants.coord1, this); - } - - - /** - * Returns whether coord1 is set - * - * @return whether coord1 is set - */ - public boolean isSetCoord1() { - return coord1 != null; - } - - /** - * Sets the value of coord1 - * @param coord1 - */ - public void setCoord1(double coord1) { - double oldCoord1 = this.coord1; - this.coord1 = coord1; - firePropertyChange(SpatialConstants.coord1, oldCoord1, this.coord1); - } - - - /** - * Unsets the variable coord1 - * - * @return {@code true}, if coord1 was set before, - * otherwise {@code false} - */ - public boolean unsetCoord1() { - if (isSetCoord1()) { - double oldCoord1 = coord1; - coord1 = null; - firePropertyChange(SpatialConstants.coord1, oldCoord1, coord1); - return true; - } - return false; - } - - /** - * Returns the value of coord2 - * - * @return the value of coord2 - */ - public double getCoord2() { - if (isSetCoord2()) { - return coord2; - } - //TODO: This is necessary if we cannot return null here. - throw new PropertyUndefinedError(SpatialConstants.coord2, this); - } - - - /** - * Returns whether coord2 is set - * - * @return whether coord2 is set - */ - public boolean isSetCoord2() { - return coord2 != null; - } - - /** - * Sets the value of coord2 - * @param coord2 - */ - public void setCoord2(double coord2) { - double oldCoord2 = this.coord2; - this.coord2 = coord2; - firePropertyChange(SpatialConstants.coord2, oldCoord2, this.coord2); - } - - - /** - * Unsets the variable coord2 - * - * @return {@code true}, if coord2 was set before, - * otherwise {@code false} - */ - public boolean unsetCoord2() { - if (isSetCoord2()) { - double oldCoord2 = coord2; - coord2 = null; - firePropertyChange(SpatialConstants.coord2, oldCoord2, coord2); - return true; - } - return false; - } - - /** - * Returns the value of coord3 - * - * @return the value of coord3 - */ - public double getCoord3() { - if (isSetCoord3()) { - return coord3; - } - // TODO:This is necessary if we cannot return null here. - throw new PropertyUndefinedError(SpatialConstants.coord3, this); - } - - - /** - * Returns whether coord3 is set - * - * @return whether coord3 is set - */ - public boolean isSetCoord3() { - return coord3 != null; - } - - /** - * Sets the value of coord3 - * @param coord3 - */ - public void setCoord3(double coord3) { - double oldCoord3 = this.coord3; - this.coord3 = coord3; - firePropertyChange(SpatialConstants.coord3, oldCoord3, this.coord3); - } - - - /** - * Unsets the variable coord3 - * - * @return {@code true}, if coord3 was set before, - * otherwise {@code false} - */ - public boolean unsetCoord3() { - if (isSetCoord3()) { - double oldCoord3 = coord3; - coord3 = null; - firePropertyChange(SpatialConstants.coord3, oldCoord3, coord3); - return true; - } - return false; - } - - /** - * Returns the value of domain - * - * @return the value of domain - */ - public String getDomain() { - if (isSetDomain()) { - return domain; - } - // TODO: This is necessary if we cannot return null here. - throw new PropertyUndefinedError(SpatialConstants.domain, this); - } - - - /** - * Returns whether domain is set - * - * @return whether domain is set - */ - public boolean isSetDomain() { - return domain != null; - } - - /** - * Sets the value of domain - * @param domain - */ - public void setDomain(String domain) { - String oldDomain = this.domain; - this.domain = domain; - firePropertyChange(SpatialConstants.domain, oldDomain, this.domain); - } - - /** - * Unsets the variable domain - * - * @return {@code true}, if domain was set before, - * otherwise {@code false} - */ - public boolean unsetDomain() { - if (isSetDomain()) { - String oldDomain = domain; - domain = null; - firePropertyChange(SpatialConstants.domain, oldDomain, domain); - return true; - } - return false; - } - - /* (non-Javadoc) - * @see org.sbml.jsbml.ext.spatial.AbstractSpatialNamedSBase#hashCode() - */ - @Override - public int hashCode() { - final int prime = 983;//Change this prime number - int hashCode = super.hashCode(); - if (isSetDomain()) { - hashCode += prime * getDomain().hashCode(); - } - - if (isSetCoord1()) { - hashCode += prime * getCoord1(); - } - - if (isSetCoord2()) { - hashCode += prime * getCoord2(); - } - - if (isSetCoord3()) { - hashCode += prime * getCoord3(); - } - return hashCode; - } - - - @Override - public Map<String, String> writeXMLAttributes() { - Map<String, String> attributes = super.writeXMLAttributes(); - if (isSetDomain()) { - attributes.remove("domain"); - attributes.put(SpatialConstants.shortLabel + ":domain", getDomain()); - } - - if (isSetCoord1()) { - attributes.remove("coord1"); - attributes.put(SpatialConstants.shortLabel + ":coord1", - String.valueOf(getCoord1())); - } - - if (isSetCoord2()) { - attributes.remove("coord1"); - attributes.put(SpatialConstants.shortLabel + ":coord1", - String.valueOf(getCoord2())); - } - - if (isSetCoord3()) { - attributes.remove("coord3"); - attributes.put(SpatialConstants.shortLabel + ":coord3", - String.valueOf(getCoord3())); - } - return attributes; - } - - - @Override - public boolean readAttribute(String attributeName, String prefix, String value) { - boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) - && (SpatialConstants.shortLabel == prefix); - if (!isAttributeRead) { - isAttributeRead = true; - if (attributeName.equals(SpatialConstants.domain)) { - try { - setDomain(value); - } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.domain); - } - } - - else if (attributeName.equals(SpatialConstants.coord1)) { - try { - setCoord1(StringTools.parseSBMLDouble(value)); - } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.coord1); - } - } - - else if (attributeName.equals(SpatialConstants.coord2)) { - try { - setCoord2(StringTools.parseSBMLDouble(value)); - } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.coord2); - } - } - - else if (attributeName.equals(SpatialConstants.coord3)) { - try { - setCoord3(StringTools.parseSBMLDouble(value)); - } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.coord3); - } - } - else { - isAttributeRead = false; - } - } - return isAttributeRead; - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("SpatialPoint [domain="); - builder.append(domain); - builder.append(", coord1="); - builder.append(coord1); - builder.append(", coord2="); - builder.append(coord2); - builder.append(", coord3="); - builder.append(coord3); - builder.append("]"); - return builder.toString(); - } - - - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-22 14:53:50
|
Revision: 2216 http://sourceforge.net/p/jsbml/code/2216 Author: pdp10 Date: 2015-04-22 14:53:42 +0000 (Wed, 22 Apr 2015) Log Message: ----------- update spatial package v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledVolume.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-22 14:36:58 UTC (rev 2215) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-22 14:53:42 UTC (rev 2216) @@ -34,7 +34,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -72,6 +73,7 @@ /** * @author Alex Thomas * @author Andreas Dräger + * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 */ @@ -83,7 +85,11 @@ /** * */ - DEFLATED; + DEFLATED, + /** + * + */ + BASE64; } /** @@ -111,10 +117,6 @@ /** * */ - private DataKind dataType; - /** - * - */ private Integer numSamples1; /** * @@ -135,6 +137,14 @@ /** * */ + private Integer samplesLength; + /** + * + */ + private DataKind dataType; + /** + * + */ private XMLNode data; /** @@ -164,6 +174,9 @@ if (sf.isSetCompression()) { setCompression(sf.getCompression()); } + if (sf.isSetSamplesLength()) { + setSamplesLength(sf.getSamplesLength()); + } if (sf.isSetInterpolation()) { setInterpolation(sf.getInterpolation()); } @@ -223,6 +236,10 @@ if (equal && isSetInterpolation()) { equal &= sf.getInterpolation().equals(getInterpolation()); } + equal &= sf.isSetSamplesLength() == isSetSamplesLength(); + if (equal && isSetSamplesLength()) { + equal &= sf.getSamplesLength() == getSamplesLength(); + } equal &= sf.isSetDataType() == isSetDataType(); if (equal && isSetDataType()) { equal &= sf.getDataType().equals(getDataType()); @@ -543,6 +560,67 @@ } +/** + * Returns the value of {@link #samplesLength}. + * + * @return the value of {@link #samplesLength}. + */ +public int getSamplesLength() { + if (isSetSamplesLength()) { + return samplesLength; + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(SpatialConstants.samplesLength, this); +} + + +/** + * Returns whether {@link #samplesLength} is set. + * + * @return whether {@link #samplesLength} is set. + */ +public boolean isSetSamplesLength() { + return this.samplesLength != null; +} + +/** + * Sets the value of samplesLength + * + * @param samplesLength the value of samplesLength to be set. + */ +public void setSamplesLength(String samplesLength) { + Integer oldSamplesLength = this.samplesLength; + this.samplesLength = StringTools.parseSBMLInt(samplesLength); + firePropertyChange(SpatialConstants.samplesLength, oldSamplesLength, this.samplesLength); +} + +/** + * Sets the value of samplesLength + * + * @param samplesLength the value of samplesLength to be set. + */ +public void setSamplesLength(int samplesLength) { + Integer oldSamplesLength = this.samplesLength; + this.samplesLength = samplesLength; + firePropertyChange(SpatialConstants.samplesLength, oldSamplesLength, this.samplesLength); +} + + +/** + * Unsets the variable samplesLength. + * + * @return {@code true} if samplesLength was set before, otherwise {@code false}. + */ +public boolean unsetSamplesLength() { + if (isSetSamplesLength()) { + Integer oldSamplesLength = this.samplesLength; + this.samplesLength = null; + firePropertyChange(SpatialConstants.samplesLength, oldSamplesLength, this.samplesLength); + return true; + } + return false; +} + /** * Returns the value of data * @@ -657,7 +735,7 @@ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1997; int hashCode = super.hashCode(); if (isSetNumSamples1()) { hashCode += prime * getNumSamples1(); @@ -678,6 +756,10 @@ if (isSetCompression()) { hashCode += prime * getCompression().hashCode(); } + + if (isSetSamplesLength()) { + hashCode += prime * getSamplesLength(); + } if (isSetInterpolation()) { hashCode += prime * getInterpolation().hashCode(); @@ -767,6 +849,13 @@ MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.compression); } } + else if (attributeName.equals(SpatialConstants.samplesLength)) { + try { + setSamplesLength(String.valueOf(value)); + } catch (Exception e) { + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.samplesLength); + } + } else if (attributeName.equals(SpatialConstants.dataType)) { try { setDataType(DataKind.valueOf(value)); @@ -800,6 +889,8 @@ builder.append(interpolation); builder.append(", compression="); builder.append(compression); + builder.append(", samplesLength="); + builder.append(samplesLength); builder.append(", data="); builder.append(data); builder.append("]"); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.java 2015-04-22 14:36:58 UTC (rev 2215) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledFieldGeometry.java 2015-04-22 14:53:42 UTC (rev 2216) @@ -70,7 +70,7 @@ super(sampledFieldGeometry); if (sampledFieldGeometry.isSetSampledField()) { - sampledField = new String(sampledFieldGeometry.getSampledField()); + setSampledField(sampledFieldGeometry.getSampledField()); } if (isSetListOfSampledVolumes()) { @@ -372,11 +372,14 @@ */ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1951; int hashCode = super.hashCode(); if (isSetSampledField()) { hashCode += prime * getSampledField().hashCode(); } + if (isSetListOfSampledVolumes()) { + hashCode += prime * getListOfSampledVolumes().hashCode(); + } return hashCode; } @@ -416,5 +419,17 @@ } return isAttributeRead; } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("SampledFieldGeometry [sampledField="); + builder.append(sampledField); + builder.append("]"); + return builder.toString(); + } } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledVolume.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledVolume.java 2015-04-22 14:36:58 UTC (rev 2215) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledVolume.java 2015-04-22 14:53:42 UTC (rev 2216) @@ -31,7 +31,8 @@ /** * @author Alex Thomas - * @author Andreas Dräger + * @author Andreas Dräger + * @author Piero Dalle Pezze * @since 1.0 * @version $Rev$ */ @@ -78,16 +79,16 @@ public SampledVolume(SampledVolume sv) { super(sv); if (sv.isSetDomainType()) { - domainType = new String(sv.getDomainType()); + setDomainType(sv.getDomainType()); } if (sv.isSetSampledValue()) { - sampledValue = new Double(sv.getSampledValue()); + setSampledValue(sv.getSampledValue()); } if (sv.isSetMinValue()) { - minValue = new Double(sv.getMinValue()); + setMinValue(sv.getMinValue()); } if (sv.isSetMaxValue()) { - maxValue = new Double(sv.getMaxValue()); + setMaxValue(sv.getMaxValue()); } } @@ -193,7 +194,7 @@ */ public double getSampledValue() { if (isSetSampledValue()) { - return sampledValue; + return sampledValue.doubleValue(); } // This is necessary if we cannot return null here. throw new PropertyUndefinedError(SpatialConstants.sampledValue, this); @@ -213,7 +214,7 @@ * @param sampledValue */ public void setSampledValue(double sampledValue) { - double oldSampledValue = this.sampledValue; + Double oldSampledValue = this.sampledValue; this.sampledValue = sampledValue; firePropertyChange(SpatialConstants.sampledValue, oldSampledValue, this.sampledValue); } @@ -227,7 +228,7 @@ */ public boolean unsetSampledValue() { if (isSetSampledValue()) { - double oldSampledValue = sampledValue; + Double oldSampledValue = sampledValue; sampledValue = null; firePropertyChange(SpatialConstants.sampledValue, oldSampledValue, sampledValue); return true; @@ -243,7 +244,7 @@ */ public double getMinValue() { if (isSetMinValue()) { - return minValue; + return minValue.doubleValue(); } // This is necessary if we cannot return null here. throw new PropertyUndefinedError(SpatialConstants.minValue, this); @@ -293,7 +294,7 @@ */ public double getMaxValue() { if (isSetMaxValue()) { - return maxValue; + return maxValue.doubleValue(); } throw new PropertyUndefinedError(SpatialConstants.maxValue, this); } @@ -339,7 +340,7 @@ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 1949; int hashCode = super.hashCode(); if (isSetSampledValue()) { hashCode += prime * getSampledValue(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-22 15:23:16
|
Revision: 2220 http://sourceforge.net/p/jsbml/code/2220 Author: pdp10 Date: 2015-04-22 15:23:14 +0000 (Wed, 22 Apr 2015) Log Message: ----------- update spatial package to v0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.java 2015-04-22 15:16:16 UTC (rev 2219) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialModelPlugin.java 2015-04-22 15:23:14 UTC (rev 2220) @@ -330,5 +330,34 @@ return success; } + + /* + * (non-Javadoc) + * @see org.sbml.jsbml.ext.AbstractSBasePlugin#hashCode() + */ + @Override + public int hashCode() { + final int prime = 2039; + int hashCode = super.hashCode(); + if (isSetGeometry()) { + hashCode += prime * getGeometry().hashCode(); + } + return hashCode; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("SpatialModelPlugin [geometry="); + builder.append(geometry); + builder.append(", spatialIdMap="); + builder.append(spatialIdMap); + builder.append("]"); + return builder.toString(); + } + } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.java 2015-04-22 15:16:16 UTC (rev 2219) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialReactionPlugin.java 2015-04-22 15:23:14 UTC (rev 2220) @@ -197,7 +197,7 @@ */ @Override public int hashCode() { - final int prime = 983;//Change this prime number + final int prime = 2039; int hashCode = super.hashCode(); if (isSetIsLocal()) { hashCode += prime * isLocal.hashCode(); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java 2015-04-22 15:16:16 UTC (rev 2219) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/TransformationComponent.java 2015-04-22 15:23:14 UTC (rev 2220) @@ -29,7 +29,6 @@ import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; -import org.sbml.jsbml.util.TreeNodeChangeEvent; /** * @author Alex Thomas @@ -112,6 +111,9 @@ if (equal && isSetComponents()) { equal &= tc.getComponents().equals(getComponents()); } + if (equal && isSetComponentsLength()) { + equal &= tc.getComponentsLength() == getComponentsLength(); + } } return equal; } @@ -178,7 +180,7 @@ */ public int getComponentsLength() { if (isSetComponentsLength()) { - return componentsLength; + return componentsLength.intValue(); } // This is necessary if we cannot return null here. throw new PropertyUndefinedError(SpatialConstants.componentsLength, this); @@ -204,6 +206,9 @@ if (isSetComponents()) { hashCode += prime * getComponents().hashCode(); } + if (isSetComponentsLength()) { + hashCode += prime * getComponentsLength(); + } return hashCode; } @@ -223,15 +228,6 @@ attributes.put(SpatialConstants.shortLabel + ":componentsLength", String.valueOf(getComponentsLength())); } - - if (isSetSBOTerm()) { - attributes.remove(TreeNodeChangeEvent.sboTerm); - attributes.put(SpatialConstants.shortLabel + ":" + TreeNodeChangeEvent.sboTerm, getSBOTermID()); - } - if (isSetMetaId()) { - attributes.remove(TreeNodeChangeEvent.metaId); - attributes.put(SpatialConstants.shortLabel + ":" + TreeNodeChangeEvent.metaId, getMetaId()); - } return attributes; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 08:49:28
|
Revision: 2226 http://sourceforge.net/p/jsbml/code/2226 Author: pdp10 Date: 2015-04-23 08:49:20 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 Added Paths: ----------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java 2015-04-23 08:49:20 UTC (rev 2226) @@ -0,0 +1,44 @@ +/* + * $Id: CompressionKind.java 2206 2015-04-23 09:57:59Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Piero Dalle Pezze + * @version $Rev$ + * @since 1.0 + * @date 23 Apr 2015 + */ +public enum CompressionKind { + /** + * If no compression is used + */ + UNCOMPRESSED, + /** + * If the deflation algorithm was used to compress the text version of the data + */ + DEFLATED, + /** + * If the base 64 algorithm was used to transform the binary form of the actual members into text + */ + BASE64; +} \ No newline at end of file Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java 2015-04-23 08:49:20 UTC (rev 2226) @@ -0,0 +1,53 @@ +/* + * $Id: DataKind.java 2206 2015-04-23 09:57:59Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Piero Dalle Pezze + * @version $Rev$ + * @since 1.0 + * @date 23 Apr 2015 + */ +public enum DataKind { + /** + * To indicate 8-bit unsigned integer + */ + UINT8, + /** + * To indicate 16-bit unsigned integer + */ + UINT16, + /** + * To indicate 32-bit unsigned integer + */ + UINT32, + /** + * To indicate single-precision (32-bit) floating point values + */ + FLOAT, + /** + * To indicate double-precision (64-bit) floating point values + */ + DOUBLE; +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 09:42:48
|
Revision: 2228 http://sourceforge.net/p/jsbml/code/2228 Author: pdp10 Date: 2015-04-23 09:42:41 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 - extraction of primitive types Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java Added Paths: ----------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryConditionKind.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java 2015-04-23 09:21:12 UTC (rev 2227) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java 2015-04-23 09:42:41 UTC (rev 2228) @@ -43,25 +43,6 @@ public class AnalyticVolume extends AbstractMathContainer implements SpatialNamedSBase{ /** - * @author Alex Thomas - * @author Andreas Dräger - * @version $Rev$ - * @since 1.0 - * @date 10.12.2014 - */ - public static enum FunctionKind { - /** - * Math child element contains an inequality - */ - LAYERED, - // /** - // * Shape is represented by a real-valued function whose sign - // * indicates coverage by the shape - // */ - // R_FUNCTION; - } - - /** * */ String spatialId; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java 2015-04-23 09:21:12 UTC (rev 2227) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java 2015-04-23 09:42:41 UTC (rev 2228) @@ -37,35 +37,6 @@ public class BoundaryCondition extends ParameterType { /** - * - * @author Andreas Dräger - * @version $Rev$ - * @since 0.8 - */ - public static enum BoundaryKind { - /** - * Neumann - */ - NEUMANN, - /** - * Dirichlet - */ - DIRICHLET, - /** - * Robin value coefficient - */ - ROBIN_VALUECOEFFICIENT, - /** - * Robin inward normal gradient coefficient - */ - ROBIN_INWARDNORMALGRADIENTCOEFFICIENT, - /** - * Robin sum - */ - ROBIN_SUM; - } - - /** * Generated serial version identifier. */ private static final long serialVersionUID = -6986768113234565819L; @@ -83,7 +54,7 @@ /** * */ - private BoundaryKind type; + private BoundaryConditionKind type; /** * @@ -168,7 +139,7 @@ * * @return the value of type */ - public BoundaryKind getType() { + public BoundaryConditionKind getType() { if (isSetType()) { return type; } @@ -191,8 +162,8 @@ * Sets the value of type * @param type */ - public void setType(BoundaryKind type) { - BoundaryKind oldType = this.type; + public void setType(BoundaryConditionKind type) { + BoundaryConditionKind oldType = this.type; this.type = type; firePropertyChange(SpatialConstants.type, oldType, this.type); } @@ -204,7 +175,7 @@ if (!Pattern.matches("[a-z]*", type)) { throw new SBMLException("The value is not all lower-case."); } - setType(BoundaryKind.valueOf(type.toUpperCase())); + setType(BoundaryConditionKind.valueOf(type.toUpperCase())); } /** @@ -215,7 +186,7 @@ */ public boolean unsetType() { if (isSetType()) { - BoundaryKind oldType = type; + BoundaryConditionKind oldType = type; type = null; firePropertyChange(SpatialConstants.type, oldType, type); return true; Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryConditionKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryConditionKind.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryConditionKind.java 2015-04-23 09:42:41 UTC (rev 2228) @@ -0,0 +1,52 @@ +/* + * $Id: BoundaryConditionKind.java 2109 2015-01-05 04:50:45Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryConditionKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Piero Dalle Pezze + * @version $Rev$ + * @since 1.0 + * @date 23 Apr 2015 + */ +public enum BoundaryConditionKind { + /** + * Neumann + */ + NEUMANN, + /** + * Dirichlet + */ + DIRICHLET, + /** + * Robin value coefficient + */ + ROBIN_VALUECOEFFICIENT, + /** + * Robin inward normal gradient coefficient + */ + ROBIN_INWARDNORMALGRADIENTCOEFFICIENT, + /** + * Robin sum + */ + ROBIN_SUM; +} \ No newline at end of file Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java 2015-04-23 09:21:12 UTC (rev 2227) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java 2015-04-23 09:42:41 UTC (rev 2228) @@ -37,44 +37,6 @@ public class CSGPrimitive extends CSGNode{ /** - * @author Alex Thomas - * @version $Rev$ - * @since 1.0 - * @date 10.12.2014 - */ - public enum PrimitiveKind { - /** - * sphere - */ - SPHERE, - /** - * cube - */ - CUBE, - /** - * cylinder - */ - CYLINDER, - /** - * cone - */ - CONE, - /** - * circle - */ - CIRCLE, - /** - * square - */ - SQUARE, - /** - * rightTriangle - */ - RIGHTTRIANGLE; - - } - - /** * */ private static final long serialVersionUID = -6783804853380306509L; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 09:43:44
|
Revision: 2229 http://sourceforge.net/p/jsbml/code/2229 Author: pdp10 Date: 2015-04-23 09:43:42 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 - extraction of primitive types Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java Added Paths: ----------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PrimitiveKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SetOperation.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-04-23 09:42:41 UTC (rev 2228) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-04-23 09:43:42 UTC (rev 2229) @@ -38,54 +38,6 @@ public class ParametricObject extends AbstractSpatialNamedSBase { /** - * @author Alex Thomas - * @author Andreas Dräger - * @version $Rev$ - * @since 1.0 - */ - public enum PolygonKind { - /** - * - */ - TRIANGLE, - - /** - * - */ - QUADRILATERAL; - } - - public enum CompressionKind { - /** - * - */ - UNCOMPRESSED, - /** - * - */ - DEFLATED, - /** - * - */ - BASE64; - } - - public enum DataKind { - /** - * - */ - UINT8, - /** - * - */ - UINT16, - /** - * - */ - UINT32; - } - - /** * */ private PolygonKind polygonType; Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonKind.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonKind.java 2015-04-23 09:43:42 UTC (rev 2229) @@ -0,0 +1,42 @@ +/* + * $Id: PolygonKind.java 2206 2015-04-23 09:57:59Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Alex Thomas + * @author Andreas Dräger + * @author Piero Dalle Pezze + * @version $Rev: 2209 $ + * @since 1.0 + */ +public enum PolygonKind { + /** + * + */ + TRIANGLE, + + /** + * + */ + QUADRILATERAL; +} \ No newline at end of file Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PrimitiveKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PrimitiveKind.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PrimitiveKind.java 2015-04-23 09:43:42 UTC (rev 2229) @@ -0,0 +1,62 @@ +/* + * $Id: CompressionKind.java 2206 2015-04-23 09:57:59Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Alex Thomas + * @author Piero Dalle Pezze + * @version $Rev: 2203 $ + * @since 1.0 + * @date 10.12.2014 + */ +public enum PrimitiveKind { + /** + * sphere + */ + SPHERE, + /** + * cube + */ + CUBE, + /** + * cylinder + */ + CYLINDER, + /** + * cone + */ + CONE, + /** + * circle + */ + CIRCLE, + /** + * square + */ + SQUARE, + /** + * rightTriangle + */ + RIGHTTRIANGLE; + +} \ No newline at end of file Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SetOperation.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SetOperation.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SetOperation.java 2015-04-23 09:43:42 UTC (rev 2229) @@ -0,0 +1,45 @@ +/* + * $Id: CompressionKind.java 2206 2015-04-23 09:57:59Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Alex Thomas + * @author Piero Dalle Pezze + * @version $Rev: 2203 $ + * @since 1.0 + * @date 10.12.2014 + */ +public enum SetOperation { + /** + * + */ + UNION, + /** + * + */ + INTERSECTION, + /** + * + */ + RELATIVECOMPONENT; +} \ No newline at end of file Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java 2015-04-23 09:42:41 UTC (rev 2228) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java 2015-04-23 09:43:42 UTC (rev 2229) @@ -42,44 +42,6 @@ private static final long serialVersionUID = -3467717442431545263L; - public enum CompressionKind { - /** - * - */ - UNCOMPRESSED, - /** - * - */ - DEFLATED, - /** - * - */ - BASE64; - } - - public enum DataKind { - /** - * - */ - UINT8, - /** - * - */ - UINT16, - /** - * - */ - UINT32, - /** - * - */ - FLOAT, - /** - * - */ - DOUBLE; - } - /** * */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 09:44:33
|
Revision: 2230 http://sourceforge.net/p/jsbml/code/2230 Author: pdp10 Date: 2015-04-23 09:44:25 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 - extraction of primitive types Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java Added Paths: ----------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/FunctionKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InterpolationKind.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java 2015-04-23 09:43:42 UTC (rev 2229) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java 2015-04-23 09:44:25 UTC (rev 2230) @@ -37,28 +37,7 @@ /** * - * @author - * @version - * @since */ - public static enum DiffusionKind { - /** - * Isotropic - */ - ISOTROPIC, - /** - * Tensor - */ - TENSOR, - /** - * Anisotropic - */ - ANISOTROPIC; - } - - /** - * - */ private DiffusionKind diffusionKind; /** * Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionKind.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionKind.java 2015-04-23 09:44:25 UTC (rev 2230) @@ -0,0 +1,44 @@ +/* + * $Id: DiffusionKind.java 2109 2015-01-05 04:50:45Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Piero Dalle Pezze + * @version $Rev$ + * @since 1.0 + * @date 23 Apr 2015 + */ +public enum DiffusionKind { + /** + * Isotropic + */ + ISOTROPIC, + /** + * Tensor + */ + TENSOR, + /** + * Anisotropic + */ + ANISOTROPIC; +} \ No newline at end of file Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/FunctionKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/FunctionKind.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/FunctionKind.java 2015-04-23 09:44:25 UTC (rev 2230) @@ -0,0 +1,42 @@ +/* + * $Id: BoundaryConditionKind.java 2109 2015-01-05 04:50:45Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/FunctionKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Alex Thomas + * @author Andreas Dräger + * @version $Rev: 2205 $ + * @since 1.0 + * @date 10.12.2014 + */ +public enum FunctionKind { + /** + * Math child element contains an inequality + */ + LAYERED, + // /** + // * Shape is represented by a real-valued function whose sign + // * indicates coverage by the shape + // */ + // R_FUNCTION; +} \ No newline at end of file Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryKind.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryKind.java 2015-04-23 09:44:25 UTC (rev 2230) @@ -0,0 +1,36 @@ +/* + * $Id: GeometryKind.java 2109 2015-01-05 04:50:45Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Alex Thomas + * @author Piero Dalle Pezze + * @version $Rev: 2206 $ + * @since 0.8 + */ +public enum GeometryKind { + /** + * cartesian + */ + CARTESIAN; +} \ No newline at end of file Added: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InterpolationKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InterpolationKind.java (rev 0) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InterpolationKind.java 2015-04-23 09:44:25 UTC (rev 2230) @@ -0,0 +1,41 @@ +/* + * $Id: InterpolationKind.java 2109 2015-01-05 04:50:45Z pdp10 $ + * $URL: svn+ssh://pd...@sv.../p/jsbml/code/trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InterpolationKind.java $ + * ---------------------------------------------------------------------------- + * This file is part of JSBML. Please visit <http://sbml.org/Software/JSBML> + * for the latest version of JSBML and more information about SBML. + * + * Copyright (C) 2009-2015 jointly by the following organizations: + * 1. The University of Tuebingen, Germany + * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK + * 3. The California Institute of Technology, Pasadena, CA, USA + * 4. The University of California, San Diego, La Jolla, CA, USA + * 5. The Babraham Institute, Cambridge, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as <http://sbml.org/Software/JSBML/License>. + * ---------------------------------------------------------------------------- + */ +package org.sbml.jsbml.ext.spatial; + +/** + * This enum type was created following the specifications defined in Spatial Package v0.90. + * @author Alex Thomas + * @author Andreas Dräger + * @author Piero Dalle Pezze + * @version $Rev: 2216 $ + * @since 1.0 + */ +public enum InterpolationKind { + /** + * + */ + NEARESTNEIGHBOR, + /** + * + */ + LINEAR; +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 09:47:05
|
Revision: 2231 http://sourceforge.net/p/jsbml/code/2231 Author: pdp10 Date: 2015-04-23 09:46:58 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package v0.90 - extraction of primitive types Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java 2015-04-23 09:44:25 UTC (rev 2230) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java 2015-04-23 09:46:58 UTC (rev 2231) @@ -44,27 +44,6 @@ public class CSGSetOperator extends CSGNode { /** - * @author Alex Thomas - * @version $Rev$ - * @since 1.0 - * @date 10.12.2014 - */ - public static enum SetOperation { - /** - * - */ - UNION, - /** - * - */ - INTERSECTION, - /** - * - */ - RELATIVECOMPONENT; - } - - /** * */ private static final long serialVersionUID = 3448308755493169761L; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-04-23 09:44:25 UTC (rev 2230) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-04-23 09:46:58 UTC (rev 2231) @@ -43,19 +43,6 @@ */ public class Geometry extends AbstractSpatialNamedSBase { - /** - * - * @author Alex Thomas - * @version $Rev$ - * @since 0.8 - */ - public static enum GeometryKind { - /** - * cartesian - */ - CARTESIAN; - } - /** * Generated serial version identifier. */ Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-23 09:44:25 UTC (rev 2230) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-04-23 09:46:58 UTC (rev 2231) @@ -41,74 +41,6 @@ */ public class SampledField extends AbstractSpatialNamedSBase { - /** - * @author Alex Thomas - * @author Andreas Dräger - * @version $Rev$ - * @since 1.0 - */ - public enum DataKind { - /** - * - */ - DOUBLE, - /** - * - */ - FLOAT, - /** - * - */ - UINT8, - /** - * - */ - UINT16, - /** - * - */ - UINT32; - } - - /** - * @author Alex Thomas - * @author Andreas Dräger - * @author Piero Dalle Pezze - * @version $Rev$ - * @since 1.0 - */ - public enum CompressionKind { - /** - * - */ - UNCOMPRESSED, - /** - * - */ - DEFLATED, - /** - * - */ - BASE64; - } - - /** - * @author Alex Thomas - * @author Andreas Dräger - * @version $Rev$ - * @since 1.0 - */ - public enum InterpolationKind { - /** - * - */ - NEARESTNEIGHBOR, - /** - * - */ - LINEAR; - } - /** * Generated serial version identifier. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-04-23 12:52:44
|
Revision: 2235 http://sourceforge.net/p/jsbml/code/2235 Author: pdp10 Date: 2015-04-23 12:52:36 +0000 (Thu, 23 Apr 2015) Log Message: ----------- update spatial package to v0.90 - added arrayData to SpatialPoints. Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-04-23 12:13:02 UTC (rev 2234) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-04-23 12:52:36 UTC (rev 2235) @@ -514,21 +514,21 @@ try { setCompression(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.compression); } } else if (attributeName.equals(SpatialConstants.pointIndexLength)) { try { setPointIndexLength(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.pointIndexLength); } } else if (attributeName.equals(SpatialConstants.dataType)) { try { setDataType(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.dataType); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-23 12:13:02 UTC (rev 2234) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialConstants.java 2015-04-23 12:52:36 UTC (rev 2235) @@ -515,6 +515,11 @@ /** * */ + public static final String arrayData = "arrayData"; + + /** + * + */ public static final String arrayDataLength = "arrayDataLength"; /** Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java 2015-04-23 12:13:02 UTC (rev 2234) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java 2015-04-23 12:52:36 UTC (rev 2235) @@ -54,7 +54,10 @@ * */ private DataKind dataType; - + /** + * + */ + private String arrayData; @@ -91,6 +94,9 @@ if (sp.isSetDataType()) { setDataType(sp.getDataType()); } + if (sp.isSetArrayData()) { + setArrayData(sp.getArrayData()); + } } @@ -111,6 +117,10 @@ if (equal && isSetCompression()) { equal &= sp.getCompression().equals(getCompression()); } + equal &= sp.isSetArrayData() == isSetArrayData(); + if (equal && isSetArrayData()) { + equal &= sp.getArrayData() == getArrayData(); + } equal &= sp.isSetArrayDataLength() == isSetArrayDataLength(); if (equal && isSetArrayDataLength()) { equal &= sp.getArrayDataLength() == getArrayDataLength(); @@ -192,6 +202,78 @@ /** + * Returns the value of {@link #arrayData}. + * + * @return the value of {@link #arrayData}. + */ + public String getArrayData() { + if (isSetArrayData()) { + return arrayData; + } + // This is necessary if we cannot return null here. For variables of type String return an empty String if no value is defined. + throw new PropertyUndefinedError(SpatialConstants.arrayData, this); + } + + + /** + * Returns whether {@link #arrayData} is set. + * + * @return whether {@link #arrayData} is set. + */ + public boolean isSetArrayData() { + return this.arrayData != null; + } + + + /** + * Sets the value of arrayData + * + * @param arrayData the value of arrayData to be set. + */ + public void setArrayData(String arrayData) { + String oldArrayData = this.arrayData; + this.arrayData = arrayData; + arrayDataLength = 1; + firePropertyChange(SpatialConstants.arrayData, oldArrayData, this.arrayData); + } + + + /** + * Unsets the variable arrayData. + * + * @return {@code true} if arrayData was set before, otherwise {@code false}. + */ + public boolean unsetArrayData() { + if (isSetArrayData()) { + String oldArrayData = this.arrayData; + this.arrayData = null; + arrayDataLength = null; + firePropertyChange(SpatialConstants.arrayData, oldArrayData, this.arrayData); + return true; + } + return false; + } + + /** + * Appends the variable data to arrayData. + * @return {@code true} if data was appended to arrayData, otherwise {@code false}. + */ + public boolean append(String data) { + if (isSetArrayData()) { + String oldArrayData = this.arrayData; + if(compression == CompressionKind.UNCOMPRESSED) { + this.arrayData = this.arrayData + "; " + data; + } else { // data is compressed + this.arrayData = this.arrayData + " " + data; + } + arrayDataLength++; + firePropertyChange(SpatialConstants.arrayData, oldArrayData, this.arrayData); + return true; + } + return false; + } + + /** * Returns the value of arrayDataLength. * * @return the value of arrayDataLength. @@ -313,6 +395,9 @@ if (isSetArrayDataLength()) { hashCode += prime * getArrayDataLength(); } + if (isSetArrayData()) { + hashCode += prime * getArrayData().hashCode(); + } if (isSetDataType()) { hashCode += prime * getDataType().hashCode(); } @@ -332,6 +417,11 @@ attributes.put(SpatialConstants.shortLabel + ":arrayDataLength", String.valueOf(getArrayDataLength())); } + if (isSetArrayData()) { + attributes.remove("arrayData"); + attributes.put(SpatialConstants.shortLabel + ":arrayData", + getArrayData()); + } if (isSetDataType()) { attributes.remove("dataType"); attributes.put(SpatialConstants.shortLabel + ":dataType", @@ -350,21 +440,28 @@ try { setCompression(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.compression); } } else if (attributeName.equals(SpatialConstants.arrayDataLength)) { try { setArrayDataLength(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.arrayDataLength); } } + else if (attributeName.equals(SpatialConstants.arrayData)) { + try { + setArrayData(value); + } catch (Exception e) { + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.arrayData); + } + } else if (attributeName.equals(SpatialConstants.dataType)) { try { setDataType(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.dataType); } } else { @@ -382,6 +479,8 @@ StringBuilder builder = new StringBuilder(); builder.append("ParametricObject [compression="); builder.append(compression); + builder.append(", arrayData="); + builder.append(arrayData); builder.append(", arrayDataLength="); builder.append(arrayDataLength); builder.append(", dataType="); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-05-13 15:26:17
|
Revision: 2296 http://sourceforge.net/p/jsbml/code/2296 Author: pdp10 Date: 2015-05-13 15:26:14 +0000 (Wed, 13 May 2015) Log Message: ----------- tested on files analytic_3d.xml, sampled_fields.xml . Added logger to classes Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.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/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/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/CSGTranslation.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/OrdinalMapping.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.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/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/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 Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AbstractSpatialNamedSBase.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -27,6 +27,7 @@ import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; @@ -39,7 +40,12 @@ * @version $Rev$ */ public abstract class AbstractSpatialNamedSBase extends AbstractSBase implements SpatialNamedSBase { - + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(AbstractSpatialNamedSBase.class); + /** * Generated serial version identifier. */ @@ -238,8 +244,8 @@ try { setSpatialId(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.spatialId); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.spatialId, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdjacentDomains.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdjacentDomains.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdjacentDomains.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -25,6 +25,7 @@ import java.util.Map; import java.util.ResourceBundle; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; @@ -35,8 +36,14 @@ * @version $Rev$ */ public class AdjacentDomains extends AbstractSpatialNamedSBase { - + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(AdjacentDomains.class); + + /** * */ private String domain1; @@ -271,16 +278,16 @@ try { setDomain1(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.domain1); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.domain1, getElementName())); } } else if (attributeName.equals(SpatialConstants.domain2)) { try { setDomain2(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.domain2); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.domain2, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AdvectionCoefficient.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -24,6 +24,7 @@ import java.text.MessageFormat; import java.util.Map; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; @@ -35,7 +36,12 @@ */ public class AdvectionCoefficient extends ParameterType { - + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(AdvectionCoefficient.class); + /** * Generated serial version identifier. */ @@ -178,9 +184,8 @@ try { setCoordinate(CoordinateKind.valueOf(value)); } catch (Exception e) { - MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.coordinate); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coordinate, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/AnalyticVolume.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -26,6 +26,7 @@ import java.util.ResourceBundle; import java.util.regex.Pattern; +import org.apache.log4j.Logger; import org.sbml.jsbml.AbstractMathContainer; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.SBMLException; @@ -42,7 +43,13 @@ */ public class AnalyticVolume extends AbstractMathContainer implements SpatialNamedSBase{ + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(AnalyticVolume.class); + + /** * */ String spatialId; @@ -413,31 +420,33 @@ try { setSpatialId(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.spatialId); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.spatialId, getElementName())); } } else if (attributeName.equals(SpatialConstants.ordinal)) { try { setOrdinal(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.ordinal); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.ordinal, getElementName())); } } else if (attributeName.equals(SpatialConstants.domainType)) { try { setDomainType(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.domainType); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.domainType, getElementName())); } } else if (attributeName.equals(SpatialConstants.functionType)) { - if (!Pattern.matches("[a-z]*", value)) { - throw new SBMLException("The value is not all lower-case."); + try { + setFunctionType(FunctionKind.valueOf(value)); + } catch (Exception e) { + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.functionType, getElementName())); } - setFunctionType(FunctionKind.valueOf(value.toUpperCase())); } else { isAttributeRead = false; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Boundary.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Boundary.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Boundary.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -25,6 +25,7 @@ import java.util.Map; import java.util.ResourceBundle; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; import org.sbml.jsbml.util.StringTools; @@ -36,7 +37,13 @@ * @version $Rev$ */ public class Boundary extends AbstractSpatialNamedSBase { - + + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(Boundary.class); + /** * Generated serial version identifier. */ @@ -198,9 +205,8 @@ try{ setValue(StringTools.parseSBMLDouble(value)); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.value); - + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.value, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryCondition.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -25,6 +25,7 @@ import java.util.Map; import java.util.regex.Pattern; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.SBMLException; @@ -35,7 +36,13 @@ * @version $Rev$ */ public class BoundaryCondition extends ParameterType { - + + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(BoundaryCondition.class); + /** * Generated serial version identifier. */ @@ -172,10 +179,7 @@ * @param type */ public void setType(String type) { - if (!Pattern.matches("[a-z]*", type)) { - throw new SBMLException("The value is not all lower-case."); - } - setType(BoundaryConditionKind.valueOf(type.toUpperCase())); + setType(BoundaryConditionKind.valueOf(type)); } /** @@ -329,21 +333,19 @@ if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.type)) { - // TODO: In the specs v0.90, the type name begins with capital letter. - if (!Pattern.matches("[a-z]*", value)) { - throw new SBMLException("The value is not all lower-case."); - } try { setType(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.type); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.type, getElementName())); } } else if (attributeName.equals(SpatialConstants.coordinateBoundary)) { try { setCoordinateBoundary(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.coordinateBoundary); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coordinateBoundary, getElementName())); } } @@ -351,7 +353,8 @@ try { setBoundaryDomainType(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.boundaryDomainType); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.boundaryDomainType, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryConditionKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryConditionKind.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/BoundaryConditionKind.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -32,21 +32,21 @@ /** * Neumann */ - NEUMANN, + Neumann, /** * Dirichlet */ - DIRICHLET, + Dirichlet, /** * Robin value coefficient */ - ROBIN_VALUECOEFFICIENT, + Robin_valueCoefficient, /** * Robin inward normal gradient coefficient */ - ROBIN_INWARDNORMALGRADIENTCOEFFICIENT, + Robin_inwardNormalGradientCoefficient, /** * Robin sum */ - ROBIN_SUM; + Robin_sum; } \ No newline at end of file Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGObject.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -27,6 +27,7 @@ import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; import org.sbml.jsbml.util.StringTools; @@ -39,7 +40,13 @@ * @version $Rev$ */ public class CSGObject extends AbstractSpatialNamedSBase { - + + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CSGObject.class); + /** * Generated serial version identifier. */ @@ -342,8 +349,8 @@ try { setDomainType(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.domainType); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.domainType, getElementName())); } } @@ -351,7 +358,8 @@ try { setOrdinal(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, SpatialConstants.ordinal); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.ordinal, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPrimitive.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -25,6 +25,7 @@ import java.util.Map; import java.util.ResourceBundle; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; @@ -36,7 +37,13 @@ */ public class CSGPrimitive extends CSGNode{ + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CSGPrimitive.class); + + /** * */ private static final long serialVersionUID = -6783804853380306509L; @@ -202,8 +209,8 @@ try { setPrimitiveType(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.primitiveType); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.primitiveType, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPseudoPrimitive.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPseudoPrimitive.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGPseudoPrimitive.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -25,6 +25,7 @@ import java.util.Map; import java.util.ResourceBundle; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; @@ -36,7 +37,13 @@ */ public class CSGPseudoPrimitive extends CSGNode{ + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CSGPseudoPrimitive.class); + + /** * */ private static final long serialVersionUID = 303742063326104808L; @@ -194,8 +201,8 @@ try { setCsgObjectRef(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.primitiveType); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.primitiveType, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGRotation.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -24,6 +24,7 @@ import java.text.MessageFormat; import java.util.Map; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; @@ -36,7 +37,13 @@ */ public class CSGRotation extends CSGTransformation { + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CSGRotation.class); + + /** * */ private static final long serialVersionUID = -4799604235135248586L; @@ -395,31 +402,32 @@ try { setRotateAxisX(StringTools.parseSBMLDouble(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.rotateAxisX); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.rotateAxisX, getElementName())); } } else if (attributeName.equals(SpatialConstants.rotateAxisY)) { try { setRotateAxisY(StringTools.parseSBMLDouble(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.rotateAxisY); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.rotateAxisY, getElementName())); } } else if (attributeName.equals(SpatialConstants.rotateAxisZ)) { try { setRotateAxisZ(StringTools.parseSBMLDouble(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.rotateAxisZ); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.rotateAxisZ, getElementName())); } } else if (attributeName.equals(SpatialConstants.rotateAngleInRadians)) { try { setRotateAngleInRadians(StringTools.parseSBMLDouble(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.rotateAngleInRadians); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.rotateAngleInRadians, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGScale.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -24,6 +24,7 @@ import java.text.MessageFormat; import java.util.Map; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; @@ -37,7 +38,13 @@ */ public class CSGScale extends CSGTransformation { + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CSGScale.class); + + /** * */ private static final long serialVersionUID = 7021488698800177528L; @@ -330,24 +337,24 @@ try { setScaleX(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.scaleX); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.scaleX, getElementName())); } } else if (attributeName.equals(SpatialConstants.scaleY)) { try { setScaleY(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.scaleY); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.scaleY, getElementName())); } } else if (attributeName.equals(SpatialConstants.scaleZ)) { try { setScaleZ(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.scaleZ); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.scaleZ, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGSetOperator.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -29,6 +29,7 @@ import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.SBMLException; @@ -43,7 +44,13 @@ */ public class CSGSetOperator extends CSGNode { + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CSGSetOperator.class); + + /** * */ private static final long serialVersionUID = 3448308755493169761L; @@ -661,17 +668,20 @@ if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.operationType)) { - if (!Pattern.matches("[a-z]*", value)) { - throw new SBMLException("The value is not all lower-case."); + try { + setOperationType(SetOperation.valueOf(value)); + } catch (Exception e) { + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.operationType, getElementName())); } - setOperationType(SetOperation.valueOf(value.toUpperCase())); } else if (attributeName.equals(SpatialConstants.complementA)) { try { setComplementA(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.complementA); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.complementA, getElementName())); } } @@ -679,7 +689,8 @@ try { setComplementB(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.complementB); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.complementB, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CSGTranslation.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -24,6 +24,7 @@ import java.text.MessageFormat; import java.util.Map; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; @@ -36,7 +37,13 @@ */ public class CSGTranslation extends CSGTransformation { + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CSGTranslation.class); + + /** * */ private static final long serialVersionUID = 7030963917812170311L; @@ -328,24 +335,24 @@ try { setTranslateX(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.translateX); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.translateX, getElementName())); } } else if (attributeName.equals(SpatialConstants.translateY)) { try { setTranslateY(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.translateY); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.translateY, getElementName())); } } else if (attributeName.equals(SpatialConstants.translateZ)) { try { setTranslateZ(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.translateZ); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.translateZ, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompartmentMapping.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -21,8 +21,10 @@ */ package org.sbml.jsbml.ext.spatial; +import java.text.MessageFormat; import java.util.Map; +import org.apache.log4j.Logger; import org.sbml.jsbml.Model; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; @@ -35,7 +37,13 @@ * @version $Rev$ */ public class CompartmentMapping extends AbstractSpatialNamedSBase { - + + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CompartmentMapping.class); + /** * Generated serial version identifier. */ @@ -273,10 +281,20 @@ if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.domainType)) { - setDomainType(value); + try { + setDomainType(value); + } catch (Exception e) { + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.domainType, getElementName())); + } } else if (attributeName.equals(SpatialConstants.unitSize)) { - setUnitSize(StringTools.parseSBMLDouble(value)); + try { + setUnitSize(StringTools.parseSBMLDouble(value)); + } catch (Exception e) { + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.unitSize, getElementName())); + } } else { isAttributeRead = false; Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CompressionKind.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -32,13 +32,13 @@ /** * If no compression is used */ - UNCOMPRESSED, + uncompressed, /** * If the deflation algorithm was used to compress the text version of the data */ - DEFLATED, + deflated, /** * If the base 64 algorithm was used to transform the binary form of the actual members into text */ - BASE64; + base64; } \ No newline at end of file Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateComponent.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -23,17 +23,16 @@ import java.text.MessageFormat; import java.util.Map; -import java.util.ResourceBundle; import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.Model; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.SBaseWithUnit; import org.sbml.jsbml.Unit; import org.sbml.jsbml.Unit.Kind; import org.sbml.jsbml.UnitDefinition; -import org.sbml.jsbml.util.ResourceManager; /** * @author Alex Thomas @@ -43,7 +42,13 @@ * @version $Rev$ */ public class CoordinateComponent extends AbstractSpatialNamedSBase implements -SBaseWithUnit { +SBaseWithUnit { + + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CoordinateComponent.class); /** * Generated serial version identifier. @@ -71,11 +76,6 @@ */ private String unit; - /** - * - */ - private static final ResourceBundle bundle = ResourceManager.getBundle("org.sbml.jsbml.ext.spatial.Messages"); - /** * */ @@ -159,6 +159,7 @@ public void setBoundaryMinimum(Boundary boundaryMinimum) { Boundary oldMinimum = this.boundaryMinimum; this.boundaryMinimum = boundaryMinimum; + registerChild(boundaryMinimum); firePropertyChange(SpatialConstants.boundaryMinimum, oldMinimum, this.boundaryMinimum); } @@ -210,6 +211,7 @@ public void setBoundaryMaximum(Boundary boundaryMaximum) { Boundary oldMaximum = boundaryMaximum; this.boundaryMaximum = boundaryMaximum; + registerChild(boundaryMaximum); firePropertyChange(SpatialConstants.boundaryMaximum, oldMaximum, boundaryMaximum); } @@ -521,22 +523,22 @@ boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; - + if (attributeName.equals(SpatialConstants.type)) { try { setType(CoordinateKind.valueOf(value)); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.type); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.type, getElementName())); } } else if (attributeName.equals(SpatialConstants.unit)) { try { setUnits(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.unit); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.unit, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateKind.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateKind.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -32,14 +32,14 @@ /** * cartesianX */ - CARTESIANX, + cartesianX, /** * cartesianY */ - CARTESIANY, + cartesianY, /** * cartesianZ */ - CARTESIANZ; + cartesianZ; } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/CoordinateReference.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -25,6 +25,7 @@ import java.util.Map; import java.util.regex.Pattern; +import org.apache.log4j.Logger; import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.SBMLException; @@ -38,10 +39,16 @@ * @version $Rev$ * @since 1.0 * @date 09.09.2011 + * @deprecated Not present in spec 0.90, as be moved into DiffusionCoefficient. */ public abstract class CoordinateReference extends AbstractSBase { /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(CoordinateReference.class); + + /** * Generated serial version identifier. */ private static final long serialVersionUID = -7651871640808157489L; @@ -117,10 +124,7 @@ * @param coordinate */ public void setCoordinate(String coordinate) { - if (!Pattern.matches("[a-z]*", coordinate)) { - throw new SBMLException("The value is not all lower-case."); - } - setCoordinate(CoordinateKind.valueOf(coordinate.toUpperCase())); + setCoordinate(CoordinateKind.valueOf(coordinate)); } /** @@ -160,13 +164,13 @@ && (SpatialConstants.shortLabel == prefix); if (!isAttributeRead) { isAttributeRead = true; + System.out.println(attributeName); if (attributeName.equals(SpatialConstants.coordinate)) { try { setCoordinate(value); } catch (Exception e) { - MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.coordinate); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coordinate, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -33,15 +33,15 @@ /** * To indicate 8-bit unsigned integer */ - UINT8, + uint8, /** * To indicate 16-bit unsigned integer */ - UINT16, + uint16, /** * To indicate 32-bit unsigned integer */ - UINT32, + uint32, /** * To indicate single-precision (32-bit) floating point values */ Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionCoefficient.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -24,7 +24,9 @@ import java.text.MessageFormat; import java.util.Map; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; +import org.sbml.jsbml.xml.parsers.SpatialParser; /** @@ -47,6 +49,11 @@ * */ private CoordinateKind coordinateReference2; + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(DiffusionCoefficient.class); /** @@ -317,12 +324,11 @@ public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); - if (isSetDiffusionKind()) { attributes.remove("type"); attributes.put(SpatialConstants.shortLabel + ":type", - String.valueOf(getDiffusionKind())); - } + String.valueOf(getDiffusionKind()).toLowerCase()); + } if (isSetCoordinateReference1()) { attributes.remove("coordinateReference1"); @@ -330,7 +336,6 @@ String.valueOf(getCoordinateReference1())); } - if (isSetCoordinateReference2()) { attributes.remove("coordinateReference2"); attributes.put(SpatialConstants.shortLabel + ":coordinateReference2", @@ -347,13 +352,13 @@ && (SpatialConstants.shortLabel == prefix); if (!isAttributeRead) { isAttributeRead = true; + if (attributeName.equals(SpatialConstants.type)) { try { setDiffusionKind(DiffusionKind.valueOf(value)); } catch (Exception e) { - MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.type); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.type, getElementName())); } } @@ -361,7 +366,7 @@ try { setCoordinateReference1(CoordinateKind.valueOf(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.coordinateReference1); + logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coordinateReference1, getElementName())); } } @@ -369,7 +374,7 @@ try { setCoordinateReference2(CoordinateKind.valueOf(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.coordinateReference2); + logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coordinateReference2, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionKind.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DiffusionKind.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -32,13 +32,13 @@ /** * Isotropic */ - ISOTROPIC, + isotropic, /** * Tensor */ - TENSOR, + tensor, /** * Anisotropic */ - ANISOTROPIC; + anisotropic; } \ No newline at end of file Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Domain.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -29,6 +29,7 @@ import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.SBMLException; @@ -42,7 +43,13 @@ * @version $Rev$ */ public class Domain extends AbstractSpatialNamedSBase { - + + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(Domain.class); + /** * Generated serial version identifier. */ @@ -398,8 +405,8 @@ try { setDomainType(value); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.domainType); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.domainType, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DomainType.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DomainType.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DomainType.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -24,6 +24,7 @@ import java.text.MessageFormat; import java.util.Map; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.SBMLException; import org.sbml.jsbml.util.StringTools; @@ -36,7 +37,13 @@ * @version $Rev$ */ public class DomainType extends AbstractSpatialNamedSBase { - + + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(DomainType.class); + /** * Generated serial version identifier. */ @@ -202,8 +209,8 @@ try { setSpatialDimensions(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.spatialDimensions); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.spatialDimensions, getElementName())); isAttributeRead = false; } } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/FunctionKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/FunctionKind.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/FunctionKind.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -33,7 +33,7 @@ /** * Math child element contains an inequality */ - LAYERED, + layered, // /** // * Shape is represented by a real-valued function whose sign // * indicates coverage by the shape Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/Geometry.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -29,6 +29,7 @@ import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.ListOf; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; @@ -43,6 +44,12 @@ */ public class Geometry extends AbstractSpatialNamedSBase { + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(Geometry.class); + /** * Generated serial version identifier. */ @@ -1205,8 +1212,8 @@ try { setCoordinateSystem(GeometryKind.valueOf(value)); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.coordinateSystem); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coordinateSystem, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryDefinition.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -24,6 +24,7 @@ import java.text.MessageFormat; import java.util.Map; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; @@ -34,7 +35,13 @@ * @version $Rev$ */ public abstract class GeometryDefinition extends AbstractSpatialNamedSBase { - + + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(GeometryDefinition.class); + /** * Generated serial version identifier. */ @@ -204,9 +211,8 @@ try { setIsActive(StringTools.parseSBMLBoolean(value)); } catch (Exception e) { - MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.isActive); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.isActive, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryKind.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/GeometryKind.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -30,7 +30,8 @@ */ public enum GeometryKind { /** - * cartesian + * */ - CARTESIAN; + cartesian; + } \ No newline at end of file Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InteriorPoint.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -27,6 +27,7 @@ import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.ResourceManager; @@ -40,7 +41,13 @@ * @version $Rev$ */ public class InteriorPoint extends AbstractSBase { - + + + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(InteriorPoint.class); + /** * Generated serial version identifier. */ @@ -367,24 +374,24 @@ try { setCoord1(StringTools.parseSBMLDouble(value)); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.coord1); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coord1, getElementName())); } } else if (attributeName.equals(SpatialConstants.coord2)) { try { setCoord2(StringTools.parseSBMLDouble(value)); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.coord2); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coord2, getElementName())); } } else if (attributeName.equals(SpatialConstants.coord3)) { try { setCoord3(StringTools.parseSBMLDouble(value)); } catch (Exception e) { - MessageFormat.format(bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.coord3); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coord3, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InterpolationKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InterpolationKind.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/InterpolationKind.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -33,9 +33,9 @@ /** * */ - NEARESTNEIGHBOR, + nearestneighbor, /** * */ - LINEAR; + linear; } \ No newline at end of file Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/OrdinalMapping.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -26,6 +26,7 @@ import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; @@ -38,7 +39,13 @@ */ public class OrdinalMapping extends AbstractSBase { + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(OrdinalMapping.class); + + /** * */ private static final long serialVersionUID = -7174553771288567408L; @@ -268,16 +275,16 @@ try { setOrdinal(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.ordinal); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.ordinal, getElementName())); } } else if (attributeName.equals(SpatialConstants.geometryDefinition)) { try { setGeometryDefinition(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.geometryDefinition); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.geometryDefinition, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParameterType.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -26,6 +26,7 @@ import javax.swing.tree.TreeNode; +import org.apache.log4j.Logger; import org.sbml.jsbml.AbstractSBase; import org.sbml.jsbml.Model; import org.sbml.jsbml.SBMLException; @@ -40,7 +41,13 @@ */ public class ParameterType extends AbstractSBase { + /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(ParameterType.class); + + /** * Generated serial version identifier. */ private static final long serialVersionUID = 1359841900912406174L; @@ -320,16 +327,16 @@ try { setSpId(value); } catch (Exception e) { - MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.spatialId); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.spatialId, getElementName())); } } else if (attributeName.equals(SpatialConstants.variable)) { try { setSpeciesReference(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.variable); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.variable, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -24,6 +24,7 @@ import java.text.MessageFormat; import java.util.Map; +import org.apache.log4j.Logger; import org.sbml.jsbml.PropertyUndefinedError; import org.sbml.jsbml.util.StringTools; @@ -38,6 +39,11 @@ public class ParametricObject extends AbstractSpatialNamedSBase { /** + * A {@link Logger} for this class. + */ + private Logger logger = Logger.getLogger(ParametricObject.class); + + /** * */ private PolygonKind polygonType; @@ -581,36 +587,40 @@ try { setDomainType(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, - SpatialConstants.domainType); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.domainType, getElementName())); } } else if (attributeName.equals(SpatialConstants.polygonType)) { try { setPolygonType(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.polygonType); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.polygonType, getElementName())); } } else if (attributeName.equals(SpatialConstants.compression)) { try { setCompression(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.compression); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.compression, getElementName())); } } else if (attributeName.equals(SpatialConstants.pointIndexLength)) { try { setPointIndexLength(StringTools.parseSBMLInt(value)); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.pointIndexLength); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.pointIndexLength, getElementName())); } } else if (attributeName.equals(SpatialConstants.dataType)) { try { setDataType(value); } catch (Exception e) { - MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ"), value, SpatialConstants.dataType); + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.dataType, getElementName())); } } else { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonKind.java 2015-05-12 16:08:17 UTC (rev 2295) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/PolygonKind.java 2015-05-13 15:26:14 UTC (rev 2296) @@ -33,10 +33,10 @@ /** * */ - TRIANGLE, + triangle, /** * */ - QUADRILATERAL; + quadrilateral; } \ No newlin... [truncated message content] |
From: <pd...@us...> - 2015-05-13 15:48:43
|
Revision: 2297 http://sourceforge.net/p/jsbml/code/2297 Author: pdp10 Date: 2015-05-13 15:48:41 +0000 (Wed, 13 May 2015) Log Message: ----------- Set DataKind fields to upper case to avoid conflicts with Java primitive types float / double Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java 2015-05-13 15:26:14 UTC (rev 2296) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/DataKind.java 2015-05-13 15:48:41 UTC (rev 2297) @@ -23,7 +23,12 @@ /** - * This enum type was created following the specifications defined in Spatial Package v0.90. + * This enum type was created following the specifications defined in Spatial Package v0.90. + * + * The fields here are intentionally left upper case (in contrast to the spec where they are lower case) + * because float and double are in conflict with the Java primitive types float and double. + * Classes using DataKind need to use the methods toLowerCase() and toUpperCase() to deal with these values + * in the methods writeXMLAttributes() and readAttribute(). * @author Piero Dalle Pezze * @version $Rev$ * @since 1.0 @@ -33,15 +38,15 @@ /** * To indicate 8-bit unsigned integer */ - uint8, + UINT8, /** * To indicate 16-bit unsigned integer */ - uint16, + UINT16, /** * To indicate 32-bit unsigned integer */ - uint32, + UINT32, /** * To indicate single-precision (32-bit) floating point values */ Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-05-13 15:26:14 UTC (rev 2296) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/ParametricObject.java 2015-05-13 15:48:41 UTC (rev 2297) @@ -569,8 +569,9 @@ } if (isSetDataType()) { attributes.remove("dataType"); + // see DataKind.java attributes.put(SpatialConstants.shortLabel + ":dataType", - getDataType().toString()); + getDataType().toString().toLowerCase()); } return attributes; @@ -617,7 +618,8 @@ } else if (attributeName.equals(SpatialConstants.dataType)) { try { - setDataType(value); + // see DataKind.java + setDataType(value.toUpperCase()); } catch (Exception e) { logger.warn(MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.dataType, getElementName())); Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-05-13 15:26:14 UTC (rev 2296) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-05-13 15:48:41 UTC (rev 2297) @@ -804,8 +804,9 @@ String.valueOf(getNumSamples3())); } if (isSetDataType()) { + // see DataKind.java attributes.put(SpatialConstants.shortLabel + ":dataType", - getDataType().toString()); + getDataType().toString().toLowerCase()); } if (isSetCompression()) { attributes.put(SpatialConstants.shortLabel + ":compression", @@ -873,7 +874,8 @@ } else if (attributeName.equals(SpatialConstants.dataType)) { try { - setDataType(DataKind.valueOf(value)); + // see DataKind.java + setDataType(DataKind.valueOf(value.toUpperCase())); } catch (Exception e) { logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.dataType, getElementName())); } Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java 2015-05-13 15:26:14 UTC (rev 2296) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java 2015-05-13 15:48:41 UTC (rev 2297) @@ -421,8 +421,9 @@ } if (isSetDataType()) { attributes.remove("dataType"); + // see DataKind.java attributes.put(SpatialConstants.shortLabel + ":dataType", - getDataType().toString()); + getDataType().toString().toLowerCase()); } return attributes; @@ -451,7 +452,8 @@ } else if (attributeName.equals(SpatialConstants.dataType)) { try { - setDataType(value); + // see DataKind.java + setDataType(value.toUpperCase()); } catch (Exception e) { logger.warn(MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.dataType, getElementName())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pd...@us...> - 2015-05-14 10:14:30
|
Revision: 2301 http://sourceforge.net/p/jsbml/code/2301 Author: pdp10 Date: 2015-05-14 10:14:27 +0000 (Thu, 14 May 2015) Log Message: ----------- updated to specs 0.90 Modified Paths: -------------- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-05-13 16:10:56 UTC (rev 2300) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SampledField.java 2015-05-14 10:14:27 UTC (rev 2301) @@ -850,8 +850,8 @@ logger.warn(MessageFormat.format(SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.numSamples3, getElementName())); } } - - else if (attributeName.equals(SpatialConstants.interpolation)) { + // TODO: update the following IF, after Lucian has decided whether it is called interpolation or interpolationType + else if (attributeName.equals(SpatialConstants.interpolation) || attributeName.equals("interpolationType")) { try { setInterpolation(InterpolationKind.valueOf(value)); } catch (Exception e) { Modified: trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java =================================================================== --- trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java 2015-05-13 16:10:56 UTC (rev 2300) +++ trunk/extensions/spatial/src/org/sbml/jsbml/ext/spatial/SpatialPoints.java 2015-05-14 10:14:27 UTC (rev 2301) @@ -434,33 +434,40 @@ public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) && (SpatialConstants.shortLabel == prefix); - if (attributeName.equals(SpatialConstants.compression)) { - try { - setCompression(value); - } catch (Exception e) { - logger.warn(MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.compression, getElementName())); + if(!isAttributeRead) { + isAttributeRead = true; + + if (attributeName.equals(SpatialConstants.compression)) { + try { + setCompression(value); + + } catch (Exception e) { + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.compression, getElementName())); + } } - } - else if (attributeName.equals(SpatialConstants.arrayDataLength)) { - try { - setArrayDataLength(StringTools.parseSBMLInt(value)); - } catch (Exception e) { - logger.warn(MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.arrayDataLength, getElementName())); + else if (attributeName.equals(SpatialConstants.arrayDataLength)) { + try { + setArrayDataLength(StringTools.parseSBMLInt(value)); + + } catch (Exception e) { + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.arrayDataLength, getElementName())); + } } - } - else if (attributeName.equals(SpatialConstants.dataType)) { - try { - // see DataKind.java - setDataType(value.toUpperCase()); - } catch (Exception e) { - logger.warn(MessageFormat.format( - SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.dataType, getElementName())); + else if (attributeName.equals(SpatialConstants.dataType)) { + try { + // see DataKind.java + setDataType(value.toUpperCase()); + + } catch (Exception e) { + logger.warn(MessageFormat.format( + SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.dataType, getElementName())); + } + } + else { + isAttributeRead = false; } - } - else { - isAttributeRead = false; } return isAttributeRead; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |