Class Transform
- All Implemented Interfaces:
Cloneable
,EventTarget
Example:
Rectangle rect = new Rectangle(50,50, Color.RED);
rect.getTransforms().add(new Rotate(45,0,0)); //rotate by 45 degrees
- Since:
- JavaFX 2.0
-
Property Summary
TypePropertyDescriptionfinal ReadOnlyBooleanProperty
Determines if this is currently an identity transform.final ObjectProperty
<EventHandler<? super TransformChangedEvent>> The onTransformChanged event handler is called whenever the transform changes any of its parameters.final ReadOnlyBooleanProperty
Determines if this is currently a 2D transform. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal <T extends Event>
voidaddEventFilter
(EventType<T> eventType, EventHandler<? super T> eventFilter) Registers an event filter for this target.final <T extends Event>
voidaddEventHandler
(EventType<T> eventType, EventHandler<? super T> eventHandler) Registers an event handler for this target.static Affine
affine
(double mxx, double myx, double mxy, double myy, double tx, double ty) Returns a newAffine
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 newAffine
object from 12 number values representing the 12 specifiable entries of the 3x4 Affine transformation matrix.Construct an event dispatch chain for this target.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.createConcatenation
(Transform transform) Returns the concatenation of this transform and the specified transform.Returns the inverse transform of this transform.deltaTransform
(double x, double y) Transforms the relative magnitude vector by this transform.deltaTransform
(double x, double y, double z) Transforms the relative magnitude vector by this transform.deltaTransform
(Point2D point) Transforms the relative magnitude vector represented by the specifiedPoint2D
instance by this transform.deltaTransform
(Point3D point) Transforms the relative magnitude vector represented by the specifiedPoint3D
instance by this transform.double
Computes determinant of the transformation matrix.double
getElement
(MatrixType type, int row, int column) Gets the specified element of the transformation matrix.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.final EventHandler
<? super TransformChangedEvent> 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.final ReadOnlyBooleanProperty
Determines if this is currently an identity transform.inverseDeltaTransform
(double x, double y) Transforms the relative magnitude vector by the inverse of this transform.inverseDeltaTransform
(double x, double y, double z) Transforms the relative magnitude vector by the inverse of this transform.inverseDeltaTransform
(Point2D point) Transforms the relative magnitude vector represented by the specifiedPoint2D
instance by the inverse of this transform.inverseDeltaTransform
(Point3D point) Transforms the relative magnitude vector represented by the specifiedPoint3D
instance by the inverse of this transform.inverseTransform
(double x, double y) Transforms the specified point by the inverse of this transform.inverseTransform
(double x, double y, double z) Transforms the specified point by the inverse of this transform.inverseTransform
(Bounds bounds) Transforms the specified bounds by the inverse of this transform.inverseTransform
(Point2D point) Transforms the specified point by the inverse of this transform.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.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.final boolean
Gets the value of theidentity
property.final boolean
isType2D()
Gets the value of thetype2D
property.final ObjectProperty
<EventHandler<? super TransformChangedEvent>> The onTransformChanged event handler is called whenever the transform changes any of its parameters.final <T extends Event>
voidremoveEventFilter
(EventType<T> eventType, EventHandler<? super T> eventFilter) Unregisters a previously registered event filter from this target.final <T extends Event>
voidremoveEventHandler
(EventType<T> eventType, EventHandler<? super T> eventHandler) Unregisters a previously registered event handler from this target.static Rotate
rotate
(double angle, double pivotX, double pivotY) Returns aRotate
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 aScale
object representing a scaling transformation.static Scale
scale
(double x, double y, double pivotX, double pivotY) Returns aScale
object representing a scaling transformation.final void
setOnTransformChanged
(EventHandler<? super TransformChangedEvent> 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 aShear
object representing a shearing transformation.static Shear
shear
(double x, double y, double pivotX, double pivotY) Returns aShear
object representing a shearing transformation.boolean
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.transform
(double x, double y) Transforms the specified point by this transform.transform
(double x, double y, double z) Transforms the specified point by this transform.Transforms the specified bounds by this transform.Transforms the specified point by this transform.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.void
transform3DPoints
(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms an array of floating point coordinates by this transform.protected void
This method must be called by all transforms whenever any of their parameters changes.static Translate
translate
(double x, double y) Returns aTranslate
object representing a translation transformation.final ReadOnlyBooleanProperty
Determines if this is currently a 2D transform.
-
Property Details
-
type2D
Determines if this is currently a 2D transform. Transform is 2D if it has no effect along the Z axis.- Since:
- JavaFX 8.0
- See Also:
-
identity
Determines if this is currently an identity transform. Identity transform has no effect on the transformed nodes.- Since:
- JavaFX 8.0
- See Also:
-
onTransformChanged
The onTransformChanged event handler is called whenever the transform changes any of its parameters.- Since:
- JavaFX 8.0
- See Also:
-
-
Constructor Details
-
Transform
public Transform()Constructor for subclasses to call.
-
-
Method Details
-
affine
Returns a newAffine
object from 12 number values representing the 6 specifiable entries of the 3x4 Affine transformation matrix.- Parameters:
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 matrix- Returns:
- a new
Affine
object derived from specified parameters
-
affine
public 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 newAffine
object from 12 number values representing the 12 specifiable entries of the 3x4 Affine transformation matrix.- Parameters:
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 matrix- Returns:
- a new
Affine
object derived from specified parameters
-
translate
Returns aTranslate
object representing a translation transformation.This is equivalent to:
new Translate(x, y);
- Parameters:
x
- the translate x valuey
- the translate y value- Returns:
- the Translate object representing a translation transformation
-
rotate
Returns aRotate
object that rotates coordinates around a pivot point.This is equivalent to:
new Rotate(angle, pivotX, pivotY);
- Parameters:
angle
- the rotation anglepivotX
- the pivot x valuepivotY
- the pivot y value- Returns:
- the Rotate object that rotates coordinates around a pivot point
-
scale
Returns aScale
object representing a scaling transformation.This is equivalent to:
new Scale(x, y);
- Parameters:
x
- the scale x valuey
- the scale y value- Returns:
- the Scale object representing a scaling transformation
-
scale
Returns aScale
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);
- Parameters:
x
- the scale x valuey
- the scale y valuepivotX
- the pivot x valuepivotY
- the pivot y value- Returns:
- the Scale object representing a scaling transformation
-
shear
Returns aShear
object representing a shearing transformation.This is equivalent to:
new Shear(x, y);
- Parameters:
x
- the shear x valuey
- the shear y value- Returns:
- the Shear object representing a shearing transformation
-
shear
Returns aShear
object representing a shearing transformation.This is equivalent to:
new Shear(x, y, pivotX, pivotY);
- Parameters:
x
- the shear x valuey
- the shear y valuepivotX
- the pivot x valuepivotY
- the pivot y value- Returns:
- the Shear object representing a shearing transformation
-
getMxx
public double getMxx()Gets the X coordinate scaling element of the 3x4 matrix.- Returns:
- the X coordinate scaling element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getMxy
public double getMxy()Gets the XY coordinate element of the 3x4 matrix.- Returns:
- the XY coordinate element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getMxz
public double getMxz()Gets the XZ coordinate element of the 3x4 matrix.- Returns:
- the XZ coordinate element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getTx
public double getTx()Gets the X coordinate translation element of the 3x4 matrix.- Returns:
- the X coordinate translation element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getMyx
public double getMyx()Gets the YX coordinate element of the 3x4 matrix.- Returns:
- the YX coordinate element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getMyy
public double getMyy()Gets the Y coordinate scaling element of the 3x4 matrix.- Returns:
- the Y coordinate scaling element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getMyz
public double getMyz()Gets the YZ coordinate element of the 3x4 matrix.- Returns:
- the YZ coordinate element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getTy
public double getTy()Gets the Y coordinate translation element of the 3x4 matrix.- Returns:
- the Y coordinate translation element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getMzx
public double getMzx()Gets the ZX coordinate element of the 3x4 matrix.- Returns:
- the ZX coordinate element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getMzy
public double getMzy()Gets the ZY coordinate element of the 3x4 matrix.- Returns:
- the ZY coordinate element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getMzz
public double getMzz()Gets the Z coordinate scaling element of the 3x4 matrix.- Returns:
- the Z coordinate scaling element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getTz
public double getTz()Gets the Z coordinate translation element of the 3x4 matrix.- Returns:
- the Z coordinate translation element of the 3x4 matrix
- Since:
- JavaFX 2.2
-
getElement
Gets the specified element of the transformation matrix.- Parameters:
type
- type of matrix to get the value fromrow
- zero-based row numbercolumn
- zero-based column number- Returns:
- value of the specified transformation matrix element
- Throws:
IllegalArgumentException
- if a 2D matrix type is requested for a 3D transformIndexOutOfBoundsException
- if the indices are not within the specified matrix typeNullPointerException
- if the specifiedtype
is null- Since:
- JavaFX 8.0
-
determinant
public double determinant()Computes determinant of the transformation matrix. Among other things, determinant can be used for testing this transform's invertibility - it is invertible if determinant is not equal to zero.- Returns:
- Determinant of the transformation matrix
- Since:
- JavaFX 8.0
-
isType2D
public final boolean isType2D()Gets the value of thetype2D
property.- Property description:
- Determines if this is currently a 2D transform. Transform is 2D if it has no effect along the Z axis.
- Returns:
- the value of the
type2D
property - Since:
- JavaFX 8.0
- See Also:
-
type2DProperty
Determines if this is currently a 2D transform. Transform is 2D if it has no effect along the Z axis.- Returns:
- the
type2D
property - Since:
- JavaFX 8.0
- See Also:
-
isIdentity
public final boolean isIdentity()Gets the value of theidentity
property.- Property description:
- Determines if this is currently an identity transform. Identity transform has no effect on the transformed nodes.
- Returns:
- the value of the
identity
property - Since:
- JavaFX 8.0
- See Also:
-
identityProperty
Determines if this is currently an identity transform. Identity transform has no effect on the transformed nodes.- Returns:
- the
identity
property - Since:
- JavaFX 8.0
- See Also:
-
similarTo
Checks if this transform is similar to the specified transform. The two transforms are considered similar if any point fromrange
is transformed by them to points that are no farther thanmaxDelta
from each other.- Parameters:
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 fromrange
by the two transforms- Returns:
- true if the transforms are similar according to the specified criteria
- Throws:
NullPointerException
- if the specifiedtransform
orrange
is null- Since:
- JavaFX 8.0
-
toArray
Returns an array containing the flattened transformation matrix. If the requested matrix type fits in the specified array, it is returned therein. Otherwise, a new array is created.- Parameters:
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.- Returns:
- an array containing the elements of the requested matrix type representing this transform
- Throws:
IllegalArgumentException
- if a 2D matrix type is requested for a 3D transformNullPointerException
- if the specifiedtype
is null- Since:
- JavaFX 8.0
-
toArray
Returns an array containing the flattened transformation matrix.- Parameters:
type
- matrix type to be filled in the array- Returns:
- an array containing the elements of the requested matrix type representing this transform
- Throws:
IllegalArgumentException
- if a 2D matrix type is requested for a 3D transformNullPointerException
- if the specifiedtype
is null- Since:
- JavaFX 8.0
-
row
Returns an array containing a row of the transformation matrix. If the row of the requested matrix type fits in the specified array, it is returned therein. Otherwise, a new array is created.- Parameters:
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.- Returns:
- an array containing the requested row of the requested matrix type representing this transform
- Throws:
IllegalArgumentException
- if a 2D matrix type is requested for a 3D transformIndexOutOfBoundsException
- if therow
index is not within the number of rows of the specified matrix typeNullPointerException
- if the specifiedtype
is null- Since:
- JavaFX 8.0
-
row
Returns an array containing a row of the transformation matrix.- Parameters:
type
- matrix type whose row is to be filled in the arrayrow
- zero-based index of the row- Returns:
- an array containing the requested row of the requested matrix type representing this transform
- Throws:
IllegalArgumentException
- if a 2D matrix type is requested for a 3D transformIndexOutOfBoundsException
- if therow
index is not within the number of rows of the specified matrix typeNullPointerException
- if the specifiedtype
is null- Since:
- JavaFX 8.0
-
column
Returns an array containing a column of the transformation matrix. If the column of the requested matrix type fits in the specified array, it is returned therein. Otherwise, a new array is created.- Parameters:
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.- Returns:
- an array containing the requested column of the requested matrix type representing this transform
- Throws:
IllegalArgumentException
- if a 2D matrix type is requested for a 3D transformIndexOutOfBoundsException
- if thecolumn
index is not within the number of columns of the specified matrix typeNullPointerException
- if the specifiedtype
is null- Since:
- JavaFX 8.0
-
column
Returns an array containing a column of the transformation matrix.- Parameters:
type
- matrix type whose column is to be filled in the arraycolumn
- zero-based index of the column- Returns:
- an array containing the requested column of the requested matrix type representing this transform
- Throws:
IllegalArgumentException
- if a 2D matrix type is requested for a 3D transformIndexOutOfBoundsException
- if thecolumn
index is not within the number of columns of the specified matrix typeNullPointerException
- if the specifiedtype
is null- Since:
- JavaFX 8.0
-
createConcatenation
Returns the concatenation of this transform and the specified transform. Applying the resulting transform to a node has the same effect as adding the two transforms to itsgetTransforms()
list,this
transform first and the specifiedtransform
second.- Parameters:
transform
- transform to be concatenated with this transform- Returns:
- The concatenated transform
- Throws:
NullPointerException
- if the specifiedtransform
is null- Since:
- JavaFX 8.0
-
createInverse
Returns the inverse transform of this transform.- Returns:
- the inverse transform
- Throws:
NonInvertibleTransformException
- if this transform cannot be inverted- Since:
- JavaFX 8.0
-
clone
-
transform
Transforms the specified point by this transform. This method can be used only for 2D transforms.- Parameters:
x
- the X coordinate of the pointy
- the Y coordinate of the point- Returns:
- the transformed point
- Throws:
IllegalStateException
- if this is a 3D transform- Since:
- JavaFX 8.0
-
transform
Transforms the specified point by this transform. This method can be used only for 2D transforms.- Parameters:
point
- the point to be transformed- Returns:
- the transformed point
- Throws:
IllegalStateException
- if this is a 3D transformNullPointerException
- if the specifiedpoint
is null- Since:
- JavaFX 8.0
-
transform
Transforms the specified point by this transform.- Parameters:
x
- the X coordinate of the pointy
- the Y coordinate of the pointz
- the Z coordinate of the point- Returns:
- the transformed point
- Since:
- JavaFX 8.0
-
transform
Transforms the specified point by this transform.- Parameters:
point
- the point to be transformed- Returns:
- the transformed point
- Throws:
NullPointerException
- if the specifiedpoint
is null- Since:
- JavaFX 8.0
-
transform
-
transform2DPoints
public void transform2DPoints(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms an array of coordinates by this transform. The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the specified offset in the order[x0, y0, x1, y1, ..., xn, yn]
. This method can be used only for 2D transforms.- Parameters:
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 transformed- Throws:
IllegalStateException
- if this is a 3D transformNullPointerException
- ifsrcPts
or (@code dstPts} is null- Since:
- JavaFX 8.0
-
transform3DPoints
public void transform3DPoints(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms an array of floating point coordinates by this transform. The three coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the specified offset in the order[x0, y0, z0, x1, y1, z1, ..., xn, yn, zn]
.- Parameters:
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 transformed- Throws:
NullPointerException
- ifsrcPts
or (@code dstPts} is null- Since:
- JavaFX 8.0
-
deltaTransform
Transforms the relative magnitude vector 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.- Parameters:
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axis- Returns:
- the transformed relative magnitude vector represented
by a
Point2D
instance - Throws:
IllegalStateException
- if this is a 3D transform- Since:
- JavaFX 8.0
-
deltaTransform
Transforms the relative magnitude vector represented by the specifiedPoint2D
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.- Parameters:
point
- the relative magnitude vector- Returns:
- the transformed relative magnitude vector represented
by a
Point2D
instance - Throws:
IllegalStateException
- if this is a 3D transformNullPointerException
- if the specifiedpoint
is null- Since:
- JavaFX 8.0
-
deltaTransform
Transforms the relative magnitude vector by this transform. The vector is transformed without applying the translation components of the affine transformation matrix.- Parameters:
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 axis- Returns:
- the transformed relative magnitude vector represented
by a
Point3D
instance - Since:
- JavaFX 8.0
-
deltaTransform
Transforms the relative magnitude vector represented by the specifiedPoint3D
instance by this transform. The vector is transformed without applying the translation components of the affine transformation matrix.- Parameters:
point
- the relative magnitude vector- Returns:
- the transformed relative magnitude vector represented
by a
Point3D
instance - Throws:
NullPointerException
- if the specifiedpoint
is null- Since:
- JavaFX 8.0
-
inverseTransform
Transforms the specified point by the inverse of this transform. This method can be used only for 2D transforms.- Parameters:
x
- the X coordinate of the pointy
- the Y coordinate of the point- Returns:
- the inversely transformed point
- Throws:
IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform cannot be inverted- Since:
- JavaFX 8.0
-
inverseTransform
Transforms the specified point by the inverse of this transform. This method can be used only for 2D transforms.- Parameters:
point
- the point to be transformed- Returns:
- the inversely transformed point
- Throws:
IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform cannot be invertedNullPointerException
- if the specifiedpoint
is null- Since:
- JavaFX 8.0
-
inverseTransform
public Point3D inverseTransform(double x, double y, double z) throws NonInvertibleTransformException Transforms the specified point by the inverse of this transform.- Parameters:
x
- the X coordinate of the pointy
- the Y coordinate of the pointz
- the Z coordinate of the point- Returns:
- the inversely transformed point
- Throws:
NonInvertibleTransformException
- if this transform cannot be inverted- Since:
- JavaFX 8.0
-
inverseTransform
Transforms the specified point by the inverse of this transform.- Parameters:
point
- the point to be transformed- Returns:
- the inversely transformed point
- Throws:
NonInvertibleTransformException
- if this transform cannot be invertedNullPointerException
- if the specifiedpoint
is null- Since:
- JavaFX 8.0
-
inverseTransform
Transforms the specified bounds by the inverse of this transform.- Parameters:
bounds
- the bounds to be transformed- Returns:
- the inversely transformed bounds
- Throws:
NonInvertibleTransformException
- if this transform cannot be invertedNullPointerException
- if the specifiedbounds
is null- Since:
- JavaFX 8.0
-
inverseTransform2DPoints
public void inverseTransform2DPoints(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NonInvertibleTransformException Transforms an array of coordinates by the inverse of this transform. The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the specified offset in the order[x0, y0, x1, y1, ..., xn, yn]
. This method can be used only for 2D transforms.- Parameters:
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 transformed- Throws:
IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform cannot be invertedNullPointerException
- ifsrcPts
or (@code dstPts} is null- Since:
- JavaFX 8.0
-
inverseTransform3DPoints
public void inverseTransform3DPoints(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NonInvertibleTransformException Transforms an array of floating point coordinates by the inverse of this transform. The three coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the specified offset in the order[x0, y0, z0, x1, y1, z1, ..., xn, yn, zn]
.- Parameters:
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 transformed- Throws:
NonInvertibleTransformException
- if this transform cannot be invertedNullPointerException
- ifsrcPts
or (@code dstPts} is null- Since:
- JavaFX 8.0
-
inverseDeltaTransform
Transforms the relative magnitude vector 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.- Parameters:
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axis- Returns:
- the inversely transformed relative magnitude vector represented
by a
Point2D
instance - Throws:
IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform cannot be inverted- Since:
- JavaFX 8.0
-
inverseDeltaTransform
Transforms the relative magnitude vector represented by the specifiedPoint2D
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.- Parameters:
point
- the relative magnitude vector- Returns:
- the inversely transformed relative magnitude vector represented
by a
Point2D
instance - Throws:
IllegalStateException
- if this is a 3D transformNonInvertibleTransformException
- if this transform cannot be invertedNullPointerException
- if the specifiedpoint
is null- Since:
- JavaFX 8.0
-
inverseDeltaTransform
public Point3D inverseDeltaTransform(double x, double y, double z) throws NonInvertibleTransformException Transforms the relative magnitude vector by the inverse of this transform. The vector is transformed without applying the translation components of the affine transformation matrix.- Parameters:
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 axis- Returns:
- the inversely transformed relative magnitude vector represented
by a
Point3D
instance - Throws:
NonInvertibleTransformException
- if this transform cannot be inverted- Since:
- JavaFX 8.0
-
inverseDeltaTransform
Transforms the relative magnitude vector represented by the specifiedPoint3D
instance by the inverse of this transform. The vector is transformed without applying the translation components of the affine transformation matrix.- Parameters:
point
- the relative magnitude vector- Returns:
- the inversely transformed relative magnitude vector represented
by a
Point3D
instance - Throws:
NonInvertibleTransformException
- if this transform cannot be invertedNullPointerException
- if the specifiedpoint
is null- Since:
- JavaFX 8.0
-
buildEventDispatchChain
Description copied from interface:EventTarget
Construct an event dispatch chain for this target. The event dispatch chain contains event dispatchers which might be interested in processing of events targeted at thisEventTarget
. This event target is not automatically added to the chain, so if it wants to process events, it needs to add anEventDispatcher
for itself to the chain.In the case the event target is part of some hierarchy, the chain for it is usually built from event dispatchers collected from the root of the hierarchy to the event target.
The event dispatch chain is constructed by modifications to the provided initial event dispatch chain. The returned chain should have the initial chain at its end so the dispatchers should be prepended to the initial chain.
The caller shouldn't assume that the initial chain remains unchanged nor that the returned value will reference a different chain.
- Specified by:
buildEventDispatchChain
in interfaceEventTarget
- Parameters:
tail
- the initial chain to build from- Returns:
- the resulting event dispatch chain for this target
-
addEventHandler
public final <T extends Event> void addEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Registers an event handler for this target.The handler is called when the target receives an
Event
of the specified type during the bubbling phase of event delivery.Currently the only event delivered to a
Transform
is theTransformChangedEvent
with its single typeTRANSFORM_CHANGED
.- Specified by:
addEventHandler
in interfaceEventTarget
- Type Parameters:
T
- the event class of the handler- Parameters:
eventType
- the type of the events received by the handlereventHandler
- the event handler- Since:
- JavaFX 8.0
-
removeEventHandler
public final <T extends Event> void removeEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Unregisters a previously registered event handler from this target.Since it is possible to register a single
EventHandler
instance for different event types, the caller needs to specify the event type from which the handler should be unregistered.- Specified by:
removeEventHandler
in interfaceEventTarget
- Type Parameters:
T
- the event class of the handler- Parameters:
eventType
- the event type from which to unregistereventHandler
- the event handler- Since:
- JavaFX 8.0
-
addEventFilter
public final <T extends Event> void addEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Registers an event filter for this target.The filter is called when the target receives an
Event
of the specified type during the capturing phase of event delivery.Currently the only event delivered to a
Transform
is theTransformChangedEvent
with its single typeTRANSFORM_CHANGED
.- Specified by:
addEventFilter
in interfaceEventTarget
- Type Parameters:
T
- the event class of the filter- Parameters:
eventType
- the type of the events received by the filtereventFilter
- the event filter- Since:
- JavaFX 8.0
-
removeEventFilter
public final <T extends Event> void removeEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Unregisters a previously registered event filter from this target.Since it is possible to register a single
EventHandler
instance for different event types, the caller needs to specify the event type from which the filter should be unregistered.- Specified by:
removeEventFilter
in interfaceEventTarget
- Type Parameters:
T
- the event class of the filter- Parameters:
eventType
- the event type from which to unregistereventFilter
- the event filter- Since:
- JavaFX 8.0
-
setOnTransformChanged
Sets the onTransformChanged event handler which is called whenever the transform changes any of its parameters.- Parameters:
value
- the event handler, can be null to clear it- Since:
- JavaFX 8.0
-
getOnTransformChanged
Gets the onTransformChanged event handler.- Returns:
- the event handler previously set by
setOnTransformChanged
method, null if the handler is not set. - Since:
- JavaFX 8.0
-
onTransformChangedProperty
public final ObjectProperty<EventHandler<? super TransformChangedEvent>> onTransformChangedProperty()The onTransformChanged event handler is called whenever the transform changes any of its parameters.- Returns:
- the onTransformChanged event handler
- Since:
- JavaFX 8.0
- See Also:
-
transformChanged
protected void transformChanged()This method must be called by all transforms whenever any of their parameters changes. It is typically called when any of the transform's properties is invalidated (it is OK to skip the call if an invalid property is set).- Since:
- JavaFX 8.0
-