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.- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AffineTransformThe transformation as a Java2D {link AffineTransform}.protected floatThe angle of the transformation, if this transformation is a rotation or a skew.protected shortType of the transformation.protected floatThe x coordinate of the center of the rotation, if this transformation is a rotation.protected floatThe 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 TypeMethodDescriptionvoidCopies the value of the specified transformation into this object.protected abstract org.w3c.dom.svg.SVGMatrixCreates and returns a newSVGMatrixfor exposing the transformation as a matrix.floatgetAngle()DOM: ImplementsSVGTransform.getAngle().org.w3c.dom.svg.SVGMatrixDOM: 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 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 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
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
-