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.SVGTransform
Abstract 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.AffineTransform
affineTransform
The transformation as a Java2D {link AffineTransform}.protected float
angle
The angle of the transformation, if this transformation is a rotation or a skew.protected short
type
Type of the transformation.protected float
x
The x coordinate of the center of the rotation, if this transformation is a rotation.protected float
y
The 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 void
assign(AbstractSVGTransform t)
Copies the value of the specified transformation into this object.protected abstract org.w3c.dom.svg.SVGMatrix
createMatrix()
Creates and returns a newSVGMatrix
for exposing the transformation as a matrix.float
getAngle()
DOM: ImplementsSVGTransform.getAngle()
.org.w3c.dom.svg.SVGMatrix
getMatrix()
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 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 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
public void assign(AbstractSVGTransform t)
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
-
-