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

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

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

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

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

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

      public LineToBuilder absolute(boolean value)
      A builder method that invokes the setAbsolute method on the instance being constructed.
      Returns:
      builder instance
    • x

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

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

      public LineToBuilder absolutePropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the absoluteProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • xPropertyApply

      public LineToBuilder 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:

      Returns:
      builder instance
    • yPropertyApply

      public LineToBuilder 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:

      Returns:
      builder instance