Class TranslateBuilder

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

public class TranslateBuilder extends Object
The TranslateBuilder class constructs instances of the Translate 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 Translate constructor and returns an instance of the TranslateBuilder.

You can use method chaining to call the builder methods for configuring the Translate. Finally, invoke the build method to generate an instance of the Translate 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 TranslateBuilder create()
      Returns an instance of the TranslateBuilder.
      Returns:
      an instance of the TranslateBuilder.
    • create

      public static TranslateBuilder create(double x, double y)
      Accepts the constructor arguments of Translate(double, double) and returns an instance of TranslateBuilder.
      Returns:
      an instance of the TranslateBuilder.
    • create

      public static TranslateBuilder create(double x, double y, double z)
      Accepts the constructor arguments of Translate(double, double, double) and returns an instance of TranslateBuilder.
      Returns:
      an instance of the TranslateBuilder.
    • build

      public Translate build()
      Builds and returns an instance of the Translate 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 Translate class
    • apply

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

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

      public TranslateBuilder x(double value)
      A builder method that invokes the setX method on the instance being constructed.
      Returns:
      builder instance
    • y

      public TranslateBuilder y(double value)
      A builder method that invokes the setY method on the instance being constructed.
      Returns:
      builder instance
    • z

      public TranslateBuilder z(double value)
      A builder method that invokes the setZ method on the instance being constructed.
      Returns:
      builder instance
    • identityPropertyApply

      public TranslateBuilder 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
    • onTransformChangedPropertyApply

      public TranslateBuilder 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
    • type2DPropertyApply

      public TranslateBuilder 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
    • xPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.xProperty().bind(anotherProperty))
      
      // Use shorthand form
      .xPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • yPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.yProperty().bind(anotherProperty))
      
      // Use shorthand form
      .yPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • zPropertyApply

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

      Example:

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