Class RMTransform
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.rm.graphics.RMTransform
- All Implemented Interfaces:
RMPropertyChanger
,Cloneable
This class represents a simple 2D transform.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new identity transform.RMTransform
(double a, double b, double c, double d, double tx, double ty) Creates a transform initialized to given matrix components.RMTransform
(double dx, double dy, double angle, double sx, double sy, double skx, double sky) Create a transform with translation, rotation, and skew.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.RMTransform
(RMTransform aTransform) Creates a new transform from a given transform. -
Method Summary
Modifier and TypeMethodDescriptiondouble
a()
Returns the first component of the transform matrix.awt()
Returns AWT version of transform for use with Java2D (caching it if needed).double
b()
Returns the second component of the transform matrix.double
c()
Returns the third component of the transform matrix.double
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
(double a, double b, double c, double d, double tx, double ty) Multiplies this transform by the given transform components (return this for convenience).multiply
(RMTransform aTransform) Multiplies this transform by the given transform.rotate
(double anAngle) Rotates this transform by given angle in degrees (returns this for convenience).scale
(double sx, double sy) Scales this transform by given scale x and scale y (returns this for convenience).skew
(double aSkewX, double 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
(double dx, double dy) Translates this transform by given x & y (returns this for convenience).double
tx()
Returns the x translation component of the transform matrix.double
ty()
Returns the y translation component of the transform matrix.Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
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
-
-
Constructor Details
-
RMTransform
public RMTransform()Creates a new identity transform. -
RMTransform
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
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.
-