- 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 Summary
FieldsModifier 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 Summary
Modifier 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_UNKNOWN
static final short SVG_LENGTHTYPE_UNKNOWN- See Also:
-
SVG_LENGTHTYPE_NUMBER
static final short SVG_LENGTHTYPE_NUMBER- See Also:
-
SVG_LENGTHTYPE_PERCENTAGE
static final short SVG_LENGTHTYPE_PERCENTAGE- See Also:
-
SVG_LENGTHTYPE_EMS
static final short SVG_LENGTHTYPE_EMS- See Also:
-
SVG_LENGTHTYPE_EXS
static final short SVG_LENGTHTYPE_EXS- See Also:
-
SVG_LENGTHTYPE_PX
static final short SVG_LENGTHTYPE_PX- See Also:
-
SVG_LENGTHTYPE_CM
static final short SVG_LENGTHTYPE_CM- See Also:
-
SVG_LENGTHTYPE_MM
static final short SVG_LENGTHTYPE_MM- See Also:
-
SVG_LENGTHTYPE_IN
static final short SVG_LENGTHTYPE_IN- See Also:
-
SVG_LENGTHTYPE_PT
static final short SVG_LENGTHTYPE_PT- See Also:
-
SVG_LENGTHTYPE_PC
static final short SVG_LENGTHTYPE_PC- See Also:
-
-
Method Details
-
getCSSUnitType
default short getCSSUnitType()Get the unit type according toCSSUnit.Optional attribute.
- Returns:
- the CSS unit type.
-
getUnitType
default 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.
-
getValue
float getValue()Gets the SVGLength's value in user units.- Returns:
- the value in user units.
-
setValue
Sets 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.
-
getValueInSpecifiedUnits
float getValueInSpecifiedUnits()Gets the numeric factor of the SVGLength's value.- Returns:
- the numeric value in the current unit.
-
setValueInSpecifiedUnits
Sets 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.
-
getValueAsString
String getValueAsString()Gets the SVGLength's value as a string.- Returns:
- the value as a string.
-
setValueAsString
Sets 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.
-
newValueSpecifiedCSSUnits
default void newValueSpecifiedCSSUnits(short cssUnitType, float valueInSpecifiedUnits) throws DOMException Sets the SVGLength's value in a typed manner.- Parameters:
cssUnitType- the unit type according toCSSUnit.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.
-
newValueSpecifiedUnits
Sets the SVGLength's value in a typed manner.- Parameters:
unitType- the unit type according to theSVGLengthconstants.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.
-
convertToSpecifiedUnits
Converts this SVGLength's value to a specific unit.- Parameters:
unitType- the unit type according to theSVGLengthconstants.- Throws:
DOMException- NOT_SUPPORTED_ERR if the unit is not supported or invalid. NO_MODIFICATION_ALLOWED_ERR if the object is read-only.
-