/** * Sets the boundaryCondition Boolean. * * @param boundaryCondition the boundary condition */ public void setBoundaryCondition(boolean boundaryCondition) { Boolean oldBoundaryCondition = this.boundaryCondition; this.boundaryCondition = boundaryCondition; isSetBoundaryCondition = true; firePropertyChange(TreeNodeChangeEvent.boundaryCondition, oldBoundaryCondition, this.boundaryCondition); }
/** * Unsets the charge of this Species * * @deprecated Only defined in SBML Level 1, Version 1 and 2, and Level 2 * Version 1. Since Level 2 Version 2 it has been marked as a * deprecated property, but has been completely removed in SBML * Level 3. */ @Deprecated public void unsetCharge() { Integer oldCharge = charge; charge = null; isSetCharge = false; firePropertyChange(TreeNodeChangeEvent.charge, oldCharge, charge); }
@Override public boolean setCompartment(String compartment) { if ((compartment != null) && (compartment.trim().length() == 0)) { compartment = null; // If we pass the empty String or null, the value is reset. } // TODO - do a call to the offline validator once all the species attribute checks are in place. if (!isReadingInProgress() && compartment != null) { // This method will throw IllegalArgumentException if the given id does not respect the SId syntax checkIdentifier(compartment); } String oldCompartment = compartmentID; compartmentID = compartment; firePropertyChange(TreeNodeChangeEvent.compartment, oldCompartment, compartmentID); return true; }
/** * Sets the charge of this {@link Species}. * * @param charge the charge * @deprecated Only defined in SBML Level 1, Version 1 and 2, and Level 2 * Version 1. Since Level 2 Version 2 it has been marked as a * deprecated property, but has been completely removed in SBML * Level 3. * @throws PropertyNotAvailableException if Level >= 3. */ @Deprecated public void setCharge(int charge) { if (3 <= getLevel()) { throw new PropertyNotAvailableException(TreeNodeChangeEvent.charge, this); } Integer oldCharge = this.charge; this.charge = Integer.valueOf(charge); isSetCharge = true; firePropertyChange(TreeNodeChangeEvent.charge, oldCharge, this.charge); }
/** * Sets the conversionFactor of this {@link Species} to * 'conversionFactorID'. This is only possible if Level >= 3. * * @param conversionFactorID the conversion factor * @throws PropertyNotAvailableException if Level < 3. */ public void setConversionFactor(String conversionFactorID) { if (getLevel() < 3) { throw new PropertyNotAvailableException( TreeNodeChangeEvent.conversionFactor, this); } String oldConversionFactor = this.conversionFactorID; if ((conversionFactorID != null) && (conversionFactorID.trim().length() == 0)) { this.conversionFactorID = null; } else { this.conversionFactorID = conversionFactorID; } firePropertyChange(TreeNodeChangeEvent.conversionFactor, oldConversionFactor, conversionFactorID); }
/** * Sets the speciesTypeID of this {@link Species} to 'speciesType'. * * @param speciesType the species type to set * @deprecated Only valid in SBML Level 2 from Version 2. * @throws PropertyNotAvailableException * for inappropriate Level/Version combinations. */ @Deprecated public void setSpeciesType(String speciesType) { if ((getLevel() != 2) || ((getLevel() == 2) && (getVersion() == 1))) { throw new PropertyNotAvailableException(TreeNodeChangeEvent.speciesType, this); } if ((speciesType == null) || (speciesType.trim().length() == 0) || checkIdentifier(speciesType)) { String oldSpeciesType = speciesTypeID; speciesTypeID = ((speciesType != null) && (speciesType.trim() .length() == 0)) ? null : speciesType; firePropertyChange(TreeNodeChangeEvent.speciesType, oldSpeciesType, speciesTypeID); } }
/** * Sets the initialAmount of this {@link Species}. * * @param initialAmount the initial amount */ public void setInitialAmount(double initialAmount) { // store initialConcentration in user define object to allow validation of incorrect SBML files if (isReadingInProgress() && isSetInitialConcentration()) { // TODO - replace by processInvalidAttribute and change the corresponding rule(s) AbstractReaderWriter.processUnknownAttribute("initialConcentration", "", getInitialConcentration() + "", "", this); } if (!amount) { amount = true; firePropertyChange(TreeNodeChangeEvent.initialAmount, Boolean.FALSE, Boolean.TRUE); } setValue(initialAmount); }
/** * Sets the initialConcentration of this {@link Species}. * * @param initialConcentration the initial concentration */ public void setInitialConcentration(double initialConcentration) { // store initialAmount in user define object to allow validation of incorrect SBML files if (isReadingInProgress() && isSetInitialAmount()) { // TODO - replace by processInvalidAttribute and change the corresponding rule(s) AbstractReaderWriter.processUnknownAttribute("initialAmount", "", getInitialAmount() + "", "", this); } if (amount) { amount = false; firePropertyChange(TreeNodeChangeEvent.initialAmount, Boolean.TRUE, Boolean.FALSE); } setValue(initialConcentration); }
/** * Sets hasOnlySubstanceUnits Boolean * * @param hasOnlySubstanceUnits the has only substance units value to be set * @throws PropertyNotAvailableException if Level < 2. */ public void setHasOnlySubstanceUnits(boolean hasOnlySubstanceUnits) { if (!isReadingInProgress() && getLevel() < 2) { throw new PropertyNotAvailableException( TreeNodeChangeEvent.hasOnlySubstanceUnits, this); } if (!isReadingInProgress() && hasOnlySubstanceUnits && isSetSpatialSizeUnits()) { String ud = isSetUnitsInstance() ? UnitDefinition.printUnits( getSpatialSizeUnitsInstance(), true) : getSpatialSizeUnits(); throw new SBMLException(MessageFormat.format( "Cannot define that species {0} with spatial size units {1} has only substance units.", toString(), ud)); } Boolean oldHasOnlySubstanceUnits = this.hasOnlySubstanceUnits; this.hasOnlySubstanceUnits = Boolean.valueOf(hasOnlySubstanceUnits); isSetHasOnlySubstanceUnits = true; firePropertyChange(TreeNodeChangeEvent.hasOnlySubstanceUnits, oldHasOnlySubstanceUnits, this.hasOnlySubstanceUnits); }
spatialSizeUnitsID = spatialSizeUnits; firePropertyChange(TreeNodeChangeEvent.spatialSizeUnits, oldSpatialSizeUnits, spatialSizeUnitsID);