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 classFSLinearGradient.IntermediateStopPointA stop point which does not yet have a length.static classFSLinearGradient.StopPoint
-
Field Summary
Fields Modifier and Type Field Description private float_angleprivate java.util.List<FSLinearGradient.StopPoint>_stopPointsprivate intx1private intx2private inty1private inty2
-
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 floatcalculateAngle(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 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(java.util.List<FSLinearGradient.IntermediateStopPoint> points, int startIndex)private intgetPrevStopPointWithLengthIndex(java.util.List<FSLinearGradient.IntermediateStopPoint> points, int maxIndex)java.util.List<FSLinearGradient.StopPoint>getStopPoints()private intgetStopsStartIndex(java.util.List<PropertyValue> params)intgetX1()intgetX2()intgetY1()intgetY2()private booleanisLengthOrPercentage(PropertyValue value)private booleanisStopPointWithLength(FSLinearGradient.IntermediateStopPoint pt)java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-