Class LengthValue
- java.lang.Object
-
- com.openhtmltopdf.css.style.DerivedValue
-
- com.openhtmltopdf.css.style.derived.LengthValue
-
- All Implemented Interfaces:
FSDerivedValue
public class LengthValue extends DerivedValue
-
-
Field Summary
Fields Modifier and Type Field Description private float_lengthAsFloatThe specified length value, as a float; pulled from the CSS textprivate short_lengthPrimitiveTypeThe specified primitive SAC data type given for this length, from the CSS textprivate CalculatedStyle_styleprivate static floatCM__PER__INprivate static intMM__PER__CMprivate static floatPC__PER__PTprivate static floatPT__PER__IN
-
Constructor Summary
Constructors Constructor Description LengthValue(CalculatedStyle style, CSSName name, PropertyValue value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description floatasFloat()static floatcalcFloatProportionalValue(CalculatedStyle style, CSSName cssName, java.lang.String stringValue, float relVal, short primitiveType, float baseValue, CssContext ctx)floatgetFloatProportionalTo(CSSName cssName, float baseValue, CssContext ctx)Computes a relative unit (e.g.shortgetLengthPrimitiveType()private CalculatedStylegetStyle()booleanhasAbsoluteUnit()booleanisDependentOnFontSize()-
Methods inherited from class com.openhtmltopdf.css.style.DerivedValue
asColor, asIdentValue, asString, asStringArray, getCssSacUnitType, getStringValue, isAbsoluteUnit, isDeclaredInherit, isIdent
-
-
-
-
Field Detail
-
MM__PER__CM
private static final int MM__PER__CM
- See Also:
- Constant Field Values
-
CM__PER__IN
private static final float CM__PER__IN
- See Also:
- Constant Field Values
-
PT__PER__IN
private static final float PT__PER__IN
- See Also:
- Constant Field Values
-
PC__PER__PT
private static final float PC__PER__PT
- See Also:
- Constant Field Values
-
_lengthAsFloat
private float _lengthAsFloat
The specified length value, as a float; pulled from the CSS text
-
_style
private CalculatedStyle _style
-
_lengthPrimitiveType
private short _lengthPrimitiveType
The specified primitive SAC data type given for this length, from the CSS text
-
-
Constructor Detail
-
LengthValue
public LengthValue(CalculatedStyle style, CSSName name, PropertyValue value)
-
-
Method Detail
-
getLengthPrimitiveType
public short getLengthPrimitiveType()
-
asFloat
public float asFloat()
- Specified by:
asFloatin interfaceFSDerivedValue- Overrides:
asFloatin classDerivedValue
-
getFloatProportionalTo
public float getFloatProportionalTo(CSSName cssName, float baseValue, CssContext ctx)
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, java.lang.String stringValue, float relVal, short primitiveType, float baseValue, CssContext ctx)
-
getStyle
private CalculatedStyle getStyle()
-
-