public class Layout extends SBase
The Layout
class stores layout information for some or all elements of the
SBML model as well as additional objects that need not be connected to the
model. The Layout
has two attributes: id and name. Additionally, a
Dimensions
element specifies the size of the layout. The actual layout
elements are contained in several lists, namely: a
ListOfCompartmentGlyphs
, a ListOfSpeciesGlyphs
, a ListOfReactionGlyphs
, a
ListOfTextGlyphs
, and a ListOfAdditionalGraphicalObjects. Each of these
lists can only occur once, and, if present, are not allowed to be empty.
Constructor and Description |
---|
Layout()
Creates a new
Layout with the given level, version, and package version. |
Layout(Layout source)
Copy constructor.
|
Layout(LayoutPkgNamespaces layoutns)
Creates a new
Layout with the given LayoutPkgNamespaces object. |
Layout(LayoutPkgNamespaces layoutns,
java.lang.String id,
Dimensions dimensions)
Creates a new
Layout with the given id and dimensions. |
Layout(long level)
Creates a new
Layout with the given level, version, and package version. |
Layout(long level,
long version)
Creates a new
Layout with the given level, version, and package version. |
Layout(long level,
long version,
long pkgVersion)
Creates a new
Layout with the given level, version, and package version. |
Layout(XMLNode node)
|
Layout(XMLNode node,
long l2version)
|
Modifier and Type | Method and Description |
---|---|
int |
addAdditionalGraphicalObject(GraphicalObject glyph)
Adds a new additional graphical object glyph.
|
int |
addCompartmentGlyph(CompartmentGlyph glyph)
Adds a new compartment glyph.
|
int |
addGeneralGlyph(GeneralGlyph glyph)
Adds a new general glyph.
|
int |
addReactionGlyph(ReactionGlyph glyph)
Adds a new reaction glyph.
|
int |
addSpeciesGlyph(SpeciesGlyph glyph)
Adds a new species glyph.
|
int |
addTextGlyph(TextGlyph glyph)
Adds a new text glyph.
|
Layout |
cloneObject()
Creates and returns a deep copy of this
Layout . |
void |
connectToChild()   |
GraphicalObject |
createAdditionalGraphicalObject()
Creates a
GraphicalObject object, adds it to the end of the additional
graphical objects list and returns a pointer to the newly created
object. |
CompartmentGlyph |
createCompartmentGlyph()
Creates a
CompartmentGlyph object, adds it to the end of the
compartment glyph objects list and returns a pointer to the newly
created object. |
CubicBezier |
createCubicBezier()
Creates a new
CubicBezier for the Curve object of the last
ReactionGlyph or the last SpeciesReferenceGlyph in the last
ReactionGlyph and adds it to its list of SpeciesReferenceGlyph
objects. |
GeneralGlyph |
createGeneralGlyph()
Creates a
GeneralGlyph object, adds it to the end of the additional
objects list and returns a reference to the newly created object. |
LineSegment |
createLineSegment()
Creates a new
LineSegment for the Curve object of the last
ReactionGlyph or the last SpeciesReferenceGlyph in the last
ReactionGlyph and adds it to its list of SpeciesReferenceGlyph
objects. |
ReactionGlyph |
createReactionGlyph()
Creates a
ReactionGlyph object, adds it to the end of the reaction
glyph objects list and returns a pointer to the newly created
object. |
SpeciesGlyph |
createSpeciesGlyph()
Creates a
SpeciesGlyph object, adds it to the end of the species glyph
objects list and returns a pointer to the newly created object. |
SpeciesReferenceGlyph |
createSpeciesReferenceGlyph()
Creates a new
SpeciesReferenceGlyph for the last ReactionGlyph and
adds it to its list of SpeciesReferenceGlyph objects. |
TextGlyph |
createTextGlyph()
Creates a
TextGlyph object, adds it to the end of the text glyph
objects list and returns a pointer to the newly created object. |
void |
delete()
Explicitly deletes the underlying native object.
|
GraphicalObject |
getAdditionalGraphicalObject(long index)
Returns the additional graphical object with the given index.
|
GraphicalObject |
getAdditionalGraphicalObject(java.lang.String id)
Returns the additional graphical object that has the given
id , or null
if no graphical object has the id. |
CompartmentGlyph |
getCompartmentGlyph(long index)
Returns the compartment glyph with the given index.
|
CompartmentGlyph |
getCompartmentGlyph(java.lang.String id)
Returns the compartment glyph that has the given
id , or null if no
compartment glyph has the id. |
Dimensions |
getDimensions()
Returns the dimensions of the layout.
|
boolean |
getDimensionsExplicitlySet()
Predicate returning true if the dimensions has been set
|
java.lang.String |
getElementName()
Returns the XML element name of
this SBML object.
|
GeneralGlyph |
getGeneralGlyph(long index)
Returns the general glyph with the given index.
|
GeneralGlyph |
getGeneralGlyph(java.lang.String id)
Returns the general glyph that has the given
id , or null
if no graphical object has the id. |
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
Layout . |
ListOfGraphicalObjects |
getListOfAdditionalGraphicalObjects()
Returns the
ListOf object that holds all additional graphical objects. |
ListOfCompartmentGlyphs |
getListOfCompartmentGlyphs()
Returns the
ListOf object that holds all compartment glyphs. |
ListOfReactionGlyphs |
getListOfReactionGlyphs()
Returns the
ListOf object that holds all reaction glyphs. |
ListOfSpeciesGlyphs |
getListOfSpeciesGlyphs()
Returns the
ListOf object that holds all species glyphs. |
ListOfTextGlyphs |
getListOfTextGlyphs()
Returns the
ListOf object that holds all text glyphs. |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
Layout object. |
long |
getNumAdditionalGraphicalObjects()
Returns the number of additional graphical objects for the layout.
|
long |
getNumCompartmentGlyphs()
Returns the number of compartment glyphs for the layout.
|
long |
getNumGeneralGlyphs()
Returns the number of general glyphs for the layout.
|
long |
getNumReactionGlyphs()
Returns the number of reaction glyphs for the layout.
|
long |
getNumSpeciesGlyphs()
Returns the number of species glyphs for the layout.
|
long |
getNumTextGlyphs()
Returns the number of text glyphs for the layout.
|
ReactionGlyph |
getReactionGlyph(long index)
Returns the reaction glyph with the given index.
|
ReactionGlyph |
getReactionGlyph(java.lang.String id)
Returns the reaction glyph that has the given
id , or null if no
reaction glyph has the id. |
SpeciesGlyph |
getSpeciesGlyph(long index)
Returns the species glyph with the given index.
|
SpeciesGlyph |
getSpeciesGlyph(java.lang.String id)
Returns the species glyph that has the given
id , or null if no species
glyph has the id. |
TextGlyph |
getTextGlyph(long index)
Returns the text glyph with the given index.
|
TextGlyph |
getTextGlyph(java.lang.String id)
Returns the text glyph that has the given
id , or null if no text glyph
has the id. |
int |
getTypeCode()
Returns the libSBML type code of this object instance.
|
void |
initDefaults()
Does nothing since no defaults are defined for
Layout . |
boolean |
isSetId()
|
boolean |
isSetName()
|
GraphicalObject |
removeAdditionalGraphicalObject(long index)
Removes the graphical object with the given index from the layout.
|
GraphicalObject |
removeAdditionalGraphicalObject(java.lang.String id)
Remove the graphical object with the given
id . |
CompartmentGlyph |
removeCompartmentGlyph(long index)
Removes the compartment glyph with the given index from the layout.
|
CompartmentGlyph |
removeCompartmentGlyph(java.lang.String id)
Remove the compartment glyph with the given
id . |
ReactionGlyph |
removeReactionGlyph(long index)
Removes the reaction glyph with the given index from the layout.
|
ReactionGlyph |
removeReactionGlyph(java.lang.String id)
Remove the reaction glyph with the given
id . |
SpeciesGlyph |
removeSpeciesGlyph(long index)
Removes the species glyph with the given index from the layout.
|
SpeciesGlyph |
removeSpeciesGlyph(java.lang.String id)
Remove the species glyph with the given
id . |
SpeciesReferenceGlyph |
removeSpeciesReferenceGlyph(java.lang.String id)
Remove the species reference glyph with the given
id . |
TextGlyph |
removeTextGlyph(long index)
Removes the text glyph with the given index from the layout.
|
TextGlyph |
removeTextGlyph(java.lang.String id)
Remove the text glyph with the given
id . |
void |
setDimensions(Dimensions dimensions)
Sets the dimensions of the layout.
|
int |
setId(java.lang.String sid)
Sets the value of the 'id' attribute of this
Layout . |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
Layout . |
XMLNode |
toXML()
Creates an
XMLNode object from this. |
int |
unsetId()
Unsets the value of the 'id' attribute of this
Layout . |
int |
unsetName()
Unsets the value of the 'name' attribute of this
Layout . |
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getElementByMetaId, getElementBySId, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getObjectVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setIdAttribute, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm, unsetUserData
public Layout(long level, long version, long pkgVersion) throws SBMLConstructorException
Layout
with the given level, version, and package version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Layout(long level, long version) throws SBMLConstructorException
Layout
with the given level, version, and package version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Layout(long level) throws SBMLConstructorException
Layout
with the given level, version, and package version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Layout() throws SBMLConstructorException
Layout
with the given level, version, and package version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Layout(LayoutPkgNamespaces layoutns) throws SBMLConstructorException
Layout
with the given LayoutPkgNamespaces
object.
The package namespaces object used in this constructor is derived from a
SBMLNamespaces
object, which encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
package version and name information used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces
facilities is to create an
package namespace object somewhere in a program once, then hand that object
as needed to object constructors of that package that accept it as and
argument, such as this one.
layoutns
- the LayoutPkgNamespaces
object.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Layout(LayoutPkgNamespaces layoutns, java.lang.String id, Dimensions dimensions) throws SBMLConstructorException
SBMLConstructorException
public Layout(XMLNode node, long l2version) throws SBMLConstructorException
SBMLConstructorException
public Layout(XMLNode node) throws SBMLConstructorException
SBMLConstructorException
public Layout(Layout source) throws SBMLConstructorException
source
- the instance to copy.SBMLConstructorException
public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the Layout.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke Layout.delete()
themselves.
public void initDefaults()
Layout
.public java.lang.String getId()
Layout
.
getId
 in class SBase
Layout
.
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.isSetIdAttribute()
,
SBase.unsetIdAttribute()
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
public boolean isSetId()
isSetId
 in class SBase
true
if the 'id' attribute of this SBML object is
set, false
otherwise.
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.unsetIdAttribute()
,
SBase.isSetIdAttribute()
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
public int setId(java.lang.String sid)
Layout
.
The string sid
is copied.
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
setId
 in class SBase
sid
- the string to use as the identifier of this object.
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.isSetIdAttribute()
,
SBase.unsetIdAttribute()
public int unsetId()
Layout
.
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
unsetId
 in class SBase
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.isSetIdAttribute()
,
SBase.unsetIdAttribute()
public java.lang.String getName()
Layout
object.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The 'name' attribute is
optional and is not intended to be used for cross-referencing purposes
within a model. Its purpose instead is to provide a human-readable
label for the component. The data type of 'name' is the type
string
defined in XML Schema. SBML imposes no
restrictions as to the content of 'name' attributes beyond those
restrictions defined by the string
type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have names). If the object in question does not posess a 'name' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the name to be set, nor will it read or write 'name' attributes for those objects.
getName
 in class SBase
SBase.getIdAttribute()
,
Layout.isSetName()
,
Layout.setName(String sid)
,
Layout.unsetName()
public boolean isSetName()
true
or false
depending on whether this
Layout
's 'name' attribute has been set.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The 'name' attribute is
optional and is not intended to be used for cross-referencing purposes
within a model. Its purpose instead is to provide a human-readable
label for the component. The data type of 'name' is the type
string
defined in XML Schema. SBML imposes no
restrictions as to the content of 'name' attributes beyond those
restrictions defined by the string
type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have names). If the object in question does not posess a 'name' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the name to be set, nor will it read or write 'name' attributes for those objects.
isSetName
 in class SBase
true
if the 'name' attribute of this SBML object is
set, false
otherwise.
Layout.getName()
,
Layout.setName(String sid)
,
Layout.unsetName()
public int setName(java.lang.String name)
public int unsetName()
Layout
.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The 'name' attribute is
optional and is not intended to be used for cross-referencing purposes
within a model. Its purpose instead is to provide a human-readable
label for the component. The data type of 'name' is the type
string
defined in XML Schema. SBML imposes no
restrictions as to the content of 'name' attributes beyond those
restrictions defined by the string
type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have names). If the object in question does not posess a 'name' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the name to be set, nor will it read or write 'name' attributes for those objects.
unsetName
 in class SBase
Layout.getName()
,
Layout.setName(String sid)
,
Layout.isSetName()
public Dimensions getDimensions()
public void setDimensions(Dimensions dimensions)
public boolean getDimensionsExplicitlySet()
public ListOfCompartmentGlyphs getListOfCompartmentGlyphs()
ListOf
object that holds all compartment glyphs.public ListOfSpeciesGlyphs getListOfSpeciesGlyphs()
ListOf
object that holds all species glyphs.public ListOfReactionGlyphs getListOfReactionGlyphs()
ListOf
object that holds all reaction glyphs.public ListOfTextGlyphs getListOfTextGlyphs()
ListOf
object that holds all text glyphs.public ListOfGraphicalObjects getListOfAdditionalGraphicalObjects()
ListOf
object that holds all additional graphical objects.public CompartmentGlyph getCompartmentGlyph(long index)
null
is returned.public SpeciesGlyph getSpeciesGlyph(long index)
null
is returned.public ReactionGlyph getReactionGlyph(long index)
null
is returned.public TextGlyph getTextGlyph(long index)
null
is returned.public GraphicalObject getAdditionalGraphicalObject(long index)
null
is returned.public GeneralGlyph getGeneralGlyph(long index)
null
is returned.public CompartmentGlyph getCompartmentGlyph(java.lang.String id)
id
, or null
if no
compartment glyph has the id.public SpeciesGlyph getSpeciesGlyph(java.lang.String id)
id
, or null
if no species
glyph has the id.public ReactionGlyph getReactionGlyph(java.lang.String id)
id
, or null
if no
reaction glyph has the id.public TextGlyph getTextGlyph(java.lang.String id)
id
, or null
if no text glyph
has the id.public GraphicalObject getAdditionalGraphicalObject(java.lang.String id)
id
, or null
if no graphical object has the id.public GeneralGlyph getGeneralGlyph(java.lang.String id)
id
, or null
if no graphical object has the id.public int addCompartmentGlyph(CompartmentGlyph glyph)
public int addSpeciesGlyph(SpeciesGlyph glyph)
public int addReactionGlyph(ReactionGlyph glyph)
public int addTextGlyph(TextGlyph glyph)
public int addAdditionalGraphicalObject(GraphicalObject glyph)
public int addGeneralGlyph(GeneralGlyph glyph)
public long getNumCompartmentGlyphs()
public long getNumSpeciesGlyphs()
public long getNumReactionGlyphs()
public long getNumTextGlyphs()
public long getNumAdditionalGraphicalObjects()
public long getNumGeneralGlyphs()
public CompartmentGlyph createCompartmentGlyph()
CompartmentGlyph
object, adds it to the end of the
compartment glyph objects list and returns a pointer to the newly
created object.public SpeciesGlyph createSpeciesGlyph()
SpeciesGlyph
object, adds it to the end of the species glyph
objects list and returns a pointer to the newly created object.public ReactionGlyph createReactionGlyph()
ReactionGlyph
object, adds it to the end of the reaction
glyph objects list and returns a pointer to the newly created
object.public GeneralGlyph createGeneralGlyph()
GeneralGlyph
object, adds it to the end of the additional
objects list and returns a reference to the newly created object.public TextGlyph createTextGlyph()
TextGlyph
object, adds it to the end of the text glyph
objects list and returns a pointer to the newly created object.public GraphicalObject createAdditionalGraphicalObject()
GraphicalObject
object, adds it to the end of the additional
graphical objects list and returns a pointer to the newly created
object.public SpeciesReferenceGlyph createSpeciesReferenceGlyph()
SpeciesReferenceGlyph
for the last ReactionGlyph
and
adds it to its list of SpeciesReferenceGlyph
objects. A pointer to
the newly created object is returned.public LineSegment createLineSegment()
LineSegment
for the Curve
object of the last
ReactionGlyph
or the last SpeciesReferenceGlyph
in the last
ReactionGlyph
and adds it to its list of SpeciesReferenceGlyph
objects. A pointer to the newly created object is returned.public CubicBezier createCubicBezier()
CubicBezier
for the Curve
object of the last
ReactionGlyph
or the last SpeciesReferenceGlyph
in the last
ReactionGlyph
and adds it to its list of SpeciesReferenceGlyph
objects. A pointer to the newly created object is returned.public CompartmentGlyph removeCompartmentGlyph(long index)
null
is returned.public SpeciesGlyph removeSpeciesGlyph(long index)
null
is returned.public ReactionGlyph removeReactionGlyph(long index)
null
is returned.public TextGlyph removeTextGlyph(long index)
null
is returned.public GraphicalObject removeAdditionalGraphicalObject(long index)
null
is returned.public CompartmentGlyph removeCompartmentGlyph(java.lang.String id)
id
.
A pointer to the removed compartment glyph is returned.
If no compartment glyph has been removed, null
is returned.public SpeciesGlyph removeSpeciesGlyph(java.lang.String id)
id
.
A pointer to the removed species glyph is returned.
If no species glyph has been removed, null
is returned.public ReactionGlyph removeReactionGlyph(java.lang.String id)
id
.
A pointer to the removed reaction glyph is returned.
If no reaction glyph has been removed, null
is returned.public SpeciesReferenceGlyph removeSpeciesReferenceGlyph(java.lang.String id)
id
.
A pointer to the removed species reference glyph is returned.
If no species reference glyph has been removed, null
is returned.public TextGlyph removeTextGlyph(java.lang.String id)
id
.
A pointer to the removed text glyph is returned.
If no text glyph has been removed, null
is returned.public GraphicalObject removeAdditionalGraphicalObject(java.lang.String id)
id
.
A pointer to the removed graphical object is returned.
If no graphical object has been removed, null
is returned.public java.lang.String getElementName()
getElementName
 in class SBase
public Layout cloneObject()
Layout
.
cloneObject
 in class SBase
Layout
.public int getTypeCode()
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_
.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants
. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the getPackageName()
method on the object.
getTypeCode
 in class SBase
SBML_LAYOUT_LAYOUT
.
Layout.getElementName()
,
SBase.getPackageName()
public void connectToChild()
connectToChild
 in class SBase