Top Description Fields Constructors Methods
javafx.scene.transform

public Class Translate

extends Transform
Class Inheritance
Imports
javafx.beans.property.DoubleProperty, .DoublePropertyBase, com.sun.javafx.geom.transform.Affine3D, .BaseTransform, javafx.geometry.Point2D, .Point3D

This class represents an Affine object that translates coordinates by the specified factors. The matrix representing the translating transformation by distances x, y and z is as follows:
             [   1   0   0   x   ]
             [   0   1   0   y   ]
             [   0   0   1   z   ]
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private DoubleProperty
x

Defines the distance by which coordinates are translated in the X axis direction

private DoubleProperty
y

Defines the distance by which coordinates are translated in the Y axis direction

private DoubleProperty
z

Defines the distance by which coordinates are translated in the Z axis direction

Constructor Summary

AccessConstructor and Description
public
Translate()

Creates a default Translate (identity).

public
Translate(double
the distance by which coordinates are translated in the X axis direction
x
,
double
the distance by which coordinates are translated in the Y axis direction
y
)

Creates a two-dimensional Translate.

public
Translate(double
the distance by which coordinates are translated in the X axis direction
x
,
double
the distance by which coordinates are translated in the Y axis direction
y
,
double
the distance by which coordinates are translated in the Z axis direction
z
)

Creates a three-dimensional Translate.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
appendTo(Affine
Affine instance to append to
a
)

Overrides javafx.scene.transform.Transform.appendTo.

Visitor from Affine class which provides an efficient append operation for the subclasses.

pack-priv void
apply(final Affine3D trans)

Implements abstract javafx.scene.transform.Transform.apply.

public Translate
clone()

Overrides javafx.scene.transform.Transform.clone.

Returns a deep copy of this transform.

pack-priv boolean
computeIs2D()

Overrides javafx.scene.transform.Transform.computeIs2D.

Computes if this transform is currently a 2D transform (has no effect in the direction of Z axis).

pack-priv boolean
computeIsIdentity()

Overrides javafx.scene.transform.Transform.computeIsIdentity.

Computes if this transform is currently an identity (has no effect in any direction).

public Transform
createConcatenation(Transform
transform to be concatenated with this transform
transform
)

Overrides javafx.scene.transform.Transform.createConcatenation.

Returns the concatenation of this transform and the specified transform.

public Translate
createInverse()

Overrides javafx.scene.transform.Transform.createInverse.

Returns the inverse transform of this transform.

public Point2D
deltaTransform(double
vector magnitude in the direction of the X axis
x
,
double
vector magnitude in the direction of the Y axis
y
)

Overrides javafx.scene.transform.Transform.deltaTransform.

Transforms the relative magnitude vector by this transform.

public Point2D
deltaTransform(Point2D
the relative magnitude vector
point
)

Overrides javafx.scene.transform.Transform.deltaTransform.

Transforms the relative magnitude vector represented by the specified Point2D instance by this transform.

public Point3D
deltaTransform(double
vector magnitude in the direction of the X axis
x
,
double
vector magnitude in the direction of the Y axis
y
,
double
vector magnitude in the direction of the Z axis
z
)

Overrides javafx.scene.transform.Transform.deltaTransform.

Transforms the relative magnitude vector by this transform.

public Point3D
deltaTransform(Point3D
the relative magnitude vector
point
)

Overrides javafx.scene.transform.Transform.deltaTransform.

Transforms the relative magnitude vector represented by the specified Point3D instance by this transform.

pack-priv BaseTransform
pack-priv void
fill2DArray(double[]
array to be filled with the 6 2D elements
array
)

Overrides javafx.scene.transform.Transform.fill2DArray.

Core of the toArray implementation for the 2D case.

pack-priv void
fill3DArray(double[]
array to be filled with the 12 3D elements
array
)

Overrides javafx.scene.transform.Transform.fill3DArray.

Core of the toArray implementation for the 3D case.

public double
getTx()

Overrides javafx.scene.transform.Transform.getTx.

Gets the X coordinate translation element of the 3x4 matrix.

public double
getTy()

Overrides javafx.scene.transform.Transform.getTy.

Gets the Y coordinate translation element of the 3x4 matrix.

public double
getTz()

Overrides javafx.scene.transform.Transform.getTz.

Gets the Z coordinate translation element of the 3x4 matrix.

public final double
getX()

public final double
getY()

public final double
getZ()

public Point2D
inverseDeltaTransform(double
vector magnitude in the direction of the X axis
x
,
double
vector magnitude in the direction of the Y axis
y
)

Overrides javafx.scene.transform.Transform.inverseDeltaTransform.

Transforms the relative magnitude vector by the inverse of this transform.

public Point2D
inverseDeltaTransform(Point2D
the relative magnitude vector
point
)

Overrides javafx.scene.transform.Transform.inverseDeltaTransform.

Transforms the relative magnitude vector represented by the specified Point2D instance by the inverse of this transform.

public Point3D
inverseDeltaTransform(double
vector magnitude in the direction of the X axis
x
,
double
vector magnitude in the direction of the Y axis
y
,
double
vector magnitude in the direction of the Z axis
z
)

Overrides javafx.scene.transform.Transform.inverseDeltaTransform.

Transforms the relative magnitude vector by the inverse of this transform.

public Point3D
inverseDeltaTransform(Point3D
the relative magnitude vector
point
)

Overrides javafx.scene.transform.Transform.inverseDeltaTransform.

Transforms the relative magnitude vector represented by the specified Point3D instance by the inverse of this transform.

public Point2D
inverseTransform(double
the X coordinate of the point
x
,
double
the Y coordinate of the point
y
)

Overrides javafx.scene.transform.Transform.inverseTransform.

Transforms the specified point by the inverse of this transform.

public Point3D
inverseTransform(double
the X coordinate of the point
x
,
double
the Y coordinate of the point
y
,
double
the Z coordinate of the point
z
)

Overrides javafx.scene.transform.Transform.inverseTransform.

Transforms the specified point by the inverse of this transform.

pack-priv void
inverseTransform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)

Overrides javafx.scene.transform.Transform.inverseTransform2DPointsImpl.

Core of the inverseTransform2DPoints method.

pack-priv void
inverseTransform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)

Overrides javafx.scene.transform.Transform.inverseTransform3DPointsImpl.

Core of the inverseTransform3DPoints method.

pack-priv void
prependTo(Affine
Affine instance to prepend to
a
)

Overrides javafx.scene.transform.Transform.prependTo.

Visitor from Affine class which provides an efficient prepend operation for the subclasses.

public final void
setX(double value)

public final void
setY(double value)

public final void
setZ(double value)

public String

Returns:

a string representation of this Translate object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this Translate object.

public Point2D
transform(double
the X coordinate of the point
x
,
double
the Y coordinate of the point
y
)

Overrides javafx.scene.transform.Transform.transform.

Transforms the specified point by this transform.

public Point3D
transform(double
the X coordinate of the point
x
,
double
the Y coordinate of the point
y
,
double
the Z coordinate of the point
z
)

Overrides javafx.scene.transform.Transform.transform.

Transforms the specified point by this transform.

pack-priv void
transform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)

Overrides javafx.scene.transform.Transform.transform2DPointsImpl.

Core of the transform2DPoints method.

pack-priv void
transform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)

Overrides javafx.scene.transform.Transform.transform3DPointsImpl.

Core of the transform3DPoints method.

pack-priv void
validate()

Overrides javafx.scene.transform.Transform.validate.

Needed for the proper delivery of the TransformChangedEvent.

public final DoubleProperty
public final DoubleProperty
public final DoubleProperty
Inherited from javafx.scene.transform.Transform:
addaddEventFilteraddEventHandleraffineaffinebuildEventDispatchChaincheckRequestedMATclearInverseCachecolumncolumncreateImmutableTransformcreateImmutableTransformcreateImmutableTransformcreateImmutableTransformdeterminantensureCanTransform2DPointgetElementgetMxxgetMxygetMxzgetMyxgetMyygetMyzgetMzxgetMzygetMzzgetOnTransformChangedidentityPropertyinverseTransforminverseTransforminverseTransforminverseTransform2DPointsinverseTransform3DPointsisIdentityisType2DonTransformChangedPropertyremoveremoveEventFilterremoveEventHandlerrotaterowrowscalescalesetOnTransformChangedshearshearsimilarTotoArraytoArraytransformtransformtransformtransform2DPointstransform3DPointstransformChangedtranslatetype2DProperty

Field Detail

xback to summary
private DoubleProperty x

Defines the distance by which coordinates are translated in the X axis direction

yback to summary
private DoubleProperty y

Defines the distance by which coordinates are translated in the Y axis direction

zback to summary
private DoubleProperty z

Defines the distance by which coordinates are translated in the Z axis direction

Constructor Detail

Translateback to summary
public Translate()

Creates a default Translate (identity).

Translateback to summary
public Translate(double x, double y)

Creates a two-dimensional Translate.

Parameters
x:double

the distance by which coordinates are translated in the X axis direction

y:double

the distance by which coordinates are translated in the Y axis direction

Translateback to summary
public Translate(double x, double y, double z)

Creates a three-dimensional Translate.

Parameters
x:double

the distance by which coordinates are translated in the X axis direction

y:double

the distance by which coordinates are translated in the Y axis direction

z:double

the distance by which coordinates are translated in the Z axis direction

Method Detail

appendToback to summary
pack-priv void appendTo(Affine a)

Overrides javafx.scene.transform.Transform.appendTo.

Doc from javafx.scene.transform.Transform.appendTo.

Visitor from Affine class which provides an efficient append operation for the subclasses.

Parameters
a:Affine

Affine instance to append to

Annotations
@Override
applyback to summary
pack-priv void apply(final Affine3D trans)

Implements abstract javafx.scene.transform.Transform.apply.

Annotations
@Override
cloneback to summary
public Translate clone()

Overrides javafx.scene.transform.Transform.clone.

Doc from javafx.scene.transform.Transform.clone.

Returns a deep copy of this transform.

Returns:Translate

a copy of this transform

Annotations
@Override
computeIs2Dback to summary
pack-priv boolean computeIs2D()

Overrides javafx.scene.transform.Transform.computeIs2D.

Doc from javafx.scene.transform.Transform.computeIs2D.

Computes if this transform is currently a 2D transform (has no effect in the direction of Z axis). Used by the subclasses to effectively provide value of the type2D property.

Returns:boolean

true if this transform is currently 2D-only

Annotations
@Override
computeIsIdentityback to summary
pack-priv boolean computeIsIdentity()

Overrides javafx.scene.transform.Transform.computeIsIdentity.

Doc from javafx.scene.transform.Transform.computeIsIdentity.

Computes if this transform is currently an identity (has no effect in any direction). Used by the subclasses to effectively provide value of the identity property.

Returns:boolean

true if this transform is currently an identity transform

Annotations
@Override
createConcatenationback to summary
public Transform createConcatenation(Transform transform)

Overrides javafx.scene.transform.Transform.createConcatenation.

Doc from javafx.scene.transform.Transform.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 its getTransforms() list, this transform first and the specified transform second.

Parameters
transform:Transform

transform to be concatenated with this transform

Returns:Transform

The concatenated transform

Annotations
@Override
createInverseback to summary
public Translate createInverse()

Overrides javafx.scene.transform.Transform.createInverse.

Doc from javafx.scene.transform.Transform.createInverse.

Returns the inverse transform of this transform.

Returns:Translate

the inverse transform

Annotations
@Override
deltaTransformback to summary
public Point2D deltaTransform(double x, double y)

Overrides javafx.scene.transform.Transform.deltaTransform.

Doc from javafx.scene.transform.Transform.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:double

vector magnitude in the direction of the X axis

y:double

vector magnitude in the direction of the Y axis

Returns:Point2D

the transformed relative magnitude vector represented by a Point2D instance

Annotations
@Override
deltaTransformback to summary
public Point2D deltaTransform(Point2D point)

Overrides javafx.scene.transform.Transform.deltaTransform.

Doc from javafx.scene.transform.Transform.deltaTransform.

Transforms the relative magnitude vector represented by the specified Point2D instance by this transform. The vector is transformed without applying the translation components of the affine transformation matrix. This method can be used only for a 2D transform.

Parameters
point:Point2D

the relative magnitude vector

Returns:Point2D

the transformed relative magnitude vector represented by a Point2D instance

Annotations
@Override
deltaTransformback to summary
public Point3D deltaTransform(double x, double y, double z)

Overrides javafx.scene.transform.Transform.deltaTransform.

Doc from javafx.scene.transform.Transform.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:double

vector magnitude in the direction of the X axis

y:double

vector magnitude in the direction of the Y axis

z:double

vector magnitude in the direction of the Z axis

Returns:Point3D

the transformed relative magnitude vector represented by a Point3D instance

Annotations
@Override
deltaTransformback to summary
public Point3D deltaTransform(Point3D point)

Overrides javafx.scene.transform.Transform.deltaTransform.

Doc from javafx.scene.transform.Transform.deltaTransform.

Transforms the relative magnitude vector represented by the specified Point3D instance by this transform. The vector is transformed without applying the translation components of the affine transformation matrix.

Parameters
point:Point3D

the relative magnitude vector

Returns:Point3D

the transformed relative magnitude vector represented by a Point3D instance

Annotations
@Override
deriveback to summary
pack-priv BaseTransform derive(final BaseTransform trans)

Implements abstract javafx.scene.transform.Transform.derive.

Annotations
@Override
fill2DArrayback to summary
pack-priv void fill2DArray(double[] array)

Overrides javafx.scene.transform.Transform.fill2DArray.

Doc from javafx.scene.transform.Transform.fill2DArray.

Core of the toArray implementation for the 2D case. All of the checks has been made by the enclosing method as well as the constant elements filled, this method only fills the varying elements to the array. Used by subclasses to fill the elements efficiently.

Parameters
array:double[]

array to be filled with the 6 2D elements

Annotations
@Override
fill3DArrayback to summary
pack-priv void fill3DArray(double[] array)

Overrides javafx.scene.transform.Transform.fill3DArray.

Doc from javafx.scene.transform.Transform.fill3DArray.

Core of the toArray implementation for the 3D case. All of the checks has been made by the enclosing method as well as the constant elements filled, this method only fills the varying elements to the array. Used by subclasses to fill the elements efficiently.

Parameters
array:double[]

array to be filled with the 12 3D elements

Annotations
@Override
getTxback to summary
public double getTx()

Overrides javafx.scene.transform.Transform.getTx.

Doc from javafx.scene.transform.Transform.getTx.

Gets the X coordinate translation element of the 3x4 matrix.

Returns:double

the X coordinate translation element of the 3x4 matrix

Annotations
@Override
getTyback to summary
public double getTy()

Overrides javafx.scene.transform.Transform.getTy.

Doc from javafx.scene.transform.Transform.getTy.

Gets the Y coordinate translation element of the 3x4 matrix.

Returns:double

the Y coordinate translation element of the 3x4 matrix

Annotations
@Override
getTzback to summary
public double getTz()

Overrides javafx.scene.transform.Transform.getTz.

Doc from javafx.scene.transform.Transform.getTz.

Gets the Z coordinate translation element of the 3x4 matrix.

Returns:double

the Z coordinate translation element of the 3x4 matrix

Annotations
@Override
getXback to summary
public final double getX()
getYback to summary
public final double getY()
getZback to summary
public final double getZ()
inverseDeltaTransformback to summary
public Point2D inverseDeltaTransform(double x, double y)

Overrides javafx.scene.transform.Transform.inverseDeltaTransform.

Doc from javafx.scene.transform.Transform.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:double

vector magnitude in the direction of the X axis

y:double

vector magnitude in the direction of the Y axis

Returns:Point2D

the inversely transformed relative magnitude vector represented by a Point2D instance

Annotations
@Override
inverseDeltaTransformback to summary
public Point2D inverseDeltaTransform(Point2D point)

Overrides javafx.scene.transform.Transform.inverseDeltaTransform.

Doc from javafx.scene.transform.Transform.inverseDeltaTransform.

Transforms the relative magnitude vector represented by the specified Point2D instance by the inverse of this transform. The vector is transformed without applying the translation components of the affine transformation matrix. This method can be used only for a 2D transform.

Parameters
point:Point2D

the relative magnitude vector

Returns:Point2D

the inversely transformed relative magnitude vector represented by a Point2D instance

Annotations
@Override
inverseDeltaTransformback to summary
public Point3D inverseDeltaTransform(double x, double y, double z)

Overrides javafx.scene.transform.Transform.inverseDeltaTransform.

Doc from javafx.scene.transform.Transform.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.

Parameters
x:double

vector magnitude in the direction of the X axis

y:double

vector magnitude in the direction of the Y axis

z:double

vector magnitude in the direction of the Z axis

Returns:Point3D

the inversely transformed relative magnitude vector represented by a Point3D instance

Annotations
@Override
inverseDeltaTransformback to summary
public Point3D inverseDeltaTransform(Point3D point)

Overrides javafx.scene.transform.Transform.inverseDeltaTransform.

Doc from javafx.scene.transform.Transform.inverseDeltaTransform.

Transforms the relative magnitude vector represented by the specified Point3D instance by the inverse of this transform. The vector is transformed without applying the translation components of the affine transformation matrix.

Parameters
point:Point3D

the relative magnitude vector

Returns:Point3D

the inversely transformed relative magnitude vector represented by a Point3D instance

Annotations
@Override
inverseTransformback to summary
public Point2D inverseTransform(double x, double y)

Overrides javafx.scene.transform.Transform.inverseTransform.

Doc from javafx.scene.transform.Transform.inverseTransform.

Transforms the specified point by the inverse of this transform. This method can be used only for 2D transforms.

Parameters
x:double

the X coordinate of the point

y:double

the Y coordinate of the point

Returns:Point2D

the inversely transformed point

Annotations
@Override
inverseTransformback to summary
public Point3D inverseTransform(double x, double y, double z)

Overrides javafx.scene.transform.Transform.inverseTransform.

Doc from javafx.scene.transform.Transform.inverseTransform.

Transforms the specified point by the inverse of this transform.

Parameters
x:double

the X coordinate of the point

y:double

the Y coordinate of the point

z:double

the Z coordinate of the point

Returns:Point3D

the inversely transformed point

Annotations
@Override
inverseTransform2DPointsImplback to summary
pack-priv void inverseTransform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)

Overrides javafx.scene.transform.Transform.inverseTransform2DPointsImpl.

Doc from javafx.scene.transform.Transform.inverseTransform2DPointsImpl.

Core of the inverseTransform2DPoints method. All the checks has been performed and the care of the overlaps has been taken by the enclosing method, this method only transforms the points and fills them to the array. Used by the subclasses to perform the transform efficiently.

Annotations
@Override
inverseTransform3DPointsImplback to summary
pack-priv void inverseTransform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)

Overrides javafx.scene.transform.Transform.inverseTransform3DPointsImpl.

Doc from javafx.scene.transform.Transform.inverseTransform3DPointsImpl.

Core of the inverseTransform3DPoints method. All the checks has been performed and the care of the overlaps has been taken by the enclosing method, this method only transforms the points and fills them to the array. Used by the subclasses to perform the transform efficiently.

Annotations
@Override
prependToback to summary
pack-priv void prependTo(Affine a)

Overrides javafx.scene.transform.Transform.prependTo.

Doc from javafx.scene.transform.Transform.prependTo.

Visitor from Affine class which provides an efficient prepend operation for the subclasses.

Parameters
a:Affine

Affine instance to prepend to

Annotations
@Override
setXback to summary
public final void setX(double value)
setYback to summary
public final void setY(double value)
setZback to summary
public final void setZ(double value)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this Translate object.

Returns:String

a string representation of this Translate object.

Annotations
@Override
transformback to summary
public Point2D transform(double x, double y)

Overrides javafx.scene.transform.Transform.transform.

Doc from javafx.scene.transform.Transform.transform.

Transforms the specified point by this transform. This method can be used only for 2D transforms.

Parameters
x:double

the X coordinate of the point

y:double

the Y coordinate of the point

Returns:Point2D

the transformed point

Annotations
@Override
transformback to summary
public Point3D transform(double x, double y, double z)

Overrides javafx.scene.transform.Transform.transform.

Doc from javafx.scene.transform.Transform.transform.

Transforms the specified point by this transform.

Parameters
x:double

the X coordinate of the point

y:double

the Y coordinate of the point

z:double

the Z coordinate of the point

Returns:Point3D

the transformed point

Annotations
@Override
transform2DPointsImplback to summary
pack-priv void transform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)

Overrides javafx.scene.transform.Transform.transform2DPointsImpl.

Doc from javafx.scene.transform.Transform.transform2DPointsImpl.

Core of the transform2DPoints method. All the checks has been performed and the care of the overlaps has been taken by the enclosing method, this method only transforms the points and fills them to the array. Used by the subclasses to perform the transform efficiently.

Annotations
@Override
transform3DPointsImplback to summary
pack-priv void transform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)

Overrides javafx.scene.transform.Transform.transform3DPointsImpl.

Doc from javafx.scene.transform.Transform.transform3DPointsImpl.

Core of the transform3DPoints method. All the checks has been performed and the care of the overlaps has been taken by the enclosing method, this method only transforms the points and fills them to the array. Used by the subclasses to perform the transform efficiently.

Annotations
@Override
validateback to summary
pack-priv void validate()

Overrides javafx.scene.transform.Transform.validate.

Doc from javafx.scene.transform.Transform.validate.

Needed for the proper delivery of the TransformChangedEvent. If the members are invalid, the transformChanged() notification is not called and the event is not delivered. To avoid that we need to manually validate all properties. Subclasses validate their specific properties.

Annotations
@Override
xPropertyback to summary
public final DoubleProperty xProperty()
yPropertyback to summary
public final DoubleProperty yProperty()
zPropertyback to summary
public final DoubleProperty zProperty()