Top Constructors Methods
com.openhtmltopdf.pdfboxout

public Class GradientHelper

extends Object
Class Inheritance
Imports
java.util.List, java.awt.geom.*, java.awt.Rectangle, .Shape, com.openhtmltopdf.css.parser.FSRGBColor, com.openhtmltopdf.css.style.derived.FSLinearGradient, .FSLinearGradient.StopPoint, org.apache.pdfbox.cos.COSArray, .COSBoolean, .COSDictionary, .COSFloat, .COSName, org.apache.pdfbox.pdmodel.common.function.PDFunctionType3, org.apache.pdfbox.pdmodel.graphics.color.PDColor, .PDDeviceRGB, org.apache.pdfbox.pdmodel.graphics.shading.PDShading, .PDShadingType2

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static COSArray

Returns:

the COSArray, which is an important parameter for setting linear gradient.
buildType2Functions
(List<FSLinearGradient.StopPoint>
colours to use.
stopPoints
,
COSArray
parameter for setting functiontype2
domain
,
COSArray
encoding COSArray
encode
)

This method is used for setting colours to linear gradient.

private static PDFunctionType3

Returns:

the function, which is an important parameter for setting linear gradient.
buildType3Function
(List<FSLinearGradient.StopPoint>
colours and lengths of linear gradient.
stopPoints
,
float distance)

This method is used for setting colour lengths to linear gradient.

public static PDShading

Returns:

shading for rendering linear gradient in PDF
createLinearGradient
(PdfBoxFastOutputDevice od, AffineTransform transform, FSLinearGradient gradient, Shape bounds)

This method is used for creating linear gradient with its components.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

GradientHelperback to summary
public GradientHelper()

Method Detail

buildType2Functionsback to summary
private static COSArray buildType2Functions(List<FSLinearGradient.StopPoint> stopPoints, COSArray domain, COSArray encode)

This method is used for setting colours to linear gradient.

Parameters
stopPoints:List<FSLinearGradient.StopPoint>

colours to use.

domain:COSArray

parameter for setting functiontype2

encode:COSArray

encoding COSArray

Returns:COSArray

the COSArray, which is an important parameter for setting linear gradient.

buildType3Functionback to summary
private static PDFunctionType3 buildType3Function(List<FSLinearGradient.StopPoint> stopPoints, float distance)

This method is used for setting colour lengths to linear gradient.

Parameters
stopPoints:List<FSLinearGradient.StopPoint>

colours and lengths of linear gradient.

Returns:PDFunctionType3

the function, which is an important parameter for setting linear gradient.

createLinearGradientback to summary
public static PDShading createLinearGradient(PdfBoxFastOutputDevice od, AffineTransform transform, FSLinearGradient gradient, Shape bounds)

This method is used for creating linear gradient with its components.

Returns:PDShading

shading for rendering linear gradient in PDF