Affine object that rotates coordinates
around an anchor point. This operation is equivalent to translating the
coordinates so that the anchor point is at the origin (S1), then rotating them
about the new origin (S2), and finally translating so that the
intermediate origin is restored to the coordinates of the original
anchor point (S3).
The matrix representing the rotation transformation around an axis (x,y,z)
by an angle t is as follows:
[ cos(t) -sin(t) 0 x-x*cos(t)+y*sin(t) ]
[ sin(t) cos(t) 0 y-x*sin(t)-y*cos(t) ]
[ 0 0 1 z ]
For example, to rotate a text 30 degrees around the Z-axis at anchor point of (50,30):
Text text = new Text("This is a test");
text.setX(10);
text.setY(50);
text.setFont(new Font(20));
text.getTransforms().add(new Rotate(30, 50, 30));
| Modifier and Type | Class and Description |
|---|---|
| private static class | Rotate.
Matrix cache. |
| Modifier and Type | Field and Description |
|---|---|
| private DoubleProperty | angle
Defines the angle of rotation measured in degrees. |
| private ObjectProperty | axis
Defines the axis of rotation at the pivot point. |
| private Rotate. | cache
Avoids lot of repeated computation. |
| private Rotate. | inverseCache
Avoids lot of repeated computation.
|
| private DoubleProperty | pivotX
Defines the X coordinate of the rotation pivot point. |
| private DoubleProperty | pivotY
Defines the Y coordinate of the rotation pivot point. |
| private DoubleProperty | pivotZ
Defines the Z coordinate of the rotation pivot point. |
| public static final Point3D | X_AXIS
Specifies the X-axis as the axis of rotation. |
| public static final Point3D | Y_AXIS
Specifies the Y-axis as the axis of rotation. |
| public static final Point3D | Z_AXIS
Specifies the Z-axis as the axis of rotation. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Rotate(double
the angle of rotation measured in degrees angle)Creates a two-dimensional Rotate transform. |
| public | |
| public | Rotate(double
the angle of rotation measured in degrees angle, double the X coordinate of the rotation pivot point pivotX, double the Y coordinate of the rotation pivot point pivotY)Creates a two-dimensional Rotate transform with pivot. |
| public | Rotate(double
the angle of rotation measured in degrees angle, double the X coordinate of the rotation pivot point pivotX, double the Y coordinate of the rotation pivot point pivotY, double the Z coordinate of the rotation pivot point pivotZ)Creates a simple Rotate transform with three-dimensional pivot. |
| public | Rotate(double
the angle of rotation measured in degrees angle, double the X coordinate of the rotation pivot point pivotX, double the Y coordinate of the rotation pivot point pivotY, double the Z coordinate of the rotation pivot point pivotZ, Point3D the axis of rotation axis)Creates a three-dimensional Rotate transform with pivot. |
| Modifier and Type | Method and Description |
|---|---|
| public final DoubleProperty | |
| pack-priv void | appendTo(Affine
Affine instance to append toOverrides javafx. Visitor from |
| pack-priv void | |
| public final ObjectProperty | |
| public Rotate | |
| pack-priv boolean | computeIs2D()
Overrides javafx. Computes if this transform is currently a 2D transform (has no effect in the direction of Z axis). |
| pack-priv boolean | computeIsIdentity()
Overrides javafx. 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. Returns the concatenation of this transform and the specified transform. |
| public Transform | createInverse()
Overrides javafx. 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. Transforms the relative magnitude vector 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. Transforms the relative magnitude vector by this transform. |
| pack-priv BaseTransform | |
| pack-priv void | fill2DArray(double[]
array to be filled with the 6 2D elements array)Overrides javafx. 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. Core of the toArray implementation for the 3D case. |
| public final double | |
| public final Point3D | |
| public double | getMxx()
Overrides javafx. Gets the X coordinate scaling element of the 3x4 matrix. |
| public double | getMxy()
Overrides javafx. Gets the XY coordinate element of the 3x4 matrix. |
| public double | getMxz()
Overrides javafx. Gets the XZ coordinate element of the 3x4 matrix. |
| public double | getMyx()
Overrides javafx. Gets the YX coordinate element of the 3x4 matrix. |
| public double | getMyy()
Overrides javafx. Gets the Y coordinate scaling element of the 3x4 matrix. |
| public double | getMyz()
Overrides javafx. Gets the YZ coordinate element of the 3x4 matrix. |
| public double | getMzx()
Overrides javafx. Gets the ZX coordinate element of the 3x4 matrix. |
| public double | getMzy()
Overrides javafx. Gets the ZY coordinate element of the 3x4 matrix. |
| public double | getMzz()
Overrides javafx. Gets the Z coordinate scaling element of the 3x4 matrix. |
| public final double | |
| public final double | |
| public final double | |
| public double | getTx()
Overrides javafx. Gets the X coordinate translation element of the 3x4 matrix. |
| public double | getTy()
Overrides javafx. Gets the Y coordinate translation element of the 3x4 matrix. |
| public double | getTz()
Overrides javafx. Gets the Z coordinate translation element of the 3x4 matrix. |
| 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. Transforms the relative magnitude vector 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. Transforms the relative magnitude vector 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. 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. 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. Core of the inverseTransform2DPoints method. |
| pack-priv void | inverseTransform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
Overrides javafx. Core of the inverseTransform3DPoints method. |
| public final DoubleProperty | |
| public final DoubleProperty | |
| public final DoubleProperty | |
| pack-priv void | prependTo(Affine
Affine instance to prepend toOverrides javafx. Visitor from |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public String | Returns: a string representation of thisRotate object.Overrides java. Returns a string representation of this |
| public Point2D | transform(double
the X coordinate of the point x, double the Y coordinate of the point y)Overrides javafx. 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. Transforms the specified point by this transform. |
| pack-priv void | transform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
Overrides javafx. Core of the transform2DPoints method. |
| pack-priv void | transform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
Overrides javafx. Core of the transform3DPoints method. |
| protected void | transformChanged()
Overrides javafx. This method must be called by all transforms whenever any of their parameters changes. |
| private void | |
| private void | |
| pack-priv void | validate()
Overrides javafx. Needed for the proper delivery of the TransformChangedEvent. |
| angle | back to summary |
|---|---|
| private DoubleProperty angle Defines the angle of rotation measured in degrees. | |
| axis | back to summary |
|---|---|
| private ObjectProperty<Point3D> axis Defines the axis of rotation at the pivot point. | |
| cache | back to summary |
|---|---|
| private Rotate. Avoids lot of repeated computation.
| |
| inverseCache | back to summary |
|---|---|
| private Rotate. Hides javafx. Avoids lot of repeated computation.
| |
| pivotX | back to summary |
|---|---|
| private DoubleProperty pivotX Defines the X coordinate of the rotation pivot point.
| |
| pivotY | back to summary |
|---|---|
| private DoubleProperty pivotY Defines the Y coordinate of the rotation pivot point.
| |
| pivotZ | back to summary |
|---|---|
| private DoubleProperty pivotZ Defines the Z coordinate of the rotation pivot point.
| |
| X_AXIS | back to summary |
|---|---|
| public static final Point3D X_AXIS Specifies the X-axis as the axis of rotation. | |
| Y_AXIS | back to summary |
|---|---|
| public static final Point3D Y_AXIS Specifies the Y-axis as the axis of rotation. | |
| Z_AXIS | back to summary |
|---|---|
| public static final Point3D Z_AXIS Specifies the Z-axis as the axis of rotation. | |
| Rotate | back to summary |
|---|---|
| public Rotate() Creates a default Rotate transform (identity). | |
| Rotate | back to summary |
|---|---|
| public Rotate(double angle) Creates a two-dimensional Rotate transform. The pivot point is set to (0,0)
| |
| Rotate | back to summary |
|---|---|
| public Rotate(double angle, Point3D axis) Creates a three-dimensional Rotate transform. The pivot point is set to (0,0,0)
| |
| Rotate | back to summary |
|---|---|
| public Rotate(double angle, double pivotX, double pivotY) Creates a two-dimensional Rotate transform with pivot.
| |
| Rotate | back to summary |
|---|---|
| public Rotate(double angle, double pivotX, double pivotY, double pivotZ) Creates a simple Rotate transform with three-dimensional pivot.
| |
| Rotate | back to summary |
|---|---|
| public Rotate(double angle, double pivotX, double pivotY, double pivotZ, Point3D axis) Creates a three-dimensional Rotate transform with pivot.
| |
| angleProperty | back to summary |
|---|---|
| public final DoubleProperty angleProperty() | |
| appendTo | back to summary |
|---|---|
| pack-priv void appendTo(Affine a) Overrides javafx. Doc from javafx. Visitor from | |
| apply | back to summary |
|---|---|
| pack-priv void apply(final Affine3D trans) Implements abstract javafx.
| |
| axisProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| clone | back to summary |
|---|---|
| public Rotate clone() Overrides javafx. Doc from javafx. Returns a deep copy of this transform. | |
| computeIs2D | back to summary |
|---|---|
| pack-priv boolean computeIs2D() Overrides javafx. Doc from javafx. 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.
| |
| computeIsIdentity | back to summary |
|---|---|
| pack-priv boolean computeIsIdentity() Overrides javafx. Doc from javafx. 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.
| |
| createConcatenation | back to summary |
|---|---|
| public Transform createConcatenation(Transform transform) Overrides javafx. Doc from javafx. 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 | |
| createInverse | back to summary |
|---|---|
| public Transform createInverse() throws NonInvertibleTransformException Overrides javafx. Doc from javafx. Returns the inverse transform of this transform.
| |
| deltaTransform | back to summary |
|---|---|
| public Point2D deltaTransform(double x, double y) Overrides javafx. Doc from javafx. 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. | |
| deltaTransform | back to summary |
|---|---|
| public Point3D deltaTransform(double x, double y, double z) Overrides javafx. Doc from javafx. Transforms the relative magnitude vector by this transform. The vector is transformed without applying the translation components of the affine transformation matrix. | |
| derive | back to summary |
|---|---|
| pack-priv BaseTransform derive(BaseTransform trans) Implements abstract javafx.
| |
| fill2DArray | back to summary |
|---|---|
| pack-priv void fill2DArray(double[] array) Overrides javafx. Doc from javafx. 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.
| |
| fill3DArray | back to summary |
|---|---|
| pack-priv void fill3DArray(double[] array) Overrides javafx. Doc from javafx. 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.
| |
| getAngle | back to summary |
|---|---|
| public final double getAngle() | |
| getAxis | back to summary |
|---|---|
| public final Point3D getAxis() | |
| getMxx | back to summary |
|---|---|
| public double getMxx() Overrides javafx. Doc from javafx. Gets the X coordinate scaling element of the 3x4 matrix.
| |
| getMxy | back to summary |
|---|---|
| public double getMxy() Overrides javafx. Doc from javafx. Gets the XY coordinate element of the 3x4 matrix.
| |
| getMxz | back to summary |
|---|---|
| public double getMxz() Overrides javafx. Doc from javafx. Gets the XZ coordinate element of the 3x4 matrix.
| |
| getMyx | back to summary |
|---|---|
| public double getMyx() Overrides javafx. Doc from javafx. Gets the YX coordinate element of the 3x4 matrix.
| |
| getMyy | back to summary |
|---|---|
| public double getMyy() Overrides javafx. Doc from javafx. Gets the Y coordinate scaling element of the 3x4 matrix.
| |
| getMyz | back to summary |
|---|---|
| public double getMyz() Overrides javafx. Doc from javafx. Gets the YZ coordinate element of the 3x4 matrix.
| |
| getMzx | back to summary |
|---|---|
| public double getMzx() Overrides javafx. Doc from javafx. Gets the ZX coordinate element of the 3x4 matrix.
| |
| getMzy | back to summary |
|---|---|
| public double getMzy() Overrides javafx. Doc from javafx. Gets the ZY coordinate element of the 3x4 matrix.
| |
| getMzz | back to summary |
|---|---|
| public double getMzz() Overrides javafx. Doc from javafx. Gets the Z coordinate scaling element of the 3x4 matrix.
| |
| getPivotX | back to summary |
|---|---|
| public final double getPivotX() | |
| getPivotY | back to summary |
|---|---|
| public final double getPivotY() | |
| getPivotZ | back to summary |
|---|---|
| public final double getPivotZ() | |
| getTx | back to summary |
|---|---|
| public double getTx() Overrides javafx. Doc from javafx. Gets the X coordinate translation element of the 3x4 matrix.
| |
| getTy | back to summary |
|---|---|
| public double getTy() Overrides javafx. Doc from javafx. Gets the Y coordinate translation element of the 3x4 matrix.
| |
| getTz | back to summary |
|---|---|
| public double getTz() Overrides javafx. Doc from javafx. Gets the Z coordinate translation element of the 3x4 matrix.
| |
| inverseDeltaTransform | back to summary |
|---|---|
| public Point2D inverseDeltaTransform(double x, double y) Overrides javafx. Doc from javafx. 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. | |
| inverseDeltaTransform | back to summary |
|---|---|
| public Point3D inverseDeltaTransform(double x, double y, double z) Overrides javafx. Doc from javafx. 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.
| |
| inverseTransform | back to summary |
|---|---|
| public Point2D inverseTransform(double x, double y) Overrides javafx. Doc from javafx. Transforms the specified point by the inverse of this transform. This method can be used only for 2D transforms. | |
| inverseTransform | back to summary |
|---|---|
| public Point3D inverseTransform(double x, double y, double z) Overrides javafx. Doc from javafx. Transforms the specified point by the inverse of this transform. | |
| inverseTransform2DPointsImpl | back to summary |
|---|---|
| pack-priv void inverseTransform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Overrides javafx. Doc from javafx. 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.
| |
| inverseTransform3DPointsImpl | back to summary |
|---|---|
| pack-priv void inverseTransform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Overrides javafx. Doc from javafx. 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.
| |
| pivotXProperty | back to summary |
|---|---|
| public final DoubleProperty pivotXProperty() | |
| pivotYProperty | back to summary |
|---|---|
| public final DoubleProperty pivotYProperty() | |
| pivotZProperty | back to summary |
|---|---|
| public final DoubleProperty pivotZProperty() | |
| prependTo | back to summary |
|---|---|
| pack-priv void prependTo(Affine a) Overrides javafx. Doc from javafx. Visitor from | |
| setAngle | back to summary |
|---|---|
| public final void setAngle(double value) | |
| setAxis | back to summary |
|---|---|
| public final void setAxis(Point3D value) | |
| setPivotX | back to summary |
|---|---|
| public final void setPivotX(double value) | |
| setPivotY | back to summary |
|---|---|
| public final void setPivotY(double value) | |
| setPivotZ | back to summary |
|---|---|
| public final void setPivotZ(double value) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this | |
| transform | back to summary |
|---|---|
| public Point2D transform(double x, double y) Overrides javafx. Doc from javafx. Transforms the specified point by this transform. This method can be used only for 2D transforms. | |
| transform | back to summary |
|---|---|
| public Point3D transform(double x, double y, double z) Overrides javafx. Doc from javafx. Transforms the specified point by this transform. | |
| transform2DPointsImpl | back to summary |
|---|---|
| pack-priv void transform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Overrides javafx. Doc from javafx. 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.
| |
| transform3DPointsImpl | back to summary |
|---|---|
| pack-priv void transform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Overrides javafx. Doc from javafx. 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.
| |
| transformChanged | back to summary |
|---|---|
| protected void transformChanged() Overrides javafx. Doc from javafx. 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).
| |
| updateCache | back to summary |
|---|---|
| private void updateCache() Updates the matrix cache | |
| updateInverseCache | back to summary |
|---|---|
| private void updateInverseCache() Updates the inverse matrix cache | |
| validate | back to summary |
|---|---|
| pack-priv void validate() Overrides javafx. Doc from javafx. 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.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv boolean | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv double | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void |
| is3D | back to summary |
|---|---|
| pack-priv boolean is3D | |
| mxx | back to summary |
|---|---|
| pack-priv double mxx | |
| mxy | back to summary |
|---|---|
| pack-priv double mxy | |
| mxz | back to summary |
|---|---|
| pack-priv double mxz | |
| myx | back to summary |
|---|---|
| pack-priv double myx | |
| myy | back to summary |
|---|---|
| pack-priv double myy | |
| myz | back to summary |
|---|---|
| pack-priv double myz | |
| mzx | back to summary |
|---|---|
| pack-priv double mzx | |
| mzy | back to summary |
|---|---|
| pack-priv double mzy | |
| mzz | back to summary |
|---|---|
| pack-priv double mzz | |
| tx | back to summary |
|---|---|
| pack-priv double tx | |
| ty | back to summary |
|---|---|
| pack-priv double ty | |
| tz | back to summary |
|---|---|
| pack-priv double tz | |
| valid | back to summary |
|---|---|
| pack-priv boolean valid | |
| MatrixCache | back to summary |
|---|---|
| public MatrixCache() | |
| invalidate | back to summary |
|---|---|
| public void invalidate() | |
| update | back to summary |
|---|---|
| public void update(double angle, Point3D axis, double px, double py, double pz) | |