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. A valid gradient will have a positive radius
greater than 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. The radius is also defined as an
absolute-relative value pair. For examples of RadialGradient object
definitions, see the SBML Render package specification and/or the SVG
specification.
GradientBase,
RelAbsVectorINVALID, PAD, REFLECT, REPEAT| Constructor and Description |
|---|
RadialGradient()
Creates a new
RadialGradient using the given SBML Level, Version and
“render” package version. |
RadialGradient(long level)
Creates a new
RadialGradient using the given SBML Level, Version and
“render” package version. |
RadialGradient(long level,
long version)
Creates a new
RadialGradient using the given SBML Level, Version and
“render” package version. |
RadialGradient(long level,
long version,
long pkgVersion)
Creates a new
RadialGradient using the given SBML Level, Version and
“render” package version. |
RadialGradient(RadialGradient orig)
Copy constructor for
RadialGradient. |
RadialGradient(RenderPkgNamespaces renderns)
Creates a new
RadialGradient using the given RenderPkgNamespaces object. |
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 start point as a reference.
|
RelAbsVector |
getCenterY()
Returns the y coordinate for the start point as a reference.
|
RelAbsVector |
getCenterZ()
Returns the z coordinate for the start point as a reference.
|
RelAbsVector |
getCx()
Returns the value of the 'cx' element of this
RadialGradient. |
RelAbsVector |
getCy()
Returns the value of the 'cy' element of this
RadialGradient. |
RelAbsVector |
getCz()
Returns the value of the 'cz' element of this
RadialGradient. |
java.lang.String |
getElementName()
Returns the XML element name of this
RadialGradient object. |
RelAbsVector |
getFocalPointX()
Returns the x coordinate for the start point as a reference.
|
RelAbsVector |
getFocalPointY()
Returns the y coordinate for the start point as a reference.
|
RelAbsVector |
getFocalPointZ()
Returns the z coordinate for the start point as a reference.
|
RelAbsVector |
getFx()
Returns the value of the 'fx' element of this
RadialGradient. |
RelAbsVector |
getFy()
Returns the value of the 'fy' element of this
RadialGradient. |
RelAbsVector |
getFz()
Returns the value of the 'fz' element of this
RadialGradient. |
RelAbsVector |
getR()
Returns the value of the 'r' element of this
RadialGradient. |
RelAbsVector |
getRadius()
Returns the radius as a reference.
|
int |
getTypeCode()
Returns the libSBML type code for this
RadialGradient object. |
boolean |
isSetCx()
Predicate returning
true if this RadialGradient's 'cx' element is set. |
boolean |
isSetCy()
Predicate returning
true if this RadialGradient's 'cy' element is set. |
boolean |
isSetCz()
Predicate returning
true if this RadialGradient's 'cz' element is set. |
boolean |
isSetFx()
Predicate returning
true if this RadialGradient's 'fx' element is set. |
boolean |
isSetFy()
Predicate returning
true if this RadialGradient's 'fy' element is set. |
boolean |
isSetFz()
Predicate returning
true if this RadialGradient's 'fz' element is set. |
boolean |
isSetR()
Predicate returning
true if this RadialGradient's 'r' element is set. |
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.
|
int |
setCx(RelAbsVector cx)
Sets the value of the 'cx' element of this
RadialGradient. |
int |
setCy(RelAbsVector cy)
Sets the value of the 'cy' element of this
RadialGradient. |
int |
setCz(RelAbsVector cz)
Sets the value of the 'cz' element of this
RadialGradient. |
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.
|
int |
setFx(RelAbsVector fx)
Sets the value of the 'fx' element of this
RadialGradient. |
int |
setFy(RelAbsVector fy)
Sets the value of the 'fy' element of this
RadialGradient. |
int |
setFz(RelAbsVector fz)
Sets the value of the 'fz' element of this
RadialGradient. |
int |
setR(RelAbsVector r)
Sets the value of the 'r' element of this
RadialGradient. |
int |
setRadius(RelAbsVector r)
Sets the radius of the radial gradient.
|
XMLNode |
toXML()
Creates an
XMLNode object from this RadialGradient object. |
int |
unsetCx()
Unsets the value of the 'cx' element of this
RadialGradient. |
int |
unsetCy()
Unsets the value of the 'cy' element of this
RadialGradient. |
int |
unsetCz()
Unsets the value of the 'cz' element of this
RadialGradient. |
int |
unsetFx()
Unsets the value of the 'fx' element of this
RadialGradient. |
int |
unsetFy()
Unsets the value of the 'fy' element of this
RadialGradient. |
int |
unsetFz()
Unsets the value of the 'fz' element of this
RadialGradient. |
int |
unsetR()
Unsets the value of the 'r' element of this
RadialGradient. |
addGradientStop, createGradientStop, getElementByMetaId, getElementBySId, getGradientStop, getGradientStop, getId, getListOfGradientStops, getName, getNumGradientStops, getSpreadMethod, getSpreadMethodAsString, getSpreadMethodString, hasRequiredAttributes, isLinearGradient, isRadialGradient, isSetId, isSetName, isSetSpreadMethod, removeGradientStop, removeGradientStop, setId, setName, setSpreadMethod, setSpreadMethod, unsetId, unsetName, unsetSpreadMethodaddCVTerm, 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 RadialGradient(long level, long version, long pkgVersion) throws SBMLConstructorException
RadialGradient using the given SBML Level, Version and
“render” package version.
level - a long integer, the SBML Level to assign to this
RadialGradient.
version - a long integer, the SBML Version to assign to this
RadialGradient.
pkgVersion - a long integer, the SBML Render Version to assign to
this RadialGradient.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public RadialGradient(long level, long version) throws SBMLConstructorException
RadialGradient using the given SBML Level, Version and
“render” package version.
level - a long integer, the SBML Level to assign to this
RadialGradient.
version - a long integer, the SBML Version to assign to this
RadialGradient.
pkgVersion - a long integer, the SBML Render Version to assign to
this RadialGradient.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public RadialGradient(long level) throws SBMLConstructorException
RadialGradient using the given SBML Level, Version and
“render” package version.
level - a long integer, the SBML Level to assign to this
RadialGradient.
version - a long integer, the SBML Version to assign to this
RadialGradient.
pkgVersion - a long integer, the SBML Render Version to assign to
this RadialGradient.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public RadialGradient() throws SBMLConstructorException
RadialGradient using the given SBML Level, Version and
“render” package version.
level - a long integer, the SBML Level to assign to this
RadialGradient.
version - a long integer, the SBML Version to assign to this
RadialGradient.
pkgVersion - a long integer, the SBML Render Version to assign to
this RadialGradient.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public RadialGradient(RenderPkgNamespaces renderns) throws SBMLConstructorException
RadialGradient using the given RenderPkgNamespaces object.
The package namespaces object used in this constructor is derived from a
SBMLNamespaces object, which encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
package version and name information used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces facilities is to create an
package namespace object somewhere in a program once, then hand that object
as needed to object constructors of that package that accept it as and
argument, such as this one.
renderns - the RenderPkgNamespaces object.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.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.
l2version - an integer indicating the version of SBML Level 2SBMLConstructorExceptionpublic 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.
renderns - the SBMLNamespaces object for the SBML 'render' packageid - the new id for the RadialGradient.
SBMLConstructorExceptionSBMLNamespaces object.public RadialGradient(RadialGradient orig) throws SBMLConstructorException
RadialGradient.
orig - the RadialGradient instance to copy.SBMLConstructorExceptionpublic 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 GradientBasepublic RadialGradient cloneObject()
RadialGradient object.
cloneObject in class GradientBaseRadialGradient object.public RelAbsVector getCx()
RadialGradient.
RadialGradient as a
RelAbsVector.public RelAbsVector getCenterX()
RelAbsVector that represents the x value of the start point.public RelAbsVector getCy()
RadialGradient.
RadialGradient as a
RelAbsVector.public RelAbsVector getCenterY()
RelAbsVector that represents the y value of the start point.public RelAbsVector getCz()
RadialGradient.
RadialGradient as a
RelAbsVector.public RelAbsVector getCenterZ()
RelAbsVector that represents the z value of the start point.public RelAbsVector getR()
RadialGradient.
RadialGradient as a
RelAbsVector.public RelAbsVector getRadius()
public RelAbsVector getFx()
RadialGradient.
RadialGradient as a
RelAbsVector.public RelAbsVector getFocalPointX()
RelAbsVector that represents the x value of the start point.public RelAbsVector getFy()
RadialGradient.
RadialGradient as a
RelAbsVector.public RelAbsVector getFocalPointY()
RelAbsVector that represents the y value of the start point.public RelAbsVector getFz()
RadialGradient.
RadialGradient as a
RelAbsVector.public RelAbsVector getFocalPointZ()
RelAbsVector that represents the z value of the start point.public boolean isSetCx()
true if this RadialGradient's 'cx' element is set.
true if this RadialGradient's 'cx' element has been set,
otherwise false is returned.public boolean isSetCy()
true if this RadialGradient's 'cy' element is set.
true if this RadialGradient's 'cy' element has been set,
otherwise false is returned.public boolean isSetCz()
true if this RadialGradient's 'cz' element is set.
true if this RadialGradient's 'cz' element has been set,
otherwise false is returned.public boolean isSetR()
true if this RadialGradient's 'r' element is set.
true if this RadialGradient's 'r' element has been set,
otherwise false is returned.public boolean isSetFx()
true if this RadialGradient's 'fx' element is set.
true if this RadialGradient's 'fx' element has been set,
otherwise false is returned.public boolean isSetFy()
true if this RadialGradient's 'fy' element is set.
true if this RadialGradient's 'fy' element has been set,
otherwise false is returned.public boolean isSetFz()
true if this RadialGradient's 'fz' element is set.
true if this RadialGradient's 'fz' element has been set,
otherwise false is returned.public int setCx(RelAbsVector cx)
RadialGradient.
cx - RelAbsVector value of the 'cx' element to be set.
public int setCy(RelAbsVector cy)
RadialGradient.
cy - RelAbsVector value of the 'cy' element to be set.
public int setCz(RelAbsVector cz)
RadialGradient.
cz - RelAbsVector value of the 'cz' element to be set.
public int setR(RelAbsVector r)
RadialGradient.
r - RelAbsVector value of the 'r' element to be set.
public int setRadius(RelAbsVector r)
r - radius of the radial gradient vector.
public int setFx(RelAbsVector fx)
RadialGradient.
fx - RelAbsVector value of the 'fx' element to be set.
public int setFy(RelAbsVector fy)
RadialGradient.
fy - RelAbsVector value of the 'fy' element to be set.
public int setFz(RelAbsVector fz)
RadialGradient.
fz - RelAbsVector value of the 'fz' element to be set.
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 int unsetCx()
RadialGradient.
public int unsetCy()
RadialGradient.
public int unsetCz()
RadialGradient.
public int unsetR()
RadialGradient.
public int unsetFx()
RadialGradient.
public int unsetFy()
RadialGradient.
public int unsetFz()
RadialGradient.
public java.lang.String getElementName()
RadialGradient object.
For RadialGradient, the XML element name is always 'radialGradient'.
getElementName in class GradientBase'radialGradient'.public int getTypeCode()
RadialGradient 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 GradientBaseSBML_RENDER_RADIALGRADIENT.
RadialGradient.getElementName(),
SBase.getPackageName()ListOf.getItemTypeCode()).
public XMLNode toXML()
XMLNode object from this RadialGradient object.
toXML in class GradientBaseXMLNode with the XML representation for the
RadialGradient object.