org.sbml.jsbml.ext.layout
public class CompartmentGlyph extends AbstractReferenceGlyph implements CompartmentalizedSBase
CompartmentGlyph
class is derived from GraphicalObject
and inherits its attributes. Additionally it has tow optional attributes:
compartment and order.UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS
Constructor and Description |
---|
CompartmentGlyph() |
CompartmentGlyph(CompartmentGlyph compartmentGlyph) |
CompartmentGlyph(int level,
int version) |
CompartmentGlyph(String id) |
CompartmentGlyph(String id,
int level,
int version) |
Modifier and Type | Method and Description |
---|---|
CompartmentGlyph |
clone()
Creates a deep copy of this object, i.e., a new
SBase with the same
properties
like this one. |
String |
getCompartment()
Returns the value of the referenced compartment.
|
NamedSBase |
getCompartmentInstance()
Returns the
Compartment that is referenced by this SBase . |
double |
getOrder()
Returns the value of order
|
void |
initDefaults()
Initializes the default values using the namespace.
|
boolean |
isCompartmentMandatory() |
boolean |
isSetCompartment() |
boolean |
isSetCompartmentInstance() |
boolean |
isSetOrder()
Returns whether order is set
|
boolean |
readAttribute(String attributeName,
String prefix,
String value)
Sets the given attribute in this
SBase . |
boolean |
setCompartment(Compartment compartment)
Sets the compartment identifiers of this
CompartmentalizedSBase to
the id of the Compartment 'compartment'. |
boolean |
setCompartment(String compartment)
Sets the compartment attribute.
|
void |
setOrder(double order)
The order attribute is an optional attribute of type
Double . |
boolean |
unsetCompartment()
Remove the reference to a compartment, i.e., unset the value of the
variable 'compartment'.
|
boolean |
unsetOrder()
Unsets the variable order
|
Map<String,String> |
writeXMLAttributes()
Returns a map with all the attributes of this
SBase that
need to be written out in XML. |
equals, getNamedSBaseInstance, getReference, getReferenceInstance, hashCode, isSetReference, setNamedSBase, setReference, toString, unsetReference
createBoundingBox, createBoundingBox, createBoundingBox, createBoundingBox, getAllowsChildren, getBoundingBox, getChildAt, getChildCount, getMetaidRef, isIdMandatory, isSetBoundingBox, isSetMetaidRef, setBoundingBox, setMetaidRef, unsetBoundingBox, unsetMetaidRef
getId, getName, isSetId, isSetName, isValidId, setId, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendAnnotation, appendAnnotation, appendNotes, appendNotes, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParent, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, registerChild, removeCVTerm, removeCVTerm, setAnnotation, setAnnotation, setAnnotation, setHistory, setLevel, setMetaId, setNamespace, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
getId, getName, isIdMandatory, isSetId, isSetName, setId, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendAnnotation, appendAnnotation, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, equals, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hashCode, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, registerChild, removeCVTerm, removeCVTerm, removeTreeNodeChangeListener, setAnnotation, setAnnotation, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
public CompartmentGlyph()
public CompartmentGlyph(CompartmentGlyph compartmentGlyph)
compartmentGlyph
- public CompartmentGlyph(int level, int version)
level
- version
- public CompartmentGlyph(String id)
id
- public CompartmentGlyph(String id, int level, int version)
id
- level
- version
- public CompartmentGlyph clone()
SBase
SBase
with the same
properties
like this one.clone
in interface SBase
clone
in class AbstractReferenceGlyph
public void initDefaults()
initDefaults
in class GraphicalObject
public String getCompartment()
CompartmentalizedSBase
getCompartment
in interface CompartmentalizedSBase
String
if it is not set.public NamedSBase getCompartmentInstance()
CompartmentalizedSBase
Compartment
that is referenced by this SBase
.
Note that the return type of this method is NamedSBase
because it
could be possible that some subclasses link other elements than
Compartment
.getCompartmentInstance
in interface CompartmentalizedSBase
Model
that represents the linked
Compartment
or null
if it does not exist or cannot
be retrieved (e.g., if this component has not yet been linked to a
Model
).public double getOrder()
public boolean isCompartmentMandatory()
isCompartmentMandatory
in interface CompartmentalizedSBase
true
if for this object the compartment attribute is
mandatory, false
otherwise.public boolean isSetCompartment()
isSetCompartment
in interface CompartmentalizedSBase
true
if compartment attribute is set, i.e., not
null
, false
otherwise.public boolean isSetCompartmentInstance()
isSetCompartmentInstance
in interface CompartmentalizedSBase
true
if the Compartment
which has the compartment
identifier stored in this CompartmentalizedSBase
as id is
not null
and this Compartment
can be retrieved from
the Model
that contains this CompartmentalizedSBase
.
In other words, this method also returns false
if the
this object is not linked to any model.public boolean isSetOrder()
public boolean readAttribute(String attributeName, String prefix, String value)
SBase
SBase
.
If the given attribute name is not recognized, nothing is done and
false
is returned.
readAttribute
in interface SBase
readAttribute
in class GraphicalObject
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.public boolean setCompartment(Compartment compartment)
CompartmentalizedSBase
CompartmentalizedSBase
to
the id of the Compartment
'compartment'.
The compartment attribute is used to add a reference to the id of
the corresponding Compartment
in the Model
.
In some situations, the compartment might be optional, so that the user can
even specify Compartment
s that are not part of the Model
.
setCompartment
in interface CompartmentalizedSBase
compartment
- the Compartment
whose identifier should be referenced.true
if this operation caused any change.CompartmentalizedSBase.setCompartment(String)
,
CompartmentalizedSBase.isCompartmentMandatory()
public boolean setCompartment(String compartment)
CompartmentalizedSBase
The required attribute compartment is used to identify the
Compartment
in which the CompartmentalizedSBase
is located.
The attribute's value should be the identifier of an existing
Compartment
object in the model.
setCompartment
in interface CompartmentalizedSBase
compartment
- the identifier of the compartment to be set.true
if this operation caused any change.CompartmentalizedSBase.setCompartment(Compartment)
,
CompartmentalizedSBase.isCompartmentMandatory()
public void setOrder(double order)
Double
. It is there
to handle the case where compartments in a layout overlap, and tools want to
clearly disambiguate which CompartmentGlyph
is on top of the other.
The order attribute follows the coordinate system. There are z dimension points
into a screen; thus, an element with a lower order value will be in front
of an elements with a higher value. If not specified, the order is undefined
and tools are free to display the compartment glyphs in the order that best fits their
needs.
Note: if z coordinates are used (and this order is seemingly redundant), the order
can still be used to disambiguate drawing order.order
- public boolean unsetCompartment()
CompartmentalizedSBase
unsetCompartment
in interface CompartmentalizedSBase
true
if compartment was set before, otherwise false
.public boolean unsetOrder()
true
, if order was set before,
otherwise false
public Map<String,String> writeXMLAttributes()
SBase
SBase
that
need to be written out in XML.
The attribute name is used as a key and the attribute value as value. If a prefix is needed for the attribute name, it need to be set directly in this map.
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class GraphicalObject
Map
containing the XML attributes of this object.