Class DropShadowBuilder

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

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

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

      public static DropShadowBuilder create(double radius, double offsetX, double offsetY, Color color)
      Accepts the constructor arguments of DropShadow(double, double, double, Color) and returns an instance of DropShadowBuilder.
      Returns:
      an instance of the DropShadowBuilder.
    • create

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

      public static DropShadowBuilder create(BlurType blurType, Color color, double radius, double spread, double offsetX, double offsetY)
      Accepts the constructor arguments of DropShadow(BlurType, Color, double, double, double, double) and returns an instance of DropShadowBuilder.
      Returns:
      an instance of the DropShadowBuilder.
    • build

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

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

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

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

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

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

      public DropShadowBuilder offsetX(double value)
      A builder method that invokes the setOffsetX method on the instance being constructed.
      Returns:
      builder instance
    • offsetY

      public DropShadowBuilder offsetY(double value)
      A builder method that invokes the setOffsetY method on the instance being constructed.
      Returns:
      builder instance
    • radius

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

      public DropShadowBuilder spread(double value)
      A builder method that invokes the setSpread method on the instance being constructed.
      Returns:
      builder instance
    • width

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

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

      // Use apply
      .apply(obj -> obj.blurTypeProperty().bind(anotherProperty))
      
      // Use shorthand form
      .blurTypePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • colorPropertyApply

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

      // Use apply
      .apply(obj -> obj.colorProperty().bind(anotherProperty))
      
      // Use shorthand form
      .colorPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • heightPropertyApply

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

      // Use apply
      .apply(obj -> obj.heightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .heightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • inputPropertyApply

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

      // Use apply
      .apply(obj -> obj.inputProperty().bind(anotherProperty))
      
      // Use shorthand form
      .inputPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • offsetXPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.offsetXProperty().bind(anotherProperty))
      
      // Use shorthand form
      .offsetXPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • offsetYPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.offsetYProperty().bind(anotherProperty))
      
      // Use shorthand form
      .offsetYPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • radiusPropertyApply

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

      // Use apply
      .apply(obj -> obj.radiusProperty().bind(anotherProperty))
      
      // Use shorthand form
      .radiusPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • spreadPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.spreadProperty().bind(anotherProperty))
      
      // Use shorthand form
      .spreadPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • widthPropertyApply

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

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