public class JsSVGTransform extends JsElementalMixinBase implements SVGTransform
SVG_TRANSFORM_MATRIX, SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SCALE, SVG_TRANSFORM_SKEWX, SVG_TRANSFORM_SKEWY, SVG_TRANSFORM_TRANSLATE, SVG_TRANSFORM_UNKNOWN
SVG_ZOOMANDPAN_DISABLE, SVG_ZOOMANDPAN_MAGNIFY, SVG_ZOOMANDPAN_UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
JsSVGTransform() |
Modifier and Type | Method and Description |
---|---|
float |
getAngle()
A convenience attribute for
SVG_TRANSFORM_ROTATE , SVG_TRANSFORM_SKEWX and SVG_TRANSFORM_SKEWY . |
JsSVGMatrix |
getMatrix()
The matrix that represents this transformation.
|
int |
getType()
The type of the value as specified by one of the SVG_TRANSFORM_* constants defined on this interface.
|
void |
setRotate(float angle,
float cx,
float cy)
Sets the transform type to
SVG_TRANSFORM_ROTATE , with parameter angle defining the rotation angle and parameters cx and cy defining the optional center of rotation. |
void |
setScale(float sx,
float sy)
Sets the transform type to
SVG_TRANSFORM_SCALE , with parameters sx and sy defining the scale amounts. |
void |
setSkewX(float angle)
Sets the transform type to
SVG_TRANSFORM_SKEWX , with parameter angle defining the amount of skew. |
void |
setSkewY(float angle)
Sets the transform type to
SVG_TRANSFORM_SKEWY , with parameter angle defining the amount of skew. |
void |
setTranslate(float tx,
float ty)
Sets the transform type to
SVG_TRANSFORM_TRANSLATE , with parameters tx and ty defining the translation amounts. |
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 float getAngle()
SVGTransform
SVG_TRANSFORM_ROTATE
, SVG_TRANSFORM_SKEWX
and SVG_TRANSFORM_SKEWY
. It holds the angle that was specified.SVG_TRANSFORM_MATRIX
, SVG_TRANSFORM_TRANSLATE
and SVG_TRANSFORM_SCALE
, angle
will be zero.getAngle
in interface SVGTransform
public final JsSVGMatrix getMatrix()
SVGTransform
The matrix that represents this transformation. The matrix object is live, meaning that any changes made to the SVGTransform
object are immediately reflected in the matrix object and vice versa. In case the matrix object is changed directly (i.e., without using the methods on the SVGTransform
interface itself) then the type of the SVGTransform
changes to SVG_TRANSFORM_MATRIX
.
SVG_TRANSFORM_MATRIX
, the matrix contains the a, b, c, d, e, f values supplied by the user.SVG_TRANSFORM_TRANSLATE
, e and f represent the translation amounts (a=1, b=0, c=0 and d=1).SVG_TRANSFORM_SCALE
, a and d represent the scale amounts (b=0, c=0, e=0 and f=0).SVG_TRANSFORM_SKEWX
and SVG_TRANSFORM_SKEWY
, a, b, c and d represent the matrix which will result in the given skew (e=0 and f=0).SVG_TRANSFORM_ROTATE
, a, b, c, d, e and f together represent the matrix which will result in the given rotation. When the rotation is around the center point (0, 0), e and f will be zero.getMatrix
in interface SVGTransform
public final int getType()
SVGTransform
getType
in interface SVGTransform
public final void setRotate(float angle, float cx, float cy)
SVGTransform
Sets the transform type to SVG_TRANSFORM_ROTATE
, with parameter angle
defining the rotation angle and parameters cx
and cy
defining the optional center of rotation.
Exceptions:
DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when attempting to modify a read only attribute or when the object itself is read only.setRotate
in interface SVGTransform
public final void setScale(float sx, float sy)
SVGTransform
Sets the transform type to SVG_TRANSFORM_SCALE
, with parameters sx
and sy
defining the scale amounts.
Exceptions:
DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when attempting to modify a read only attribute or when the object itself is read only.setScale
in interface SVGTransform
public final void setSkewX(float angle)
SVGTransform
Sets the transform type to SVG_TRANSFORM_SKEWX
, with parameter angle
defining the amount of skew.
Exceptions:
DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when attempting to modify a read only attribute or when the object itself is read only.setSkewX
in interface SVGTransform
public final void setSkewY(float angle)
SVGTransform
Sets the transform type to SVG_TRANSFORM_SKEWY
, with parameter angle
defining the amount of skew.
Exceptions:
DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when attempting to modify a read only attribute or when the object itself is read only.setSkewY
in interface SVGTransform
public final void setTranslate(float tx, float ty)
SVGTransform
Sets the transform type to SVG_TRANSFORM_TRANSLATE
, with parameters tx
and ty
defining the translation amounts.
Exceptions:
DOMException
with code NO_MODIFICATION_ALLOWED_ERR
is raised when attempting to modify a read only attribute or when the object itself is read only.setTranslate
in interface SVGTransform
Copyright © 2018. All rights reserved.