Top Inners Fields Constructors Methods
com.openhtmltopdf.css.style.derived

public Class FSLinearGradient

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, .Objects, com.openhtmltopdf.css.constants.CSSName, .Idents, com.openhtmltopdf.css.parser.CSSPrimitiveValue, .FSColor, .FSFunction, .PropertyValue, com.openhtmltopdf.css.parser.property.AbstractPropertyBuilder, .Conversions, com.openhtmltopdf.css.style.CalculatedStyle, .CssContext

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
FSLinearGradient.IntermediateStopPoint

A stop point which does not yet have a length.

public static class

Field Summary

Modifier and TypeField and Description
private final float
private final List<FSLinearGradient.StopPoint>
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
FSLinearGradient(CalculatedStyle style, FSFunction function, int boxWidth, int boxHeight, CssContext ctx)

Method Summary

Modifier and TypeMethod and Description
private 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(final float deg)

private void
endPointsFromAngle(float angleDeg, final int w, final int h)

private float
public float
getAngle()

The angle of this linear gradient in compass degrees.

private int
private int
public List<FSLinearGradient.StopPoint>
private int
public int
public int
public int
public int
private boolean
private boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_angleback to summary
private final float _angle
_stopPointsback to summary
private final List<FSLinearGradient.StopPoint> _stopPoints
x1back to summary
private int x1
x2back to summary
private int x2
y1back to summary
private int y1
y2back to summary
private int y2

Constructor Detail

FSLinearGradientback to summary
public FSLinearGradient(CalculatedStyle style, FSFunction function, int boxWidth, int boxHeight, CssContext ctx)

Method Detail

calculateAngleback to summary
private float calculateAngle(List<PropertyValue> params, int stopsStartIndex)

Calculates the angle of the linear gradient in degrees.

calculateStopPointsback to summary
private List<FSLinearGradient.StopPoint> calculateStopPoints(List<PropertyValue> params, CalculatedStyle style, CssContext ctx, float boxWidth, int stopsStartIndex)
deg2radback to summary
private float deg2rad(final float deg)
endPointsFromAngleback to summary
private void endPointsFromAngle(float angleDeg, final int w, final int h)
get100PercentDefaultStopLengthback to summary
private float get100PercentDefaultStopLength(CalculatedStyle style, CssContext ctx, float boxWidth)
getAngleback to summary
public float getAngle()

The angle of this linear gradient in compass degrees.

getNextStopPointWithLengthIndexback to summary
private int getNextStopPointWithLengthIndex(List<FSLinearGradient.IntermediateStopPoint> points, int startIndex)
getPrevStopPointWithLengthIndexback to summary
private int getPrevStopPointWithLengthIndex(List<FSLinearGradient.IntermediateStopPoint> points, int maxIndex)
getStopPointsback to summary
public List<FSLinearGradient.StopPoint> getStopPoints()
getStopsStartIndexback to summary
private int getStopsStartIndex(List<PropertyValue> params)
getX1back to summary
public int getX1()
getX2back to summary
public int getX2()
getY1back to summary
public int getY1()
getY2back to summary
public int getY2()
isLengthOrPercentageback to summary
private boolean isLengthOrPercentage(PropertyValue value)
isStopPointWithLengthback to summary
private boolean isStopPointWithLength(FSLinearGradient.IntermediateStopPoint pt)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
com.openhtmltopdf.css.style.derived back to summary

private Class FSLinearGradient.IntermediateStopPoint

extends Object
Class Inheritance
  • java.lang.Object
  • com.openhtmltopdf.css.style.derived.FSLinearGradient.IntermediateStopPoint
Known Direct Subclasses
com.openhtmltopdf.css.style.derived.FSLinearGradient.StopPoint

A stop point which does not yet have a length. We need all the stop points first before we can calculate a length for intermediate stop points without a length.

Field Summary

Modifier and TypeField and Description
private final FSColor

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public FSColor
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_colorback to summary
private final FSColor _color

Constructor Detail

IntermediateStopPointback to summary
pack-priv IntermediateStopPoint(FSColor color)

Method Detail

getColorback to summary
public FSColor getColor()
com.openhtmltopdf.css.style.derived back to summary

public Class FSLinearGradient.StopPoint

extends IntermediateStopPoint
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final float

Constructor Summary

AccessConstructor and Description
pack-priv
StopPoint(FSColor color, float length)

Method Summary

Modifier and TypeMethod and Description
public float
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from com.openhtmltopdf.css.style.derived.FSLinearGradient.IntermediateStopPoint:
getColor

Field Detail

_lengthback to summary
private final float _length

Constructor Detail

StopPointback to summary
pack-priv StopPoint(FSColor color, float length)

Method Detail

getLengthback to summary
public float getLength()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override