Class RMTransform

All Implemented Interfaces:
RMPropertyChanger, Cloneable

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

    • _a

      public double _a
    • _b

      public double _b
    • _c

      public double _c
    • _d

      public double _d
    • _tx

      public double _tx
    • _ty

      public double _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(double a, double b, double c, double d, double tx, double ty)
      Creates a transform initialized to given matrix components.
    • RMTransform

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

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

    • a

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

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

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

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

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

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

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

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

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

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

      public RMTransform skew(double aSkewX, double 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(double a, double b, double c, double d, double tx, double 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 RMObject