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 Object implements org.w3c.dom.svg.SVGTransform
Abstract implementation of SVGTransform.
Version:
$Id: AbstractSVGTransform.java 1733416 2016-03-03 07:07:13Z gadams $
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Copies the value of the specified transformation into this object.
    protected abstract org.w3c.dom.svg.SVGMatrix
    Creates and returns a new SVGMatrix for exposing the transformation as a matrix.
    float
    DOM: Implements SVGTransform.getAngle().
    org.w3c.dom.svg.SVGMatrix
    DOM: Implements SVGTransform.getMatrix().
    short
    DOM: Implements SVGTransform.getType().
    float
    Returns the x coordinate of the center of the rotation, if this transformation is a rotation.
    float
    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: Implements SVGTransform.setMatrix(SVGMatrix).
    void
    setRotate(float angle, float cx, float cy)
    DOM: Implements SVGTransform.setRotate(float,float,float).
    void
    setScale(float sx, float sy)
    DOM: Implements SVGTransform.setScale(float,float).
    void
    setSkewX(float angle)
    DOM: Implements SVGTransform.setSkewX(float).
    void
    setSkewY(float angle)
    DOM: Implements SVGTransform.setSkewY(float).
    void
    setTranslate(float tx, float ty)
    DOM: Implements SVGTransform.setTranslate(float,float).
    void
    setType(short type)
    Sets the type of transformation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • type

      protected short type
      Type of the transformation. Before any values are set, the type is unknown.
    • 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.
    • 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.
  • Constructor Details

    • AbstractSVGTransform

      public AbstractSVGTransform()
  • Method Details

    • createMatrix

      protected abstract org.w3c.dom.svg.SVGMatrix createMatrix()
      Creates and returns a new SVGMatrix 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: Implements SVGTransform.getType().
      Specified by:
      getType in interface org.w3c.dom.svg.SVGTransform
    • getMatrix

      public org.w3c.dom.svg.SVGMatrix getMatrix()
      DOM: Implements SVGTransform.getMatrix().
      Specified by:
      getMatrix in interface org.w3c.dom.svg.SVGTransform
    • getAngle

      public float getAngle()
      DOM: Implements SVGTransform.getAngle().
      Specified by:
      getAngle in interface org.w3c.dom.svg.SVGTransform
    • setMatrix

      public void setMatrix(org.w3c.dom.svg.SVGMatrix matrix)
      DOM: Implements SVGTransform.setMatrix(SVGMatrix).
      Specified by:
      setMatrix in interface org.w3c.dom.svg.SVGTransform
    • setTranslate

      public void setTranslate(float tx, float ty)
      DOM: Implements SVGTransform.setTranslate(float,float).
      Specified by:
      setTranslate in interface org.w3c.dom.svg.SVGTransform
    • setScale

      public void setScale(float sx, float sy)
      DOM: Implements SVGTransform.setScale(float,float).
      Specified by:
      setScale in interface org.w3c.dom.svg.SVGTransform
    • setRotate

      public void setRotate(float angle, float cx, float cy)
      DOM: Implements SVGTransform.setRotate(float,float,float).
      Specified by:
      setRotate in interface org.w3c.dom.svg.SVGTransform
    • setSkewX

      public void setSkewX(float angle)
      DOM: Implements SVGTransform.setSkewX(float).
      Specified by:
      setSkewX in interface org.w3c.dom.svg.SVGTransform
    • setSkewY

      public void setSkewY(float angle)
      DOM: Implements SVGTransform.setSkewY(float).
      Specified by:
      setSkewY in interface org.w3c.dom.svg.SVGTransform