public class GeneralGlyph extends GraphicalObject
The GeneralGlyph
is used to facilitate the representation of elements
other than Compartment
, Species
and Reaction
and thus can be used for the
display of relationships of Rule
or elements defined by other SBML
packages. It closely follows the structure of the ReactionGlyph
.
GeneralGlyph
is defined to have an optional attribute reference as well as
the elements curve, listOfReferenceGlyphs and listOfSubGlyphs.
Constructor and Description |
---|
GeneralGlyph()
Creates a new
GeneralGlyph . |
GeneralGlyph(GeneralGlyph source)
Copy constructor.
|
GeneralGlyph(LayoutPkgNamespaces layoutns)
Creates a new
GeneralGlyph with the given LayoutPkgNamespaces object. |
GeneralGlyph(LayoutPkgNamespaces layoutns,
java.lang.String id)
Creates a glyph with the given
LayoutPkgNamespaces and id. |
GeneralGlyph(LayoutPkgNamespaces layoutns,
java.lang.String id,
java.lang.String referenceId)
Creates a glyph with the given
LayoutPkgNamespaces , id and set the id of the
associated element to the second argument. |
GeneralGlyph(long level)
Creates a new
GeneralGlyph . |
GeneralGlyph(long level,
long version)
Creates a new
GeneralGlyph . |
GeneralGlyph(long level,
long version,
long pkgVersion)
Creates a new
GeneralGlyph . |
GeneralGlyph(XMLNode node)
Creates a new
GeneralGlyph from the given XMLNode |
GeneralGlyph(XMLNode node,
long l2version)
Creates a new
GeneralGlyph from the given XMLNode |
Modifier and Type | Method and Description |
---|---|
int |
addReferenceGlyph(ReferenceGlyph glyph)
Adds a new reference glyph to the list.
|
int |
addSubGlyph(GraphicalObject glyph)
Adds a new subglyph to the list.
|
GeneralGlyph |
cloneObject()
Creates and returns a deep copy of this
GeneralGlyph . |
void |
connectToChild()   |
CubicBezier |
createCubicBezier()
Creates a new
CubicBezier object, adds it to the end of the list of
curve segment objects of the curve and returns a reference to the
newly created object. |
LineSegment |
createLineSegment()
Creates a new
LineSegment object, adds it to the end of the list of
curve segment objects of the curve and returns a reference to the
newly created object. |
ReferenceGlyph |
createReferenceGlyph()
Creates a new
ReferenceGlyph object, adds it to the end of the
list of reference objects and returns a reference to the newly
created object. |
void |
delete()
Explicitly deletes the underlying native object.
|
Curve |
getCurve()
Returns the curve object for the reaction glyph
|
boolean |
getCurveExplicitlySet()   |
java.lang.String |
getElementName()
Returns the XML element name of
this SBML object.
|
long |
getIndexForReferenceGlyph(java.lang.String id)
Returns the index of the reference glyph with the given
id . |
long |
getIndexForSubGlyph(java.lang.String id)
Returns the index of the subglyph with the given
id . |
ListOfReferenceGlyphs |
getListOfReferenceGlyphs()
Returns the
ListOf object that hold the reference glyphs. |
ListOfGraphicalObjects |
getListOfSubGlyphs()
Returns the
ListOf object that hold the sub glyphs. |
long |
getNumReferenceGlyphs()
Returns the number of reference glyph objects.
|
long |
getNumSubGlyphs()
Returns the number of subglyph objects.
|
ReferenceGlyph |
getReferenceGlyph(long index)
Returns the reference glyph with the given
index . |
java.lang.String |
getReferenceId()
Returns the id of the associated element.
|
GraphicalObject |
getSubGlyph(long index)
Returns the sub glyph with the given
index . |
int |
getTypeCode()
Returns the libSBML type code of this object instance.
|
void |
initDefaults()
Calls initDefaults from
GraphicalObject . |
boolean |
isSetCurve()
Returns
true if the curve consists of one or more segments. |
boolean |
isSetReferenceId()
Returns
true if the id of the associated element is not the empty
string. |
ReferenceGlyph |
removeReferenceGlyph(long index)
Remove the reference glyph with the given
index . |
ReferenceGlyph |
removeReferenceGlyph(java.lang.String id)
Remove the reference glyph with the given
id . |
GraphicalObject |
removeSubGlyph(long index)
Remove the subglyph with the given
index . |
GraphicalObject |
removeSubGlyph(java.lang.String id)
Remove the subglyph with the given
id . |
void |
renameSIdRefs(java.lang.String oldid,
java.lang.String newid)
Replaces all uses of a given
SIdRef type attribute value with another
value. |
void |
setCurve(Curve curve)
Sets the curve object for the reaction glyph.
|
int |
setReferenceId(java.lang.String id)
Sets the id of the associated element.
|
XMLNode |
toXML()
Creates an
XMLNode object from this. |
getBoundingBox, getBoundingBoxExplicitlySet, getId, getMetaIdRef, isSetId, isSetMetaIdRef, renameMetaIdRefs, setBoundingBox, setId, setMetaIdRef, unsetId, unsetMetaIdRef
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, getName, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageCoreVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetName, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setIdAttribute, setMetaId, setModelHistory, setName, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetName, unsetNotes, unsetSBOTerm, unsetUserData
public GeneralGlyph(long level, long version, long pkgVersion) throws SBMLConstructorException
GeneralGlyph
. The list of reference glyph and subglyphs is
empty and the id of the associated element is set to the empty
string.
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 GeneralGlyph(long level, long version) throws SBMLConstructorException
GeneralGlyph
. The list of reference glyph and subglyphs is
empty and the id of the associated element is set to the empty
string.
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 GeneralGlyph(long level) throws SBMLConstructorException
GeneralGlyph
. The list of reference glyph and subglyphs is
empty and the id of the associated element is set to the empty
string.
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 GeneralGlyph() throws SBMLConstructorException
GeneralGlyph
. The list of reference glyph and subglyphs is
empty and the id of the associated element is set to the empty
string.
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 GeneralGlyph(LayoutPkgNamespaces layoutns) throws SBMLConstructorException
GeneralGlyph
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 GeneralGlyph(LayoutPkgNamespaces layoutns, java.lang.String id) throws SBMLConstructorException
LayoutPkgNamespaces
and id.
(FOR BACKWARD COMPATIBILITY)
SBMLConstructorException
public GeneralGlyph(LayoutPkgNamespaces layoutns, java.lang.String id, java.lang.String referenceId) throws SBMLConstructorException
LayoutPkgNamespaces
, id and set the id of the
associated element to the second argument.
(FOR BACKWARD COMPATIBILITY)
SBMLConstructorException
public GeneralGlyph(XMLNode node, long l2version) throws SBMLConstructorException
SBMLConstructorException
public GeneralGlyph(XMLNode node) throws SBMLConstructorException
SBMLConstructorException
public GeneralGlyph(GeneralGlyph 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 GeneralGlyph.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 GeneralGlyph.delete()
themselves.
delete
 in class GraphicalObject
public void renameSIdRefs(java.lang.String oldid, java.lang.String newid)
Replaces all uses of a given SIdRef
type attribute value with another
value.
In SBML, object identifiers are of a data type called SId
.
In SBML Level 3, an explicit data type called SIdRef
was
introduced for attribute values that refer to SId
values in
previous Levels of SBML, this data type did not exist and attributes were
simply described to as 'referring to an identifier', but the effective
data type was the same as SIdRef
in Level 3. These and
other methods of libSBML refer to the type SIdRef
for all
Levels of SBML, even if the corresponding SBML specification did not
explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of oldid
. If any matches are found, the
matching values are replaced with newid
. The method does not
descend into child elements.
renameSIdRefs
 in class SBase
oldid
- the old identifier.newid
- the new identifier.public java.lang.String getReferenceId()
public int setReferenceId(java.lang.String id)
public boolean isSetReferenceId()
true
if the id of the associated element is not the empty
string.public ListOfReferenceGlyphs getListOfReferenceGlyphs()
ListOf
object that hold the reference glyphs.public ListOfGraphicalObjects getListOfSubGlyphs()
ListOf
object that hold the sub glyphs.public ReferenceGlyph getReferenceGlyph(long index)
index
.
If the index is invalid, null
is returned.public GraphicalObject getSubGlyph(long index)
index
.
If the index is invalid, null
is returned.public int addReferenceGlyph(ReferenceGlyph glyph)
public int addSubGlyph(GraphicalObject glyph)
public long getNumReferenceGlyphs()
public long getNumSubGlyphs()
public void initDefaults()
GraphicalObject
.initDefaults
 in class GraphicalObject
public void setCurve(Curve curve)
public boolean isSetCurve()
true
if the curve consists of one or more segments.public boolean getCurveExplicitlySet()
public ReferenceGlyph createReferenceGlyph()
ReferenceGlyph
object, adds it to the end of the
list of reference objects and returns a reference to the newly
created object.public LineSegment createLineSegment()
LineSegment
object, adds it to the end of the list of
curve segment objects of the curve and returns a reference to the
newly created object.public CubicBezier createCubicBezier()
CubicBezier
object, adds it to the end of the list of
curve segment objects of the curve and returns a reference to the
newly created object.public ReferenceGlyph removeReferenceGlyph(long index)
index
.
A pointer to the object is returned. If no object has been removed, null
is returned.public GraphicalObject removeSubGlyph(long index)
index
.
A pointer to the object is returned. If no object has been removed, null
is returned.public ReferenceGlyph removeReferenceGlyph(java.lang.String id)
id
.
A pointer to the object is returned. If no object has been removed, null
is returned.public GraphicalObject removeSubGlyph(java.lang.String id)
id
.
A pointer to the object is returned. If no object has been removed, null
is returned.public long getIndexForReferenceGlyph(java.lang.String id)
id
.
If the glyph does not contain a reference glyph with this
id, cpp the
value of the maximum long integer is returned as an indicator.public long getIndexForSubGlyph(java.lang.String id)
id
.
If the glyph does not contain a subglyph with this
id, cpp the
value of the maximum long integer is returned as an indicator.public java.lang.String getElementName()
getElementName
 in class GraphicalObject
public GeneralGlyph cloneObject()
GeneralGlyph
.
cloneObject
 in class GraphicalObject
GeneralGlyph
.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
method on the object.
SBase.getPackageName()
getTypeCode
 in class GraphicalObject
SBML_LAYOUT_GENERALGLYPH
.
GeneralGlyph.getElementName()
,
SBase.getPackageName()
public XMLNode toXML()
XMLNode
object from this.toXML
 in class GraphicalObject
public void connectToChild()
connectToChild
 in class GraphicalObject