org.apache.batik.dom.svg

Class AbstractSVGTransform

public abstract class AbstractSVGTransform extends Object implements SVGTransform

Abstract implementation of {@link SVGTransform}.
Field Summary
protected AffineTransformaffineTransform
The transformation as a Java2D {link AffineTransform}.
protected floatangle
The angle of the transformation, if this transformation is a rotation or a skew.
protected shorttype
Type of the transformation.
protected floatx
The x coordinate of the center of the rotation, if this transformation is a rotation.
protected floaty
The y coordinate of the center of the rotation, if this transformation is a rotation.
Method Summary
voidassign(AbstractSVGTransform t)
Copies the value of the specified transformation into this object.
protected abstract SVGMatrixcreateMatrix()
Creates and returns a new {@link SVGMatrix} for exposing the transformation as a matrix.
floatgetAngle()
DOM: Implements {@link SVGTransform#getAngle()}.
SVGMatrixgetMatrix()
DOM: Implements {@link SVGTransform#getMatrix()}.
shortgetType()
DOM: Implements {@link SVGTransform#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(SVGMatrix matrix)
DOM: Implements {@link SVGTransform#setMatrix(SVGMatrix)}.
voidsetRotate(float angle, float cx, float cy)
DOM: Implements {@link SVGTransform#setRotate(float,float,float)}.
voidsetScale(float sx, float sy)
DOM: Implements {@link SVGTransform#setScale(float,float)}.
voidsetSkewX(float angle)
DOM: Implements {@link SVGTransform#setSkewX(float)}.
voidsetSkewY(float angle)
DOM: Implements {@link SVGTransform#setSkewY(float)}.
voidsetTranslate(float tx, float ty)
DOM: Implements {@link SVGTransform#setTranslate(float,float)}.
protected voidsetType(short type)
Sets the type of transformation.

Field Detail

affineTransform

protected 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.

type

protected short type
Type of the transformation. Before any values are set, the type is unknown.

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

assign

public void assign(AbstractSVGTransform t)
Copies the value of the specified transformation into this object.

createMatrix

protected abstract SVGMatrix createMatrix()
Creates and returns a new {@link SVGMatrix} for exposing the transformation as a matrix.

Returns: SVGMatrix representing the transformation

getAngle

public float getAngle()
DOM: Implements {@link SVGTransform#getAngle()}.

getMatrix

public SVGMatrix getMatrix()
DOM: Implements {@link SVGTransform#getMatrix()}.

getType

public short getType()
DOM: Implements {@link SVGTransform#getType()}.

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.

setMatrix

public void setMatrix(SVGMatrix matrix)
DOM: Implements {@link SVGTransform#setMatrix(SVGMatrix)}.

setRotate

public void setRotate(float angle, float cx, float cy)
DOM: Implements {@link SVGTransform#setRotate(float,float,float)}.

setScale

public void setScale(float sx, float sy)
DOM: Implements {@link SVGTransform#setScale(float,float)}.

setSkewX

public void setSkewX(float angle)
DOM: Implements {@link SVGTransform#setSkewX(float)}.

setSkewY

public void setSkewY(float angle)
DOM: Implements {@link SVGTransform#setSkewY(float)}.

setTranslate

public void setTranslate(float tx, float ty)
DOM: Implements {@link SVGTransform#setTranslate(float,float)}.

setType

protected void setType(short type)
Sets the type of transformation.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.