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 floatThe specified length value, as a float; pulled from the CSS textprivate shortThe specified primitive SAC data type given for this length, from the CSS textprivate CalculatedStyleprivate static final floatprivate static final intprivate static final floatprivate static final float -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatasFloat()static floatcalcFloatProportionalValue(CalculatedStyle style, CSSName cssName, String stringValue, float relVal, short primitiveType, float baseValue, CssContext ctx) floatgetFloatProportionalTo(CSSName cssName, float baseValue, CssContext ctx) Computes a relative unit (e.g.shortprivate CalculatedStylegetStyle()booleanbooleanMethods 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:
asFloatin interfaceFSDerivedValue- Overrides:
asFloatin 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:
getFloatProportionalToin interfaceFSDerivedValue- Overrides:
getFloatProportionalToin classDerivedValue- Parameters:
cssName- Name of the propertybaseValue-ctx-- Returns:
- the absolute value or computed absolute value
-
hasAbsoluteUnit
public boolean hasAbsoluteUnit()- Specified by:
hasAbsoluteUnitin interfaceFSDerivedValue- Overrides:
hasAbsoluteUnitin classDerivedValue
-
isDependentOnFontSize
public boolean isDependentOnFontSize()- Specified by:
isDependentOnFontSizein interfaceFSDerivedValue- Overrides:
isDependentOnFontSizein classDerivedValue
-
calcFloatProportionalValue
public static float calcFloatProportionalValue(CalculatedStyle style, CSSName cssName, String stringValue, float relVal, short primitiveType, float baseValue, CssContext ctx) -
getStyle
-