public class Shear extends Transform
Affine
object that shears coordinates
by the specified multipliers. The matrix representing the shearing
transformation is as follows:
[ 1 x 0 -x*pivotY ] [ y 1 0 -y*pivotX ] [ 0 0 1 0 ]
For example:
Text text = new Text("Using Shear for pseudo-italic font");
text.setX(20);
text.setY(50);
text.setFont(new Font(20));
text.getTransforms().add(new Shear(-0.35, 0));
Modifier and Type | Field and Description |
---|---|
private DoubleProperty |
pivotX
Defines the X coordinate of the shear pivot point.
|
private DoubleProperty |
pivotY
Defines the Y coordinate of the shear pivot point.
|
private DoubleProperty |
x
Defines the multiplier by which coordinates are shifted in the direction
of the positive X axis as a factor of their Y coordinate.
|
private DoubleProperty |
y
Defines the multiplier by which coordinates are shifted in the direction
of the positive Y axis as a factor of their X coordinate.
|
Constructor and Description |
---|
Shear()
Creates a default Shear (identity).
|
Shear(double x,
double y)
Creates a new instance of Shear.
|
Shear(double x,
double y,
double pivotX,
double pivotY)
Creates a new instance of Shear with pivot.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
appendTo(Affine a)
Visitor from
Affine class which provides an efficient
append operation for the subclasses. |
Shear |
clone()
Returns a deep copy of this transform.
|
(package private) boolean |
computeIs2D()
Computes if this transform is currently a 2D transform (has no effect
in the direction of Z axis).
|
(package private) boolean |
computeIsIdentity()
Computes if this transform is currently an identity (has
no effect in any direction).
|
Transform |
createConcatenation(Transform transform)
Returns the concatenation of this transform and the specified transform.
|
Transform |
createInverse()
Returns the inverse transform of this transform.
|
Point2D |
deltaTransform(double x,
double y)
Transforms the relative magnitude vector by this transform.
|
Point3D |
deltaTransform(double x,
double y,
double z)
Transforms the relative magnitude vector by this transform.
|
(package private) void |
fill2DArray(double[] array)
Core of the toArray implementation for the 2D case.
|
(package private) void |
fill3DArray(double[] array)
Core of the toArray implementation for the 3D case.
|
double |
getMxy()
Gets the XY coordinate element of the 3x4 matrix.
|
double |
getMyx()
Gets the YX coordinate element of the 3x4 matrix.
|
double |
getPivotX() |
double |
getPivotY() |
double |
getTx()
Gets the X coordinate translation element of the 3x4 matrix.
|
double |
getTy()
Gets the Y coordinate translation element of the 3x4 matrix.
|
double |
getX() |
double |
getY() |
void |
impl_apply(Affine3D trans)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
BaseTransform |
impl_derive(BaseTransform trans)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
Point2D |
inverseDeltaTransform(double x,
double y)
Transforms the relative magnitude vector by the inverse of this transform.
|
Point3D |
inverseDeltaTransform(double x,
double y,
double z)
Transforms the relative magnitude vector by the inverse of this transform.
|
Point2D |
inverseTransform(double x,
double y)
Transforms the specified point by the inverse of this transform.
|
Point3D |
inverseTransform(double x,
double y,
double z)
Transforms the specified point by the inverse of this transform.
|
(package private) void |
inverseTransform2DPointsImpl(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Core of the inverseTransform2DPoints method.
|
(package private) void |
inverseTransform3DPointsImpl(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Core of the inverseTransform3DPoints method.
|
DoubleProperty |
pivotXProperty() |
DoubleProperty |
pivotYProperty() |
(package private) void |
prependTo(Affine a)
Visitor from
Affine class which provides an efficient
prepend operation for the subclasses. |
void |
setPivotX(double value) |
void |
setPivotY(double value) |
void |
setX(double value) |
void |
setY(double value) |
java.lang.String |
toString()
Returns a string representation of this
Shear object. |
Point2D |
transform(double x,
double y)
Transforms the specified point by this transform.
|
Point3D |
transform(double x,
double y,
double z)
Transforms the specified point by this transform.
|
(package private) void |
transform2DPointsImpl(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Core of the transform2DPoints method.
|
(package private) void |
transform3DPointsImpl(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Core of the transform3DPoints method.
|
(package private) void |
validate()
Needed for the proper delivery of the TransformChangedEvent.
|
DoubleProperty |
xProperty() |
DoubleProperty |
yProperty() |
addEventFilter, addEventHandler, affine, affine, buildEventDispatchChain, checkRequestedMAT, clearInverseCache, column, column, deltaTransform, deltaTransform, determinant, ensureCanTransform2DPoint, getElement, getMxx, getMxz, getMyy, getMyz, getMzx, getMzy, getMzz, getOnTransformChanged, getTz, identityProperty, impl_add, impl_remove, 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
private DoubleProperty x
private DoubleProperty y
private DoubleProperty pivotX
private DoubleProperty pivotY
public Shear()
public Shear(double x, double y)
x
- the multiplier by which coordinates are shifted in the direction
of the positive X axis as a factor of their Y coordinatey
- the multiplier by which coordinates are shifted in the direction
of the positive Y axis as a factor of their X coordinatepublic Shear(double x, double y, double pivotX, double pivotY)
x
- the multiplier by which coordinates are shifted in the direction
of the positive X axis as a factor of their Y coordinatey
- the multiplier by which coordinates are shifted in the direction
of the positive Y axis as a factor of their X coordinatepivotX
- the X coordinate of the shear pivot pointpivotY
- the Y coordinate of the shear pivot pointpublic final void setX(double value)
public final double getX()
public final DoubleProperty xProperty()
public final void setY(double value)
public final double getY()
public final DoubleProperty yProperty()
public final void setPivotX(double value)
public final double getPivotX()
public final DoubleProperty pivotXProperty()
public final void setPivotY(double value)
public final double getPivotY()
public final DoubleProperty pivotYProperty()
public double getMxy()
Transform
public double getMyx()
Transform
public double getTx()
Transform
public double getTy()
Transform
boolean computeIs2D()
Transform
computeIs2D
in class Transform
boolean computeIsIdentity()
Transform
computeIsIdentity
in class Transform
void fill2DArray(double[] array)
Transform
fill2DArray
in class Transform
array
- array to be filled with the 6 2D elementsvoid fill3DArray(double[] array)
Transform
fill3DArray
in class Transform
array
- array to be filled with the 12 3D elementspublic Transform createConcatenation(Transform transform)
Transform
getTransforms()
list,
this
transform first and the specified transform
second.createConcatenation
in class Transform
transform
- transform to be concatenated with this transformpublic Transform createInverse()
Transform
createInverse
in class Transform
public Shear clone()
Transform
public Point2D transform(double x, double y)
Transform
public Point3D transform(double x, double y, double z)
Transform
void transform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
Transform
transform2DPointsImpl
in class Transform
void transform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
Transform
transform3DPointsImpl
in class Transform
public Point2D deltaTransform(double x, double y)
Transform
deltaTransform
in class Transform
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axisPoint2D
instancepublic Point3D deltaTransform(double x, double y, double z)
Transform
deltaTransform
in class Transform
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axisPoint3D
instancepublic Point2D inverseTransform(double x, double y) throws NonInvertibleTransformException
Transform
inverseTransform
in class Transform
x
- the X coordinate of the pointy
- the Y coordinate of the pointNonInvertibleTransformException
- if this transform
cannot be invertedpublic Point3D inverseTransform(double x, double y, double z) throws NonInvertibleTransformException
Transform
inverseTransform
in class Transform
x
- the X coordinate of the pointy
- the Y coordinate of the pointz
- the Z coordinate of the pointNonInvertibleTransformException
- if this transform
cannot be invertedvoid inverseTransform2DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NonInvertibleTransformException
Transform
inverseTransform2DPointsImpl
in class Transform
NonInvertibleTransformException
void inverseTransform3DPointsImpl(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NonInvertibleTransformException
Transform
inverseTransform3DPointsImpl
in class Transform
NonInvertibleTransformException
public Point2D inverseDeltaTransform(double x, double y) throws NonInvertibleTransformException
Transform
inverseDeltaTransform
in class Transform
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axisPoint2D
instanceNonInvertibleTransformException
- if this transform
cannot be invertedpublic Point3D inverseDeltaTransform(double x, double y, double z) throws NonInvertibleTransformException
Transform
inverseDeltaTransform
in class Transform
x
- vector magnitude in the direction of the X axisy
- vector magnitude in the direction of the Y axisPoint3D
instanceNonInvertibleTransformException
- if this transform
cannot be invertedpublic java.lang.String toString()
Shear
object.toString
in class java.lang.Object
Shear
object.@Deprecated public void impl_apply(Affine3D trans)
impl_apply
in class Transform
@Deprecated public BaseTransform impl_derive(BaseTransform trans)
impl_derive
in class Transform
void validate()
Transform
void appendTo(Affine a)
Transform
Affine
class which provides an efficient
append
operation for the subclasses.