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,
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 |
---|---|
void |
addAdditionalGraphicalObject(GraphicalObject glyph)
Adds a new additional graphical object glyph.
|
void |
addCompartmentGlyph(CompartmentGlyph glyph)
Adds a new compartment glyph.
|
void |
addGeneralGlyph(GeneralGlyph glyph)
Adds a new general glyph.
|
void |
addReactionGlyph(ReactionGlyph glyph)
Adds a new reaction glyph.
|
void |
addSpeciesGlyph(SpeciesGlyph glyph)
Adds a new species glyph.
|
void |
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(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(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
|
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(String id)
Returns the general glyph that has the given
id , or null
if no graphical object has the id. |
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. |
String |
getName()
Returns the value of the 'name' attribute of this
Layout . |
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(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(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(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(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(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(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(String id)
Remove the species glyph with the given
id . |
SpeciesReferenceGlyph |
removeSpeciesReferenceGlyph(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(String id)
Remove the text glyph with the given
id . |
void |
setDimensions(Dimensions dimensions)
Sets the dimensions of the layout.
|
int |
setId(String id)
Sets the value of the 'id' attribute of this
Layout . |
int |
setName(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, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm, unsetUserData
public Layout(long level, long version, long pkgVersion) throws SBMLConstructorException
Layout
with the given level, version, and package version.SBMLConstructorException
public Layout(long level, long version) throws SBMLConstructorException
Layout
with the given level, version, and package version.SBMLConstructorException
public Layout(long level) throws SBMLConstructorException
Layout
with the given level, version, and package version.SBMLConstructorException
public Layout() throws SBMLConstructorException
Layout
with the given level, version, and package version.SBMLConstructorException
public Layout(LayoutPkgNamespaces layoutns) throws SBMLConstructorException
Layout
with the given LayoutPkgNamespaces
object.SBMLConstructorException
public Layout(LayoutPkgNamespaces layoutns, 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
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 int unsetId()
Layout
.public int setName(String name)
Layout
.public int unsetName()
Layout
.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(String id)
id
, or null
if no
compartment glyph has the id.public SpeciesGlyph getSpeciesGlyph(String id)
id
, or null
if no species
glyph has the id.public ReactionGlyph getReactionGlyph(String id)
id
, or null
if no
reaction glyph has the id.public TextGlyph getTextGlyph(String id)
id
, or null
if no text glyph
has the id.public GraphicalObject getAdditionalGraphicalObject(String id)
id
, or null
if no graphical object has the id.public GeneralGlyph getGeneralGlyph(String id)
id
, or null
if no graphical object has the id.public void addCompartmentGlyph(CompartmentGlyph glyph)
public void addSpeciesGlyph(SpeciesGlyph glyph)
public void addReactionGlyph(ReactionGlyph glyph)
public void addTextGlyph(TextGlyph glyph)
public void addAdditionalGraphicalObject(GraphicalObject glyph)
public void 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(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(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(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(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(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(String id)
id
.
A pointer to the removed graphical object is returned.
If no graphical object has been removed, null
is returned.public 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