Class RMTransform
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.rm.graphics.RMTransform
-
- All Implemented Interfaces:
RMPropertyChanger
,java.lang.Cloneable
public class RMTransform extends RMObject
This class represents a simple 2D transform.
-
-
Constructor Summary
Constructors Constructor Description RMTransform()
Creates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
a()
Returns the first component of the transform matrix.java.awt.geom.AffineTransform
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
equals(java.lang.Object anObj)
Standard equals implementation.RMTransform
invert()
Inverts this transform (and returns this for convenience).boolean
isIdentity()
Returns whether this transform is identity.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).RMTransform
multiply(RMTransform aTransform)
Multiplies this transform by the given transform.RMTransform
rotate(double anAngle)
Rotates this transform by given angle in degrees (returns this for convenience).RMTransform
scale(double sx, double sy)
Scales this transform by given scale x and scale y (returns this for convenience).RMTransform
skew(double aSkewX, double aSkewY)
Skews this transform by given skew x and skew y angles in degrees (returns this for convenience).java.lang.String
toString()
Returns a string representation of the transform.RMPoint
transform(RMPoint aPoint)
Transforms the given point.RMRect
transform(RMRect aRect)
Transforms the given rect.RMSize
transform(RMSize aSize)
Transforms the given size.RMSize
transformVector(RMSize aSize)
Transforms the given size as a vector (preserves negative values).RMTransform
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 Detail
-
_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 Detail
-
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 Detail
-
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).
-
transformVector
public RMSize transformVector(RMSize aSize)
Transforms the given size as a vector (preserves negative values).
-
equals
public boolean equals(java.lang.Object anObj)
Standard equals implementation.- Overrides:
equals
in classjava.lang.Object
-
awt
public java.awt.geom.AffineTransform awt()
Returns AWT version of transform for use with Java2D (caching it if needed).
-
-