Class AffineBuilder
AffineBuilder
class constructs instances of the Affine
class
and offers a fluent interface for creating and configuring it.
This class includes a static create
method that accepts the same arguments as the original Affine
constructor
and returns an instance of the AffineBuilder
.
You can use method chaining to call the builder methods for configuring the Affine
.
Finally, invoke the build
method to generate an instance of the Affine
class.
Note that intermediate builder methods are not evaluated until the build
method
is called, meaning they are evaluated lazily.
- Author:
- Hidekazu Kubota <hidekazu.kubota@gmail.com>
-
Method Summary
Modifier and TypeMethodDescriptionApplies a function to the Affine instance being constructed.build()
Builds and returns an instance of theAffine
class.static AffineBuilder
create()
Returns an instance of theAffineBuilder
.static AffineBuilder
create
(double[] matrix, MatrixType type, int offset) Accepts the constructor arguments ofAffine(double..., MatrixType, int)
and returns an instance ofAffineBuilder
.static AffineBuilder
create
(double mxx, double mxy, double tx, double myx, double myy, double ty) Accepts the constructor arguments ofAffine(double, double, double, double, double, double)
and returns an instance ofAffineBuilder
.static AffineBuilder
create
(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz) Accepts the constructor arguments ofAffine(double, double, double, double, double, double, double, double, double, double, double, double)
and returns an instance ofAffineBuilder
.static AffineBuilder
Accepts the constructor arguments ofAffine(Transform)
and returns an instance ofAffineBuilder
.element
(MatrixType type, int row, int column, double value) A builder method that invokes thesetElement
method on the instance being constructed.Applies a function to theidentityProperty
of the instance being constructed.mxx
(double value) A builder method that invokes thesetMxx
method on the instance being constructed.Applies a function to themxxProperty
of the instance being constructed.mxy
(double value) A builder method that invokes thesetMxy
method on the instance being constructed.Applies a function to themxyProperty
of the instance being constructed.mxz
(double value) A builder method that invokes thesetMxz
method on the instance being constructed.Applies a function to themxzProperty
of the instance being constructed.myx
(double value) A builder method that invokes thesetMyx
method on the instance being constructed.Applies a function to themyxProperty
of the instance being constructed.myy
(double value) A builder method that invokes thesetMyy
method on the instance being constructed.Applies a function to themyyProperty
of the instance being constructed.myz
(double value) A builder method that invokes thesetMyz
method on the instance being constructed.Applies a function to themyzProperty
of the instance being constructed.mzx
(double value) A builder method that invokes thesetMzx
method on the instance being constructed.Applies a function to themzxProperty
of the instance being constructed.mzy
(double value) A builder method that invokes thesetMzy
method on the instance being constructed.Applies a function to themzyProperty
of the instance being constructed.mzz
(double value) A builder method that invokes thesetMzz
method on the instance being constructed.Applies a function to themzzProperty
of the instance being constructed.onTransformChanged
(EventHandler<? super TransformChangedEvent> value) A builder method that invokes thesetOnTransformChanged
method on the instance being constructed.onTransformChangedPropertyApply
(Consumer<ObjectProperty<EventHandler<? super TransformChangedEvent>>> op) Applies a function to theonTransformChangedProperty
of the instance being constructed.A builder method that invokes thesetToIdentity
method on the instance being constructed.toTransform
(double[] matrix, MatrixType type, int offset) A builder method that invokes thesetToTransform
method on the instance being constructed.toTransform
(double mxx, double mxy, double tx, double myx, double myy, double ty) A builder method that invokes thesetToTransform
method on the instance being constructed.toTransform
(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz) A builder method that invokes thesetToTransform
method on the instance being constructed.toTransform
(Transform transform) A builder method that invokes thesetToTransform
method on the instance being constructed.tx
(double value) A builder method that invokes thesetTx
method on the instance being constructed.Applies a function to thetxProperty
of the instance being constructed.ty
(double value) A builder method that invokes thesetTy
method on the instance being constructed.Applies a function to thetype2DProperty
of the instance being constructed.Applies a function to thetyProperty
of the instance being constructed.tz
(double value) A builder method that invokes thesetTz
method on the instance being constructed.Applies a function to thetzProperty
of the instance being constructed.
-
Method Details
-
create
Returns an instance of theAffineBuilder
.- Returns:
- an instance of the
AffineBuilder
.
-
create
public static AffineBuilder create(double mxx, double mxy, double tx, double myx, double myy, double ty) Accepts the constructor arguments ofAffine(double, double, double, double, double, double)
and returns an instance ofAffineBuilder
.- Returns:
- an instance of the
AffineBuilder
.
-
create
public static AffineBuilder create(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz) Accepts the constructor arguments ofAffine(double, double, double, double, double, double, double, double, double, double, double, double)
and returns an instance ofAffineBuilder
.- Returns:
- an instance of the
AffineBuilder
.
-
create
Accepts the constructor arguments ofAffine(double..., MatrixType, int)
and returns an instance ofAffineBuilder
.- Returns:
- an instance of the
AffineBuilder
.
-
create
Accepts the constructor arguments ofAffine(Transform)
and returns an instance ofAffineBuilder
.- Returns:
- an instance of the
AffineBuilder
.
-
build
Builds and returns an instance of theAffine
class.Intermediate builder methods are not evaluated until the
build
method is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
Affine
class
-
apply
Applies a function to the Affine instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
element
A builder method that invokes thesetElement
method on the instance being constructed.- Returns:
- builder instance
-
mxx
A builder method that invokes thesetMxx
method on the instance being constructed.- Returns:
- builder instance
-
mxy
A builder method that invokes thesetMxy
method on the instance being constructed.- Returns:
- builder instance
-
mxz
A builder method that invokes thesetMxz
method on the instance being constructed.- Returns:
- builder instance
-
myx
A builder method that invokes thesetMyx
method on the instance being constructed.- Returns:
- builder instance
-
myy
A builder method that invokes thesetMyy
method on the instance being constructed.- Returns:
- builder instance
-
myz
A builder method that invokes thesetMyz
method on the instance being constructed.- Returns:
- builder instance
-
mzx
A builder method that invokes thesetMzx
method on the instance being constructed.- Returns:
- builder instance
-
mzy
A builder method that invokes thesetMzy
method on the instance being constructed.- Returns:
- builder instance
-
mzz
A builder method that invokes thesetMzz
method on the instance being constructed.- Returns:
- builder instance
-
onTransformChanged
A builder method that invokes thesetOnTransformChanged
method on the instance being constructed.- Returns:
- builder instance
-
toIdentity
A builder method that invokes thesetToIdentity
method on the instance being constructed.- Returns:
- builder instance
-
toTransform
public AffineBuilder toTransform(double mxx, double mxy, double tx, double myx, double myy, double ty) A builder method that invokes thesetToTransform
method on the instance being constructed.- Returns:
- builder instance
-
toTransform
public AffineBuilder toTransform(double mxx, double mxy, double mxz, double tx, double myx, double myy, double myz, double ty, double mzx, double mzy, double mzz, double tz) A builder method that invokes thesetToTransform
method on the instance being constructed.- Returns:
- builder instance
-
toTransform
A builder method that invokes thesetToTransform
method on the instance being constructed.- Returns:
- builder instance
-
toTransform
A builder method that invokes thesetToTransform
method on the instance being constructed.- Returns:
- builder instance
-
tx
A builder method that invokes thesetTx
method on the instance being constructed.- Returns:
- builder instance
-
ty
A builder method that invokes thesetTy
method on the instance being constructed.- Returns:
- builder instance
-
tz
A builder method that invokes thesetTz
method on the instance being constructed.- Returns:
- builder instance
-
identityPropertyApply
Applies a function to theidentityProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
mxxPropertyApply
Applies a function to themxxProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
mxyPropertyApply
Applies a function to themxyProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
mxzPropertyApply
Applies a function to themxzProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
myxPropertyApply
Applies a function to themyxProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
myyPropertyApply
Applies a function to themyyProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
myzPropertyApply
Applies a function to themyzProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
mzxPropertyApply
Applies a function to themzxProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
mzyPropertyApply
Applies a function to themzyProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
mzzPropertyApply
Applies a function to themzzProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
onTransformChangedPropertyApply
public AffineBuilder onTransformChangedPropertyApply(Consumer<ObjectProperty<EventHandler<? super TransformChangedEvent>>> op) Applies a function to theonTransformChangedProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
txPropertyApply
Applies a function to thetxProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
tyPropertyApply
Applies a function to thetyProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
type2DPropertyApply
Applies a function to thetype2DProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
tzPropertyApply
Applies a function to thetzProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-