Class FSLinearGradient
- java.lang.Object
-
- com.openhtmltopdf.css.style.derived.FSLinearGradient
-
public class FSLinearGradient extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
FSLinearGradient.IntermediateStopPoint
A stop point which does not yet have a length.static class
FSLinearGradient.StopPoint
-
Field Summary
Fields Modifier and Type Field Description private float
_angle
private java.util.List<FSLinearGradient.StopPoint>
_stopPoints
private int
x1
private int
x2
private int
y1
private int
y2
-
Constructor Summary
Constructors Constructor Description FSLinearGradient(CalculatedStyle style, FSFunction function, int boxWidth, int boxHeight, CssContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private float
calculateAngle(java.util.List<PropertyValue> params, int stopsStartIndex)
Calculates the angle of the linear gradient in degrees.private java.util.List<FSLinearGradient.StopPoint>
calculateStopPoints(java.util.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(java.util.List<FSLinearGradient.IntermediateStopPoint> points, int startIndex)
private int
getPrevStopPointWithLengthIndex(java.util.List<FSLinearGradient.IntermediateStopPoint> points, int maxIndex)
java.util.List<FSLinearGradient.StopPoint>
getStopPoints()
private int
getStopsStartIndex(java.util.List<PropertyValue> params)
int
getX1()
int
getX2()
int
getY1()
int
getY2()
private boolean
isLengthOrPercentage(PropertyValue value)
private boolean
isStopPointWithLength(FSLinearGradient.IntermediateStopPoint pt)
java.lang.String
toString()
-
-
-
Field Detail
-
_stopPoints
private final java.util.List<FSLinearGradient.StopPoint> _stopPoints
-
_angle
private final float _angle
-
x1
private int x1
-
x2
private int x2
-
y1
private int y1
-
y2
private int y2
-
-
Constructor Detail
-
FSLinearGradient
public FSLinearGradient(CalculatedStyle style, FSFunction function, int boxWidth, int boxHeight, CssContext ctx)
-
-
Method Detail
-
deg2rad
private float deg2rad(float deg)
-
endPointsFromAngle
private void endPointsFromAngle(float angleDeg, int w, int h)
-
isLengthOrPercentage
private boolean isLengthOrPercentage(PropertyValue value)
-
calculateStopPoints
private java.util.List<FSLinearGradient.StopPoint> calculateStopPoints(java.util.List<PropertyValue> params, CalculatedStyle style, CssContext ctx, float boxWidth, int stopsStartIndex)
-
getPrevStopPointWithLengthIndex
private int getPrevStopPointWithLengthIndex(java.util.List<FSLinearGradient.IntermediateStopPoint> points, int maxIndex)
-
get100PercentDefaultStopLength
private float get100PercentDefaultStopLength(CalculatedStyle style, CssContext ctx, float boxWidth)
-
isStopPointWithLength
private boolean isStopPointWithLength(FSLinearGradient.IntermediateStopPoint pt)
-
getNextStopPointWithLengthIndex
private int getNextStopPointWithLengthIndex(java.util.List<FSLinearGradient.IntermediateStopPoint> points, int startIndex)
-
getStopsStartIndex
private int getStopsStartIndex(java.util.List<PropertyValue> params)
-
calculateAngle
private float calculateAngle(java.util.List<PropertyValue> params, int stopsStartIndex)
Calculates the angle of the linear gradient in degrees.
-
getStopPoints
public java.util.List<FSLinearGradient.StopPoint> 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-