public class JsSVGLength extends JsElementalMixinBase implements SVGLength
SVG_LENGTHTYPE_CM, SVG_LENGTHTYPE_EMS, SVG_LENGTHTYPE_EXS, SVG_LENGTHTYPE_IN, SVG_LENGTHTYPE_MM, SVG_LENGTHTYPE_NUMBER, SVG_LENGTHTYPE_PC, SVG_LENGTHTYPE_PERCENTAGE, SVG_LENGTHTYPE_PT, SVG_LENGTHTYPE_PX, SVG_LENGTHTYPE_UNKNOWN
SVG_ZOOMANDPAN_DISABLE, SVG_ZOOMANDPAN_MAGNIFY, SVG_ZOOMANDPAN_UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
JsSVGLength() |
Modifier and Type | Method and Description |
---|---|
void |
convertToSpecifiedUnits(int unitType)
Preserve the same underlying stored value, but reset the stored unit identifier to the given
unitType . |
int |
getUnitType()
The type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined on this interface.
|
float |
getValue()
The value as a floating point value, in user units.
|
String |
getValueAsString()
The value as a string value, in the units expressed by
unitType . |
float |
getValueInSpecifiedUnits()
The value as a floating point value, in the units expressed by
unitType . |
void |
newValueSpecifiedUnits(int unitType,
float valueInSpecifiedUnits)
Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.
|
void |
setValue(float param_value) |
void |
setValueAsString(String param_valueAsString) |
void |
setValueInSpecifiedUnits(float param_valueInSpecifiedUnits) |
addEventListener, addEventListener, beginElement, beginElementAt, dispatchEvent, endElement, endElementAt, getAnimatedClassName, getAnimatedHeight, getAnimatedHref, getAnimatedResult, getAnimatedTransform, getAnimatedWidth, getAnimatedX, getAnimatedY, getBBox, getChildElementCount, getCTM, getExternalResourcesRequired, getFarthestViewportElement, getFirstElementChild, getLastElementChild, getNearestViewportElement, getNextElementSibling, getPresentationAttribute, getPreserveAspectRatio, getPreviousElementSibling, getRequiredExtensions, getRequiredFeatures, getScreenCTM, getSvgStyle, getSystemLanguage, getTransformToElement, getViewBox, getXmllang, getXmlspace, getZoomAndPan, hasExtension, querySelector, querySelectorAll, removeEventListener, removeEventListener, setXmllang, setXmlspace, setZoomAndPan
at, at, intAt, intAt, length, numberAt, numberAt, setAt, setAt, setAt, setAt, setAt, setAt
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
intAt, length
numberAt
public final int getUnitType()
SVGLength
getUnitType
in interface SVGLength
public final float getValue()
SVGLength
The value as a floating point value, in user units. Setting this attribute will cause valueInSpecifiedUnits
and valueAsString
to be updated automatically to reflect this setting.
Exceptions on setting: a DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read only attribute or when the object itself is read only.
public final void setValue(float param_value)
public final String getValueAsString()
SVGLength
The value as a string value, in the units expressed by unitType
. Setting this attribute will cause value
, valueInSpecifiedUnits
and unitType
to be updated automatically to reflect this setting.
Exceptions on setting:
DOMException
with code SYNTAX_ERR
is raised if the assigned string cannot be parsed as a valid <length>.DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read only attribute or when the object itself is read only.getValueAsString
in interface SVGLength
public final void setValueAsString(String param_valueAsString)
setValueAsString
in interface SVGLength
public final float getValueInSpecifiedUnits()
SVGLength
The value as a floating point value, in the units expressed by unitType
. Setting this attribute will cause value
and valueAsString
to be updated automatically to reflect this setting.
Exceptions on setting: a DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read only attribute or when the object itself is read only.
getValueInSpecifiedUnits
in interface SVGLength
public final void setValueInSpecifiedUnits(float param_valueInSpecifiedUnits)
setValueInSpecifiedUnits
in interface SVGLength
public final void convertToSpecifiedUnits(int unitType)
SVGLength
unitType
. Object attributes unitType
, valueInSpecifiedUnits
and valueAsString
might be modified as a result of this method. For example, if the original value were "0.5cm" and the method was invoked to convert to millimeters, then the unitType
would be changed to SVG_LENGTHTYPE_MM
, valueInSpecifiedUnits
would be changed to the numeric value 5 and valueAsString
would be changed to "5mm".convertToSpecifiedUnits
in interface SVGLength
public final void newValueSpecifiedUnits(int unitType, float valueInSpecifiedUnits)
SVGLength
Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.
Exceptions:
DOMException
with code NOT_SUPPORTED_ERR
is raised if unitType
is SVG_LENGTHTYPE_UNKNOWN
or not a valid unit type constant (one of the other SVG_LENGTHTYPE_*
constants defined on this interface).DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when the length corresponds to a read only attribute or when the object itself is read only.newValueSpecifiedUnits
in interface SVGLength
Copyright © 2016. All rights reserved.