public class RenderInformationBase extends SBase
In the SBML render extension, local and global render information representations share many attributes. These are implemented in this abstract base class.
GlobalRenderInformation
and LocalRenderInformation
are the classes that are derived
from this base class.
All render information objects have the following things in common:
a) a set of color definitions b) a set of gradient definitions c) a set of line endings
In addition to those, they share attributes for background color and some meta information as to which program created the render information etc.
Modifier and Type | Method and Description |
---|---|
int |
addColorDefinition(ColorDefinition cd)
Adds a copy of the given color definition to the end of the list of
color definitions.
|
int |
addGradientDefinition(GradientBase gradient)
Adds a copy of the given gradient definition to the end of the list of
gradient definitions.
|
int |
addLineEnding(LineEnding le)
Adds a copy of the given line ending to the end of the list of line
endings.
|
ColorDefinition |
createColorDefinition()
Creates a new color definition object without an id.
|
LinearGradient |
createLinearGradientDefinition()
Creates a new linear gradient definition.
|
LineEnding |
createLineEnding()
Creates a new line ending.
|
RadialGradient |
createRadialGradientDefinition()
Creates a new radial gradient definition.
|
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getBackgroundColor()
Returns the background color which is either the id of a color in the
list of color definitions, or a color value.
|
ColorDefinition |
getColorDefinition(long index)
Returns a pointer to the color definition with the given index, or
null
if the index is invalid. |
ColorDefinition |
getColorDefinition(java.lang.String id)
Returns a pointer to the color definition with the given
id , or null
if there is no color definition with that id. |
GradientBase |
getGradientDefinition(long index)
Returns a pointer to the gradient definition with the given index, or
null
if the index is invalid. |
GradientBase |
getGradientDefinition(java.lang.String id)
Returns a pointer to the gradient definition with the given
id , or null
if there is no gradient definition with that id. |
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
RenderInformationBase . |
LineEnding |
getLineEnding(long index)
Returns a pointer to the line ending with the given index, or
null
if the index is invalid. |
LineEnding |
getLineEnding(java.lang.String id)
Returns a pointer to the line ending with the given
id , or null
if there is no line ending with that id. |
ListOfColorDefinitions |
getListOfColorDefinitions()
Returns a pointer to the list of color definitions.
|
ListOfGradientDefinitions |
getListOfGradientDefinitions()
Returns a pointer to the list of gradient definitions.
|
ListOfLineEndings |
getListOfLineEndings()
Returns a pointer to the list of line endings.
|
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
RenderInformationBase . |
long |
getNumColorDefinitions()
Returns the number of color definitions.
|
long |
getNumGradientDefinitions()
Returns the number of gradient definitions in the render information.
|
long |
getNumLineEndings()
Returns the number of line endings for the render information.
|
java.lang.String |
getProgramName()
Returns the program name that created the render information.
|
java.lang.String |
getProgramVersion()
Returns the version of the program that created the render information.
|
java.lang.String |
getReferenceRenderInformationId()
Returns the id of the referenced render information object.
|
boolean |
isSetId()
Predicate returning
true or false depending on whether this
RenderInformationBase 's 'id' attribute has been set. |
boolean |
isSetName()
Predicate returning
true or false depending on whether this
RenderInformationBase 's 'name' attribute has been set. |
ColorDefinition |
removeColorDefinition(long index)
Removes the color definition with the given index from the list of color definitions.
|
GradientBase |
removeGradientDefinition(long index)
Removes the gradient definition with the given index.
|
LineEnding |
removeLineEnding(long index)
Removes the line ending with the given index.
|
void |
setBackgroundColor(java.lang.String bg)
Sets the background color to either the id of a color in the list of
color definitions, or a color value.
|
int |
setId(java.lang.String id)
Sets the value of the 'id' attribute of this
RenderInformationBase . |
int |
setName(java.lang.String id)
Sets the value of the 'name' attribute of this
RenderInformationBase . |
void |
setProgramName(java.lang.String name)
Sets the name of the program that created the render information.
|
void |
setProgramVersion(java.lang.String version)
Sets the version string of the program that created the render information.
|
void |
setReferenceRenderInformationId(java.lang.String id)
Sets the id of the referenced render information object.
|
int |
unsetId()
Unsets the value of the 'id' attribute of this
RenderInformationBase . |
int |
unsetName()
Unsets the value of the 'name' attribute of this
RenderInformationBase . |
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, cloneObject, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getElementByMetaId, getElementBySId, getElementName, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getTypeCode, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, 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
public int addColorDefinition(ColorDefinition cd)
The color definition has to be valid, i.e. have a unique id and a valid color value. Otherwise it is not added.
cd
- const pointer to ColorDefinition
object to be added
RenderInformationBase.createColorDefinition()
Reaction
. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Reaction
. In addition, the caller should make
sure to free the original object if it is no longer being used, or
else a memory leak will result. Please see RenderInformationBase.createColorDefinition()
for a method that does not lead to these issues.
public int addGradientDefinition(GradientBase gradient)
gradient
- GradientDefinition object to be added
RenderInformationBase.createRadialGradientDefinition()
,
RenderInformationBase.createLinearGradientDefinition()
RenderInformationBase
. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the RenderInformationBase
. In addition, the caller should make
sure to free the original object if it is no longer being used, or
else a memory leak will result. Please see
RenderInformationBase.createLinearGradientDefinition()
or
RenderInformationBase.createRadialGradientDefinition()
for methods that does not lead to these issues.
public int addLineEnding(LineEnding le)
LineEnding
is only added if it is valid.
le
- const pointer to LineEnding
to be added
RenderInformationBase.createLineEnding()
RenderInformationBase
. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the RenderInformationBase
. In addition, the caller should make
sure to free the original object if it is no longer being used, or
else a memory leak will result. Please see RenderInformationBase.createLineEnding()
for a method that does not lead to these issues.
public ColorDefinition createColorDefinition()
The created ColorDefinition
object is added to and owned by the render information.
ColorDefinition
objectpublic LinearGradient createLinearGradientDefinition()
Since the newly created object has no id and no gradient stops, it is invalid until those things have been added.
LinearGradient
object.public LineEnding createLineEnding()
LineEnding
objectpublic RadialGradient createRadialGradientDefinition()
Since the newly created object has no id and no gradient stops, it is invalid until those things have been added.
RadialGradient
object.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 RenderInformationBase.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 RenderInformationBase.delete()
themselves.
public java.lang.String getBackgroundColor()
public ColorDefinition getColorDefinition(long index)
null
if the index is invalid.
index
- of the ColorDefinition
object to be returned
ColorDefinition
object at the given index or nullpublic ColorDefinition getColorDefinition(java.lang.String id)
id
, or null
if there is no color definition with that id.
id
- of the color definition object to be returned.
id
or null if there is no color definition with given id
public GradientBase getGradientDefinition(long index)
null
if the index is invalid.
index
- index of the GradientDefinition object to be returned
public GradientBase getGradientDefinition(java.lang.String id)
id
, or null
if there is no gradient definition with that id.
id
- of the gradient definition object to be returned.
id
or null if there is no gradient definition with given id
public java.lang.String getId()
RenderInformationBase
.
getId
 in class SBase
RenderInformationBase
public LineEnding getLineEnding(long index)
null
if the index is invalid.
index
- of the line ending object to be returned.
public LineEnding getLineEnding(java.lang.String id)
id
, or null
if there is no line ending with that id.
id
- of the line ending object to be returned.
id
or null if there is no line ending with given id
public ListOfColorDefinitions getListOfColorDefinitions()
public ListOfGradientDefinitions getListOfGradientDefinitions()
ListOfGradientDefinitions
public ListOfLineEndings getListOfLineEndings()
public java.lang.String getName()
RenderInformationBase
.
getName
 in class SBase
RenderInformationBase
public long getNumColorDefinitions()
public long getNumGradientDefinitions()
public long getNumLineEndings()
public java.lang.String getProgramName()
public java.lang.String getProgramVersion()
public java.lang.String getReferenceRenderInformationId()
Global render information objects can only reference other global render information objects, local render information objects can reference other local render information objects from the same list of local render information or other global render infromation.
public boolean isSetId()
true
or false
depending on whether this
RenderInformationBase
's 'id' attribute has been set.
isSetId
 in class SBase
RenderInformationBase
has been set.public boolean isSetName()
true
or false
depending on whether this
RenderInformationBase
's 'name' attribute has been set.
isSetName
 in class SBase
RenderInformationBase
has been set.public ColorDefinition removeColorDefinition(long index)
null
is returned.
index
- index of the color definition to be removed.
public GradientBase removeGradientDefinition(long index)
null
is returned.
index
- index of the gradient definition object to be removed.
public LineEnding removeLineEnding(long index)
null
is returned.
index
- index of the object to be removed.
public void setBackgroundColor(java.lang.String bg)
bg
- id of a color definition or a valid color value to be used as background color.public int setId(java.lang.String id)
RenderInformationBase
.
setId
 in class SBase
id
- the new id for the RenderInformationBase
public int setName(java.lang.String id)
RenderInformationBase
.
setName
 in class SBase
name
- the new name for the RenderInformationBase
public void setProgramName(java.lang.String name)
name
- the name of the programmpublic void setProgramVersion(java.lang.String version)
version
- version string of the programpublic void setReferenceRenderInformationId(java.lang.String id)
id
- the id of the referenced render infromationpublic int unsetId()
RenderInformationBase
.public int unsetName()
RenderInformationBase
.