public class Transform
extends com.google.gwt.core.client.JavaScriptObject
It allows parsing the svg transform attribute with parse(String)
,
manipulation using setters, such as rotate(double)
,
then generation of the transform attribute with JavaScriptObject.toString()
Modifier | Constructor and Description |
---|---|
protected |
Transform() |
Modifier and Type | Method and Description |
---|---|
static Transform |
parse(String transformString)
Parses the given 2D affine transform string, as defined by SVG's transform
attribute.
|
double |
rotate()
Returns the rotation angle θ of this transform, in degrees.
|
Transform |
rotate(double degrees)
Set the rotation angle of this transform
|
Array<Double> |
scale()
Returns the [kx, ky] scale of this transform, as a two-element array.
|
Transform |
scale(int x)
Create a scale operation by x and by y = x.
|
Transform |
scale(int x,
int y)
Create a scale operation by x and y
|
double |
skew()
Returns the x-skew φ of this transform, in degrees.
|
Transform |
skew(double x) |
Array<Double> |
translate()
Returns the [dx, dy] translation of this transform, as a two-element
array in local coordinates (typically pixels).
|
Transform |
translate(int x)
Create a translation by x and 0.
|
Transform |
translate(int x,
int y)
Create a translation by x and y
|
public static final Transform parse(String transformString)
The transform is then decomposed to a standard representation of translate, rotate, x-skew and scale.
This behavior is standardized by CSS: see matrix decomposition for animation.
transformString
- the transform string as in SVGpublic final double rotate()
public final Transform rotate(double degrees)
degrees
- the rotate degreepublic final Array<Double> translate()
public final Transform translate(int x, int y)
x
- y
- Transform
.public final Transform translate(int x)
x
- the xTransform
public final Transform scale(int x, int y)
x
- y
- Transform
.public final Transform scale(int x)
x
- the xTransform
public final double skew()
public final Transform skew(double x)
Copyright © 2015 gwt-d3. All rights reserved.