Class FSLinearGradient
java.lang.Object
com.openhtmltopdf.css.style.derived.FSLinearGradient
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
A stop point which does not yet have a length.static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final float
private final List
<FSLinearGradient.StopPoint> private int
private int
private int
private int
-
Constructor Summary
ConstructorsConstructorDescriptionFSLinearGradient
(CalculatedStyle style, FSFunction function, int boxWidth, int boxHeight, CssContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionprivate float
calculateAngle
(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 float
deg2rad
(float deg) private void
endPointsFromAngle
(float angleDeg, int w, int h) private float
get100PercentDefaultStopLength
(CalculatedStyle style, CssContext ctx, float boxWidth) float
getAngle()
The angle of this linear gradient in compass degrees.private int
getNextStopPointWithLengthIndex
(List<FSLinearGradient.IntermediateStopPoint> points, int startIndex) private int
getPrevStopPointWithLengthIndex
(List<FSLinearGradient.IntermediateStopPoint> points, int maxIndex) private int
getStopsStartIndex
(List<PropertyValue> params) int
getX1()
int
getX2()
int
getY1()
int
getY2()
private boolean
private boolean
toString()
-
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
-