Class FSLinearGradient
java.lang.Object
com.openhtmltopdf.css.style.derived.FSLinearGradient
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classA stop point which does not yet have a length.static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatprivate final List<FSLinearGradient.StopPoint> private intprivate intprivate intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionFSLinearGradient(CalculatedStyle style, FSFunction function, int boxWidth, int boxHeight, CssContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionprivate floatcalculateAngle(List<PropertyValue> params, int stopsStartIndex) Calculates the angle of the linear gradient in degrees.private List<FSLinearGradient.StopPoint> calculateStopPoints(List<PropertyValue> params, CalculatedStyle style, CssContext ctx, float boxWidth, int stopsStartIndex) private floatdeg2rad(float deg) private voidendPointsFromAngle(float angleDeg, int w, int h) private floatget100PercentDefaultStopLength(CalculatedStyle style, CssContext ctx, float boxWidth) floatgetAngle()The angle of this linear gradient in compass degrees.private intgetNextStopPointWithLengthIndex(List<FSLinearGradient.IntermediateStopPoint> points, int startIndex) private intgetPrevStopPointWithLengthIndex(List<FSLinearGradient.IntermediateStopPoint> points, int maxIndex) private intgetStopsStartIndex(List<PropertyValue> params) intgetX1()intgetX2()intgetY1()intgetY2()private booleanprivate booleantoString()
-
Field Details
-
_stopPoints
-
_angle
private final float _angle -
x1
private int x1 -
x2
private int x2 -
y1
private int y1 -
y2
private int y2
-
-
Constructor Details
-
FSLinearGradient
public FSLinearGradient(CalculatedStyle style, FSFunction function, int boxWidth, int boxHeight, CssContext ctx)
-
-
Method Details
-
deg2rad
private float deg2rad(float deg) -
endPointsFromAngle
private void endPointsFromAngle(float angleDeg, int w, int h) -
isLengthOrPercentage
-
calculateStopPoints
private List<FSLinearGradient.StopPoint> calculateStopPoints(List<PropertyValue> params, CalculatedStyle style, CssContext ctx, float boxWidth, int stopsStartIndex) -
getPrevStopPointWithLengthIndex
private int getPrevStopPointWithLengthIndex(List<FSLinearGradient.IntermediateStopPoint> points, int maxIndex) -
get100PercentDefaultStopLength
-
isStopPointWithLength
-
getNextStopPointWithLengthIndex
private int getNextStopPointWithLengthIndex(List<FSLinearGradient.IntermediateStopPoint> points, int startIndex) -
getStopsStartIndex
-
calculateAngle
Calculates the angle of the linear gradient in degrees. -
getStopPoints
-
getAngle
public float getAngle()The angle of this linear gradient in compass degrees. -
getX1
public int getX1() -
getX2
public int getX2() -
getY1
public int getY1() -
getY2
public int getY2() -
toString
-