Class Affine
- javafx.scene.transform.Transform
-
- javafx.scene.transform.Affine
All Implemented Interfaces:
public class Affine extends Transform
The Affine class represents a general affine transform. An affine transform performs a linear mapping from 2D/3D coordinates to other 2D/3D coordinates while preserving the "straightness" and "parallelness" of lines. Affine transformations can be constructed using sequence rotations, translations, scales, and shears.
For simple transformations application developers should use the specific Translate, Scale, Rotate, or Shear transforms, which are more lightweight and thus more optimal for this simple purpose. The Affine class, on the other hand, has the advantage of being able to represent a general affine transform and perform matrix operations on it in place, so it fits better for more complex transformation usages.
Such a coordinate transformation can be represented by a 3 row by 4 column matrix. This matrix transforms source coordinates (x,y,z) into destination coordinates (x',y',z') by considering them to be a column vector and multiplying the coordinate vector by the matrix according to the following process:
[ x'] [ mxx mxy mxz tx ] [ x ] [ mxx * x + mxy * y + mxz * z + tx ]
[ y'] = [ myx myy myz ty ] [ y ] = [ myx * x + myy * y + myz * z + ty ]
[ z'] [ mzx mzy mzz tz ] [ z ] [ mzx * x + mzy * y + mzz * z + tz ]
[ 1 ]
Since:
JavaFX 2.0
-
Property Summary
All MethodsInstance MethodsConcrete Methods Type Property and Description DoublePropertymxxDefines the X coordinate scaling element of the 3x4 matrix.DoublePropertymxyDefines the XY coordinate element of the 3x4 matrix.DoublePropertymxzDefines the XZ coordinate element of the 3x4 matrix.DoublePropertymyxDefines the YX coordinate element of the 3x4 matrix.DoublePropertymyyDefines the Y coordinate scaling element of the 3x4 matrix.DoublePropertymyzDefines the YZ coordinate element of the 3x4 matrix.DoublePropertymzxDefines the ZX coordinate element of the 3x4 matrix.DoublePropertymzyDefines the ZY coordinate element of the 3x4 matrix.DoublePropertymzzDefines the Z coordinate scaling element of the 3x4 matrix.DoublePropertytxDefines the X coordinate translation element of the 3x4 matrix.DoublePropertytyDefines the Y coordinate translation element of the 3x4 matrix.DoublePropertytzDefines the Z coordinate translation element of the 3x4 matrix.-
Properties inherited from class javafx.scene.transform.Transform
identity, onTransformChanged, type2D
-
-
Constructor Summary
Constructors Constructor and Description Affine()Creates a new instance ofAffinecontaining an identity transform.Affine(double[] matrix, MatrixType type, int offset)Creates a new instance ofAffinewith a transformation matrix specified by an array.Affine(double mxx, double mxy, double tx, double myx, double myy, double ty)Creates a new instance ofAffinewith a 2D transform specified by the element values.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)Creates a new instance ofAffinewith a transform specified by the element values.Affine(Transform transform)Creates a new instance ofAffinefilled with the values from the specified transform.
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description voidappend(double[] matrix, MatrixType type, int offset)Appends the transform specified by the array to this instance.voidappend(double mxx, double mxy, double tx, double myx, double myy, double ty)Appends the 2D transform specified by the element values to this instance.voidappend(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz)Appends the transform specified by the element values to this instance.voidappend(Transform transform)Appends the specified transform to this instance.voidappendRotation(double angle)Appends the 2D rotation to this instance.voidappendRotation(double angle, double pivotX, double pivotY)Appends the 2D rotation with pivot to this instance.voidappendRotation(double angle, double pivotX, double pivotY, double pivotZ, double axisX, double axisY, double axisZ)Appends the rotation to this instance.voidappendRotation(double angle, double pivotX, double pivotY, double pivotZ, Point3D axis)Appends the rotation to this instance.voidappendRotation(double angle, Point2D pivot)Appends the 2D rotation with pivot to this instance.voidappendRotation(double angle, Point3D pivot, Point3D axis)Appends the rotation to this instance.voidappendScale(double sx, double sy)Appends the 2D scale to this instance.voidappendScale(double sx, double sy, double sz)Appends the scale to this instance.voidappendScale(double sx, double sy, double pivotX, double pivotY)Appends the 2D scale with pivot to this instance.voidappendScale(double sx, double sy, double sz, double pivotX, double pivotY, double pivotZ)Appends the scale with pivot to this instance.voidappendScale(double sx, double sy, double sz, Point3D pivot)Appends the scale with pivot to this instance.voidappendScale(double sx, double sy, Point2D pivot)Appends the 2D scale with pivot to this instance.voidappendShear(double shx, double shy)Appends the shear to this instance.voidappendShear(double shx, double shy, double pivotX, double pivotY)Appends the shear with pivot to this instance.voidappendShear(double shx, double shy, Point2D pivot)Appends the shear with pivot to this instance.voidappendTranslation(double tx, double ty)Appends the 2D translation to this instance.voidappendTranslation(double tx, double ty, double tz)Appends the translation to this instance.Affineclone()Returns a deep copy of this transform.TransformcreateConcatenation(Transform transform)Returns the concatenation of this transform and the specified transform.AffinecreateInverse()Returns the inverse transform of this transform.Point2DdeltaTransform(double x, double y)Transforms the relative magnitude vector by this transform.Point3DdeltaTransform(double x, double y, double z)Transforms the relative magnitude vector by this transform.doubledeterminant()Computes determinant of the transformation matrix.doublegetMxx()Gets the value of the property mxx.doublegetMxy()Gets the value of the property mxy.doublegetMxz()Gets the value of the property mxz.doublegetMyx()Gets the value of the property myx.doublegetMyy()Gets the value of the property myy.doublegetMyz()Gets the value of the property myz.doublegetMzx()Gets the value of the property mzx.doublegetMzy()Gets the value of the property mzy.doublegetMzz()Gets the value of the property mzz.doublegetTx()Gets the value of the property tx.doublegetTy()Gets the value of the property ty.doublegetTz()Gets the value of the property tz.Point2DinverseDeltaTransform(double x, double y)Transforms the relative magnitude vector by the inverse of this transform.Point3DinverseDeltaTransform(double x, double y, double z)Transforms the relative magnitude vector by the inverse of this transform.Point2DinverseTransform(double x, double y)Transforms the specified point by the inverse of this transform.Point3DinverseTransform(double x, double y, double z)Transforms the specified point by the inverse of this transform.voidinvert()Inverts this transform in place.DoublePropertymxxProperty()Defines the X coordinate scaling element of the 3x4 matrix.DoublePropertymxyProperty()Defines the XY coordinate element of the 3x4 matrix.DoublePropertymxzProperty()Defines the XZ coordinate element of the 3x4 matrix.DoublePropertymyxProperty()Defines the YX coordinate element of the 3x4 matrix.DoublePropertymyyProperty()Defines the Y coordinate scaling element of the 3x4 matrix.DoublePropertymyzProperty()Defines the YZ coordinate element of the 3x4 matrix.DoublePropertymzxProperty()Defines the ZX coordinate element of the 3x4 matrix.DoublePropertymzyProperty()Defines the ZY coordinate element of the 3x4 matrix.DoublePropertymzzProperty()Defines the Z coordinate scaling element of the 3x4 matrix.voidprepend(double[] matrix, MatrixType type, int offset)Prepends the transform specified by the array to this instance.voidprepend(double mxx, double mxy, double tx, double myx, double myy, double ty)Prepends the 2D transform specified by the element values to this instance.voidprepend(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz)Prepends the transform specified by the element values to this instance.voidprepend(Transform transform)Prepends the specified transform to this instance.voidprependRotation(double angle)Prepends the 2D rotation to this instance.voidprependRotation(double angle, double pivotX, double pivotY)Prepends the 2D rotation with pivot to this instance.voidprependRotation(double angle, double pivotX, double pivotY, double pivotZ, double axisX, double axisY, double axisZ)Prepends the rotation to this instance.voidprependRotation(double angle, double pivotX, double pivotY, double pivotZ, Point3D axis)Prepends the rotation to this instance.voidprependRotation(double angle, Point2D pivot)Prepends the 2D rotation with pivot to this instance.voidprependRotation(double angle, Point3D pivot, Point3D axis)Prepends the rotation to this instance.voidprependScale(double sx, double sy)Prepends the 2D scale to this instance.voidprependScale(double sx, double sy, double sz)Prepends the scale to this instance.voidprependScale(double sx, double sy, double pivotX, double pivotY)Prepends the 2D scale with pivot to this instance.voidprependScale(double sx, double sy, double sz, double pivotX, double pivotY, double pivotZ)Prepends the scale with pivot to this instance.voidprependScale(double sx, double sy, double sz, Point3D pivot)Prepends the scale with pivot to this instance.voidprependScale(double sx, double sy, Point2D pivot)Prepends the 2D scale with pivot to this instance.voidprependShear(double shx, double shy)Prepends the shear to this instance.voidprependShear(double shx, double shy, double pivotX, double pivotY)Prepends the shear with pivot to this instance.voidprependShear(double shx, double shy, Point2D pivot)Prepends the shear with pivot to this instance.voidprependTranslation(double tx, double ty)Prepends the 2D translation to this instance.voidprependTranslation(double tx, double ty, double tz)Prepends the translation to this instance.voidsetElement(MatrixType type, int row, int column, double value)Sets the specified element of the transformation matrix.voidsetMxx(double value)Sets the value of the property mxx.voidsetMxy(double value)Sets the value of the property mxy.voidsetMxz(double value)Sets the value of the property mxz.voidsetMyx(double value)Sets the value of the property myx.voidsetMyy(double value)Sets the value of the property myy.voidsetMyz(double value)Sets the value of the property myz.voidsetMzx(double value)Sets the value of the property mzx.voidsetMzy(double value)Sets the value of the property mzy.voidsetMzz(double value)Sets the value of the property mzz.voidsetToIdentity()Resets this transform to the identity transform.voidsetToTransform(double[] matrix, MatrixType type, int offset)Sets the values of this instance to the transformation matrix specified by an array.voidsetToTransform(double mxx, double mxy, double tx, double myx, double myy, double ty)Sets the values of this instance to the 2D transform specified by the element values.voidsetToTransform(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz)Sets the values of this instance to the transform specified by the element values.voidsetToTransform(Transform transform)Sets the values of this instance to the values provided by the specified transform.voidsetTx(double value)Sets the value of the property tx.voidsetTy(double value)Sets the value of the property ty.voidsetTz(double value)Sets the value of the property tz.StringtoString()Returns a string representation of thisAffineobject.Point2Dtransform(double x, double y)Transforms the specified point by this transform.Point3Dtransform(double x, double y, double z)Transforms the specified point by this transform.DoublePropertytxProperty()Defines the X coordinate translation element of the 3x4 matrix.DoublePropertytyProperty()Defines the Y coordinate translation element of the 3x4 matrix.DoublePropertytzProperty()Defines the Z coordinate translation element of the 3x4 matrix.-
Methods inherited from class javafx.scene.transform.Transform
addEventFilter, addEventHandler, affine, affine, buildEventDispatchChain, column, column, deltaTransform, deltaTransform, getElement, getOnTransformChanged, identityProperty, inverseDeltaTransform, inverseDeltaTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform2DPoints, inverseTransform3DPoints, isIdentity, isType2D, onTransformChangedProperty, removeEventFilter, removeEventHandler, rotate, row, row, scale, scale, setOnTransformChanged, shear, shear, similarTo, toArray, toArray, transform, transform, transform, transform2DPoints, transform3DPoints, transformChanged, translate, type2DProperty
-
-
Property Detail
-
mxx
public final DoubleProperty mxxProperty
Defines the X coordinate scaling element of the 3x4 matrix.See Also:
-
mxy
public final DoubleProperty mxyProperty
Defines the XY coordinate element of the 3x4 matrix.See Also:
-
mxz
public final DoubleProperty mxzProperty
Defines the XZ coordinate element of the 3x4 matrix.See Also:
-
tx
public final DoubleProperty txProperty
Defines the X coordinate translation element of the 3x4 matrix.See Also:
-
myx
public final DoubleProperty myxProperty
Defines the YX coordinate element of the 3x4 matrix.See Also:
-
myy
public final DoubleProperty myyProperty
Defines the Y coordinate scaling element of the 3x4 matrix.See Also:
-
myz
public final DoubleProperty myzProperty
Defines the YZ coordinate element of the 3x4 matrix.See Also:
-
ty
public final DoubleProperty tyProperty
Defines the Y coordinate translation element of the 3x4 matrix.See Also:
-
mzx
public final DoubleProperty mzxProperty
Defines the ZX coordinate element of the 3x4 matrix.See Also:
-
mzy
public final DoubleProperty mzyProperty
Defines the ZY coordinate element of the 3x4 matrix.See Also:
-
mzz
public final DoubleProperty mzzProperty
Defines the Z coordinate scaling element of the 3x4 matrix.See Also:
-
tz
public final DoubleProperty tzProperty
Defines the Z coordinate translation element of the 3x4 matrix.See Also:
-
-
Constructor Detail
-
Affine
public Affine()
Creates a new instance ofAffinecontaining an identity transform.
-
Affine
public Affine(Transform transform)
Creates a new instance ofAffinefilled with the values from the specified transform.Parameters:
transform- transform whose matrix is to be filled to the new instanceThrows:
NullPointerException- if the specifiedtransformis nullSince:
JavaFX 8.0
-
Affine
public Affine(double mxx, double mxy, double tx, double myx, double myy, double ty)Creates a new instance ofAffinewith a 2D transform specified by the element values.Parameters:
mxx- the X coordinate scaling elementSince:
JavaFX 8.0
-
Affine
public 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)Creates a new instance ofAffinewith a transform specified by the element values.Parameters:
mxx- the X coordinate scaling elementSince:
JavaFX 8.0
-
Affine
public Affine(double[] matrix, MatrixType type, int offset)Creates a new instance ofAffinewith a transformation matrix specified by an array.Parameters:
matrix- array containing the flattened transformation matrixThrows:
IndexOutOfBoundsException- if the array is too short for the specifiedtypeandoffsetSince:
JavaFX 8.0
-
-
Method Detail
-
setMxx
public final void setMxx(double value)
Sets the value of the property mxx.Property description:
Defines the X coordinate scaling element of the 3x4 matrix.
-
getMxx
public final double getMxx()
Gets the value of the property mxx.
-
mxxProperty
public final DoubleProperty mxxProperty()
Defines the X coordinate scaling element of the 3x4 matrix.See Also:
-
setMxy
public final void setMxy(double value)
Sets the value of the property mxy.Property description:
Defines the XY coordinate element of the 3x4 matrix.
-
getMxy
public final double getMxy()
Gets the value of the property mxy.
-
mxyProperty
public final DoubleProperty mxyProperty()
Defines the XY coordinate element of the 3x4 matrix.See Also:
-
setMxz
public final void setMxz(double value)
Sets the value of the property mxz.Property description:
Defines the XZ coordinate element of the 3x4 matrix.
-
getMxz
public final double getMxz()
Gets the value of the property mxz.
-
mxzProperty
public final DoubleProperty mxzProperty()
Defines the XZ coordinate element of the 3x4 matrix.See Also:
-
setTx
public final void setTx(double value)
Sets the value of the property tx.Property description:
Defines the X coordinate translation element of the 3x4 matrix.
-
getTx
public final double getTx()
Gets the value of the property tx.
-
txProperty
public final DoubleProperty txProperty()
Defines the X coordinate translation element of the 3x4 matrix.See Also:
-
setMyx
public final void setMyx(double value)
Sets the value of the property myx.Property description:
Defines the YX coordinate element of the 3x4 matrix.
-
getMyx
public final double getMyx()
Gets the value of the property myx.
-
myxProperty
public final DoubleProperty myxProperty()
Defines the YX coordinate element of the 3x4 matrix.See Also:
-
setMyy
public final void setMyy(double value)
Sets the value of the property myy.Property description:
Defines the Y coordinate scaling element of the 3x4 matrix.
-
getMyy
public final double getMyy()
Gets the value of the property myy.
-
myyProperty
public final DoubleProperty myyProperty()
Defines the Y coordinate scaling element of the 3x4 matrix.See Also:
-
setMyz
public final void setMyz(double value)
Sets the value of the property myz.Property description:
Defines the YZ coordinate element of the 3x4 matrix.
-
getMyz
public final double getMyz()
Gets the value of the property myz.
-
myzProperty
public final DoubleProperty myzProperty()
Defines the YZ coordinate element of the 3x4 matrix.See Also:
-
setTy
public final void setTy(double value)
Sets the value of the property ty.Property description:
Defines the Y coordinate translation element of the 3x4 matrix.
-
getTy
public final double getTy()
Gets the value of the property ty.
-
tyProperty
public final DoubleProperty tyProperty()
Defines the Y coordinate translation element of the 3x4 matrix.See Also:
-
setMzx
public final void setMzx(double value)
Sets the value of the property mzx.Property description:
Defines the ZX coordinate element of the 3x4 matrix.
-
getMzx
public final double getMzx()
Gets the value of the property mzx.
-
mzxProperty
public final DoubleProperty mzxProperty()
Defines the ZX coordinate element of the 3x4 matrix.See Also:
-
setMzy
public final void setMzy(double value)
Sets the value of the property mzy.Property description:
Defines the ZY coordinate element of the 3x4 matrix.
-
getMzy
public final double getMzy()
Gets the value of the property mzy.
-
mzyProperty
public final DoubleProperty mzyProperty()
Defines the ZY coordinate element of the 3x4 matrix.See Also:
-
setMzz
public final void setMzz(double value)
Sets the value of the property mzz.Property description:
Defines the Z coordinate scaling element of the 3x4 matrix.
-
getMzz
public final double getMzz()
Gets the value of the property mzz.
-
mzzProperty
public final DoubleProperty mzzProperty()
Defines the Z coordinate scaling element of the 3x4 matrix.See Also:
-
setTz
public final void setTz(double value)
Sets the value of the property tz.Property description:
Defines the Z coordinate translation element of the 3x4 matrix.
-
getTz
public final double getTz()
Gets the value of the property tz.
-
tzProperty
public final DoubleProperty tzProperty()
Defines the Z coordinate translation element of the 3x4 matrix.See Also:
-
setElement
public void setElement(MatrixType type, int row, int column, double value)Sets the specified element of the transformation matrix.Parameters:
type- type of matrix to work withThrows:
IndexOutOfBoundsException- if the indices are not within the specified matrix typeSince:
JavaFX 8.0
-
determinant
public double determinant()
Description copied from class:TransformComputes 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.Overrides:
determinantin classTransformReturns:
Determinant of the transformation matrix
-
createConcatenation
public Transform createConcatenation(Transform transform)
Description copied from class:TransformReturns 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,thistransform first and the specifiedtransformsecond.Overrides:
createConcatenationin classTransformParameters:
transform- transform to be concatenated with this transformReturns:
The concatenated transform
-
createInverse
public Affine createInverse() throws NonInvertibleTransformExceptionDescription copied from class:TransformReturns the inverse transform of this transform.Overrides:
createInversein classTransformReturns:
the inverse transform
Throws:
NonInvertibleTransformException- if this transform cannot be inverted
-
clone
public Affine clone()
Description copied from class:TransformReturns a deep copy of this transform.
-
setToTransform
public void setToTransform(Transform transform)
Sets the values of this instance to the values provided by the specified transform.Parameters:
transform- transform whose matrix is to be filled to this instanceThrows:
NullPointerException- if the specifiedtransformis nullSince:
JavaFX 8.0
-
setToTransform
public void setToTransform(double mxx, double mxy, double tx, double myx, double myy, double ty)Sets the values of this instance to the 2D transform specified by the element values.Parameters:
mxx- the X coordinate scaling elementSince:
JavaFX 8.0
-
setToTransform
public void setToTransform(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz)Sets the values of this instance to the transform specified by the element values.Parameters:
mxx- the X coordinate scaling elementSince:
JavaFX 8.0
-
setToTransform
public void setToTransform(double[] matrix, MatrixType type, int offset)Sets the values of this instance to the transformation matrix specified by an array.Parameters:
matrix- array containing the flattened transformation matrixThrows:
IndexOutOfBoundsException- if the array is too short for the specifiedtypeandoffsetSince:
JavaFX 8.0
-
setToIdentity
public void setToIdentity()
Resets this transform to the identity transform.Since:
JavaFX 8.0
-
invert
public void invert() throws NonInvertibleTransformExceptionInverts this transform in place.Throws:
NonInvertibleTransformException- if this transform cannot be invertedSince:
JavaFX 8.0
-
append
public void append(Transform transform)
Appends the specified transform to this instance. The operation modifies this transform in a way that applying it to a node has the same effect as adding the two transforms to its
getTransforms()list,thistransform first and the specifiedtransformsecond.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified transform.
Parameters:
transform- transform to be appended to this instanceThrows:
NullPointerException- if the specifiedtransformis nullSince:
JavaFX 8.0
-
append
public void append(double mxx, double mxy, double tx, double myx, double myy, double ty)Appends the 2D transform specified by the element values to this instance. The operation modifies this transform in a way that applying it to a node has the same effect as adding the two transforms to its
getTransforms()list,thistransform first and the specifiedtransformsecond.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified transform.
Parameters:
mxx- the X coordinate scaling element of the transform to be appendedSince:
JavaFX 8.0
-
append
public void append(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz)Appends the transform specified by the element values to this instance. The operation modifies this transform in a way that applying it to a node has the same effect as adding the two transforms to its
getTransforms()list,thistransform first and the specifiedtransformsecond.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified transform.
Parameters:
mxx- the X coordinate scaling element of the transform to be appendedSince:
JavaFX 8.0
-
append
public void append(double[] matrix, MatrixType type, int offset)Appends the transform specified by the array to this instance. The operation modifies this transform in a way that applying it to a node has the same effect as adding the two transforms to its
getTransforms()list,thistransform first and the specifiedtransformsecond.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified transform.
Parameters:
matrix- array containing the flattened transformation matrix to be appendedThrows:
IndexOutOfBoundsException- if the array is too short for the specifiedtypeandoffsetSince:
JavaFX 8.0
-
prepend
public void prepend(Transform transform)
Prepends the specified transform to this instance. The operation modifies this transform in a way that applying it to a node has the same effect as adding the two transforms to its
getTransforms()list, the specifiedtransformfirst andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified transform.
Parameters:
transform- transform to be prepended to this instanceThrows:
NullPointerException- if the specifiedtransformis nullSince:
JavaFX 8.0
-
prepend
public void prepend(double mxx, double mxy, double tx, double myx, double myy, double ty)Prepends the 2D transform specified by the element values to this instance. The operation modifies this transform in a way that applying it to a node has the same effect as adding the two transforms to its
getTransforms()list, the specifiedtransformfirst andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified transform.
Parameters:
mxx- the X coordinate scaling element of the transform to be prependedSince:
JavaFX 8.0
-
prepend
public void prepend(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz)Prepends the transform specified by the element values to this instance. The operation modifies this transform in a way that applying it to a node has the same effect as adding the two transforms to its
getTransforms()list, the specifiedtransformfirst andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified transform.
Parameters:
mxx- the X coordinate scaling element of the transform to be prependedSince:
JavaFX 8.0
-
prepend
public void prepend(double[] matrix, MatrixType type, int offset)Prepends the transform specified by the array to this instance. The operation modifies this transform in a way that applying it to a node has the same effect as adding the two transforms to its
getTransforms()list, the specifiedtransformfirst andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified transform.
Parameters:
matrix- array containing the flattened transformation matrix to be prependedThrows:
IndexOutOfBoundsException- if the array is too short for the specifiedtypeandoffsetSince:
JavaFX 8.0
-
appendTranslation
public void appendTranslation(double tx, double ty)Appends the 2D translation to this instance. It is equivalent to
append(new Translate(tx, ty)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified translation second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified translation.
Parameters:
tx- the X coordinate translationSince:
JavaFX 8.0
-
appendTranslation
public void appendTranslation(double tx, double ty, double tz)Appends the translation to this instance. It is equivalent to
append(new Translate(tx, ty, tz)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified translation second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified translation.
Parameters:
tx- the X coordinate translationSince:
JavaFX 8.0
-
prependTranslation
public void prependTranslation(double tx, double ty, double tz)Prepends the translation to this instance. It is equivalent to
prepend(new Translate(tx, ty, tz)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified translation first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified translation.
Parameters:
tx- the X coordinate translationSince:
JavaFX 8.0
-
prependTranslation
public void prependTranslation(double tx, double ty)Prepends the 2D translation to this instance. It is equivalent to
prepend(new Translate(tx, ty)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified translation first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified translation.
Parameters:
tx- the X coordinate translationSince:
JavaFX 8.0
-
appendScale
public void appendScale(double sx, double sy)Appends the 2D scale to this instance. It is equivalent to
append(new Scale(sx, sy)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified scale second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorSince:
JavaFX 8.0
-
appendScale
public void appendScale(double sx, double sy, double pivotX, double pivotY)Appends the 2D scale with pivot to this instance. It is equivalent to
append(new Scale(sx, sy, pivotX, pivotY)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified scale second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorSince:
JavaFX 8.0
-
appendScale
public void appendScale(double sx, double sy, Point2D pivot)Appends the 2D scale with pivot to this instance. It is equivalent to
append(new Scale(sx, sy, pivot.getX(), pivot.getY()).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified scale second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorThrows:
NullPointerException- if the specifiedpivotis nullSince:
JavaFX 8.0
-
appendScale
public void appendScale(double sx, double sy, double sz)Appends the scale to this instance. It is equivalent to
append(new Scale(sx, sy, sz)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified scale second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorSince:
JavaFX 8.0
-
appendScale
public void appendScale(double sx, double sy, double sz, double pivotX, double pivotY, double pivotZ)Appends the scale with pivot to this instance. It is equivalent to
append(new Scale(sx, sy, sz, pivotX, pivotY, pivotZ)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified scale second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorSince:
JavaFX 8.0
-
appendScale
public void appendScale(double sx, double sy, double sz, Point3D pivot)Appends the scale with pivot to this instance. It is equivalent to
append(new Scale(sx, sy, sz, pivot.getX(), pivot.getY(), pivot.getZ())).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified scale second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorThrows:
NullPointerException- if the specifiedpivotis nullSince:
JavaFX 8.0
-
prependScale
public void prependScale(double sx, double sy)Prepends the 2D scale to this instance. It is equivalent to
prepend(new Scale(sx, sy)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified scale first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorSince:
JavaFX 8.0
-
prependScale
public void prependScale(double sx, double sy, double pivotX, double pivotY)Prepends the 2D scale with pivot to this instance. It is equivalent to
prepend(new Scale(sx, sy, pivotX, pivotY)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified scale first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorSince:
JavaFX 8.0
-
prependScale
public void prependScale(double sx, double sy, Point2D pivot)Prepends the 2D scale with pivot to this instance. It is equivalent to
prepend(new Scale(sx, sy, pivot.getX(), </p>pivot.getY())).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified scale first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorThrows:
NullPointerException- if the specifiedpivotis nullSince:
JavaFX 8.0
-
prependScale
public void prependScale(double sx, double sy, double sz)Prepends the scale to this instance. It is equivalent to
prepend(new Scale(sx, sy, sz)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified scale first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorSince:
JavaFX 8.0
-
prependScale
public void prependScale(double sx, double sy, double sz, double pivotX, double pivotY, double pivotZ)Prepends the scale with pivot to this instance. It is equivalent to
prepend(new Scale(sx, sy, sz, pivotX, pivotY, pivotZ)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified scale first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorSince:
JavaFX 8.0
-
prependScale
public void prependScale(double sx, double sy, double sz, Point3D pivot)Prepends the scale with pivot to this instance. It is equivalent to
prepend(new Scale(sx, sy, sz, pivot.getX(), pivot.getY(), pivot.getZ())).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified scale first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified scale.
Parameters:
sx- the X coordinate scale factorThrows:
NullPointerException- if the specifiedpivotis nullSince:
JavaFX 8.0
-
appendShear
public void appendShear(double shx, double shy)Appends the shear to this instance. It is equivalent to
append(new Shear(sx, sy)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified shear second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified shear.
Parameters:
shx- the XY coordinate elementSince:
JavaFX 8.0
-
appendShear
public void appendShear(double shx, double shy, double pivotX, double pivotY)Appends the shear with pivot to this instance. It is equivalent to
append(new Shear(sx, sy, pivotX, pivotY)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified shear second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified shear.
Parameters:
shx- the XY coordinate elementSince:
JavaFX 8.0
-
appendShear
public void appendShear(double shx, double shy, Point2D pivot)Appends the shear with pivot to this instance. It is equivalent to
append(new Shear(sx, sy, pivot.getX(), pivot.getY())).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified shear second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified shear.
Parameters:
shx- the XY coordinate elementThrows:
NullPointerException- if the specifiedpivotis nullSince:
JavaFX 8.0
-
prependShear
public void prependShear(double shx, double shy)Prepends the shear to this instance. It is equivalent to
prepend(new Shear(sx, sy)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified shear first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified shear.
Parameters:
shx- the XY coordinate elementSince:
JavaFX 8.0
-
prependShear
public void prependShear(double shx, double shy, double pivotX, double pivotY)Prepends the shear with pivot to this instance. It is equivalent to
prepend(new Shear(sx, sy, pivotX, pivotY)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified shear first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified shear.
Parameters:
shx- the XY coordinate elementSince:
JavaFX 8.0
-
prependShear
public void prependShear(double shx, double shy, Point2D pivot)Prepends the shear with pivot to this instance. It is equivalent to
prepend(new Shear(sx, sy, pivot.getX(), pivot.getY())).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified shear first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified shear.
Parameters:
shx- the XY coordinate elementThrows:
NullPointerException- if the specifiedpivotis nullSince:
JavaFX 8.0
-
appendRotation
public void appendRotation(double angle)
Appends the 2D rotation to this instance. It is equivalent to
append(new Rotate(angle)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified rotation second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesSince:
JavaFX 8.0
-
appendRotation
public void appendRotation(double angle, double pivotX, double pivotY)Appends the 2D rotation with pivot to this instance. It is equivalent to
append(new Rotate(angle, pivotX, pivotY)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified rotation second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesSince:
JavaFX 8.0
-
appendRotation
public void appendRotation(double angle, Point2D pivot)Appends the 2D rotation with pivot to this instance. It is equivalent to
append(new Rotate(angle, pivot.getX(), pivot.getY())).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified rotation second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesThrows:
NullPointerException- if the specifiedpivotis nullSince:
JavaFX 8.0
-
appendRotation
public void appendRotation(double angle, double pivotX, double pivotY, double pivotZ, double axisX, double axisY, double axisZ)Appends the rotation to this instance. It is equivalent to
append(new Rotate(angle, pivotX, pivotY, pivotZ, new Point3D(axisX, axisY, axisZ))).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified rotation second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesSince:
JavaFX 8.0
-
appendRotation
public void appendRotation(double angle, double pivotX, double pivotY, double pivotZ, Point3D axis)Appends the rotation to this instance. It is equivalent to
append(new Rotate(angle, pivotX, pivotY, pivotZ, axis)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified rotation second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesThrows:
NullPointerException- if the specifiedaxisis nullSince:
JavaFX 8.0
-
appendRotation
public void appendRotation(double angle, Point3D pivot, Point3D axis)Appends the rotation to this instance. It is equivalent to
append(new Rotate(angle, pivot.getX(), pivot.getY(), pivot.getZ(), axis)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list,thistransform first and the specified rotation second.From the matrix point of view, the transformation matrix of this transform is multiplied on the right by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesThrows:
NullPointerException- if the specifiedpivotoraxisis nullSince:
JavaFX 8.0
-
prependRotation
public void prependRotation(double angle)
Prepends the 2D rotation to this instance. It is equivalent to
prepend(new Rotate(angle)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified rotation first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesSince:
JavaFX 8.0
-
prependRotation
public void prependRotation(double angle, double pivotX, double pivotY)Prepends the 2D rotation with pivot to this instance. It is equivalent to
prepend(new Rotate(angle, pivotX, pivotY)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified rotation first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesSince:
JavaFX 8.0
-
prependRotation
public void prependRotation(double angle, Point2D pivot)Prepends the 2D rotation with pivot to this instance. It is equivalent to
prepend(new Rotate(angle, pivot.getX(), pivot.getY())).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified rotation first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesThrows:
NullPointerException- if the specifiedpivotis nullSince:
JavaFX 8.0
-
prependRotation
public void prependRotation(double angle, double pivotX, double pivotY, double pivotZ, double axisX, double axisY, double axisZ)Prepends the rotation to this instance. It is equivalent to
prepend(new Rotate(angle, pivotX, pivotY, pivotZ, new Point3D(axisX, axisY, axisZ))).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified rotation first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesSince:
JavaFX 8.0
-
prependRotation
public void prependRotation(double angle, double pivotX, double pivotY, double pivotZ, Point3D axis)Prepends the rotation to this instance. It is equivalent to
prepend(new Rotate(angle, pivotX, pivotY, pivotZ, axis)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified rotation first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesThrows:
NullPointerException- if the specifiedaxisis nullSince:
JavaFX 8.0
-
prependRotation
public void prependRotation(double angle, Point3D pivot, Point3D axis)Prepends the rotation to this instance. It is equivalent to
prepend(new Rotate(angle, pivot.getX(), pivot.getY(), pivot.getZ(), axis)).The operation modifies this transform in a way that applying it to a node has the same effect as adding two transforms to its
getTransforms()list, the specified rotation first andthistransform second.From the matrix point of view, the transformation matrix of this transform is multiplied on the left by the transformation matrix of the specified rotation.
Parameters:
angle- the angle of the rotation in degreesThrows:
NullPointerException- if the specifiedpivotoraxisis nullSince:
JavaFX 8.0
-
transform
public Point2D transform(double x, double y)Description copied from class:TransformTransforms the specified point by this transform. This method can be used only for 2D transforms.
-
transform
public Point3D transform(double x, double y, double z)Description copied from class:TransformTransforms the specified point by this transform.
-
deltaTransform
public Point2D deltaTransform(double x, double y)Description copied from class:TransformTransforms 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.Overrides:
deltaTransformin classTransformParameters:
x- vector magnitude in the direction of the X axisReturns:
the transformed relative magnitude vector represented by a
Point2Dinstance
-
deltaTransform
public Point3D deltaTransform(double x, double y, double z)Description copied from class:TransformTransforms the relative magnitude vector by this transform. The vector is transformed without applying the translation components of the affine transformation matrix.Overrides:
deltaTransformin classTransformParameters:
x- vector magnitude in the direction of the X axisReturns:
the transformed relative magnitude vector represented by a
Point3Dinstance
-
inverseTransform
public Point2D inverseTransform(double x, double y) throws NonInvertibleTransformExceptionDescription copied from class:TransformTransforms the specified point by the inverse of this transform. This method can be used only for 2D transforms.Overrides:
inverseTransformin classTransformParameters:
x- the X coordinate of the pointReturns:
the inversely transformed point
Throws:
NonInvertibleTransformException- if this transform cannot be inverted
-
inverseTransform
public Point3D inverseTransform(double x, double y, double z) throws NonInvertibleTransformExceptionDescription copied from class:TransformTransforms the specified point by the inverse of this transform.Overrides:
inverseTransformin classTransformParameters:
x- the X coordinate of the pointReturns:
the inversely transformed point
Throws:
NonInvertibleTransformException- if this transform cannot be inverted
-
inverseDeltaTransform
public Point2D inverseDeltaTransform(double x, double y) throws NonInvertibleTransformExceptionDescription copied from class:TransformTransforms 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.Overrides:
inverseDeltaTransformin classTransformParameters:
x- vector magnitude in the direction of the X axisReturns:
the inversely transformed relative magnitude vector represented by a
Point2DinstanceThrows:
NonInvertibleTransformException- if this transform cannot be inverted
-
inverseDeltaTransform
public Point3D inverseDeltaTransform(double x, double y, double z) throws NonInvertibleTransformExceptionDescription copied from class:TransformTransforms the relative magnitude vector by the inverse of this transform. The vector is transformed without applying the translation components of the affine transformation matrix.Overrides:
inverseDeltaTransformin classTransformParameters:
x- vector magnitude in the direction of the X axisReturns:
the inversely transformed relative magnitude vector represented by a
Point3DinstanceThrows:
NonInvertibleTransformException- if this transform cannot be inverted
-
toString
public String toString()
Returns a string representation of thisAffineobject.
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.