Class RMTransform

java.lang.Object
com.reportmill.base.RMObject
com.reportmill.graphics.RMTransform
All Implemented Interfaces:
RMArchiver.Archiving, Cloneable

public class RMTransform extends RMObject
This class represents a simple 2D transform.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
     
    float
     
    float
     
    float
     
    float
     
    float
     
    static final RMTransform
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new identity transform.
    RMTransform(float a, float b, float c, float d, float tx, float ty)
    Creates a transform initialized to given matrix components.
    RMTransform(float dx, float dy, float angle, float sx, float sy, float skx, float sky)
    Create a transform with translation, rotation, and skew.
    RMTransform(float dx, float dy, float anAngle, float porx, float pory, float sx, float sy, float skx, float sky)
    Creates a transform with translation and given rotation/skew about a point.
    Creates a new transform from a given transform.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    a()
    Returns the first component of the transform matrix.
    awt()
    Returns AWT version of transform for use with Java2D (caching it if needed).
    float
    b()
    Returns the second component of the transform matrix.
    float
    c()
    Returns the third component of the transform matrix.
    float
    d()
    Returns the fourth component of the transform matrix.
    boolean
    equals(Object anObj)
    Standard equals implementation.
    Inverts this transform (and returns this for convenience).
    boolean
    Returns whether this transform is identity.
    multiply(float a, float b, float c, float d, float tx, float ty)
    Multiplies this transform by the given transform components (return this for convenience).
    multiply(RMTransform aTransform)
    Multiplies this transform by the given transform.
    rotate(float anAngle)
    Rotates this transform by given angle in degrees (returns this for convenience).
    scale(float sx, float sy)
    Scales this transform by given scale x and scale y (returns this for convenience).
    skew(float aSkewX, float aSkewY)
    Skews this transform by given skew x and skew y angles in degrees (returns this for convenience).
    Returns a string representation of the transform.
    Transforms the given point.
    Transforms the given rect.
    Transforms the given size.
    Transforms the given size as a vector (preserves negative values).
    translate(float dx, float dy)
    Translates this transform by given x & y (returns this for convenience).
    float
    tx()
    Returns the x translation component of the transform matrix.
    float
    ty()
    Returns the y translation component of the transform matrix.

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • _a

      public float _a
    • _b

      public float _b
    • _c

      public float _c
    • _d

      public float _d
    • _tx

      public float _tx
    • _ty

      public float _ty
    • identity

      public static final RMTransform identity
  • Constructor Details

    • RMTransform

      public RMTransform()
      Creates a new identity transform.
    • RMTransform

      public RMTransform(RMTransform aTransform)
      Creates a new transform from a given transform.
    • RMTransform

      public RMTransform(float a, float b, float c, float d, float tx, float ty)
      Creates a transform initialized to given matrix components.
    • RMTransform

      public RMTransform(float dx, float dy, float angle, float sx, float sy, float skx, float sky)
      Create a transform with translation, rotation, and skew.
    • RMTransform

      public RMTransform(float dx, float dy, float anAngle, float porx, float pory, float sx, float sy, float skx, float sky)
      Creates a transform with translation and given rotation/skew about a point.
  • Method Details

    • a

      public float a()
      Returns the first component of the transform matrix.
    • b

      public float b()
      Returns the second component of the transform matrix.
    • c

      public float c()
      Returns the third component of the transform matrix.
    • d

      public float d()
      Returns the fourth component of the transform matrix.
    • tx

      public float tx()
      Returns the x translation component of the transform matrix.
    • ty

      public float ty()
      Returns the y translation component of the transform matrix.
    • isIdentity

      public boolean isIdentity()
      Returns whether this transform is identity.
    • translate

      public RMTransform translate(float dx, float dy)
      Translates this transform by given x & y (returns this for convenience).
    • rotate

      public RMTransform rotate(float anAngle)
      Rotates this transform by given angle in degrees (returns this for convenience).
    • scale

      public RMTransform scale(float sx, float sy)
      Scales this transform by given scale x and scale y (returns this for convenience).
    • skew

      public RMTransform skew(float aSkewX, float aSkewY)
      Skews this transform by given skew x and skew y angles in degrees (returns this for convenience).
    • multiply

      public RMTransform multiply(RMTransform aTransform)
      Multiplies this transform by the given transform.
    • multiply

      public RMTransform multiply(float a, float b, float c, float d, float tx, float ty)
      Multiplies this transform by the given transform components (return this for convenience).
    • invert

      public RMTransform invert()
      Inverts this transform (and returns this for convenience).
    • transform

      public RMPoint transform(RMPoint aPoint)
      Transforms the given point.
    • transform

      public RMSize transform(RMSize aSize)
      Transforms the given size.
    • transform

      public RMRect transform(RMRect aRect)
      Transforms the given rect.
    • transformVector

      public RMSize transformVector(RMSize aSize)
      Transforms the given size as a vector (preserves negative values).
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • awt

      public AffineTransform awt()
      Returns AWT version of transform for use with Java2D (caching it if needed).
    • toString

      public String toString()
      Returns a string representation of the transform.
      Overrides:
      toString in class Object