java.lang.Object
io.sf.carte.echosvg.css.engine.value.AbstractValueFactory
io.sf.carte.echosvg.css.engine.value.AbstractValueManager
io.sf.carte.echosvg.css.engine.value.LengthManager
- All Implemented Interfaces:
ValueManager
- Direct Known Subclasses:
BaselineShiftManager
,EnableBackgroundManager
,FontSizeManager
,KerningManager
,LineHeightManager
,MarginLengthManager
,RectManager
,SpacingManager
,StrokeDasharrayManager
,StrokeDashoffsetManager
,StrokeWidthManager
This class provides a manager for the property with support for length
values.
Original author: Stephane Hillion. For later modifications, see Git history.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
static final float
The default line height.protected static final int
protected static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomputeValue
(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) createFloatValue
(short type, float floatValue) ImplementsValueManager.createFloatValue(short,float)
.createValue
(io.sf.carte.doc.style.css.nsac.LexicalUnit lu, CSSEngine engine) ImplementsValueManager.createValue(LexicalUnit,CSSEngine)
.protected abstract int
Indicates the orientation of the property associated with this manager.protected float
lineHeightValue
(CSSStylableElement elt, String pseudo, CSSEngine engine, Value v) Methods inherited from class io.sf.carte.echosvg.css.engine.value.AbstractValueManager
createCalc, createDOMException, createLexicalValue, createMathFunction, createStringValue, evaluateMath, lengthValue
Methods inherited from class io.sf.carte.echosvg.css.engine.value.AbstractValueFactory
createDOMException, createInvalidFloatTypeDOMException, createInvalidFloatValueDOMException, createInvalidIdentifierDOMException, createInvalidLexicalUnitDOMException, createInvalidStringTypeDOMException, createMalformedLexicalUnitDOMException, getPropertyName, resolveURI
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sf.carte.echosvg.css.engine.value.ValueManager
getDefaultValue, getPropertyName, getPropertyType, isAdditiveProperty, isAnimatableProperty, isInheritedProperty
-
Field Details
-
DEFAULT_LINE_HEIGHT
public static final float DEFAULT_LINE_HEIGHTThe default line height.In SVG 1.1 the line height is defined to be 1, and Batik uses that value in the SVG 1.1 implementation, but it uses 1.1 as the default value for the SVG 1.2 implementation. For accessibility reasons this projects adopts the latter, which implies that images rendered with the SVG 1.1 implementation of Batik may show a different line-height with respect to EchoSVG.
In SVG2 line-height is defined as in CSS2, but "It is not applicable to text on a path". Web browsers use a default based on the font family, close to 1.2
- See Also:
-
HORIZONTAL_ORIENTATION
protected static final int HORIZONTAL_ORIENTATION- See Also:
-
VERTICAL_ORIENTATION
protected static final int VERTICAL_ORIENTATION- See Also:
-
BOTH_ORIENTATION
protected static final int BOTH_ORIENTATION- See Also:
-
-
Constructor Details
-
LengthManager
public LengthManager()
-
-
Method Details
-
createValue
public Value createValue(io.sf.carte.doc.style.css.nsac.LexicalUnit lu, CSSEngine engine) throws DOMException ImplementsValueManager.createValue(LexicalUnit,CSSEngine)
.- Parameters:
lu
- The SAC lexical unit used to create the value.engine
- The calling CSSEngine.- Throws:
DOMException
-
createFloatValue
ImplementsValueManager.createFloatValue(short,float)
.- Specified by:
createFloatValue
in interfaceValueManager
- Overrides:
createFloatValue
in classAbstractValueManager
- Parameters:
type
- A unit code as defined above. The unit code can only be a float unit typefloatValue
- The new float value.- Throws:
DOMException
-
computeValue
public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) - Specified by:
computeValue
in interfaceValueManager
- Overrides:
computeValue
in classAbstractValueManager
- Parameters:
elt
- The owner of the value.pseudo
- The pseudo element.engine
- The CSSEngine.idx
- The property index in the engine.sm
- The computed style map.value
- The value to compute.
-
lineHeightValue
protected float lineHeightValue(CSSStylableElement elt, String pseudo, CSSEngine engine, Value v) throws DOMException - Throws:
DOMException
-
getOrientation
protected abstract int getOrientation()Indicates the orientation of the property associated with this manager.
-