public abstract class AffineBase extends BaseTransform
BaseTransform.Degree
Modifier and Type | Field and Description |
---|---|
protected static int |
APPLY_2D_DELTA_MASK |
protected static int |
APPLY_2D_MASK |
protected static int |
APPLY_3D
This constant is used for the internal state variable to indicate
that the 3D (Z) components of the matrix (m*z and mz*) need
to be factored in to complete the transformation equation of this
transform.
|
protected static int |
APPLY_IDENTITY
This constant is used for the internal state variable to indicate
that no calculations need to be performed and that the source
coordinates only need to be copied to their destinations to
complete the transformation equation of this transform.
|
protected static int |
APPLY_SCALE
This constant is used for the internal state variable to indicate
that the scaling components of the matrix (m00 and m11) need
to be factored in to complete the transformation equation of
this transform.
|
protected static int |
APPLY_SHEAR
This constant is used for the internal state variable to indicate
that the shearing components of the matrix (m01 and m10) need
to be factored in to complete the transformation equation of this
transform.
|
protected static int |
APPLY_TRANSLATE
This constant is used for the internal state variable to indicate
that the translation components of the matrix (m02 and m12) need
to be added to complete the transformation equation of this transform.
|
protected static int |
HI_3D |
protected static int |
HI_IDENTITY |
protected static int |
HI_SCALE |
protected static int |
HI_SHEAR |
protected static int |
HI_SHIFT |
protected static int |
HI_TRANSLATE |
protected double |
mxt
The X coordinate of the translation element of the
3x3 affine transformation matrix.
|
protected double |
mxx
The X coordinate scaling element of the 3x3
affine transformation matrix.
|
protected double |
mxy
The X coordinate shearing element of the 3x3
affine transformation matrix.
|
protected double |
myt
The Y coordinate of the translation element of the
3x3 affine transformation matrix.
|
protected double |
myx
The Y coordinate shearing element of the 3x3
affine transformation matrix.
|
protected double |
myy
The Y coordinate scaling element of the 3x3
affine transformation matrix.
|
protected int |
state
This field keeps track of which components of the matrix need to
be applied when performing a transformation.
|
protected int |
type
This field caches the current transformation type of the matrix.
|
IDENTITY_TRANSFORM, TYPE_AFFINE_3D, TYPE_AFFINE2D_MASK, TYPE_FLIP, TYPE_GENERAL_ROTATION, TYPE_GENERAL_SCALE, TYPE_GENERAL_TRANSFORM, TYPE_IDENTITY, TYPE_MASK_ROTATION, TYPE_MASK_SCALE, TYPE_QUADRANT_ROTATION, TYPE_TRANSLATION, TYPE_UNIFORM_SCALE, TYPE_UNKNOWN
Constructor and Description |
---|
AffineBase() |
Modifier and Type | Method and Description |
---|---|
protected int |
calculateType() |
void |
concatenate(BaseTransform Tx)
Concatenates a
BaseTransform Tx to
this Affine2D Cx in the most commonly useful
way to provide a new user space
that is mapped to the former user space by Tx . |
void |
concatenate(double Txx,
double Txy,
double Txt,
double Tyx,
double Tyy,
double Tyt)
Similar to
concatenate(com.sun.javafx.geom.transform.BaseTransform) ,
passing the individual elements of the transformation. |
Shape |
createTransformedShape(Shape s)
Returns a new
Shape object defined by the geometry of the
specified Shape after it has been transformed by
this transform. |
void |
deltaTransform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms an array of relative distance vectors by this
transform.
|
void |
deltaTransform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Transforms an array of relative distance vectors by this
transform.
|
Vec3d |
deltaTransform(Vec3d src,
Vec3d dst)
Transforms the specified
src vector and stores the result
in dst vector, without applying the translation elements. |
double |
getDeterminant()
Returns the determinant of the matrix representation of the transform.
|
double |
getMxt()
Returns the X coordinate of the translation element (mxt) of the
3x3 affine transformation matrix.
|
double |
getMxx()
Returns the X coordinate scaling element (mxx) of the 3x3
affine transformation matrix.
|
double |
getMxy()
Returns the X coordinate shearing element (mxy) of the 3x3
affine transformation matrix.
|
double |
getMyt()
Returns the Y coordinate of the translation element (myt) of the
3x3 affine transformation matrix.
|
double |
getMyx()
Returns the Y coordinate shearing element (myx) of the 3x3
affine transformation matrix.
|
double |
getMyy()
Returns the Y coordinate scaling element (myy) of the 3x3
affine transformation matrix.
|
int |
getType()
Retrieves the flag bits describing the conversion properties of
this transform.
|
void |
inverseDeltaTransform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Inverse transforms an array of single precision relative coordinates by
this transform.
|
Vec3d |
inverseDeltaTransform(Vec3d src,
Vec3d dst)
Inverse transforms the specified
src vector and stores the
result in dst vector (without applying the translation
elements). |
BaseBounds |
inverseTransform(BaseBounds src,
BaseBounds dst) |
void |
inverseTransform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Inverse transforms an array of double precision coordinates by
this transform.
|
void |
inverseTransform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Inverse transforms an array of single precision coordinates by
this transform.
|
Point2D |
inverseTransform(Point2D ptSrc,
Point2D ptDst)
Inverse transforms the specified
ptSrc and stores the
result in ptDst . |
void |
inverseTransform(Rectangle src,
Rectangle dst) |
Vec3d |
inverseTransform(Vec3d src,
Vec3d dst)
Inverse transforms the specified
src and stores the
result in dst . |
void |
invert()
Sets this transform to the inverse of itself.
|
boolean |
is2D() |
boolean |
isIdentity()
Returns
true if this Affine2D is
an identity transform. |
boolean |
isTranslateOrIdentity() |
protected abstract void |
reset3Delements()
Resets the 3D (Z) components of the matrix to identity settings
(if they are present).
|
void |
rotate(double theta)
Concatenates this transform with a rotation transformation.
|
protected void |
rotate180() |
protected void |
rotate270() |
protected void |
rotate90() |
void |
scale(double sx,
double sy)
Concatenates this transform with a scaling transformation.
|
void |
setToIdentity()
Resets this transform to the Identity transform.
|
void |
setToShear(double shx,
double shy)
Sets this transform to a shearing transformation.
|
void |
setTransform(double mxx,
double myx,
double mxy,
double myy,
double mxt,
double myt)
Sets this transform to the matrix specified by the 6
double precision values.
|
void |
shear(double shx,
double shy)
Concatenates this transform with a shearing transformation.
|
protected static void |
stateError() |
BaseBounds |
transform(BaseBounds src,
BaseBounds dst) |
void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms an array of double precision coordinates by this transform.
|
void |
transform(double[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Transforms an array of double precision coordinates by this transform
and stores the results into an array of floats.
|
void |
transform(float[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms an array of floating point coordinates by this transform
and stores the results into an array of doubles.
|
void |
transform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Transforms an array of floating point coordinates by this transform.
|
Point2D |
transform(Point2D pt) |
Point2D |
transform(Point2D ptSrc,
Point2D ptDst)
Transforms the specified
ptSrc and stores the result
in ptDst . |
void |
transform(Rectangle src,
Rectangle dst) |
Vec3d |
transform(Vec3d src,
Vec3d dst) |
void |
translate(double tx,
double ty)
Concatenates this transform with a translation transformation.
|
protected void |
updateState()
Manually recalculates the state of the transform when the matrix
changes too much to predict the effects on the state.
|
protected void |
updateState2D() |
almostZero, copy, createInverse, deriveWithConcatenation, deriveWithConcatenation, deriveWithConcatenation, deriveWithNewTransform, deriveWithPreConcatenation, deriveWithPreTranslation, deriveWithRotation, deriveWithScale, deriveWithTranslation, deriveWithTranslation, equals, getDegree, getInstance, getInstance, getInstance, getMxz, getMyz, getMzt, getMzx, getMzy, getMzz, getRotateInstance, getScaleInstance, getTranslateInstance, hashCode, restoreTransform, restoreTransform, setTransform, toString
protected static final int APPLY_IDENTITY
APPLY_TRANSLATE
,
APPLY_SCALE
,
APPLY_SHEAR
,
APPLY_3D
,
state
,
Constant Field Valuesprotected static final int APPLY_TRANSLATE
APPLY_IDENTITY
,
APPLY_SCALE
,
APPLY_SHEAR
,
APPLY_3D
,
state
,
Constant Field Valuesprotected static final int APPLY_SCALE
APPLY_IDENTITY
,
APPLY_TRANSLATE
,
APPLY_SHEAR
,
APPLY_3D
,
state
,
Constant Field Valuesprotected static final int APPLY_SHEAR
APPLY_IDENTITY
,
APPLY_TRANSLATE
,
APPLY_SCALE
,
APPLY_3D
,
state
,
Constant Field Valuesprotected static final int APPLY_3D
APPLY_IDENTITY
,
APPLY_TRANSLATE
,
APPLY_SCALE
,
APPLY_SHEAR
,
state
,
Constant Field Valuesprotected static final int APPLY_2D_MASK
protected static final int APPLY_2D_DELTA_MASK
protected static final int HI_SHIFT
protected static final int HI_IDENTITY
protected static final int HI_TRANSLATE
protected static final int HI_SCALE
protected static final int HI_SHEAR
protected static final int HI_3D
protected double mxx
protected double myx
protected double mxy
protected double myy
protected double mxt
protected double myt
protected transient int state
APPLY_IDENTITY
,
APPLY_TRANSLATE
,
APPLY_SCALE
,
APPLY_SHEAR
,
APPLY_3D
protected transient int type
BaseTransform.TYPE_IDENTITY
,
BaseTransform.TYPE_TRANSLATION
,
BaseTransform.TYPE_UNIFORM_SCALE
,
BaseTransform.TYPE_GENERAL_SCALE
,
BaseTransform.TYPE_FLIP
,
BaseTransform.TYPE_QUADRANT_ROTATION
,
BaseTransform.TYPE_GENERAL_ROTATION
,
BaseTransform.TYPE_GENERAL_TRANSFORM
,
BaseTransform.TYPE_UNKNOWN
,
getType()
protected static void stateError()
protected void updateState()
SCALE SHEAR TRANSLATE m00/m11 m01/m10 m02/m12 IDENTITY 1.0 0.0 0.0 TRANSLATE (TR) 1.0 0.0 not both 0.0 SCALE (SC) not both 1.0 0.0 0.0 TR | SC not both 1.0 0.0 not both 0.0 SHEAR (SH) 0.0 not both 0.0 0.0 TR | SH 0.0 not both 0.0 not both 0.0 SC | SH not both 0.0 not both 0.0 0.0 TR | SC | SH not both 0.0 not both 0.0 not both 0.0
protected void updateState2D()
public int getType()
BaseTransform
getType
in class BaseTransform
BaseTransform.TYPE_IDENTITY
,
BaseTransform.TYPE_TRANSLATION
,
BaseTransform.TYPE_UNIFORM_SCALE
,
BaseTransform.TYPE_GENERAL_SCALE
,
BaseTransform.TYPE_QUADRANT_ROTATION
,
BaseTransform.TYPE_GENERAL_ROTATION
,
BaseTransform.TYPE_GENERAL_TRANSFORM
protected int calculateType()
public double getMxx()
getMxx
in class BaseTransform
#getMatrix
public double getMyy()
getMyy
in class BaseTransform
#getMatrix
public double getMxy()
getMxy
in class BaseTransform
#getMatrix
public double getMyx()
getMyx
in class BaseTransform
#getMatrix
public double getMxt()
getMxt
in class BaseTransform
#getMatrix
public double getMyt()
getMyt
in class BaseTransform
#getMatrix
public boolean isIdentity()
true
if this Affine2D
is
an identity transform.isIdentity
in class BaseTransform
true
if this Affine2D
is
an identity transform; false
otherwise.public boolean isTranslateOrIdentity()
isTranslateOrIdentity
in class BaseTransform
public boolean is2D()
is2D
in class BaseTransform
public double getDeterminant()
If the determinant is non-zero, then this transform is
invertible and the various methods that depend on the inverse
transform do not need to throw a
NoninvertibleTransformException
.
If the determinant is zero then this transform can not be
inverted since the transform maps all input coordinates onto
a line or a point.
If the determinant is near enough to zero then inverse transform
operations might not carry enough precision to produce meaningful
results.
If this transform represents a uniform scale, as indicated by
the getType
method then the determinant also
represents the square of the uniform scale factor by which all of
the points are expanded from or contracted towards the origin.
If this transform represents a non-uniform scale or more general
transform then the determinant is not likely to represent a
value useful for any purpose other than determining if inverse
transforms are possible.
Mathematically, the determinant is calculated using the formula:
| mxx mxy mxt | | myx myy myt | = mxx * myy - mxy * myx | 0 0 1 |
getDeterminant
in class BaseTransform
getType()
,
BaseTransform.createInverse()
,
inverseTransform(com.sun.javafx.geom.Point2D, com.sun.javafx.geom.Point2D)
,
BaseTransform.TYPE_UNIFORM_SCALE
protected abstract void reset3Delements()
public void setToIdentity()
setToIdentity
in class BaseTransform
public void setTransform(double mxx, double myx, double mxy, double myy, double mxt, double myt)
mxx
- the X coordinate scaling element of the 3x3 matrixmyx
- the Y coordinate shearing element of the 3x3 matrixmxy
- the X coordinate shearing element of the 3x3 matrixmyy
- the Y coordinate scaling element of the 3x3 matrixmxt
- the X coordinate translation element of the 3x3 matrixmyt
- the Y coordinate translation element of the 3x3 matrixpublic void setToShear(double shx, double shy)
[ 1 shx 0 ] [ shy 1 0 ] [ 0 0 1 ]
shx
- the multiplier by which coordinates are shifted in the
direction of the positive X axis as a factor of their Y coordinateshy
- the multiplier by which coordinates are shifted in the
direction of the positive Y axis as a factor of their X coordinatepublic Point2D transform(Point2D ptSrc, Point2D ptDst)
ptSrc
and stores the result
in ptDst
.
If ptDst
is null
, a new Point2D
object is allocated and then the result of the transformation is
stored in this object.
In either case, ptDst
, which contains the
transformed point, is returned for convenience.
If ptSrc
and ptDst
are the same
object, the input point is correctly overwritten with
the transformed point.transform
in class BaseTransform
ptSrc
- the specified Point2D
to be transformedptDst
- the specified Point2D
that stores the
result of transforming ptSrc
ptDst
after transforming
ptSrc
and stroring the result in ptDst
.public Vec3d transform(Vec3d src, Vec3d dst)
transform
in interface CanTransformVec3d
transform
in class BaseTransform
public Vec3d deltaTransform(Vec3d src, Vec3d dst)
src
vector and stores the result
in dst
vector, without applying the translation elements.
If dst
is null
, a new Vec3d
object is allocated and then the result of the transformation is
stored in this object.
In either case, dst
, which contains the
transformed vector, is returned for convenience.
If src
and dst
are the same
object, the input vector is correctly overwritten with
the transformed vector.deltaTransform
in class BaseTransform
src
- the specified Vec3d
to be transformeddst
- the specified Vec3d
that stores the
result of transforming src
dst
vector after transforming
src
and storing the result in dst
.public BaseBounds transform(BaseBounds src, BaseBounds dst)
transform
in class BaseTransform
public void transform(Rectangle src, Rectangle dst)
transform
in class BaseTransform
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
[x0, y0, x1, y1, ..., xn, yn]
.transform
in class BaseTransform
srcPts
- the array containing the source point coordinates.
Each point is stored as a pair of x, y coordinates.dstPts
- the array into which the transformed point coordinates
are returned. Each point is stored as a pair of x, y
coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of points to be transformedpublic void deltaTransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
[ x' ] [ m00 m01 (m02) ] [ x ] [ m00x + m01y ] [ y' ] = [ m10 m11 (m12) ] [ y ] = [ m10x + m11y ] [ (1) ] [ (0) (0) ( 1 ) ] [ (1) ] [ (1) ]The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order
[x0, y0, x1, y1, ..., xn, yn]
.deltaTransform
in class BaseTransform
srcPts
- the array containing the source distance vectors.
Each vector is stored as a pair of relative x, y coordinates.dstPts
- the array into which the transformed distance vectors
are returned. Each vector is stored as a pair of relative
x, y coordinates.srcOff
- the offset to the first vector to be transformed
in the source arraydstOff
- the offset to the location of the first
transformed vector that is stored in the destination arraynumPts
- the number of vector coordinate pairs to be
transformedpublic void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
[x0, y0, x1, y1, ..., xn, yn]
.transform
in class BaseTransform
srcPts
- the array containing the source point coordinates.
Each point is stored as a pair of x, y coordinates.dstPts
- the array into which the transformed point
coordinates are returned. Each point is stored as a pair of
x, y coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of point objects to be transformedpublic void deltaTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
[ x' ] [ m00 m01 (m02) ] [ x ] [ m00x + m01y ] [ y' ] = [ m10 m11 (m12) ] [ y ] = [ m10x + m11y ] [ (1) ] [ (0) (0) ( 1 ) ] [ (1) ] [ (1) ]The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order
[x0, y0, x1, y1, ..., xn, yn]
.deltaTransform
in class BaseTransform
srcPts
- the array containing the source distance vectors.
Each vector is stored as a pair of relative x, y coordinates.dstPts
- the array into which the transformed distance vectors
are returned. Each vector is stored as a pair of relative
x, y coordinates.srcOff
- the offset to the first vector to be transformed
in the source arraydstOff
- the offset to the location of the first
transformed vector that is stored in the destination arraynumPts
- the number of vector coordinate pairs to be
transformedpublic void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
[x0, y0, x1, y1, ..., xn, yn]
.transform
in class BaseTransform
srcPts
- the array containing the source point coordinates.
Each point is stored as a pair of x, y coordinates.dstPts
- the array into which the transformed point coordinates
are returned. Each point is stored as a pair of x, y
coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of points to be transformedpublic void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
[x0, y0, x1, y1, ..., xn, yn]
.transform
in class BaseTransform
srcPts
- the array containing the source point coordinates.
Each point is stored as a pair of x, y coordinates.dstPts
- the array into which the transformed point
coordinates are returned. Each point is stored as a pair of
x, y coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of point objects to be transformedpublic Point2D inverseTransform(Point2D ptSrc, Point2D ptDst) throws NoninvertibleTransformException
ptSrc
and stores the
result in ptDst
.
If ptDst
is null
, a new
Point2D
object is allocated and then the result of the
transform is stored in this object.
In either case, ptDst
, which contains the transformed
point, is returned for convenience.
If ptSrc
and ptDst
are the same
object, the input point is correctly overwritten with the
transformed point.inverseTransform
in class BaseTransform
ptSrc
- the point to be inverse transformedptDst
- the resulting transformed pointptDst
, which contains the result of the
inverse transform.NoninvertibleTransformException
- if the matrix cannot be
inverted.public Vec3d inverseTransform(Vec3d src, Vec3d dst) throws NoninvertibleTransformException
src
and stores the
result in dst
.
If dst
is null
, a new
Vec3d
object is allocated and then the result of the
transform is stored in this object.
In either case, dst
, which contains the transformed
point, is returned for convenience.
If src
and dst
are the same
object, the input point is correctly overwritten with the
transformed point.inverseTransform
in class BaseTransform
src
- the point to be inverse transformeddst
- the resulting transformed pointdst
, which contains the result of the
inverse transform.NoninvertibleTransformException
- if the matrix cannot be
inverted.public Vec3d inverseDeltaTransform(Vec3d src, Vec3d dst) throws NoninvertibleTransformException
src
vector and stores the
result in dst
vector (without applying the translation
elements).
If dst
is null
, a new
Vec3d
object is allocated and then the result of the
transform is stored in this object.
In either case, dst
, which contains the transformed
vector, is returned for convenience.
If src
and dst
are the same
object, the input vector is correctly overwritten with the
transformed vector.inverseDeltaTransform
in class BaseTransform
src
- the vector to be inverse transformeddst
- the resulting transformed vectordst
, which contains the result of the
inverse transform.NoninvertibleTransformException
- if the matrix cannot be
inverted.public BaseBounds inverseTransform(BaseBounds src, BaseBounds dst) throws NoninvertibleTransformException
inverseTransform
in class BaseTransform
NoninvertibleTransformException
public void inverseTransform(Rectangle src, Rectangle dst) throws NoninvertibleTransformException
inverseTransform
in class BaseTransform
NoninvertibleTransformException
public void inverseTransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) throws NoninvertibleTransformException
[x0, y0, x1, y1, ..., xn, yn]
.inverseTransform
in class BaseTransform
srcPts
- the array containing the source point coordinates.
Each point is stored as a pair of x, y coordinates.dstPts
- the array into which the transformed point
coordinates are returned. Each point is stored as a pair of
x, y coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of point objects to be transformedNoninvertibleTransformException
- if the matrix cannot be
inverted.public void inverseDeltaTransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) throws NoninvertibleTransformException
[x0, y0, x1, y1, ..., xn, yn]
.inverseDeltaTransform
in class BaseTransform
srcPts
- the array containing the relative source coordinates.
Each point is stored as a pair of x, y coordinates.dstPts
- the array into which the relative transformed point
coordinates are returned. Each point is stored as a pair of
x, y coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of point objects to be transformedNoninvertibleTransformException
- if the matrix cannot be
inverted.public void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NoninvertibleTransformException
[x0, y0, x1, y1, ..., xn, yn]
.inverseTransform
in class BaseTransform
srcPts
- the array containing the source point coordinates.
Each point is stored as a pair of x, y coordinates.dstPts
- the array into which the transformed point
coordinates are returned. Each point is stored as a pair of
x, y coordinates.srcOff
- the offset to the first point to be transformed
in the source arraydstOff
- the offset to the location of the first
transformed point that is stored in the destination arraynumPts
- the number of point objects to be transformedNoninvertibleTransformException
- if the matrix cannot be
inverted.public Shape createTransformedShape(Shape s)
Shape
object defined by the geometry of the
specified Shape
after it has been transformed by
this transform.createTransformedShape
in class BaseTransform
pSrc
- the specified Shape
object to be
transformed by this transform.Shape
object that defines the geometry
of the transformed Shape
, or null if pSrc
is null.public void translate(double tx, double ty)
Affine2D
represented by the following matrix:
[ 1 0 tx ] [ 0 1 ty ] [ 0 0 1 ]
tx
- the distance by which coordinates are translated in the
X axis directionty
- the distance by which coordinates are translated in the
Y axis directionprotected final void rotate90()
protected final void rotate180()
protected final void rotate270()
public void rotate(double theta)
Affine2D
represented by the following matrix:
[ cos(theta) -sin(theta) 0 ] [ sin(theta) cos(theta) 0 ] [ 0 0 1 ]Rotating by a positive angle theta rotates points on the positive X axis toward the positive Y axis. Note also the discussion of Handling 90-Degree Rotations above.
theta
- the angle of rotation measured in radianspublic void scale(double sx, double sy)
Affine2D
represented by the following matrix:
[ sx 0 0 ] [ 0 sy 0 ] [ 0 0 1 ]
sx
- the factor by which coordinates are scaled along the
X axis directionsy
- the factor by which coordinates are scaled along the
Y axis directionpublic void shear(double shx, double shy)
Affine2D
represented by the following matrix:
[ 1 shx 0 ] [ shy 1 0 ] [ 0 0 1 ]
shx
- the multiplier by which coordinates are shifted in the
direction of the positive X axis as a factor of their Y coordinateshy
- the multiplier by which coordinates are shifted in the
direction of the positive Y axis as a factor of their X coordinatepublic void concatenate(BaseTransform Tx)
BaseTransform
Tx
to
this Affine2D
Cx in the most commonly useful
way to provide a new user space
that is mapped to the former user space by Tx
.
Cx is updated to perform the combined transformation.
Transforming a point p by the updated transform Cx' is
equivalent to first transforming p by Tx
and then
transforming the result by the original transform Cx like this:
Cx'(p) = Cx(Tx(p))
In matrix notation, if this transform Cx is
represented by the matrix [this] and Tx
is represented
by the matrix [Tx] then this method does the following:
[this] = [this] x [Tx]
Tx
- the BaseTransform
object to be
concatenated with this Affine2D
object.#preConcatenate
public void concatenate(double Txx, double Txy, double Txt, double Tyx, double Tyy, double Tyt)
concatenate(com.sun.javafx.geom.transform.BaseTransform)
,
passing the individual elements of the transformation.public void invert() throws NoninvertibleTransformException
If this transform maps all coordinates onto a point or a line
then it will not have an inverse, since coordinates that do
not lie on the destination point or line will not have an inverse
mapping.
The getDeterminant
method can be used to determine if this
transform has no inverse, in which case an exception will be
thrown if the invert
method is called.
invert
in class BaseTransform
NoninvertibleTransformException
- if the matrix cannot be inverted.getDeterminant()
Copyright © 2020. All rights reserved.