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
public abstract class AbstractSVGTransform extends java.lang.Object implements org.w3c.dom.svg.SVGTransformAbstract implementation ofSVGTransform.- Version:
- $Id: AbstractSVGTransform.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.geom.AffineTransformaffineTransformThe transformation as a Java2D {link AffineTransform}.protected floatangleThe angle of the transformation, if this transformation is a rotation or a skew.protected shorttypeType of the transformation.protected floatxThe x coordinate of the center of the rotation, if this transformation is a rotation.protected floatyThe y coordinate of the center of the rotation, if this transformation is a rotation.
-
Constructor Summary
Constructors Constructor Description AbstractSVGTransform()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidassign(AbstractSVGTransform t)Copies the value of the specified transformation into this object.protected abstract org.w3c.dom.svg.SVGMatrixcreateMatrix()Creates and returns a newSVGMatrixfor exposing the transformation as a matrix.floatgetAngle()DOM: ImplementsSVGTransform.getAngle().org.w3c.dom.svg.SVGMatrixgetMatrix()DOM: ImplementsSVGTransform.getMatrix().shortgetType()DOM: ImplementsSVGTransform.getType().floatgetX()Returns the x coordinate of the center of the rotation, if this transformation is a rotation.floatgetY()Returns the y coordinate of the center of the rotation, if this transformation is a rotation.voidsetMatrix(org.w3c.dom.svg.SVGMatrix matrix)DOM: ImplementsSVGTransform.setMatrix(SVGMatrix).voidsetRotate(float angle, float cx, float cy)DOM: ImplementsSVGTransform.setRotate(float,float,float).voidsetScale(float sx, float sy)DOM: ImplementsSVGTransform.setScale(float,float).voidsetSkewX(float angle)DOM: ImplementsSVGTransform.setSkewX(float).voidsetSkewY(float angle)DOM: ImplementsSVGTransform.setSkewY(float).voidsetTranslate(float tx, float ty)DOM: ImplementsSVGTransform.setTranslate(float,float).voidsetType(short type)Sets the type of transformation.
-
-
-
Field Detail
-
type
protected short type
Type of the transformation. Before any values are set, the type is unknown.
-
affineTransform
protected java.awt.geom.AffineTransform affineTransform
The transformation as a Java2D {link AffineTransform}.
-
angle
protected float angle
The 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 x
The x coordinate of the center of the rotation, if this transformation is a rotation.
-
y
protected float y
The y coordinate of the center of the rotation, if this transformation is a rotation.
-
-
Method Detail
-
createMatrix
protected abstract org.w3c.dom.svg.SVGMatrix createMatrix()
Creates and returns a newSVGMatrixfor 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
public void assign(AbstractSVGTransform t)
Copies the value of the specified transformation into this object.
-
getType
public short getType()
DOM: ImplementsSVGTransform.getType().- Specified by:
getTypein interfaceorg.w3c.dom.svg.SVGTransform
-
getMatrix
public org.w3c.dom.svg.SVGMatrix getMatrix()
DOM: ImplementsSVGTransform.getMatrix().- Specified by:
getMatrixin interfaceorg.w3c.dom.svg.SVGTransform
-
getAngle
public float getAngle()
DOM: ImplementsSVGTransform.getAngle().- Specified by:
getAnglein interfaceorg.w3c.dom.svg.SVGTransform
-
setMatrix
public void setMatrix(org.w3c.dom.svg.SVGMatrix matrix)
DOM: ImplementsSVGTransform.setMatrix(SVGMatrix).- Specified by:
setMatrixin interfaceorg.w3c.dom.svg.SVGTransform
-
setTranslate
public void setTranslate(float tx, float ty)DOM: ImplementsSVGTransform.setTranslate(float,float).- Specified by:
setTranslatein interfaceorg.w3c.dom.svg.SVGTransform
-
setScale
public void setScale(float sx, float sy)DOM: ImplementsSVGTransform.setScale(float,float).- Specified by:
setScalein interfaceorg.w3c.dom.svg.SVGTransform
-
setRotate
public void setRotate(float angle, float cx, float cy)DOM: ImplementsSVGTransform.setRotate(float,float,float).- Specified by:
setRotatein interfaceorg.w3c.dom.svg.SVGTransform
-
setSkewX
public void setSkewX(float angle)
DOM: ImplementsSVGTransform.setSkewX(float).- Specified by:
setSkewXin interfaceorg.w3c.dom.svg.SVGTransform
-
setSkewY
public void setSkewY(float angle)
DOM: ImplementsSVGTransform.setSkewY(float).- Specified by:
setSkewYin interfaceorg.w3c.dom.svg.SVGTransform
-
-