TinyLine
v2.0

com.tinyline.svg
Class SVGGradientElem

java.lang.Object
  extended bycom.tinyline.svg.SVGNode
      extended bycom.tinyline.svg.SVGGradientElem

public class SVGGradientElem
extends SVGNode

The SVGGradientElem class implements the 'linearGradient' or the 'radialGradient' element.

Gradients consist of continuously smooth color transitions along a vector from one color to another. This class provides for two types of gradients, linear gradients and radial gradients.

Version:
1.10

Author:
Andrew Girow

Field Summary
 TinyColor gcolor
          The gradient color.
 TinyMatrix gradientTransform
          The optional additional transformation from the gradient coordinate system onto the target coordinate system.
 int gradientUnits
          Defines the coordinate system
 int spreadMethod
          Indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.
 TinyString xlink_href
          A URI reference to a different 'linearGradient' or 'radialGradient' element within the current SVG document fragment.
 
Fields inherited from class com.tinyline.svg.SVGNode
animatedVals, bounds, children, color, display, fill, fillOpacity, fillRule, fontFamily, fontSize, fontStyle, fontWeight, helem, id, opacity, outlined, ownerDocument, parent, stopColor, stopOpacity, stroke, strokeDashArray, strokeDashOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, strokeOpacity, strokeWidth, textAnchor, transform, visibility, xmlSpace
 
Constructor Summary
SVGGradientElem(SVGGradientElem src)
          Constructs a copy of the given SVGGradientElem node.
 
Method Summary
 SVGNode copyNode()
          Constructs a copy of the given node.
 int createOutline()
          Creates an outline of this node.
 java.lang.Object getAttribute(int hattr)
          Returns the value object for the given attribute, or null object otherwise.
 TinyRect getDevBounds(SVGRaster renderer)
          Returns the device bounds of this SVGGradientElem node.
 void paint(SVGRaster renderer)
          Draws this node.
 int setAttribute(int hattr, java.lang.Object value)
          Assigns or modifies the value of the specified attribute.
 void setDefaults()
           
 
Methods inherited from class com.tinyline.svg.SVGNode
addChild, contains, getBounds, getCapStyle, getCurrentColor, getDashArray, getDashOffset, getDisplay, getFillColor, getFillOpacity, getFillRule, getFontFamily, getFontSize, getGlobalTransform, getJoinStyle, getLineThickness, getMiterLimit, getNodeById, getOpacity, getStopColor, getStopOpacity, getStrokeColor, getStrokeOpacity, getTextAnchor, getVisibility, intersects, isDisplay, isVisible, matchUserAgent, nodeHitAt, removeChild, resolveColor, seekAElem
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gcolor

public TinyColor gcolor
The gradient color.


gradientTransform

public TinyMatrix gradientTransform
The optional additional transformation from the gradient coordinate system onto the target coordinate system.


spreadMethod

public int spreadMethod
Indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.


gradientUnits

public int gradientUnits
Defines the coordinate system


xlink_href

public TinyString xlink_href
A URI reference to a different 'linearGradient' or 'radialGradient' element within the current SVG document fragment.

Constructor Detail

SVGGradientElem

public SVGGradientElem(SVGGradientElem src)
Constructs a copy of the given SVGGradientElem node.

Method Detail

setDefaults

public void setDefaults()

copyNode

public SVGNode copyNode()
Constructs a copy of the given node.

Specified by:
copyNode in class SVGNode

setAttribute

public int setAttribute(int hattr,
                        java.lang.Object value)
                 throws java.lang.Exception
Assigns or modifies the value of the specified attribute.

Overrides:
setAttribute in class SVGNode
Parameters:
hattr - The attribute handle.
value - The value of the attribute.
Returns:
The error code that could be one of the following: SVG.ERR_OK, SVG.ERR_NUMBER_FORMAT, SVG.ERR_INVALID_ARG, SVG.ERR_NOT_FOUND, SVG.ERR_NOT_SUPPORTED, SVG.ERR_HIERARCHY_REQUEST
Throws:
java.lang.Exception - if the value type doesn not match to the attribute handle.

getAttribute

public java.lang.Object getAttribute(int hattr)
Returns the value object for the given attribute, or null object otherwise.

Overrides:
getAttribute in class SVGNode
Parameters:
hattr - The attribute handle.
Returns:
The value of the attribute or null.

paint

public void paint(SVGRaster renderer)
Draws this node.

Specified by:
paint in class SVGNode
Parameters:
renderer - The SVGRaster object that does the drawing.

createOutline

public int createOutline()
Creates an outline of this node.

Specified by:
createOutline in class SVGNode

getDevBounds

public TinyRect getDevBounds(SVGRaster renderer)
Returns the device bounds of this SVGGradientElem node. as a union of device bounds of nodes which have 'fill' or 'stroke' attributes referred to this SVGGradientElem node.

Overrides:
getDevBounds in class SVGNode
Parameters:
renderer - The SVGRaster object.
Returns:
The device bounds of this SVGGradientElem node or null

COORDINATES ARE IN DEVICE SPACE.


TinyLine
v2.0

Provided under the terms of the TinyLine License Agreement that has been included with this distribution