- All Known Implementing Classes:
- AbstractSVGAnimatedLength.AnimSVGLength,- AbstractSVGAnimatedLength.BaseSVGLength,- AbstractSVGLength,- AbstractSVGLengthList.SVGLengthItem,- SVGOMLength
public interface SVGLength
Represents a value that can be a <length>, <percentage> or
 <number>.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final short
- 
Method SummaryModifier and TypeMethodDescriptionvoidconvertToSpecifiedUnits(short unitType) Converts this SVGLength's value to a specific unit.default shortGet the unit type according toCSSUnit.default shortThe type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined on this interface.floatgetValue()Gets the SVGLength's value in user units.Gets the SVGLength's value as a string.floatGets the numeric factor of the SVGLength's value.default voidnewValueSpecifiedCSSUnits(short cssUnitType, float valueInSpecifiedUnits) Sets the SVGLength's value in a typed manner.voidnewValueSpecifiedUnits(short unitType, float valueInSpecifiedUnits) Sets the SVGLength's value in a typed manner.voidsetValue(float value) Sets the SVGLength's value in user units.voidsetValueAsString(String valueAsString) Sets the SVGLength's value as a string.voidsetValueInSpecifiedUnits(float valueInSpecifiedUnits) Sets the numeric factor of the SVGLength's value.
- 
Field Details- 
SVG_LENGTHTYPE_UNKNOWNstatic final short SVG_LENGTHTYPE_UNKNOWN- See Also:
 
- 
SVG_LENGTHTYPE_NUMBERstatic final short SVG_LENGTHTYPE_NUMBER- See Also:
 
- 
SVG_LENGTHTYPE_PERCENTAGEstatic final short SVG_LENGTHTYPE_PERCENTAGE- See Also:
 
- 
SVG_LENGTHTYPE_EMSstatic final short SVG_LENGTHTYPE_EMS- See Also:
 
- 
SVG_LENGTHTYPE_EXSstatic final short SVG_LENGTHTYPE_EXS- See Also:
 
- 
SVG_LENGTHTYPE_PXstatic final short SVG_LENGTHTYPE_PX- See Also:
 
- 
SVG_LENGTHTYPE_CMstatic final short SVG_LENGTHTYPE_CM- See Also:
 
- 
SVG_LENGTHTYPE_MMstatic final short SVG_LENGTHTYPE_MM- See Also:
 
- 
SVG_LENGTHTYPE_INstatic final short SVG_LENGTHTYPE_IN- See Also:
 
- 
SVG_LENGTHTYPE_PTstatic final short SVG_LENGTHTYPE_PT- See Also:
 
- 
SVG_LENGTHTYPE_PCstatic final short SVG_LENGTHTYPE_PC- See Also:
 
 
- 
- 
Method Details- 
getCSSUnitTypedefault short getCSSUnitType()Get the unit type according toCSSUnit.Optional attribute. - Returns:
- the CSS unit type.
 
- 
getUnitTypedefault short getUnitType()The type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined on this interface.- Returns:
- the SVG unit type.
 
- 
getValuefloat getValue()Gets the SVGLength's value in user units.- Returns:
- the value in user units.
 
- 
setValueSets the SVGLength's value in user units.- Parameters:
- value- the value in user units.
- Throws:
- DOMException- NO_MODIFICATION_ALLOWED_ERR if the object is read-only.
 
- 
getValueInSpecifiedUnitsfloat getValueInSpecifiedUnits()Gets the numeric factor of the SVGLength's value.- Returns:
- the numeric value in the current unit.
 
- 
setValueInSpecifiedUnitsSets the numeric factor of the SVGLength's value.- Parameters:
- valueInSpecifiedUnits- the value in the current unit.
- Throws:
- DOMException- NO_MODIFICATION_ALLOWED_ERR if the object is read-only.
 
- 
getValueAsStringString getValueAsString()Gets the SVGLength's value as a string.- Returns:
- the value as a string.
 
- 
setValueAsStringSets the SVGLength's value as a string.- Parameters:
- valueAsString- the length value as a string.
- Throws:
- DOMException- SYNTAX_ERR if the value is not a valid length. NO_MODIFICATION_ALLOWED_ERR if the object is read-only.
 
- 
newValueSpecifiedCSSUnitsdefault void newValueSpecifiedCSSUnits(short cssUnitType, float valueInSpecifiedUnits) throws DOMException Sets the SVGLength's value in a typed manner.- Parameters:
- cssUnitType- the unit type according to- CSSUnit.
- valueInSpecifiedUnits- the value in the given unit.
- Throws:
- DOMException- NOT_SUPPORTED_ERR if the unit is not supported or invalid. NO_MODIFICATION_ALLOWED_ERR if the object is read-only.
 
- 
newValueSpecifiedUnitsSets the SVGLength's value in a typed manner.- Parameters:
- unitType- the unit type according to the- SVGLengthconstants.
- valueInSpecifiedUnits- the value in the given unit.
- Throws:
- DOMException- NOT_SUPPORTED_ERR if the unit is not supported or invalid. NO_MODIFICATION_ALLOWED_ERR if the object is read-only.
 
- 
convertToSpecifiedUnitsConverts this SVGLength's value to a specific unit.- Parameters:
- unitType- the unit type according to the- SVGLengthconstants.
- Throws:
- DOMException- NOT_SUPPORTED_ERR if the unit is not supported or invalid. NO_MODIFICATION_ALLOWED_ERR if the object is read-only.
 
 
-