Class LengthValue
java.lang.Object
com.openhtmltopdf.css.style.DerivedValue
com.openhtmltopdf.css.style.derived.LengthValue
- All Implemented Interfaces:
FSDerivedValue
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float
The specified length value, as a float; pulled from the CSS textprivate short
The specified primitive SAC data type given for this length, from the CSS textprivate CalculatedStyle
private static final float
private static final int
private static final float
private static final float
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
asFloat()
static float
calcFloatProportionalValue
(CalculatedStyle style, CSSName cssName, String stringValue, float relVal, short primitiveType, float baseValue, CssContext ctx) float
getFloatProportionalTo
(CSSName cssName, float baseValue, CssContext ctx) Computes a relative unit (e.g.short
private CalculatedStyle
getStyle()
boolean
boolean
Methods inherited from class com.openhtmltopdf.css.style.DerivedValue
asColor, asIdentValue, asString, asStringArray, getCssSacUnitType, getStringValue, isAbsoluteUnit, isDeclaredInherit, isIdent
-
Field Details
-
MM__PER__CM
private static final int MM__PER__CM- See Also:
-
CM__PER__IN
private static final float CM__PER__IN- See Also:
-
PT__PER__IN
private static final float PT__PER__IN- See Also:
-
PC__PER__PT
private static final float PC__PER__PT- See Also:
-
_lengthAsFloat
private float _lengthAsFloatThe specified length value, as a float; pulled from the CSS text -
_style
-
_lengthPrimitiveType
private short _lengthPrimitiveTypeThe specified primitive SAC data type given for this length, from the CSS text
-
-
Constructor Details
-
LengthValue
-
-
Method Details
-
getLengthPrimitiveType
public short getLengthPrimitiveType() -
asFloat
public float asFloat()- Specified by:
asFloat
in interfaceFSDerivedValue
- Overrides:
asFloat
in classDerivedValue
-
getFloatProportionalTo
Computes a relative unit (e.g. percentage) as an absolute value, using the input value. Used for such properties whose parent value cannot be known before layout/render- Specified by:
getFloatProportionalTo
in interfaceFSDerivedValue
- Overrides:
getFloatProportionalTo
in classDerivedValue
- Parameters:
cssName
- Name of the propertybaseValue
-ctx
-- Returns:
- the absolute value or computed absolute value
-
hasAbsoluteUnit
public boolean hasAbsoluteUnit()- Specified by:
hasAbsoluteUnit
in interfaceFSDerivedValue
- Overrides:
hasAbsoluteUnit
in classDerivedValue
-
isDependentOnFontSize
public boolean isDependentOnFontSize()- Specified by:
isDependentOnFontSize
in interfaceFSDerivedValue
- Overrides:
isDependentOnFontSize
in classDerivedValue
-
calcFloatProportionalValue
public static float calcFloatProportionalValue(CalculatedStyle style, CSSName cssName, String stringValue, float relVal, short primitiveType, float baseValue, CssContext ctx) -
getStyle
-