Package com.reportmill.graphics
Class RMTransform
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.graphics.RMTransform
- All Implemented Interfaces:
RMArchiver.Archiving
,Cloneable
This class represents a simple 2D transform.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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.RMTransform
(RMTransform aTransform) Creates a new transform from a given transform. -
Method Summary
Modifier and TypeMethodDescriptionfloat
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
Standard equals implementation.invert()
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).toString()
Returns a string representation of the transform.Transforms the given point.Transforms the given rect.Transforms the given size.transformVector
(RMSize aSize) 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 com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
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
-
-
Constructor Details
-
RMTransform
public RMTransform()Creates a new identity transform. -
RMTransform
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
Translates this transform by given x & y (returns this for convenience). -
rotate
Rotates this transform by given angle in degrees (returns this for convenience). -
scale
Scales this transform by given scale x and scale y (returns this for convenience). -
skew
Skews this transform by given skew x and skew y angles in degrees (returns this for convenience). -
multiply
Multiplies this transform by the given transform. -
multiply
Multiplies this transform by the given transform components (return this for convenience). -
invert
Inverts this transform (and returns this for convenience). -
transform
Transforms the given point. -
transform
Transforms the given size. -
transform
Transforms the given rect. -
transformVector
Transforms the given size as a vector (preserves negative values). -
equals
Standard equals implementation. -
awt
Returns AWT version of transform for use with Java2D (caching it if needed). -
toString
Returns a string representation of the transform.
-