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

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

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

      public static ShadowBuilder create(double radius, Color color)
      Accepts the constructor arguments of Shadow(double, Color) and returns an instance of ShadowBuilder.
      Returns:
      an instance of the ShadowBuilder.
    • create

      public static ShadowBuilder create(BlurType blurType, Color color, double radius)
      Accepts the constructor arguments of Shadow(BlurType, Color, double) and returns an instance of ShadowBuilder.
      Returns:
      an instance of the ShadowBuilder.
    • build

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

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

      public ShadowBuilder blurType(BlurType value)
      A builder method that invokes the setBlurType method on the instance being constructed.
      Returns:
      builder instance
    • color

      public ShadowBuilder color(Color value)
      A builder method that invokes the setColor method on the instance being constructed.
      Returns:
      builder instance
    • height

      public ShadowBuilder height(double value)
      A builder method that invokes the setHeight method on the instance being constructed.
      Returns:
      builder instance
    • input

      public ShadowBuilder input(Effect value)
      A builder method that invokes the setInput method on the instance being constructed.
      Returns:
      builder instance
    • radius

      public ShadowBuilder radius(double value)
      A builder method that invokes the setRadius method on the instance being constructed.
      Returns:
      builder instance
    • width

      public ShadowBuilder width(double value)
      A builder method that invokes the setWidth method on the instance being constructed.
      Returns:
      builder instance
    • blurTypePropertyApply

      public ShadowBuilder blurTypePropertyApply(Consumer<ObjectProperty<BlurType>> op)
      Applies a function to the blurTypeProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • colorPropertyApply

      public ShadowBuilder colorPropertyApply(Consumer<ObjectProperty<Color>> op)
      Applies a function to the colorProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • heightPropertyApply

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

      Example:

      Returns:
      builder instance
    • inputPropertyApply

      public ShadowBuilder inputPropertyApply(Consumer<ObjectProperty<Effect>> op)
      Applies a function to the inputProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • radiusPropertyApply

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

      Example:

      Returns:
      builder instance
    • widthPropertyApply

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

      Example:

      Returns:
      builder instance