Package org.openpdf.css.style.derived
Class LengthValue
java.lang.Object
org.openpdf.css.style.DerivedValue
org.openpdf.css.style.derived.LengthValue
- All Implemented Interfaces:
FSDerivedValue
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe specified length value, as a float; pulled from the CSS textprivate final shortThe specified primitive SAC data type given for this length, from the CSS textprivate final 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.private CalculatedStylegetStyle()booleanbooleanMethods inherited from class org.openpdf.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 final float _lengthAsFloatThe specified length value, as a float; pulled from the CSS text -
_style
-
_lengthPrimitiveType
private final short _lengthPrimitiveTypeThe specified primitive SAC data type given for this length, from the CSS text
-
-
Constructor Details
-
LengthValue
-
-
Method Details
-
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 property- 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
-