public class RadialGradient extends GradientBase
The concept of a radial gradient is more or or less taken from SVG.
A radial gradient is defined by a center point, a radius and an optional focal point.
So for a valid gradient the radius should have a positive length different from 0 and
the focal point should be within the circle defined by the center point and the radius.
Otherwise all restrictions for the GradientBase
class apply. (
The center and the focal point of a radial gradient are defined by three pairs of
absolute-relative value. (@see RelAbsVector)
The radius is also defined asn an absolute-relative value pair.
For examples of RadialGradients see the render extension specification and/or the SVG specification.
GradientBase)
PAD, REFLECT, REPEAT
Constructor and Description |
---|
RadialGradient()
Creates a new
RadialGradient object with the given SBML level
and SBML version. |
RadialGradient(long level)
Creates a new
RadialGradient object with the given SBML level
and SBML version. |
RadialGradient(long level,
long version)
Creates a new
RadialGradient object with the given SBML level
and SBML version. |
RadialGradient(long level,
long version,
long pkgVersion)
Creates a new
RadialGradient object with the given SBML level
and SBML version. |
RadialGradient(RenderPkgNamespaces renderns)
Creates a new
RadialGradient object with the given SBMLNamespaces . |
RadialGradient(RenderPkgNamespaces renderns,
java.lang.String id)
Constructor which creates a
RadialGradient with no gradient stops. |
RadialGradient(XMLNode node,
long l2version)
Creates a new
RadialGradient object from the given XMLNode object. |
Modifier and Type | Method and Description |
---|---|
RadialGradient |
cloneObject()
Creates and returns a deep copy of this
RadialGradient object. |
void |
delete()
Explicitly deletes the underlying native object.
|
RelAbsVector |
getCenterX()
Returns the x coordinate for the center point as a reference.
|
RelAbsVector |
getCenterY()
Returns the y coordinate for the center point as a reference.
|
RelAbsVector |
getCenterZ()
Returns the z coordinate for the center point as a reference.
|
java.lang.String |
getElementName()
Returns the XML element name of this object.
|
RelAbsVector |
getFocalPointX()
Returns the x coordinate for the focal point as a reference.
|
RelAbsVector |
getFocalPointY()
Returns the y coordinate for the focal point as a reference.
|
RelAbsVector |
getFocalPointZ()
Returns the z coordinate for the focal point as a reference.
|
RelAbsVector |
getRadius()
Returns the radius as a reference.
|
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
void |
setCenter(RelAbsVector x,
RelAbsVector y)
Sets the coordinates for the center point.
|
void |
setCenter(RelAbsVector x,
RelAbsVector y,
RelAbsVector z)
Sets the coordinates for the center point.
|
void |
setCoordinates(RelAbsVector x,
RelAbsVector y,
RelAbsVector r,
RelAbsVector fx,
RelAbsVector fy)
Sets the 2D coordinates for the center and the focal
point as well as the radius.
|
void |
setCoordinates(RelAbsVector x,
RelAbsVector y,
RelAbsVector z,
RelAbsVector r,
RelAbsVector fx,
RelAbsVector fy,
RelAbsVector fz)
Sets the 3D coordinates for the center and the focal
point as well as the radius.
|
void |
setFocalPoint(RelAbsVector x,
RelAbsVector y)
Sets the coordinates for the focal point.
|
void |
setFocalPoint(RelAbsVector x,
RelAbsVector y,
RelAbsVector z)
Sets the coordinates for the focal point.
|
void |
setRadius(RelAbsVector r)
Sets the radius of the radial gradient.
|
XMLNode |
toXML()
Creates an
XMLNode object from this RadialGradient object. |
addGradientStop, connectToChild, createGradientStop, getGradientStop, getId, getListOfGradientStops, getNumGradientStops, getSpreadMethod, isSetId, setId, setSpreadMethod, unsetId
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getElementByMetaId, getElementBySId, 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, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetName, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setIdAttribute, setMetaId, setModelHistory, setName, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetName, unsetNotes, unsetSBOTerm, unsetUserData
public RadialGradient(long level, long version, long pkgVersion) throws SBMLConstructorException
RadialGradient
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public RadialGradient(long level, long version) throws SBMLConstructorException
RadialGradient
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public RadialGradient(long level) throws SBMLConstructorException
RadialGradient
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public RadialGradient() throws SBMLConstructorException
RadialGradient
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public RadialGradient(RenderPkgNamespaces renderns) throws SBMLConstructorException
RadialGradient
object with the given SBMLNamespaces
.
sbmlns
- The SBML namespace for the object.SBMLConstructorException
public RadialGradient(XMLNode node, long l2version) throws SBMLConstructorException
RadialGradient
object from the given XMLNode
object.
The XMLNode
object has to contain a valid XML representation of a
RadialGradient
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 RadialGradient
object to be instantiated.SBMLConstructorException
public RadialGradient(RenderPkgNamespaces renderns, java.lang.String id) throws SBMLConstructorException
RadialGradient
with no gradient stops.
The id is set to the given value.
The RadialGradient
object is invalid until it has an id and at least two
gradient stops.
The start and the end of the linear gradient vector are set to (0,0,0).
A linear gradient with a vector of length zero should also be considered invalid.
id
- the new id for the RadialGradient
.
This constructor is deprecated. The new libsbml API only has
constructors which take the SBML level and version or one that takes
an SBMLNamespaces
object.
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 RadialGradient.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 RadialGradient.delete()
themselves.
delete
 in class GradientBase
public void setCoordinates(RelAbsVector x, RelAbsVector y, RelAbsVector z, RelAbsVector r, RelAbsVector fx, RelAbsVector fy, RelAbsVector fz)
RelAbsVector
object.
x
- x value of the center point of the radial gradient vectory
- y value of the center point of the radial gradient vectorz
- z value of the center point of the radial gradient vectorr
- x value of the radius of the radial gradient vectorfx
- x value of the focal point of the radial gradient vectorfy
- y value of the focal point of the radial gradient vectorfz
- z value of the focal point of the radial gradient vectorpublic void setCoordinates(RelAbsVector x, RelAbsVector y, RelAbsVector r, RelAbsVector fx, RelAbsVector fy)
RelAbsVector
object.
x
- x value of the center point of the radial gradient vectory
- y value of the center point of the radial gradient vectorr
- x value of the radius of the radial gradient vectorfx
- x value of the focal point of the radial gradient vectorfy
- y value of the focal point of the radial gradient vectorpublic void setCenter(RelAbsVector x, RelAbsVector y, RelAbsVector z)
x
- x value of the center point of the radial gradient vectory
- y value of the center point of the radial gradient vectorz
- z value of the center point of the radial gradient vector
The z argument can be omitted. In that case it is set to 0.public void setCenter(RelAbsVector x, RelAbsVector y)
x
- x value of the center point of the radial gradient vectory
- y value of the center point of the radial gradient vectorz
- z value of the center point of the radial gradient vector
The z argument can be omitted. In that case it is set to 0.public void setFocalPoint(RelAbsVector x, RelAbsVector y, RelAbsVector z)
x
- x value of the focal point of the radial gradient vectory
- y value of the focal point of the radial gradient vectorz
- z value of the focal point of the radial gradient vector.
The z argument can be omitted. In that case it is set to 0.public void setFocalPoint(RelAbsVector x, RelAbsVector y)
x
- x value of the focal point of the radial gradient vectory
- y value of the focal point of the radial gradient vectorz
- z value of the focal point of the radial gradient vector.
The z argument can be omitted. In that case it is set to 0.public void setRadius(RelAbsVector r)
r
- radius of the radial gradient vector.public RelAbsVector getCenterX()
public RelAbsVector getCenterY()
public RelAbsVector getCenterZ()
public RelAbsVector getFocalPointX()
public RelAbsVector getFocalPointY()
public RelAbsVector getFocalPointZ()
public RelAbsVector getRadius()
public RadialGradient cloneObject()
RadialGradient
object.
cloneObject
 in class GradientBase
RadialGradient
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 GradientBase
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).
RadialGradient.getElementName()
public XMLNode toXML()
XMLNode
object from this RadialGradient
object.
toXML
 in class GradientBase
XMLNode
with the XML representation for the
RadialGradient
object.