org.sbml.jsbml.ext.layout
public class Layout extends AbstractNamedSBase implements UniqueNamedSBase
Modifier and Type | Field and Description |
---|---|
private Dimensions |
dimensions |
private ListOf<GraphicalObject> |
listOfAdditionalGraphicalObjects |
private ListOf<CompartmentGlyph> |
listOfCompartmentGlyphs |
private ListOf<ReactionGlyph> |
listOfReactionGlyphs |
private ListOf<SpeciesGlyph> |
listOfSpeciesGlyphs |
private ListOf<TextGlyph> |
listOfTextGlyphs |
private static long |
serialVersionUID
Generated serial version identifier.
|
ignoredExtensions, ignoredXMLElements
listOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS
Constructor and Description |
---|
Layout() |
Layout(int level,
int version) |
Layout(Layout layout) |
Layout(java.lang.String id,
int level,
int version) |
Modifier and Type | Method and Description |
---|---|
void |
addCompartmentGlyph(CompartmentGlyph compartmentGlyph) |
void |
addGeneralGlyph(GeneralGlyph object)
Adds a
GeneralGlyph object. |
void |
addGraphicalObject(GraphicalObject object)
Adds an arbitrary additional
GraphicalObject . |
void |
addReactionGlyph(ReactionGlyph reactionGlyph)
Adds a
ReactionGlyph to this layout |
void |
addSpeciesGlyph(SpeciesGlyph speciesGlyph) |
void |
addTextGlyph(TextGlyph TextGlyph) |
Layout |
clone()
Creates a deep copy of this object, i.e., a new
SBase with the same properties
like this one. |
boolean |
containsGlyph(Compartment compartment) |
private <T extends AbstractReferenceGlyph> |
containsGlyph(ListOf<T> listOfGlyphs,
NamedSBase nsb) |
boolean |
containsGlyph(Reaction reaction) |
boolean |
containsGlyph(Species species) |
CompartmentGlyph |
createCompartmentGlyph(java.lang.String id)
Creates and adds a new
CompartmentGlyph . |
CompartmentGlyph |
createCompartmentGlyph(java.lang.String id,
java.lang.String compartment)
Creates and adds a new
CompartmentGlyph . |
Dimensions |
createDimensions(double width,
double height,
double depth)
Creates, sets and returns
Dimensions based on the
given values. |
Dimensions |
createDimensions(java.lang.String id,
double width,
double height,
double depth)
Creates, sets and returns
Dimensions based on the
given values. |
GeneralGlyph |
createGeneralGlyph(java.lang.String id)
Creates and adds a new
GeneralGlyph . |
GeneralGlyph |
createGeneralGlyph(java.lang.String id,
java.lang.String reference)
Creates and adds a new
GeneralGlyph . |
ReactionGlyph |
createReactionGlyph(java.lang.String id)
Creates and adds a new
ReactionGlyph . |
ReactionGlyph |
createReactionGlyph(java.lang.String id,
java.lang.String reaction)
Creates and adds a new
ReactionGlyph . |
SpeciesGlyph |
createSpeciesGlyph(java.lang.String id)
Creates and adds a new
SpeciesGlyph with the given identifier. |
SpeciesGlyph |
createSpeciesGlyph(java.lang.String id,
java.lang.String species)
Creates and adds a new
SpeciesGlyph . |
TextGlyph |
createTextGlyph(java.lang.String id)
Creates and adds a new
TextGlyph . |
TextGlyph |
createTextGlyph(java.lang.String id,
java.lang.String text)
Creates and adds a new
TextGlyph . |
boolean |
equals(java.lang.Object object)
|
java.util.List<CompartmentGlyph> |
findCompartmentGlyphs(java.lang.String compartmentID)
Searches all instances of
CompartmentGlyph within this Layout that
refer to the Compartment with the given id. |
private <T> java.util.List<T> |
findGlyphs(ListOf<? extends T> listOfGlyphs,
java.lang.String id) |
java.util.List<ReactionGlyph> |
findReactionGlyphs(java.lang.String reactionID)
Searches all instances of
ReactionGlyph within this Layout that
refer to the Reaction with the given id. |
java.util.List<SpeciesGlyph> |
findSpeciesGlyphs(java.lang.String speciesID)
Searches all instances of
SpeciesGlyph within this Layout that
refer to the Species with the given id. |
java.util.List<TextGlyph> |
findTextGlyphs(java.lang.String id)
Searches within the
listOfTextGlyphs for TextGlyph s whose
TextGlyph.getOriginOfText() points to the given id. |
GraphicalObject |
getAdditionalGraphicalObject(int i) |
int |
getAdditionalGraphicalObjectCount() |
javax.swing.tree.TreeNode |
getChildAt(int index) |
int |
getChildCount() |
CompartmentGlyph |
getCompartmentGlyph(int i) |
CompartmentGlyph |
getCompartmentGlyph(java.lang.String id) |
int |
getCompartmentGlyphCount() |
Dimensions |
getDimensions() |
ListOf<GraphicalObject> |
getListOfAdditionalGraphicalObjects() |
ListOf<CompartmentGlyph> |
getListOfCompartmentGlyphs() |
ListOf<ReactionGlyph> |
getListOfReactionGlyphs() |
ListOf<SpeciesGlyph> |
getListOfSpeciesGlyphs() |
ListOf<TextGlyph> |
getListOfTextGlyphs() |
ReactionGlyph |
getReactionGlyph(int i) |
ReactionGlyph |
getReactionGlyph(java.lang.String id) |
int |
getReactionGlyphCount() |
SpeciesGlyph |
getSpeciesGlyph(int i) |
SpeciesGlyph |
getSpeciesGlyph(java.lang.String id) |
int |
getSpeciesGlyphCount() |
TextGlyph |
getTextGlyph(int i) |
TextGlyph |
getTextGlyph(java.lang.String id) |
int |
getTextGlyphCount() |
int |
hashCode() |
private void |
initDefault() |
boolean |
isIdMandatory()
This method can be used to query if the identifier of this
NamedSBase is required to be defined (i.e., not null )
in the definition of SBML. |
boolean |
isSetAddGraphicalObjects() |
boolean |
isSetDimensions() |
boolean |
isSetListOfAdditionalGraphicalObjects() |
boolean |
isSetListOfCompartmentGlyphs() |
boolean |
isSetListOfReactionGlyphs() |
boolean |
isSetListOfSpeciesGlyphs() |
boolean |
isSetListOfTextGlyphs() |
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
If the attribute is an id or name attribute, it will set the id or name
of this object with the value of the XML attribute ('value').
|
void |
setAddGraphicalObjects(ListOf<GraphicalObject> addGraphicalObjects) |
void |
setDimensions(Dimensions dimensions) |
void |
setListOfAdditionalGraphicalObjects(ListOf<GraphicalObject> additionalGraphicalObjects) |
void |
setListOfCompartmentGlyphs(ListOf<CompartmentGlyph> compartmentGlyphs) |
void |
setListOfReactionGlyphs(ListOf<ReactionGlyph> reactionGlyphs) |
void |
setListOfSpeciesGlyphs(ListOf<SpeciesGlyph> speciesGlyphs) |
void |
setListOfTextGlyphs(ListOf<TextGlyph> textGlyphs) |
java.lang.String |
toString()
Returns the name of the component, if it is available.
|
boolean |
unsetListOfAdditionalGraphicalObjects()
Removes the
listOfAdditionalGraphicalObjects from this Model and notifies
all registered instances of TreeNodeChangeListener . |
boolean |
unsetListOfCompartmentGlyphs()
Removes the
listOfCompartmentGlyphs from this Model and notifies
all registered instances of TreeNodeChangeListener . |
boolean |
unsetListOfReactionGlyphs()
Removes the
listOfReactionGlyphs from this Model and notifies
all registered instances of TreeNodeChangeListener . |
boolean |
unsetListOfSpeciesGlyphs()
Removes the
listOfSpeciesGlyphs from this Model and notifies
all registered instances of TreeNodeChangeListener . |
boolean |
unsetListOfTextGlyphs()
Removes the
listOfTextGlyphs from this Model and notifies
all registered instances of TreeNodeChangeListener . |
java.util.Map<java.lang.String,java.lang.String> |
writeXMLAttributes() |
getId, getName, isSetId, isSetName, isValidId, setId, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, appendNotes, appendNotes, checkLevelAndVersionCompatibility, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, getAllowsChildren, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParent, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, notifyChildChange, registerChild, setAnnotation, setHistory, setLevel, setMetaId, setNamespace, setNotes, setNotes, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getName, isSetId, isSetName, setId, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, registerChild, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
private static final long serialVersionUID
private Dimensions dimensions
private ListOf<GraphicalObject> listOfAdditionalGraphicalObjects
private ListOf<CompartmentGlyph> listOfCompartmentGlyphs
private ListOf<ReactionGlyph> listOfReactionGlyphs
private ListOf<SpeciesGlyph> listOfSpeciesGlyphs
public Layout()
public Layout(int level, int version)
level
- version
- public Layout(Layout layout)
layout
- public Layout(java.lang.String id, int level, int version)
id
- level
- version
- public void addGraphicalObject(GraphicalObject object)
GraphicalObject
.object
- public void addGeneralGlyph(GeneralGlyph object)
GeneralGlyph
object.object
- public void addCompartmentGlyph(CompartmentGlyph compartmentGlyph)
compartmentGlyph
- public void addReactionGlyph(ReactionGlyph reactionGlyph)
ReactionGlyph
to this layoutreactionGlyph
- public void addSpeciesGlyph(SpeciesGlyph speciesGlyph)
speciesGlyph
- public void addTextGlyph(TextGlyph TextGlyph)
TextGlyph
- public Layout clone()
SBase
SBase
with the same properties
like this one.clone
in interface SBase
clone
in class AbstractSBase
public boolean containsGlyph(Compartment compartment)
compartment
- private <T extends AbstractReferenceGlyph> boolean containsGlyph(ListOf<T> listOfGlyphs, NamedSBase nsb)
listOfGlyphs
- nsb
- public boolean containsGlyph(Reaction reaction)
reaction
- public boolean containsGlyph(Species species)
species
- public CompartmentGlyph createCompartmentGlyph(java.lang.String id)
CompartmentGlyph
.id
- the identifier of the CompartmentGlyph
to be created.CompartmentGlyph
.createCompartmentGlyph(String, String)
public CompartmentGlyph createCompartmentGlyph(java.lang.String id, java.lang.String compartment)
CompartmentGlyph
.id
- the identifier of the CompartmentGlyph
to be created.compartment
- Compartment
ID.CompartmentGlyph
.public Dimensions createDimensions(double width, double height, double depth)
Dimensions
based on the
given values.width
- height
- depth
- Dimensions
object.createDimensions(String, double, double, double)
public Dimensions createDimensions(java.lang.String id, double width, double height, double depth)
Dimensions
based on the
given values.id
- the identifier of the Dimensions
to be created.width
- height
- depth
- Dimensions
object.public ReactionGlyph createReactionGlyph(java.lang.String id)
ReactionGlyph
.id
- the identifier of the ReactionGlyph
to be created.ReactionGlyph
.createReactionGlyph(String, String)
public ReactionGlyph createReactionGlyph(java.lang.String id, java.lang.String reaction)
ReactionGlyph
.id
- the identifier of the ReactionGlyph
to be created.reaction
- Reaction
ID.ReactionGlyph
.public GeneralGlyph createGeneralGlyph(java.lang.String id)
GeneralGlyph
.id
- the identifier of the GeneralGlyph
to be created.GeneralGlyph
.createGeneralGlyph(String, String)
public GeneralGlyph createGeneralGlyph(java.lang.String id, java.lang.String reference)
GeneralGlyph
.id
- the identifier of the GeneralGlyph
to be created.reference
- the identifier of an element in the model that this GeneralGlyph will represent.GeneralGlyph
.public SpeciesGlyph createSpeciesGlyph(java.lang.String id)
SpeciesGlyph
with the given identifier.id
- the identifier for the SpeciesGlyph
to be created.SpeciesGlyph
.createSpeciesGlyph(String, String)
public SpeciesGlyph createSpeciesGlyph(java.lang.String id, java.lang.String species)
SpeciesGlyph
.id
- the identifier for the SpeciesGlyph
to be created.species
- Species
ID.SpeciesGlyph
.public TextGlyph createTextGlyph(java.lang.String id)
TextGlyph
.id
- the identifier for the TextGlyph
to be created.TextGlyph
.createTextGlyph(String, String)
public TextGlyph createTextGlyph(java.lang.String id, java.lang.String text)
TextGlyph
.public boolean equals(java.lang.Object object)
SBase
true
if and only if the given SBase
has exactly the same
properties like this SBase
instance.equals
in interface SBase
equals
in class AbstractNamedSBase
true
if and only if the given Object
is an instance of
SBase
that has exactly the same properties like this
SBase instance.public java.util.List<CompartmentGlyph> findCompartmentGlyphs(java.lang.String compartmentID)
CompartmentGlyph
within this Layout
that
refer to the Compartment
with the given id.compartmentID
- List
containing all identified elements. It can be
empty but not null
.private <T> java.util.List<T> findGlyphs(ListOf<? extends T> listOfGlyphs, java.lang.String id)
listOfGlyphs
- id
- public java.util.List<ReactionGlyph> findReactionGlyphs(java.lang.String reactionID)
ReactionGlyph
within this Layout
that
refer to the Reaction
with the given id.reactionID
- List
containing all identified elements. It can be
empty but not null
.public java.util.List<SpeciesGlyph> findSpeciesGlyphs(java.lang.String speciesID)
SpeciesGlyph
within this Layout
that
refer to the Species
with the given id.speciesID
- List
containing all identified elements. It can be
empty but not null
.public java.util.List<TextGlyph> findTextGlyphs(java.lang.String id)
listOfTextGlyphs
for TextGlyph
s whose
TextGlyph.getOriginOfText()
points to the given id.public GraphicalObject getAdditionalGraphicalObject(int i)
i
- public int getAdditionalGraphicalObjectCount()
public javax.swing.tree.TreeNode getChildAt(int index)
getChildAt
in interface javax.swing.tree.TreeNode
getChildAt
in class AbstractSBase
public int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
getChildCount
in class AbstractSBase
public CompartmentGlyph getCompartmentGlyph(int i)
i
- public CompartmentGlyph getCompartmentGlyph(java.lang.String id)
id
- public int getCompartmentGlyphCount()
public Dimensions getDimensions()
public ListOf<GraphicalObject> getListOfAdditionalGraphicalObjects()
public ListOf<CompartmentGlyph> getListOfCompartmentGlyphs()
public ListOf<ReactionGlyph> getListOfReactionGlyphs()
public ListOf<SpeciesGlyph> getListOfSpeciesGlyphs()
public ReactionGlyph getReactionGlyph(int i)
i
- public ReactionGlyph getReactionGlyph(java.lang.String id)
id
- public int getReactionGlyphCount()
public SpeciesGlyph getSpeciesGlyph(int i)
i
- public SpeciesGlyph getSpeciesGlyph(java.lang.String id)
id
- public int getSpeciesGlyphCount()
public TextGlyph getTextGlyph(int i)
i
- public TextGlyph getTextGlyph(java.lang.String id)
id
- public int getTextGlyphCount()
public int hashCode()
hashCode
in interface SBase
hashCode
in class AbstractNamedSBase
Object.hashCode()
private void initDefault()
public boolean isIdMandatory()
NamedSBase
NamedSBase
is required to be defined (i.e., not null
)
in the definition of SBML.isIdMandatory
in interface NamedSBase
true
if the identifier of this element must be set in
order to create a valid SBML representation. false
otherwise, i.e., if the identifier can be understood as an optional
attribute.public boolean isSetAddGraphicalObjects()
public boolean isSetDimensions()
public boolean isSetListOfAdditionalGraphicalObjects()
public boolean isSetListOfCompartmentGlyphs()
public boolean isSetListOfReactionGlyphs()
public boolean isSetListOfSpeciesGlyphs()
public boolean isSetListOfTextGlyphs()
public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBase
readAttribute
in interface SBase
readAttribute
in class AbstractNamedSBase
attributeName
- prefix
- value
- public void setAddGraphicalObjects(ListOf<GraphicalObject> addGraphicalObjects)
listOfAdditionalGraphicalObjects
- public void setDimensions(Dimensions dimensions)
dimensions
- public void setListOfAdditionalGraphicalObjects(ListOf<GraphicalObject> additionalGraphicalObjects)
AdditionalGraphicalObjects
- public void setListOfCompartmentGlyphs(ListOf<CompartmentGlyph> compartmentGlyphs)
compartmentGlyphs
- public void setListOfReactionGlyphs(ListOf<ReactionGlyph> reactionGlyphs)
reactionGlyphs
- public void setListOfSpeciesGlyphs(ListOf<SpeciesGlyph> speciesGlyphs)
speciesGlyphs
- public void setListOfTextGlyphs(ListOf<TextGlyph> textGlyphs)
textGlyphs
- public java.lang.String toString()
AbstractNamedSBase
toString
in class AbstractNamedSBase
public boolean unsetListOfAdditionalGraphicalObjects()
listOfAdditionalGraphicalObjects
from this Model
and notifies
all registered instances of TreeNodeChangeListener
.true
if calling this method lead to a change in this
data structure.public boolean unsetListOfCompartmentGlyphs()
listOfCompartmentGlyphs
from this Model
and notifies
all registered instances of TreeNodeChangeListener
.true
if calling this method lead to a change in this
data structure.public boolean unsetListOfReactionGlyphs()
listOfReactionGlyphs
from this Model
and notifies
all registered instances of TreeNodeChangeListener
.true
if calling this method lead to a change in this
data structure.public boolean unsetListOfSpeciesGlyphs()
listOfSpeciesGlyphs
from this Model
and notifies
all registered instances of TreeNodeChangeListener
.true
if calling this method lead to a change in this
data structure.public boolean unsetListOfTextGlyphs()
listOfTextGlyphs
from this Model
and notifies
all registered instances of TreeNodeChangeListener
.true
if calling this method lead to a change in this
data structure.public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class AbstractNamedSBase
Map
containing the XML attributes of this object.