Spec-Zone .ru
спецификации, руководства, описания, API
|
public class Rotate extends Transform
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).
For example, the matrix representing the returned transform of
new Rotate (theta, x, y, z) around the Z-axis
is :
[ cos(theta) -sin(theta) 0 x-x*cos+y*sin ] [ sin(theta) cos(theta) 0 y-x*sin-y*cos ] [ 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));
Type | Property and Description |
---|---|
DoubleProperty |
angle
Defines the angle of rotation measured in degrees.
|
ObjectProperty<Point3D> |
axis
Defines the axis of rotation at the pivot point.
|
DoubleProperty |
pivotX
Defines the X coordinate of the rotation pivot point.
|
DoubleProperty |
pivotY
Defines the Y coordinate of the rotation pivot point.
|
DoubleProperty |
pivotZ
Defines the Z coordinate of the rotation pivot point.
|
Modifier and Type | Field and Description |
---|---|
static Point3D |
X_AXIS
Specifies the X-axis as the axis of rotation.
|
static Point3D |
Y_AXIS
Specifies the Y-axis as the axis of rotation.
|
static Point3D |
Z_AXIS
Specifies the Z-axis as the axis of rotation.
|
Constructor and Description |
---|
Rotate()
Creates a default Rotate transform (identity).
|
Rotate(double angle)
Creates a two-dimensional Rotate transform.
|
Rotate(double angle,
double pivotX,
double pivotY)
Creates a two-dimensional Rotate transform with pivot.
|
Rotate(double angle,
double pivotX,
double pivotY,
double pivotZ)
Creates a simple Rotate transform with three-dimensional pivot.
|
Rotate(double angle,
double pivotX,
double pivotY,
double pivotZ,
Point3D axis)
Creates a three-dimensional Rotate transform with pivot.
|
Rotate(double angle,
Point3D axis)
Creates a three-dimensional Rotate transform.
|
Modifier and Type | Method and Description |
---|---|
DoubleProperty |
angleProperty()
Defines the angle of rotation measured in degrees.
|
ObjectProperty<Point3D> |
axisProperty()
Defines the axis of rotation at the pivot point.
|
double |
getAngle()
Defines the angle of rotation measured in degrees.
|
Point3D |
getAxis()
Defines the axis of rotation at the pivot point.
|
double |
getPivotX()
Defines the X coordinate of the rotation pivot point.
|
double |
getPivotY()
Defines the Y coordinate of the rotation pivot point.
|
double |
getPivotZ()
Defines the Z coordinate of the rotation pivot point.
|
DoubleProperty |
pivotXProperty()
Defines the X coordinate of the rotation pivot point.
|
DoubleProperty |
pivotYProperty()
Defines the Y coordinate of the rotation pivot point.
|
DoubleProperty |
pivotZProperty()
Defines the Z coordinate of the rotation pivot point.
|
void |
setAngle(double value)
Defines the angle of rotation measured in degrees.
|
void |
setAxis(Point3D value)
Defines the axis of rotation at the pivot point.
|
void |
setPivotX(double value)
Defines the X coordinate of the rotation pivot point.
|
void |
setPivotY(double value)
Defines the Y coordinate of the rotation pivot point.
|
void |
setPivotZ(double value)
Defines the Z coordinate of the rotation pivot point.
|
java.lang.String |
toString()
Returns a string representation of this
Rotate object. |
getAngle()
,
setAngle(double)
getPivotX()
,
setPivotX(double)
getPivotY()
,
setPivotY(double)
getPivotZ()
,
setPivotZ(double)
getAxis()
,
setAxis(Point3D)
public static final Point3D X_AXIS
public static final Point3D Y_AXIS
public static final Point3D Z_AXIS
public Rotate()
public Rotate(double angle)
angle
- the angle of rotation measured in degreespublic Rotate(double angle, Point3D axis)
angle
- the angle of rotation measured in degreesaxis
- the axis of rotationpublic Rotate(double angle, double pivotX, double pivotY)
angle
- the angle of rotation measured in degreespivotX
- the X coordinate of the rotation pivot pointpivotY
- the Y coordinate of the rotation pivot pointpublic Rotate(double angle, double pivotX, double pivotY, double pivotZ)
angle
- the angle of rotation measured in degreespivotX
- the X coordinate of the rotation pivot pointpivotY
- the Y coordinate of the rotation pivot pointpivotZ
- the Z coordinate of the rotation pivot pointpublic Rotate(double angle, double pivotX, double pivotY, double pivotZ, Point3D axis)
angle
- the angle of rotation measured in degreespivotX
- the X coordinate of the rotation pivot pointpivotY
- the Y coordinate of the rotation pivot pointpivotZ
- the Z coordinate of the rotation pivot pointaxis
- the axis of rotationpublic final void setAngle(double value)
public final double getAngle()
public final DoubleProperty angleProperty()
getAngle()
,
setAngle(double)
public final void setPivotX(double value)
public final double getPivotX()
public final DoubleProperty pivotXProperty()
getPivotX()
,
setPivotX(double)
public final void setPivotY(double value)
public final double getPivotY()
public final DoubleProperty pivotYProperty()
getPivotY()
,
setPivotY(double)
public final void setPivotZ(double value)
public final double getPivotZ()
public final DoubleProperty pivotZProperty()
getPivotZ()
,
setPivotZ(double)
public final void setAxis(Point3D value)
public final Point3D getAxis()
public final ObjectProperty<Point3D> axisProperty()
getAxis()
,
setAxis(Point3D)
public java.lang.String toString()
Rotate
object.toString
in class java.lang.Object
Rotate
object.Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to