java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.AffineBuilder

public class AffineBuilder extends Object
The 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 Details

    • create

      public static AffineBuilder create()
      Returns an instance of the AffineBuilder.
      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 of Affine(double, double, double, double, double, double) and returns an instance of AffineBuilder.
      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 of Affine(double, double, double, double, double, double, double, double, double, double, double, double) and returns an instance of AffineBuilder.
      Returns:
      an instance of the AffineBuilder.
    • create

      public static AffineBuilder create(double[] matrix, MatrixType type, int offset)
      Accepts the constructor arguments of Affine(double..., MatrixType, int) and returns an instance of AffineBuilder.
      Returns:
      an instance of the AffineBuilder.
    • create

      public static AffineBuilder create(Transform transform)
      Accepts the constructor arguments of Affine(Transform) and returns an instance of AffineBuilder.
      Returns:
      an instance of the AffineBuilder.
    • build

      public Affine build()
      Builds and returns an instance of the Affine 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

      public AffineBuilder apply(Consumer<Affine> func)
      Applies a function to the Affine instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • element

      public AffineBuilder element(MatrixType type, int row, int column, double value)
      A builder method that invokes the setElement method on the instance being constructed.
      Returns:
      builder instance
    • mxx

      public AffineBuilder mxx(double value)
      A builder method that invokes the setMxx method on the instance being constructed.
      Returns:
      builder instance
    • mxy

      public AffineBuilder mxy(double value)
      A builder method that invokes the setMxy method on the instance being constructed.
      Returns:
      builder instance
    • mxz

      public AffineBuilder mxz(double value)
      A builder method that invokes the setMxz method on the instance being constructed.
      Returns:
      builder instance
    • myx

      public AffineBuilder myx(double value)
      A builder method that invokes the setMyx method on the instance being constructed.
      Returns:
      builder instance
    • myy

      public AffineBuilder myy(double value)
      A builder method that invokes the setMyy method on the instance being constructed.
      Returns:
      builder instance
    • myz

      public AffineBuilder myz(double value)
      A builder method that invokes the setMyz method on the instance being constructed.
      Returns:
      builder instance
    • mzx

      public AffineBuilder mzx(double value)
      A builder method that invokes the setMzx method on the instance being constructed.
      Returns:
      builder instance
    • mzy

      public AffineBuilder mzy(double value)
      A builder method that invokes the setMzy method on the instance being constructed.
      Returns:
      builder instance
    • mzz

      public AffineBuilder mzz(double value)
      A builder method that invokes the setMzz method on the instance being constructed.
      Returns:
      builder instance
    • onTransformChanged

      public AffineBuilder onTransformChanged(EventHandler<? super TransformChangedEvent> value)
      A builder method that invokes the setOnTransformChanged method on the instance being constructed.
      Returns:
      builder instance
    • toIdentity

      public AffineBuilder toIdentity()
      A builder method that invokes the setToIdentity 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 the setToTransform 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 the setToTransform method on the instance being constructed.
      Returns:
      builder instance
    • toTransform

      public AffineBuilder toTransform(double[] matrix, MatrixType type, int offset)
      A builder method that invokes the setToTransform method on the instance being constructed.
      Returns:
      builder instance
    • toTransform

      public AffineBuilder toTransform(Transform transform)
      A builder method that invokes the setToTransform method on the instance being constructed.
      Returns:
      builder instance
    • tx

      public AffineBuilder tx(double value)
      A builder method that invokes the setTx method on the instance being constructed.
      Returns:
      builder instance
    • ty

      public AffineBuilder ty(double value)
      A builder method that invokes the setTy method on the instance being constructed.
      Returns:
      builder instance
    • tz

      public AffineBuilder tz(double value)
      A builder method that invokes the setTz method on the instance being constructed.
      Returns:
      builder instance
    • identityPropertyApply

      public AffineBuilder identityPropertyApply(Consumer<ReadOnlyBooleanProperty> op)
      Applies a function to the identityProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.identityProperty().bind(anotherProperty))
      
      // Use shorthand form
      .identityPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • mxxPropertyApply

      public AffineBuilder mxxPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the mxxProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.mxxProperty().bind(anotherProperty))
      
      // Use shorthand form
      .mxxPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • mxyPropertyApply

      public AffineBuilder mxyPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the mxyProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.mxyProperty().bind(anotherProperty))
      
      // Use shorthand form
      .mxyPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • mxzPropertyApply

      public AffineBuilder mxzPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the mxzProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.mxzProperty().bind(anotherProperty))
      
      // Use shorthand form
      .mxzPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • myxPropertyApply

      public AffineBuilder myxPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the myxProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.myxProperty().bind(anotherProperty))
      
      // Use shorthand form
      .myxPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • myyPropertyApply

      public AffineBuilder myyPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the myyProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.myyProperty().bind(anotherProperty))
      
      // Use shorthand form
      .myyPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • myzPropertyApply

      public AffineBuilder myzPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the myzProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.myzProperty().bind(anotherProperty))
      
      // Use shorthand form
      .myzPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • mzxPropertyApply

      public AffineBuilder mzxPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the mzxProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.mzxProperty().bind(anotherProperty))
      
      // Use shorthand form
      .mzxPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • mzyPropertyApply

      public AffineBuilder mzyPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the mzyProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.mzyProperty().bind(anotherProperty))
      
      // Use shorthand form
      .mzyPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • mzzPropertyApply

      public AffineBuilder mzzPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the mzzProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.mzzProperty().bind(anotherProperty))
      
      // Use shorthand form
      .mzzPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onTransformChangedPropertyApply

      public AffineBuilder onTransformChangedPropertyApply(Consumer<ObjectProperty<EventHandler<? super TransformChangedEvent>>> op)
      Applies a function to the onTransformChangedProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onTransformChangedProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onTransformChangedPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • txPropertyApply

      public AffineBuilder txPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the txProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.txProperty().bind(anotherProperty))
      
      // Use shorthand form
      .txPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • tyPropertyApply

      public AffineBuilder tyPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the tyProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.tyProperty().bind(anotherProperty))
      
      // Use shorthand form
      .tyPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • type2DPropertyApply

      public AffineBuilder type2DPropertyApply(Consumer<ReadOnlyBooleanProperty> op)
      Applies a function to the type2DProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.type2DProperty().bind(anotherProperty))
      
      // Use shorthand form
      .type2DPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • tzPropertyApply

      public AffineBuilder tzPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the tzProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.tzProperty().bind(anotherProperty))
      
      // Use shorthand form
      .tzPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance