public class Style extends SBase
Local and global styles in the SBML Level 3 Render package have many
attributes and methods in common. These have been implemented in the
abstract base class Style.
A style is a graphical representation for certain layout objects. The assignment of styles to individual layout objects can either be done through layout object ids (local styles only), layout object types (SPECIES, COMPARTMENT, etc.) or layout object roles.
| Constructor and Description |
|---|
Style(Style orig)
Copy constructor for
Style. |
| Modifier and Type | Method and Description |
|---|---|
int |
addRole(java.lang.String role)
Adds an id to the role list.
|
int |
addType(java.lang.String type)
Adds a type string to the type list.
|
SBase |
cloneObject()
Creates and returns a deep copy of this
Style object. |
RenderGroup |
createGroup()
Creates a new
RenderGroup object, adds it to this Style object and returns
the RenderGroup object created. |
java.lang.String |
createRoleString() |
java.lang.String |
createTypeString() |
void |
delete()
Explicitly deletes the underlying native object.
|
SBase |
getElementByMetaId(java.lang.String metaid)
Returns the first child element that has the given
metaid, or null
if no such object is found. |
SBase |
getElementBySId(java.lang.String id)
Returns the first child element that has the given
id in the model-wide
SId namespace, or null if no such object is found. |
java.lang.String |
getElementName()
Returns the XML element name of this
Style object. |
RenderGroup |
getGroup()
Returns the value of the 'group' element of this
Style. |
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
Style. |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
Style. |
long |
getNumRoles()
Returns the number of ids in the role list.
|
long |
getNumTypes()
Returns the number of types in the type list.
|
StringSet |
getRoleList()
Returns the value of the 'roleList' attribute of this
Style. |
int |
getTypeCode()
Returns the libSBML type code for this
Style object. |
StringSet |
getTypeList()
Returns the type list.
|
boolean |
hasRequiredAttributes()
Predicate returning
true if all the required attributes for this Style
object have been set. |
boolean |
isGlobalStyle()
|
boolean |
isInRoleList(java.lang.String role)
Checks whether a given role is in the role list.
|
boolean |
isInTypeList(java.lang.String type)
Checks whether a given type string is in the type list.
|
boolean |
isLocalStyle()
|
boolean |
isSetGroup()
Predicate returning
true if this Style's 'group' element is set. |
boolean |
isSetId()
Predicate returning
true if this Style's 'id' attribute is set. |
boolean |
isSetName()
Predicate returning
true if this Style's 'name' attribute is set. |
int |
removeRole(java.lang.String role)
Removes the given role from the role list.
|
int |
removeType(java.lang.String type)
Removes a type string from the type list.
|
int |
setGroup(RenderGroup group)
Sets the value of the 'group' element of this
Style. |
int |
setId(java.lang.String id)
Sets the value of the 'id' attribute of this
Style. |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
Style. |
int |
setRoleList(StringSet roleList)
Sets the complete role list to a copy of the given list.
|
int |
setTypeList(StringSet typeList)
Sets the complete type list to a copy of the given list.
|
XMLNode |
toXML()
|
int |
unsetGroup()
Unsets the value of the 'group' element of this
Style. |
int |
unsetId()
Unsets the value of the 'id' attribute of this
Style. |
int |
unsetName()
Unsets the value of the 'name' attribute of this
Style. |
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, connectToChild, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, 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, 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, unsetUserDatapublic 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 Style.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 Style.delete() themselves.
public SBase cloneObject()
Style object.
cloneObject in class SBaseStyle object.public java.lang.String getId()
Style.
getId in class SBaseStyle as a string.SBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.isSetIdAttribute(),
SBase.unsetIdAttribute()public java.lang.String getName()
Style.
getName in class SBaseStyle as a string.SBase.getIdAttribute(),
SBase.isSetName(),
SBase.setName(String sid),
SBase.unsetName()public boolean isSetId()
true if this Style's 'id' attribute is set.
isSetId in class SBasetrue if this Style's 'id' attribute has been set, otherwise
false is returned.SBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.unsetIdAttribute(),
SBase.isSetIdAttribute()public boolean isSetName()
true if this Style's 'name' attribute is set.
isSetName in class SBasetrue if this Style's 'name' attribute has been set, otherwise
false is returned.SBase.getName(),
SBase.setName(String sid),
SBase.unsetName()public int setId(java.lang.String id)
Style.
setId in class SBaseid - String& value of the 'id' attribute to be set.
Calling this function with id = null or an empty string is
equivalent to calling unsetId().
SBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.isSetIdAttribute(),
SBase.unsetIdAttribute()public int setName(java.lang.String name)
Style.
setName in class SBasename - String& value of the 'name' attribute to be set.
Calling this function with name = null or an empty string is
equivalent to calling unsetName().
public int unsetId()
Style.
unsetId in class SBaseSBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.isSetIdAttribute(),
SBase.unsetIdAttribute()public int unsetName()
Style.
unsetName in class SBaseSBase.getName(),
SBase.setName(String sid),
SBase.isSetName()public StringSet getRoleList()
Style.
Style as a string.public long getNumRoles()
public boolean isInRoleList(java.lang.String role)
role - role string to check for in the role list.public int addRole(java.lang.String role)
role - New role to be added to the role list.public java.lang.String createRoleString()
public int removeRole(java.lang.String role)
role - role string to be removed from the role list.public int setRoleList(StringSet roleList)
roleList - New list of role strings to be set on the style.public StringSet getTypeList()
The attribute 'typeList' for LocalStyle and GlobalStyle objects contains
a list of StyleType entries that describe what sorts of object to apply
the style to.
In the SBML
Level 3 Version 1 Render specification, the following are the
allowable entries in a whitespace-separated 'typeList':
'COMPARTMENTGLYPH': The style is to be applied to all compartment
glyphs.
'SPECIESGLYPH': The style is to be applied to all species
glyphs.
'REACTIONGLYPH': The style is to be applied to all reaction
glyphs.
'SPECIESREFERENCEGLYPH': The style is to be applied to all
species reference glyphs.
'TEXTGLYPH': The style is to be applied to all text
glyphs.
'GENERALGLYPH': The style is to be applied to all general
glyphs.
'GRAPHICALOBJECT': The style is to be applied to all graphical
objects.
'ANY': The style is to be applied to any and all glyphs and
graphical objects. Equivalent to explicitly listing all other keywords.
public long getNumTypes()
public boolean isInTypeList(java.lang.String type)
type - string to be searched for in the type list
true or false depending on whether the given string was
found in the type list.
The attribute 'typeList' for LocalStyle and GlobalStyle objects contains
a list of StyleType entries that describe what sorts of object to apply
the style to.
In the SBML
Level 3 Version 1 Render specification, the following are the
allowable entries in a whitespace-separated 'typeList':
'COMPARTMENTGLYPH': The style is to be applied to all compartment
glyphs.
'SPECIESGLYPH': The style is to be applied to all species
glyphs.
'REACTIONGLYPH': The style is to be applied to all reaction
glyphs.
'SPECIESREFERENCEGLYPH': The style is to be applied to all
species reference glyphs.
'TEXTGLYPH': The style is to be applied to all text
glyphs.
'GENERALGLYPH': The style is to be applied to all general
glyphs.
'GRAPHICALOBJECT': The style is to be applied to all graphical
objects.
'ANY': The style is to be applied to any and all glyphs and
graphical objects. Equivalent to explicitly listing all other keywords.
public int addType(java.lang.String type)
type - new type string to be added to the type listpublic java.lang.String createTypeString()
public int removeType(java.lang.String type)
type - type string to be removed from the type list.public int setTypeList(StringSet typeList)
typeList - the list of types to be set for the style.
The attribute 'typeList' for LocalStyle and GlobalStyle objects contains
a list of StyleType entries that describe what sorts of object to apply
the style to.
In the SBML
Level 3 Version 1 Render specification, the following are the
allowable entries in a whitespace-separated 'typeList':
'COMPARTMENTGLYPH': The style is to be applied to all compartment
glyphs.
'SPECIESGLYPH': The style is to be applied to all species
glyphs.
'REACTIONGLYPH': The style is to be applied to all reaction
glyphs.
'SPECIESREFERENCEGLYPH': The style is to be applied to all
species reference glyphs.
'TEXTGLYPH': The style is to be applied to all text
glyphs.
'GENERALGLYPH': The style is to be applied to all general
glyphs.
'GRAPHICALOBJECT': The style is to be applied to all graphical
objects.
'ANY': The style is to be applied to any and all glyphs and
graphical objects. Equivalent to explicitly listing all other keywords.
public RenderGroup getGroup()
Style.
Style as a RenderGroup.public boolean isSetGroup()
true if this Style's 'group' element is set.
true if this Style's 'group' element has been set, otherwise
false is returned.public int setGroup(RenderGroup group)
Style.
group - RenderGroup value of the 'group' element to be set.
public RenderGroup createGroup()
RenderGroup object, adds it to this Style object and returns
the RenderGroup object created.
RenderGroup object instance.public int unsetGroup()
Style.
public boolean isGlobalStyle()
true if this abstract Style is of type GlobalStyle, false
otherwisepublic boolean isLocalStyle()
true if this abstract Style is of type LocalStyle, false
otherwisepublic java.lang.String getElementName()
Style object.
For Style, the XML element name is always 'style'.
getElementName in class SBase'style'.public int getTypeCode()
Style object.
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()
The exception to this is lists: all SBML-style list elements have the type
SBML_LIST_OF, regardless of what package they
are from.
getTypeCode in class SBaseSBML_RENDER_STYLE_BASE.
Style.getElementName(),
SBase.getPackageName()ListOf.getItemTypeCode()).
public boolean hasRequiredAttributes()
true if all the required attributes for this Style
object have been set.
hasRequiredAttributes in class SBasetrue to indicate that all the required attributes of this Style
have been set, otherwise false is returned.public SBase getElementBySId(java.lang.String id)
id in the model-wide
SId namespace, or null if no such object is found.
getElementBySId in class SBaseid - a string representing the id attribute of the object to
retrieve.
SBase element with the given id. If no such
object is found, this method returns null.public SBase getElementByMetaId(java.lang.String metaid)
metaid, or null
if no such object is found.
getElementByMetaId in class SBasemetaid - a string representing the metaid attribute of the object to
retrieve.
SBase element with the given metaid. If no
such object is found this method returns null.