public class AffineTransforms extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Function<T,AffineTransform> |
compose(Function<? super T,? extends AffineTransform> f0,
Function<? super T,? extends AffineTransform> f1)
Creates a function that returns an affine transform that is the
concatenation of the affine transforms returned by the given
functions.
|
static double |
computeDistanceX(AffineTransform at,
double distanceX)
Computes the distance that two points have when they are transformed
with the given affine transform, and initially had the given distance
in x-direction
|
static double |
computeDistanceY(AffineTransform at,
double distanceY)
Computes the distance that two points have when they are transformed
with the given affine transform, and initially had the given distance
in y-direction
|
static double |
computeX(AffineTransform at,
double x,
double y)
Computes the x-coordinate of the specified point when it is transformed
with the given affine transform
|
static double |
computeX(AffineTransform at,
Point2D p)
Computes the x-coordinate of the given point when it is transformed
with the given affine transform
|
static double |
computeY(AffineTransform at,
double x,
double y)
Computes the y-coordinate of the specified point when it is transformed
with the given affine transform
|
static double |
computeY(AffineTransform at,
Point2D p)
Computes the y-coordinate of the given point when it is transformed
with the given affine transform
|
static Shape |
createTransformedShape(AffineTransform at,
Shape shape)
An implementation of the
AffineTransform#createTransformedShape method
that is optimized for certain simple shapes (like
Rectangle2D and Line2D): If the given
transform only consists of translation (or translation and
scaling) then a new shape will be constructed directly,
avoiding the general (but inefficient) method of creating
a Path2D. |
static AffineTransform |
getScaleInstance(double minX,
double minY,
double maxX,
double maxY,
AffineTransform result)
Sets the given result to be an affine transform that transforms the
unit square into the given rectangle.
|
static AffineTransform |
getScaleInstance(Rectangle2D rectangle,
AffineTransform result)
Sets the given result to be an affine transform that transforms the
unit square into the given rectangle.
|
static AffineTransform |
invert(AffineTransform atSrc,
AffineTransform atDst)
Invert the given affine transform, storing the result in the
given destination.
|
static <T> Function<T,AffineTransform> |
rotating(ToDoubleFunction<? super T> angleRadFunction)
Creates a function that returns an affine transform that performs
a rotation according to value returned by the given function.
|
static <T> Function<T,AffineTransform> |
rotating(ToDoubleFunction<? super T> angleRadFunction,
double anchorX,
double anchorY)
Creates a function that returns an affine transform that performs
a rotation according to value returned by the given function.
|
static <T> Function<T,AffineTransform> |
scaling(ToDoubleFunction<? super T> scalingFunction)
Creates a function that returns an affine transform that performs
a scaling according to value returned by the given function.
|
static <T> Function<T,AffineTransform> |
scaling(ToDoubleFunction<? super T> xScalingFunction,
ToDoubleFunction<? super T> yScalingFunction)
Creates a function that returns an affine transform that performs
a scaling according to values returned by the given functions.
|
static String |
toString(AffineTransform at)
Creates a formatted, multi-line string representation of the
given affine transform
|
static String |
toString(AffineTransform at,
Locale locale,
String format)
Creates a formatted, multi-line string representation of the
given affine transform, using the given format for each entry
|
static String |
toString(AffineTransform at,
String format)
Creates a formatted, multi-line string representation of the
given affine transform, using the given format for each entry
|
static <T> Function<T,AffineTransform> |
translate(ToDoubleFunction<? super T> xTranslationFunction,
ToDoubleFunction<? super T> yTranslationFunction)
Creates a function that returns an affine transform that performs
a translation according to values returned by the given functions.
|
public static AffineTransform invert(AffineTransform atSrc, AffineTransform atDst)
null,
then a new affine transform will be created and returned.atSrc - The sourceatDst - The destinationIllegalArgumentException - If the given transform can not
be inverted.public static <T> Function<T,AffineTransform> scaling(ToDoubleFunction<? super T> xScalingFunction, ToDoubleFunction<? super T> yScalingFunction)
T - The function argument typexScalingFunction - The function that returns the x-scalingyScalingFunction - The function that returns the y-scalingpublic static <T> Function<T,AffineTransform> scaling(ToDoubleFunction<? super T> scalingFunction)
T - The function argument typescalingFunction - The function that returns the scalingpublic static <T> Function<T,AffineTransform> rotating(ToDoubleFunction<? super T> angleRadFunction)
T - The function argument typeangleRadFunction - The function that returns the rotation angle,
in radianspublic static <T> Function<T,AffineTransform> rotating(ToDoubleFunction<? super T> angleRadFunction, double anchorX, double anchorY)
T - The function argument typeangleRadFunction - The function that returns the rotation angle,
in radiansanchorX - The x-coordinate of the rotation centeranchorY - The y-coordinate of the rotation centerpublic static <T> Function<T,AffineTransform> translate(ToDoubleFunction<? super T> xTranslationFunction, ToDoubleFunction<? super T> yTranslationFunction)
T - The function argument typexTranslationFunction - The function that returns the x-translationyTranslationFunction - The function that returns the y-translationpublic static <T> Function<T,AffineTransform> compose(Function<? super T,? extends AffineTransform> f0, Function<? super T,? extends AffineTransform> f1)
null,
then the result will be equal to the affine transform of the
other function. If both functions return null, then
the function will also return null.T - The function argument typef0 - The first functionf1 - The second functionpublic static double computeDistanceX(AffineTransform at, double distanceX)
at - The affine transformdistanceX - The distancepublic static double computeDistanceY(AffineTransform at, double distanceY)
at - The affine transformdistanceY - The distancepublic static double computeX(AffineTransform at, Point2D p)
at - The affine transformp - The pointpublic static double computeX(AffineTransform at, double x, double y)
at - The affine transformx - The x-coordinate of the pointy - The y-coordinate of the pointpublic static double computeY(AffineTransform at, Point2D p)
at - The affine transformp - The pointpublic static double computeY(AffineTransform at, double x, double y)
at - The affine transformx - The x-coordinate of the pointy - The y-coordinate of the pointpublic static Shape createTransformedShape(AffineTransform at, Shape shape)
AffineTransform#createTransformedShape method
that is optimized for certain simple shapes (like
Rectangle2D and Line2D): If the given
transform only consists of translation (or translation and
scaling) then a new shape will be constructed directly,
avoiding the general (but inefficient) method of creating
a Path2D.
Otherwise, AffineTransform#createTransformedShape
will be calledat - The affine transformshape - The shapepublic static AffineTransform getScaleInstance(Rectangle2D rectangle, AffineTransform result)
null, then a new transform will be created and returned.rectangle - The rectangleresult - The resultpublic static AffineTransform getScaleInstance(double minX, double minY, double maxX, double maxY, AffineTransform result)
null, then a new transform will be created and returned.minX - The minimum x-coordinateminY - The minimum y-coordinatemaxX - The maximum x-coordinatemaxY - The maximum y-coordinateresult - The resultpublic static String toString(AffineTransform at)
at - The affine transformpublic static String toString(AffineTransform at, String format)
at - The affine transformformat - The formatpublic static String toString(AffineTransform at, Locale locale, String format)
at - The affine transformlocale - The localeformat - The formatCopyright © 2017. All rights reserved.