Package org.apache.batik.dom.svg
Class AbstractSVGTransform
java.lang.Object
org.apache.batik.dom.svg.AbstractSVGTransform
- All Implemented Interfaces:
org.w3c.dom.svg.SVGTransform
- Direct Known Subclasses:
AbstractSVGTransformList.SVGTransformItem
,SVGOMTransform
Abstract implementation of
SVGTransform
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AffineTransform
The transformation as a Java2D {link AffineTransform}.protected float
The angle of the transformation, if this transformation is a rotation or a skew.protected short
Type of the transformation.protected float
The x coordinate of the center of the rotation, if this transformation is a rotation.protected float
The y coordinate of the center of the rotation, if this transformation is a rotation.Fields inherited from interface org.w3c.dom.svg.SVGTransform
SVG_TRANSFORM_MATRIX, SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SCALE, SVG_TRANSFORM_SKEWX, SVG_TRANSFORM_SKEWY, SVG_TRANSFORM_TRANSLATE, SVG_TRANSFORM_UNKNOWN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Copies the value of the specified transformation into this object.protected abstract org.w3c.dom.svg.SVGMatrix
Creates and returns a newSVGMatrix
for exposing the transformation as a matrix.float
getAngle()
DOM: ImplementsSVGTransform.getAngle()
.org.w3c.dom.svg.SVGMatrix
DOM: ImplementsSVGTransform.getMatrix()
.short
getType()
DOM: ImplementsSVGTransform.getType()
.float
getX()
Returns the x coordinate of the center of the rotation, if this transformation is a rotation.float
getY()
Returns the y coordinate of the center of the rotation, if this transformation is a rotation.void
setMatrix
(org.w3c.dom.svg.SVGMatrix matrix) DOM: ImplementsSVGTransform.setMatrix(SVGMatrix)
.void
setRotate
(float angle, float cx, float cy) DOM: ImplementsSVGTransform.setRotate(float,float,float)
.void
setScale
(float sx, float sy) DOM: ImplementsSVGTransform.setScale(float,float)
.void
setSkewX
(float angle) DOM: ImplementsSVGTransform.setSkewX(float)
.void
setSkewY
(float angle) DOM: ImplementsSVGTransform.setSkewY(float)
.void
setTranslate
(float tx, float ty) DOM: ImplementsSVGTransform.setTranslate(float,float)
.void
setType
(short type) Sets the type of transformation.
-
Field Details
-
type
protected short typeType of the transformation. Before any values are set, the type is unknown. -
affineTransform
The transformation as a Java2D {link AffineTransform}. -
angle
protected float angleThe angle of the transformation, if this transformation is a rotation or a skew. This is stored to avoid extracting the angle from the transformation matrix. -
x
protected float xThe x coordinate of the center of the rotation, if this transformation is a rotation. -
y
protected float yThe y coordinate of the center of the rotation, if this transformation is a rotation.
-
-
Constructor Details
-
AbstractSVGTransform
public AbstractSVGTransform()
-
-
Method Details
-
createMatrix
protected abstract org.w3c.dom.svg.SVGMatrix createMatrix()Creates and returns a newSVGMatrix
for exposing the transformation as a matrix.- Returns:
- SVGMatrix representing the transformation
-
setType
public void setType(short type) Sets the type of transformation. -
getX
public float getX()Returns the x coordinate of the center of the rotation, if this transformation is a rotation. -
getY
public float getY()Returns the y coordinate of the center of the rotation, if this transformation is a rotation. -
assign
Copies the value of the specified transformation into this object. -
getType
public short getType()DOM: ImplementsSVGTransform.getType()
.- Specified by:
getType
in interfaceorg.w3c.dom.svg.SVGTransform
-
getMatrix
public org.w3c.dom.svg.SVGMatrix getMatrix()DOM: ImplementsSVGTransform.getMatrix()
.- Specified by:
getMatrix
in interfaceorg.w3c.dom.svg.SVGTransform
-
getAngle
public float getAngle()DOM: ImplementsSVGTransform.getAngle()
.- Specified by:
getAngle
in interfaceorg.w3c.dom.svg.SVGTransform
-
setMatrix
public void setMatrix(org.w3c.dom.svg.SVGMatrix matrix) DOM: ImplementsSVGTransform.setMatrix(SVGMatrix)
.- Specified by:
setMatrix
in interfaceorg.w3c.dom.svg.SVGTransform
-
setTranslate
public void setTranslate(float tx, float ty) DOM: ImplementsSVGTransform.setTranslate(float,float)
.- Specified by:
setTranslate
in interfaceorg.w3c.dom.svg.SVGTransform
-
setScale
public void setScale(float sx, float sy) DOM: ImplementsSVGTransform.setScale(float,float)
.- Specified by:
setScale
in interfaceorg.w3c.dom.svg.SVGTransform
-
setRotate
public void setRotate(float angle, float cx, float cy) DOM: ImplementsSVGTransform.setRotate(float,float,float)
.- Specified by:
setRotate
in interfaceorg.w3c.dom.svg.SVGTransform
-
setSkewX
public void setSkewX(float angle) DOM: ImplementsSVGTransform.setSkewX(float)
.- Specified by:
setSkewX
in interfaceorg.w3c.dom.svg.SVGTransform
-
setSkewY
public void setSkewY(float angle) DOM: ImplementsSVGTransform.setSkewY(float)
.- Specified by:
setSkewY
in interfaceorg.w3c.dom.svg.SVGTransform
-