public abstract class Transform
extends java.lang.Object
implements java.lang.Cloneable
Example:
Rectangle rect = new Rectangle(50,50, Color.RED);
rect.getTransforms().add(new Rotate(45,0,0)); //rotate by 45 degrees
Type | Property and Description |
---|---|
ReadOnlyBooleanProperty |
identity
Determines if this is currently an identity transform.
|
<any> |
onTransformChanged
The onTransformChanged event handler is called whenever the transform
changes any of its parameters.
|
ReadOnlyBooleanProperty |
type2D
Determines if this is currently a 2D transform.
|
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Transform.ImmutableTransform
Immutable transformation with performance optimizations based on Affine.
|
private static class |
Transform.LazyBooleanProperty
Lazily computed read-only boolean property implementation.
|
Modifier and Type | Field and Description |
---|---|
private Transform.LazyBooleanProperty |
identity
Determines if this is currently an identity transform.
|
private EventHandlerManager |
internalEventDispatcher |
private java.lang.ref.SoftReference<Transform> |
inverseCache
For transforms with expensive inversion we cache the inverted matrix
once it is needed and computed for some operation.
|
private WeakReferenceQueue |
nodes |
private <any> |
onTransformChanged |
private Transform.LazyBooleanProperty |
type2D
Determines if this is currently a 2D transform.
|
Constructor and Description |
---|
Transform() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
add(Node node) |
<T extends Event> |
addEventFilter(<any> eventType,
<any> eventFilter)
Registers an event filter to this transform.
|
<T extends Event> |
addEventHandler(<any> eventType,
<any> eventHandler)
Registers an event handler to this transform.
|
static Affine |
affine(double mxx,
double myx,
double mxy,
double myy,
double tx,
double ty)
Returns a new
Affine object from 12 number
values representing the 6 specifiable entries of the 3x4
Affine transformation matrix. |
static Affine |
affine(double mxx,
double mxy,
double mxz,
double tx,
double myx,
double myy,
double myz,
double ty,
double mzx,
double mzy,
double mzz,
double tz)
Returns a new
Affine object from 12 number
values representing the 12 specifiable entries of the 3x4
Affine transformation matrix. |
(package private) void |
appendTo(Affine a)
Visitor from
Affine class which provides an efficient
append operation for the subclasses. |
(package private) abstract void |
apply(Affine3D t) |
EventDispatchChain |
buildEventDispatchChain(EventDispatchChain tail) |
(package private) void |
checkRequestedMAT(MatrixType type)
Makes sure the specified matrix type can be requested from this transform.
|
(package private) void |
clearInverseCache()
Used only by tests to emulate garbage collecting the soft references
|
Transform |
clone()
Returns a deep copy of this transform.
|
double[] |
column(MatrixType type,
int column)
Returns an array containing a column of the transformation matrix.
|
double[] |
column(MatrixType type,
int column,
double[] array)
Returns an array containing a column of the transformation matrix.
|
(package private) boolean |
computeIs2D()
Computes if this transform is currently a 2D transform (has no effect
in the direction of Z axis).
|
(package private) boolean |
computeIsIdentity()
Computes if this transform is currently an identity (has
no effect in any direction).
|
Transform |
createConcatenation(Transform transform)
Returns the concatenation of this transform and the specified transform.
|
(package private) static Transform |
createImmutableTransform()
ImmutableTransform Class and supporting methods
|
(package private) static Transform |
createImmutableTransform(double mxx,
double mxy,
double mxz,
double tx,
double myx,
double myy,
double myz,
double ty,
double mzx,
double mzy,
double mzz,
double tz) |
(package private) static Transform |
createImmutableTransform(Transform transform,
double mxx,
double mxy,
double mxz,
double tx,
double myx,
double myy,
double myz,
double ty,
double mzx,
double mzy,
double mzz,
double tz) |
(package private) static Transform |
createImmutableTransform(Transform transform,
Transform left,
Transform right) |
Transform |
createInverse()
Returns the inverse transform of this transform.
|
Point2D |
deltaTransform(double x,
double y)
Transforms the relative magnitude vector by this transform.
|
Point3D |
deltaTransform(double x,
double y,
double z)
Transforms the relative magnitude vector by this transform.
|
Point2D |
deltaTransform(Point2D point)
Transforms the relative magnitude vector represented by the specified
Point2D instance by this transform. |
Point3D |
deltaTransform(Point3D point)
Transforms the relative magnitude vector represented by the specified
Point3D instance by this transform. |
(package private) abstract BaseTransform |
derive(BaseTransform t) |
double |
determinant()
Computes determinant of the transformation matrix.
|
(package private) void |
ensureCanTransform2DPoint()
Makes sure this is a 2D transform.
|
(package private) void |
fill2DArray(double[] array)
Core of the toArray implementation for the 2D case.
|
(package private) void |
fill3DArray(double[] array)
Core of the toArray implementation for the 3D case.
|
double |
getElement(MatrixType type,
int row,
int column)
Gets the specified element of the transformation matrix.
|
private int |
getFixedSrcOffset(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts,
int dimensions)
Helper method for transforming arrays of points that deals with
overlapping arrays.
|
private EventHandlerManager |
getInternalEventDispatcher() |
private Transform |
getInverseCache()
Gets the inverse transform cache.
|
double |
getMxx()
Gets the X coordinate scaling element of the 3x4 matrix.
|
double |
getMxy()
Gets the XY coordinate element of the 3x4 matrix.
|
double |
getMxz()
Gets the XZ coordinate element of the 3x4 matrix.
|
double |
getMyx()
Gets the YX coordinate element of the 3x4 matrix.
|
double |
getMyy()
Gets the Y coordinate scaling element of the 3x4 matrix.
|
double |
getMyz()
Gets the YZ coordinate element of the 3x4 matrix.
|
double |
getMzx()
Gets the ZX coordinate element of the 3x4 matrix.
|
double |
getMzy()
Gets the ZY coordinate element of the 3x4 matrix.
|
double |
getMzz()
Gets the Z coordinate scaling element of the 3x4 matrix.
|
<any> |
getOnTransformChanged()
Gets the onTransformChanged event handler.
|
double |
getTx()
Gets the X coordinate translation element of the 3x4 matrix.
|
double |
getTy()
Gets the Y coordinate translation element of the 3x4 matrix.
|
double |
getTz()
Gets the Z coordinate translation element of the 3x4 matrix.
|
ReadOnlyBooleanProperty |
identityProperty()
Determines if this is currently an identity transform.
|
Point2D |
inverseDeltaTransform(double x,
double y)
Transforms the relative magnitude vector by the inverse of this transform.
|
Point3D |
inverseDeltaTransform(double x,
double y,
double z)
Transforms the relative magnitude vector by the inverse of this transform.
|
Point2D |
inverseDeltaTransform(Point2D point)
Transforms the relative magnitude vector represented by the specified
Point2D instance by the inverse of this transform. |
Point3D |
inverseDeltaTransform(Point3D point)
Transforms the relative magnitude vector represented by the specified
Point3D instance by the inverse of this transform. |
Bounds |
inverseTransform(Bounds bounds)
Transforms the specified bounds by the inverse of this transform.
|
Point2D |
inverseTransform(double x,
double y)
Transforms the specified point by the inverse of this transform.
|
Point3D |
inverseTransform(double x,
double y,
double z)
Transforms the specified point by the inverse of this transform.
|
Point2D |
inverseTransform(Point2D point)
Transforms the specified point by the inverse of this transform.
|
Point3D |
inverseTransform(Point3D point)
Transforms the specified point by the inverse of this transform.
|
void |
inverseTransform2DPoints(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms an array of coordinates by the inverse of this transform.
|
(package private) void |
inverseTransform2DPointsImpl(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Core of the inverseTransform2DPoints method.
|
void |
inverseTransform3DPoints(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms an array of floating point coordinates by the inverse
of this transform.
|
(package private) void |
inverseTransform3DPointsImpl(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Core of the inverseTransform3DPoints method.
|
boolean |
isIdentity()
Gets the value of the property identity.
|
boolean |
isType2D()
Gets the value of the property type2D.
|
<any> |
onTransformChangedProperty()
The onTransformChanged event handler is called whenever the transform
changes any of its parameters.
|
(package private) void |
prependTo(Affine a)
Visitor from
Affine class which provides an efficient
prepend operation for the subclasses. |
(package private) void |
remove(Node node) |
<T extends Event> |
removeEventFilter(<any> eventType,
<any> eventFilter)
Unregisters a previously registered event filter from this transform.
|
<T extends Event> |
removeEventHandler(<any> eventType,
<any> eventHandler)
Unregisters a previously registered event handler from this transform.
|
static Rotate |
rotate(double angle,
double pivotX,
double pivotY)
Returns a
Rotate object that rotates coordinates around a pivot
point. |
double[] |
row(MatrixType type,
int row)
Returns an array containing a row of the transformation matrix.
|
double[] |
row(MatrixType type,
int row,
double[] array)
Returns an array containing a row of the transformation matrix.
|
static Scale |
scale(double x,
double y)
Returns a
Scale object representing a scaling transformation. |
static Scale |
scale(double x,
double y,
double pivotX,
double pivotY)
Returns a
Scale object representing a scaling transformation. |
void |
setOnTransformChanged(<any> value)
Sets the onTransformChanged event handler which is called whenever
the transform changes any of its parameters.
|
static Shear |
shear(double x,
double y)
Returns a
Shear object representing a shearing transformation. |
static Shear |
shear(double x,
double y,
double pivotX,
double pivotY)
Returns a
Shear object representing a shearing transformation. |
boolean |
similarTo(Transform transform,
Bounds range,
double maxDelta)
Checks if this transform is similar to the specified transform.
|
double[] |
toArray(MatrixType type)
Returns an array containing the flattened transformation matrix.
|
double[] |
toArray(MatrixType type,
double[] array)
Returns an array containing the flattened transformation matrix.
|
Bounds |
transform(Bounds bounds)
Transforms the specified bounds by this transform.
|
Point2D |
transform(double x,
double y)
Transforms the specified point by this transform.
|
Point3D |
transform(double x,
double y,
double z)
Transforms the specified point by this transform.
|
Point2D |
transform(Point2D point)
Transforms the specified point by this transform.
|
Point3D |
transform(Point3D point)
Transforms the specified point by this transform.
|
void |
transform2DPoints(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms an array of coordinates by this transform.
|
(package private) void |
transform2DPointsImpl(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Core of the transform2DPoints method.
|
void |
transform3DPoints(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms an array of floating point coordinates by this transform.
|
(package private) void |
transform3DPointsImpl(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Core of the transform3DPoints method.
|
protected void |
transformChanged()
This method must be called by all transforms whenever any of their
parameters changes.
|
private double |
transformDiff(Transform t,
double x,
double y)
Transforms the specified point by this transform and by the specified
transform and returns distance of the result points.
|
private double |
transformDiff(Transform t,
double x,
double y,
double z)
Transforms the specified point by this transform and by the specified
transform and returns distance of the result points.
|
static Translate |
translate(double x,
double y)
Returns a
Translate object representing a translation transformation. |
ReadOnlyBooleanProperty |
type2DProperty()
Determines if this is currently a 2D transform.
|
(package private) void |
validate()
Needed for the proper delivery of the TransformChangedEvent.
|
public final ReadOnlyBooleanProperty type2DProperty
isType2D()
public final ReadOnlyBooleanProperty identityProperty
isIdentity()
public final <any> onTransformChangedProperty
getOnTransformChanged()
,
#setOnTransformChanged()
private java.lang.ref.SoftReference<Transform> inverseCache
private WeakReferenceQueue nodes
private Transform.LazyBooleanProperty type2D
private Transform.LazyBooleanProperty identity
private EventHandlerManager internalEventDispatcher
private <any> onTransformChanged
public static Affine affine(double mxx, double myx, double mxy, double myy, double tx, double ty)
Affine
object from 12 number
values representing the 6 specifiable entries of the 3x4
Affine transformation matrix.mxx
- the X coordinate scaling element of the 3x4 matrixmyx
- the Y coordinate shearing element of the 3x4 matrixmxy
- the X coordinate shearing element of the 3x4 matrixmyy
- the Y coordinate scaling element of the 3x4 matrixtx
- the X coordinate translation element of the 3x4 matrixty
- the Y coordinate translation element of the 3x4 matrixAffine
object derived from specified parameterspublic static Affine affine(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz)
Affine
object from 12 number
values representing the 12 specifiable entries of the 3x4
Affine transformation matrix.mxx
- the X coordinate scaling element of the 3x4 matrixmxy
- the XY element of the 3x4 matrixmxz
- the XZ element of the 3x4 matrixtx
- the X coordinate translation element of the 3x4 matrixmyx
- the YX element of the 3x4 matrixmyy
- the Y coordinate scaling element of the 3x4 matrixmyz
- the YZ element of the 3x4 matrixty
- the Y coordinate translation element of the 3x4 matrixmzx
- the ZX element of the 3x4 matrixmzy
- the ZY element of the 3x4 matrixmzz
- the Z coordinate scaling element of the 3x4 matrixtz
- the Z coordinate translation element of the 3x4 matrixAffine
object derived from specified parameterspublic static Translate translate(double x, double y)
Translate
object representing a translation transformation.
This is equivalent to:
new Translate(x, y);
x
- the translate x valuey
- the translate y valuepublic static Rotate rotate(double angle, double pivotX, double pivotY)
Rotate
object that rotates coordinates around a pivot
point.
This is equivalent to:
new Rotate(angle, pivotX, pivotY);
angle
- the rotation anglepivotX
- the pivot x valuepivotY
- the pivot y valuepublic static Scale scale(double x, double y)
Scale
object representing a scaling transformation.
This is equivalent to:
new Scale(x, y);
x
- the scale x valuey
- the scale y valuepublic static Scale scale(double x, double y, double pivotX, double pivotY)
Scale
object representing a scaling transformation.
The returned scale operation will be about the given pivot point.
This is equivalent to:
new Scale(x, y, pivotX, pivotY);
x
- the scale x valuey
- the scale y valuepivotX
- the pivot x valuepivotY
- the pivot y valuepublic static Shear shear(double x, double y)
Shear
object representing a shearing transformation.
This is equivalent to:
new Shear(x, y);
x
- the shear x valuey
- the shear y valuepublic static Shear shear(double x, double y, double pivotX, double pivotY)
Shear
object representing a shearing transformation.
This is equivalent to:
new Shear(x, y, pivotX, pivotY);
x
- the shear x valuey
- the shear y valuepivotX
- the pivot x valuepivotY
- the pivot y valuepublic double getMxx()
public double getMxy()
public double getMxz()
public double getTx()
public double getMyx()
public double getMyy()
public double getMyz()
public double getTy()
public double getMzx()
public double getMzy()
public double getMzz()
public double getTz()
public double getElement(MatrixType type, int row, int column)
type
- type of matrix to get the value fromrow
- zero-based row numbercolumn
- zero-based column numberjava.lang.IllegalArgumentException
- if a 2D matrix type is requested for
a 3D transformjava.lang.IndexOutOfBoundsException
- if the indices are not within
the specified matrix typejava.lang.NullPointerException
- if the specified type
is nullboolean computeIs2D()
boolean computeIsIdentity()
public double determinant()
public final boolean isType2D()
public final ReadOnlyBooleanProperty type2DProperty()
isType2D()
public final boolean isIdentity()
public final ReadOnlyBooleanProperty identityProperty()
isIdentity()
private double transformDiff(Transform t, double x, double y)
t
- the other transformx
- point's X coordinatey
- point's Y coordinateprivate double transformDiff(Transform t, double x, double y, double z)
t
- the other transformx
- point's X coordinatey
- point's Y coordinatez
- point's Z coordinatepublic boolean similarTo(Transform transform, Bounds range, double maxDelta)
range
is transformed by them to points that are no farther
than maxDelta
from each other.transform
- transform to be compared to this transformrange
- region of interest on which the two transforms are comparedmaxDelta
- maximum allowed distance for the results of transforming
any single point from range
by the two transformsjava.lang.NullPointerException
- if the specified transform
or range
is nullvoid fill2DArray(double[] array)
array
- array to be filled with the 6 2D elementsvoid fill3DArray(double[] array)
array
- array to be filled with the 12 3D elementspublic double[] toArray(MatrixType type, double[] array)
type
- matrix type to be filled in the arrayarray
- array into which the elements of the matrix are to be
stored, if it is non-null and big enough; otherwise,
a new array is created for this purpose.java.lang.IllegalArgumentException
- if a 2D matrix type is requested for
a 3D transformjava.lang.NullPointerException
- if the specified type
is nullpublic double[] toArray(MatrixType type)
type
- matrix type to be filled in the arrayjava.lang.IllegalArgumentException
- if a 2D matrix type is requested for
a 3D transformjava.lang.NullPointerException
- if the specified type
is nullpublic double[] row(MatrixType type, int row, double[] array)
type
- matrix type whose row is to be filled in the arrayrow
- zero-based index of the rowarray
- array into which the elements of the row are to be
stored, if it is non-null and big enough; otherwise,
a new array is created for this purpose.java.lang.IllegalArgumentException
- if a 2D matrix type is requested for
a 3D transformjava.lang.IndexOutOfBoundsException
- if the row
index is not within
the number of rows of the specified matrix typejava.lang.NullPointerException
- if the specified type
is nullpublic double[] row(MatrixType type, int row)
type
- matrix type whose row is to be filled in the arrayrow
- zero-based index of the rowjava.lang.IllegalArgumentException
- if a 2D matrix type is requested for
a 3D transformjava.lang.IndexOutOfBoundsException
- if the row
index is not within
the number of rows of the specified matrix typejava.lang.NullPointerException
- if the specified type
is nullpublic double[] column(MatrixType type, int column, double[] array)
type
- matrix type whose column is to be filled in the arraycolumn
- zero-based index of the columnarray
- array into which the elements of the column are to be
stored, if it is non-null and big enough; otherwise,
a new array is created for this purpose.java.lang.IllegalArgumentException
- if a 2D matrix type is requested for
a 3D transformjava.lang.IndexOutOfBoundsException
- if the column
index
is not within the number of columns of the specified matrix typejava.lang.NullPointerException
- if the specified type
is nullpublic double[] column(MatrixType type, int column)
type
- matrix type whose column is to be filled in the arraycolumn
- zero-based index of the columnjava.lang.IllegalArgumentException
- if a 2D matrix type is requested for
a 3D transformjava.lang.IndexOutOfBoundsException
- if the column
index
is not within the number of columns of the specified matrix typejava.lang.NullPointerException
- if the specified type
is nullpublic Transform createConcatenation(Transform transform)
getTransforms()
list,
this
transform first and the specified transform
second.transform
- transform to be concatenated with this transformjava.lang.NullPointerException
- if the specified transform
is nullpublic Transform createInverse() throws NonInvertibleTransformException
NonInvertibleTransformException
- if this transform
cannot be invertedpublic Transform clone()
clone
in class java.lang.Object
public Point2D transform(double x, double y)
x
- the X coordinate of the pointy
- the Y coordinate of the pointjava.lang.IllegalStateException
- if this is a 3D transformpublic Point2D transform(Point2D point)
point
- the point to be transformedjava.lang.IllegalStateException
- if this is a 3D transformjava.lang.NullPointerException
- if the specified point
is nullpublic Point3D transform(double x, double y, double z)
x
- the X coordinate of the pointy
- the Y coordinate of the pointz
- the Z coordinate of the pointpublic Point3D transform(Point3D point)
point
- the point to be transformedjava.lang.NullPointerException
- if the specified point
is nullpublic Bounds transform(Bounds bounds)
bounds
- the bounds to be transformedvoid transform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
void transform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
public void transform2DPoints(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
[x0, y0, x1, y1, ..., xn, yn]
.
This method can be used only for 2D transforms.srcPts
- the array containing the source point coordinates.
Each point is stored as a pair of x, y coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstPts
- the array into which the transformed point coordinates
are returned. Each point is stored as a pair of x, y
coordinates.dstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of points to be transformedjava.lang.IllegalStateException
- if this is a 3D transformjava.lang.NullPointerException
- if srcPts
or (@code dstPts} is nullpublic void transform3DPoints(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
[x0, y0, z0, x1, y1, z1, ..., xn, yn, zn]
.srcPts
- the array containing the source point coordinates.
Each point is stored as a tiplet of x, y, z coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstPts
- the array into which the transformed point coordinates
are returned. Each point is stored as a triplet of x, y, z
coordinates.dstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of points to be transformedjava.lang.NullPointerException
- if srcPts
or (@code dstPts} is nullpublic Point2D deltaTransform(double x, double y)
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axisPoint2D
instancejava.lang.IllegalStateException
- if this is a 3D transformpublic Point2D deltaTransform(Point2D point)
Point2D
instance by this transform.
The vector is transformed without applying the translation components
of the affine transformation matrix.
This method can be used only for a 2D transform.point
- the relative magnitude vectorPoint2D
instancejava.lang.IllegalStateException
- if this is a 3D transformjava.lang.NullPointerException
- if the specified point
is nullpublic Point3D deltaTransform(double x, double y, double z)
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axisz
- vector magnitude in the direction of the Z axisPoint3D
instancepublic Point3D deltaTransform(Point3D point)
Point3D
instance by this transform.
The vector is transformed without applying the translation components
of the affine transformation matrix.point
- the relative magnitude vectorPoint3D
instancejava.lang.NullPointerException
- if the specified point
is nullpublic Point2D inverseTransform(double x, double y) throws NonInvertibleTransformException
x
- the X coordinate of the pointy
- the Y coordinate of the pointjava.lang.IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform
cannot be invertedpublic Point2D inverseTransform(Point2D point) throws NonInvertibleTransformException
point
- the point to be transformedjava.lang.IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform
cannot be invertedjava.lang.NullPointerException
- if the specified point
is nullpublic Point3D inverseTransform(double x, double y, double z) throws NonInvertibleTransformException
x
- the X coordinate of the pointy
- the Y coordinate of the pointz
- the Z coordinate of the pointNonInvertibleTransformException
- if this transform
cannot be invertedpublic Point3D inverseTransform(Point3D point) throws NonInvertibleTransformException
point
- the point to be transformedNonInvertibleTransformException
- if this transform
cannot be invertedjava.lang.NullPointerException
- if the specified point
is nullpublic Bounds inverseTransform(Bounds bounds) throws NonInvertibleTransformException
bounds
- the bounds to be transformedNonInvertibleTransformException
- if this transform
cannot be invertedjava.lang.NullPointerException
- if the specified bounds
is nullvoid inverseTransform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NonInvertibleTransformException
NonInvertibleTransformException
void inverseTransform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NonInvertibleTransformException
NonInvertibleTransformException
public void inverseTransform2DPoints(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NonInvertibleTransformException
[x0, y0, x1, y1, ..., xn, yn]
.
This method can be used only for 2D transforms.srcPts
- the array containing the source point coordinates.
Each point is stored as a pair of x, y coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstPts
- the array into which the transformed point coordinates
are returned. Each point is stored as a pair of x, y
coordinates.dstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of points to be transformedjava.lang.IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform
cannot be invertedjava.lang.NullPointerException
- if srcPts
or (@code dstPts} is nullpublic void inverseTransform3DPoints(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NonInvertibleTransformException
[x0, y0, z0, x1, y1, z1, ..., xn, yn, zn]
.srcPts
- the array containing the source point coordinates.
Each point is stored as a triplet of x, y, z coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstPts
- the array into which the transformed point coordinates
are returned. Each point is stored as a triplet of x, y, z
coordinates.dstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of points to be transformedNonInvertibleTransformException
- if this transform
cannot be invertedjava.lang.NullPointerException
- if srcPts
or (@code dstPts} is nullpublic Point2D inverseDeltaTransform(double x, double y) throws NonInvertibleTransformException
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axisPoint2D
instancejava.lang.IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform
cannot be invertedpublic Point2D inverseDeltaTransform(Point2D point) throws NonInvertibleTransformException
Point2D
instance by the inverse of this transform.
The vector is transformed without applying the translation components
of the affine transformation matrix.
This method can be used only for a 2D transform.point
- the relative magnitude vectorPoint2D
instancejava.lang.IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform
cannot be invertedjava.lang.NullPointerException
- if the specified point
is nullpublic Point3D inverseDeltaTransform(double x, double y, double z) throws NonInvertibleTransformException
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axisz
- vector magnitude in the direction of the Z axisPoint3D
instanceNonInvertibleTransformException
- if this transform
cannot be invertedpublic Point3D inverseDeltaTransform(Point3D point) throws NonInvertibleTransformException
Point3D
instance by the inverse of this transform.
The vector is transformed without applying the translation components
of the affine transformation matrix.point
- the relative magnitude vectorPoint3D
instanceNonInvertibleTransformException
- if this transform
cannot be invertedjava.lang.NullPointerException
- if the specified point
is nullprivate int getFixedSrcOffset(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts, int dimensions)
private EventHandlerManager getInternalEventDispatcher()
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail)
public final <T extends Event> void addEventHandler(<any> eventType, <any> eventHandler)
Registers an event handler to this transform. Any event filters are first processed, then the specified onFoo event handlers, and finally any event handlers registered by this method.
Currently the only event delivered to a Transform
is the
TransformChangedEvent
with it's single type
TRANSFORM_CHANGED
.
T
- the specific event class of the handlereventType
- the type of the events to receive by the handlereventHandler
- the handler to registerjava.lang.NullPointerException
- if the event type or handler is nullpublic final <T extends Event> void removeEventHandler(<any> eventType, <any> eventHandler)
T
- the specific event class of the handlereventType
- the event type from which to unregistereventHandler
- the handler to unregisterjava.lang.NullPointerException
- if the event type or handler is nullpublic final <T extends Event> void addEventFilter(<any> eventType, <any> eventFilter)
Registers an event filter to this transform. Registered event filters get an event before any associated event handlers.
Currently the only event delivered to a Transform
is the
TransformChangedEvent
with it's single type
TRANSFORM_CHANGED
.
T
- the specific event class of the filtereventType
- the type of the events to receive by the filtereventFilter
- the filter to registerjava.lang.NullPointerException
- if the event type or filter is nullpublic final <T extends Event> void removeEventFilter(<any> eventType, <any> eventFilter)
T
- the specific event class of the filtereventType
- the event type from which to unregistereventFilter
- the filter to unregisterjava.lang.NullPointerException
- if the event type or filter is nullpublic final void setOnTransformChanged(<any> value)
value
- the event handler, can be null to clear itpublic final <any> getOnTransformChanged()
setOnTransformChanged
method, null if the handler is not set.public final <any> onTransformChangedProperty()
getOnTransformChanged()
,
#setOnTransformChanged()
void checkRequestedMAT(MatrixType type) throws java.lang.IllegalArgumentException
type
- matrix type to checkjava.lang.IllegalArgumentException
- if this is a 3D transform and
a 2D type is requestedvoid ensureCanTransform2DPoint() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if this is a 2D transformvoid validate()
abstract void apply(Affine3D t)
abstract BaseTransform derive(BaseTransform t)
void add(Node node)
void remove(Node node)
protected void transformChanged()
void appendTo(Affine a)
Affine
class which provides an efficient
append
operation for the subclasses.a
- Affine
instance to append tovoid prependTo(Affine a)
Affine
class which provides an efficient
prepend
operation for the subclasses.a
- Affine
instance to prepend toprivate Transform getInverseCache() throws NonInvertibleTransformException
Gets the inverse transform cache.
Computing the inverse transform is generally an expensive operation, so once it is needed we cache the result (throwing it away when the transform changes). The subclasses may avoid using the cache if their inverse can be computed quickly on the fly.
This method computes the inverse if the cache is not valid.
NonInvertibleTransformException
- if this transform
cannot be invertedvoid clearInverseCache()
static Transform createImmutableTransform()
static Transform createImmutableTransform(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz)
static Transform createImmutableTransform(Transform transform, double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz)