Package com.kitfox.svg
Class Gradient
- java.lang.Object
-
- com.kitfox.svg.SVGElement
-
- com.kitfox.svg.FillElement
-
- com.kitfox.svg.Gradient
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
LinearGradient
,RadialGradient
public abstract class Gradient extends FillElement
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.geom.AffineTransform
gradientTransform
protected int
gradientUnits
static int
GU_OBJECT_BOUNDING_BOX
static int
GU_USER_SPACE_ON_USE
static int
SM_PAD
static int
SM_REFLECT
static int
SM_REPEAT
(package private) int
spreadMethod
(package private) java.awt.Color[]
stopColors
(package private) float[]
stopFractions
(package private) java.net.URI
stopRef
(package private) java.util.ArrayList<Stop>
stops
static java.lang.String
TAG_NAME
-
Fields inherited from class com.kitfox.svg.SVGElement
children, contexts, cssClass, diagram, dirty, id, ignorePresAttrib, inlineStyles, parent, presAttribs, serialVersionUID, SVG_NS, trackManager, xmlBase
-
-
Constructor Summary
Constructors Constructor Description Gradient()
Creates a new instance of Gradient
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendStop(Stop stop)
protected void
build()
Called by internal processes to rebuild the geometry of this node from it's presentation attributes, style attributes and animated tracks.private void
buildStops()
private int
clamp(int val, int min, int max)
java.awt.Color[]
getStopColors()
float[]
getStopFractions()
java.lang.String
getTagName()
void
loaderAddChild(SVGLoaderHelper helper, SVGElement child)
Called after the start element but before the end element to indicate each child tag that has been processedvoid
setStopRef(java.net.URI grad)
boolean
updateTime(double curTime)
Updates all attributes in this diagram associated with a time event.-
Methods inherited from class com.kitfox.svg.FillElement
getPaint
-
Methods inherited from class com.kitfox.svg.SVGElement
addAttribute, buildPath, getChild, getChild, getChildren, getId, getInlineAttributes, getNumChildren, getParent, getParentContext, getPath, getPres, getPresAbsolute, getPresentationAttributes, getRoot, getStyle, getStyle, getStyle, getStyleAbsolute, getXMLBase, hasAttribute, indexOfChild, lerp, loaderAddText, loaderEndElement, loaderStartElement, nextFloat, parsePathList, parseSingleTransform, parseTransform, popParentContext, pushParentContext, removeAttribute, removeChild, setAttribute, setDiagram, setParent, swapChildren
-
-
-
-
Field Detail
-
TAG_NAME
public static final java.lang.String TAG_NAME
- See Also:
- Constant Field Values
-
SM_PAD
public static final int SM_PAD
- See Also:
- Constant Field Values
-
SM_REPEAT
public static final int SM_REPEAT
- See Also:
- Constant Field Values
-
SM_REFLECT
public static final int SM_REFLECT
- See Also:
- Constant Field Values
-
spreadMethod
int spreadMethod
-
GU_OBJECT_BOUNDING_BOX
public static final int GU_OBJECT_BOUNDING_BOX
- See Also:
- Constant Field Values
-
GU_USER_SPACE_ON_USE
public static final int GU_USER_SPACE_ON_USE
- See Also:
- Constant Field Values
-
gradientUnits
protected int gradientUnits
-
stops
java.util.ArrayList<Stop> stops
-
stopRef
java.net.URI stopRef
-
gradientTransform
protected java.awt.geom.AffineTransform gradientTransform
-
stopFractions
float[] stopFractions
-
stopColors
java.awt.Color[] stopColors
-
-
Method Detail
-
getTagName
public java.lang.String getTagName()
- Specified by:
getTagName
in classSVGElement
-
loaderAddChild
public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException
Called after the start element but before the end element to indicate each child tag that has been processed- Overrides:
loaderAddChild
in classSVGElement
- Throws:
SVGElementException
-
build
protected void build() throws SVGException
Description copied from class:SVGElement
Called by internal processes to rebuild the geometry of this node from it's presentation attributes, style attributes and animated tracks.- Overrides:
build
in classSVGElement
- Throws:
SVGException
-
buildStops
private void buildStops()
-
getStopFractions
public float[] getStopFractions()
-
getStopColors
public java.awt.Color[] getStopColors()
-
clamp
private int clamp(int val, int min, int max)
-
setStopRef
public void setStopRef(java.net.URI grad)
-
appendStop
public void appendStop(Stop stop)
-
updateTime
public boolean updateTime(double curTime) throws SVGException
Updates all attributes in this diagram associated with a time event. Ie, all attributes with track information.- Specified by:
updateTime
in classSVGElement
- Returns:
- - true if this node has changed state as a result of the time update
- Throws:
SVGException
-
-