public class GradientStop extends SBase
SBML render extension. The gradient stop concept was more or less taken from
the corresponding concept in SVG.
A GradientStop
object represents the color at a certain location in a linear or
radial gradient.
Each gradient should contain two or more gradient stops which mark the edges of a region
within this region color are interpolated based on the distance of the location to the
edges of the region.
A gradient stop has two attributes. The first attribute is an offset which determines the location for the gradient stop within the object the gradient is appllied to. The offset can either be ab absolute value or a relative value or a combination of absolute and relative value. E.g. a value of '50%' for the offset means that the gradient stop is located at 50% of the gradient vector. For more information and examples, see the render extension specification or the SVG specification.
The second attribute defines the color for the gradient stop. The color can either be defined
be a color value string or by the id of a ColorDefinition
object. (@see ColorDefinition)
Constructor and Description |
---|
GradientStop()
Creates a new
GradientStop object with the given SBML level
and SBML version. |
GradientStop(long level)
Creates a new
GradientStop object with the given SBML level
and SBML version. |
GradientStop(long level,
long version)
Creates a new
GradientStop object with the given SBML level
and SBML version. |
GradientStop(long level,
long version,
long pkgVersion)
Creates a new
GradientStop object with the given SBML level
and SBML version. |
GradientStop(RenderPkgNamespaces renderns)
Creates a new
GradientStop object with the given SBMLNamespaces . |
GradientStop(XMLNode node)
Creates a new
GradientStop object from the given XMLNode object. |
GradientStop(XMLNode node,
long l2version)
Creates a new
GradientStop object from the given XMLNode object. |
Modifier and Type | Method and Description |
---|---|
SBase |
cloneObject()
Creates and returns a deep copy of this
GradientStop object. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getElementName()
Returns the XML element name of this object.
|
RelAbsVector |
getOffset()
Returns the offset of the gradient.
|
java.lang.String |
getStopColor()
Returns the stop color id or the value string.
|
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
void |
setOffset(double abs,
double rel)
Sets the offset for the gradient stop.
|
void |
setOffset(RelAbsVector offset)
Sets the offset to the given vector object.
|
void |
setOffset(java.lang.String arg0)
Sets the offset to the value specified by the given string.
|
void |
setStopColor(java.lang.String color)
Sets the stop color id or the stop color value.
|
XMLNode |
toXML()
Creates an
XMLNode object from this GradientStop object. |
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, connectToChild, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getElementByMetaId, getElementBySId, getId, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getName, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getObjectVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetId, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetName, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setId, setIdAttribute, setMetaId, setModelHistory, setName, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetId, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetName, unsetNotes, unsetSBOTerm, unsetUserData
public GradientStop(long level, long version, long pkgVersion) throws SBMLConstructorException
GradientStop
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public GradientStop(long level, long version) throws SBMLConstructorException
GradientStop
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public GradientStop(long level) throws SBMLConstructorException
GradientStop
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public GradientStop() throws SBMLConstructorException
GradientStop
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public GradientStop(RenderPkgNamespaces renderns) throws SBMLConstructorException
GradientStop
object with the given SBMLNamespaces
.
sbmlns
- The SBML namespace for the object.SBMLConstructorException
public GradientStop(XMLNode node, long l2version) throws SBMLConstructorException
GradientStop
object from the given XMLNode
object.
The XMLNode
object has to contain a valid XML representation of a
GradientStop
object as defined in the render extension specification.
This method is normally called when render information is read from a file and
should normally not have to be called explicitly.
node
- the XMLNode
object reference that describes the GradientStop
object to be instantiated.SBMLConstructorException
public GradientStop(XMLNode node) throws SBMLConstructorException
GradientStop
object from the given XMLNode
object.
The XMLNode
object has to contain a valid XML representation of a
GradientStop
object as defined in the render extension specification.
This method is normally called when render information is read from a file and
should normally not have to be called explicitly.
node
- the XMLNode
object reference that describes the GradientStop
object to be instantiated.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 GradientStop.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 GradientStop.delete()
themselves.
public RelAbsVector getOffset()
public void setOffset(double abs, double rel)
abs
- the absolute value of the offset.
rel
- the relative value of the offset.public void setOffset(java.lang.String arg0)
a
- string representing a valid offset value.public void setOffset(RelAbsVector offset)
offset
- The RelAbsVector
object that specifies the
offset of the gradient stop.public java.lang.String getStopColor()
public void setStopColor(java.lang.String color)
color
- Either the id of a ColorDefinition
object, or a color
value string.public SBase cloneObject()
GradientStop
object.
cloneObject
 in class SBase
GradientStop
objectpublic java.lang.String getElementName()
This is overridden by subclasses to return a string appropriate to the
SBML component. For example, Model
defines it as returning 'model',
CompartmentType
defines it as returning 'compartmentType', etc.
getElementName
 in class SBase
public XMLNode toXML()
XMLNode
object from this GradientStop
object.
XMLNode
with the XML representation for the
GradientStop
object.public int getTypeCode()
LibSBML attaches an
identifying code to every kind of SBML object. These are known as
SBML type codes. In other languages, the set of type codes
is stored in an enumeration in the Java language interface for
libSBML, the type codes are defined as static integer constants in
interface class libsbmlConstants
. The names of the type codes
all begin with the characters SBML_.
getTypeCode
 in class SBase
SBML_UNKNOWN
(default).
GradientStop.getElementName()