public interface SVGAngle
The SVGAngle
interface correspond to the <angle> basic data type.
An SVGAngle
object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
Modifier and Type | Field and Description |
---|---|
static int |
SVG_ANGLETYPE_DEG
The unit type was explicitly set to degrees.
|
static int |
SVG_ANGLETYPE_GRAD
The unit type is gradians.
|
static int |
SVG_ANGLETYPE_RAD
The unit type is radians.
|
static int |
SVG_ANGLETYPE_UNKNOWN
The unit type is not one of predefined unit types.
|
static int |
SVG_ANGLETYPE_UNSPECIFIED
No unit type was provided (i.e., a unitless value was specified).
|
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_ANGLETYPE_* 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 arg) |
void |
setValueAsString(String arg) |
void |
setValueInSpecifiedUnits(float arg) |
static final int SVG_ANGLETYPE_DEG
static final int SVG_ANGLETYPE_GRAD
static final int SVG_ANGLETYPE_RAD
static final int SVG_ANGLETYPE_UNKNOWN
static final int SVG_ANGLETYPE_UNSPECIFIED
int getUnitType()
float getValue()
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.
void setValue(float arg)
String getValueAsString()
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 <angle>.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.void setValueAsString(String arg)
float getValueInSpecifiedUnits()
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.
void setValueInSpecifiedUnits(float arg)
void convertToSpecifiedUnits(int unitType)
unitType
. Object attributes unitType
, valueInSpecifiedUnits
and valueAsString
might be modified as a result of this method.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.
Exceptions:
DOMException
with code NOT_SUPPORTED_ERR
is raised if unitType
is SVG_ANGLETYPE_UNKNOWN
or not a valid unit type constant (one of the other SVG_ANGLETYPE_*
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.Copyright © 2016. All rights reserved.