Package com.itextpdf.svg.renderers.impl
Class AbstractGradientSvgNodeRenderer
java.lang.Object
com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
com.itextpdf.svg.renderers.impl.AbstractBranchSvgNodeRenderer
com.itextpdf.svg.renderers.impl.AbstractGradientSvgNodeRenderer
- All Implemented Interfaces:
-
IBranchSvgNodeRenderer,INoDrawSvgNodeRenderer,ISvgNodeRenderer,ISvgPaintServer
- Direct Known Subclasses:
-
LinearGradientSvgNodeRenderer,RadialGradientSvgNodeRenderer
public abstract class AbstractGradientSvgNodeRenderer extends AbstractBranchSvgNodeRenderer implements ISvgPaintServer
ISvgNodeRenderer abstract implementation for gradient tags (-
Field Summary
FieldsFields inherited from class com.itextpdf.svg.renderers.impl.AbstractBranchSvgNodeRenderer
VIEWBOX_VALUES_NUMBERFields inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
attributesAndStyles -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateColor(SvgDrawContext context, Rectangle objectBoundingBox, float objectBoundingBoxMargin, float parentOpacity) Creates theColorthat represents the corresponding paint server for specified object box.protected IGradientBuildercreateGradientBuilderAndConfigureGeometry(SvgDrawContext context, Rectangle objectBoundingBox) Deprecated.deprecated in failure of making abstractprotected voiddoDraw(SvgDrawContext context) Gradient node renderers are not directly drawable.protected List<StopSvgNodeRenderer>Deprecated.will become privateprotected AffineTransformDeprecated.will become privateprotected AffineTransformgetGradientTransformToUserSpaceOnUse(Rectangle objectBoundingBox, boolean isObjectBoundingBox) Creates a transformation from the gradient coordinate space to user space.protected booleanisHidden()Check if this renderer should draw the element based on its attributes (e.g.protected booleanChecks whether the gradient units values are on user space on use or object bounding boxprotected GradientSpreadMethodDeprecated.will become privateMethods inherited from class com.itextpdf.svg.renderers.impl.AbstractBranchSvgNodeRenderer
addChild, createDeepCopy, deepCopyChildren, getChildrenMethods inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
canConstructViewPort, canElementFill, deepCopyAttributesAndStyles, draw, getAttribute, getAttributeMapCopy, getAttributeOrDefault, getCurrentFontSize, getCurrentFontSize, getCurrentViewBox, getParent, parseAbsoluteLength, parseHorizontalLength, parseVerticalLength, setAttribute, setAttributesAndStyles, setParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.itextpdf.svg.renderers.IBranchSvgNodeRenderer
addChild, getChildrenMethods inherited from interface com.itextpdf.svg.renderers.ISvgNodeRenderer
createDeepCopy, draw, getAttribute, getAttributeMapCopy, getObjectBoundingBox, getParent, setAttribute, setAttributesAndStyles, setParent
-
Field Details
-
CONVERT_COEFF
protected static final double CONVERT_COEFF- See Also:
-
-
Constructor Details
-
AbstractGradientSvgNodeRenderer
public AbstractGradientSvgNodeRenderer()
-
-
Method Details
-
doDraw
Gradient node renderers are not directly drawable.- Overrides:
-
doDrawin classAbstractBranchSvgNodeRenderer - Parameters:
-
context- the object that knows the place to draw this element and maintains its state - Throws:
-
UnsupportedOperationException- always, because gradient definitions cannot be drawn as nodes
-
createColor
public Color createColor(SvgDrawContext context, Rectangle objectBoundingBox, float objectBoundingBoxMargin, float parentOpacity) Creates theColorthat represents the corresponding paint server for specified object box.- Specified by:
-
createColorin interfaceISvgPaintServer - Parameters:
-
context- the current svg draw context -
objectBoundingBox- the coloring object bounding box without any adjustments (additional stroke width or others) -
objectBoundingBoxMargin- the objectBoundingBoxMargin of the object bounding box to be colored (for example - the part of stroke width that exceeds the object bounding box, i.e. the half of stroke width value) -
parentOpacity- current parent opacity modifier - Returns:
- the created color
-
createGradientBuilderAndConfigureGeometry
@Deprecated protected IGradientBuilder createGradientBuilderAndConfigureGeometry(SvgDrawContext context, Rectangle objectBoundingBox) Deprecated.deprecated in failure of making abstractCreates and configures gradient builder specific to concrete gradient type.- Parameters:
-
context- the current svg draw context -
objectBoundingBox- target element bounding box - Returns:
- the configured builder instance for this renderer type
-
isHidden
protected boolean isHidden()Check if this renderer should draw the element based on its attributes (e.g. visibility/display)- Overrides:
-
isHiddenin classAbstractSvgNodeRenderer - Returns:
- true if element won't be drawn, false otherwise
-
isObjectBoundingBoxUnits
protected boolean isObjectBoundingBoxUnits()Checks whether the gradient units values are on user space on use or object bounding box- Returns:
-
falseif the 'gradientUnits' value of the gradient tag equals to 'userSpaceOnUse', otherwisetrue
-
getGradientTransform
Deprecated.will become privateEvaluates the 'gradientTransform' transformations- Returns:
-
an
AffineTransformobject representing the specified gradient transformation
-
getGradientTransformToUserSpaceOnUse
protected AffineTransform getGradientTransformToUserSpaceOnUse(Rectangle objectBoundingBox, boolean isObjectBoundingBox) Creates a transformation from the gradient coordinate space to user space.- Parameters:
-
objectBoundingBox- target element bounding box -
isObjectBoundingBox- whether gradient units are object-bounding-box based - Returns:
-
a composed
AffineTransformto use for gradient rendering
-
getChildStopRenderers
Deprecated.will become privateConstruct a list of child stop renderers- Returns:
-
a list of
StopSvgNodeRendererelements that represents the child stop values
-
parseSpreadMethod
Deprecated.will become privateParses the gradient spread method- Returns:
-
the parsed
GradientSpreadMethodspecified in the gradient
-