Class ReflectionBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.ReflectionBuilder
The
ReflectionBuilder
class constructs instances of the Reflection
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 Reflection
constructor
and returns an instance of the ReflectionBuilder
.
You can use method chaining to call the builder methods for configuring the Reflection
.
Finally, invoke the build
method to generate an instance of the Reflection
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 Summary
Modifier and TypeMethodDescriptionapply
(Consumer<Reflection> func) Applies a function to the Reflection instance being constructed.bottomOpacity
(double value) A builder method that invokes thesetBottomOpacity
method on the instance being constructed.Applies a function to thebottomOpacityProperty
of the instance being constructed.build()
Builds and returns an instance of theReflection
class.static ReflectionBuilder
create()
Returns an instance of theReflectionBuilder
.static ReflectionBuilder
create
(double topOffset, double fraction, double topOpacity, double bottomOpacity) Accepts the constructor arguments ofReflection(double, double, double, double)
and returns an instance ofReflectionBuilder
.fraction
(double value) A builder method that invokes thesetFraction
method on the instance being constructed.Applies a function to thefractionProperty
of the instance being constructed.A builder method that invokes thesetInput
method on the instance being constructed.Applies a function to theinputProperty
of the instance being constructed.topOffset
(double value) A builder method that invokes thesetTopOffset
method on the instance being constructed.Applies a function to thetopOffsetProperty
of the instance being constructed.topOpacity
(double value) A builder method that invokes thesetTopOpacity
method on the instance being constructed.Applies a function to thetopOpacityProperty
of the instance being constructed.
-
Method Details
-
create
Returns an instance of theReflectionBuilder
.- Returns:
- an instance of the
ReflectionBuilder
.
-
create
public static ReflectionBuilder create(double topOffset, double fraction, double topOpacity, double bottomOpacity) Accepts the constructor arguments ofReflection(double, double, double, double)
and returns an instance ofReflectionBuilder
.- Returns:
- an instance of the
ReflectionBuilder
.
-
build
Builds and returns an instance of theReflection
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
Reflection
class
-
apply
Applies a function to the Reflection instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
bottomOpacity
A builder method that invokes thesetBottomOpacity
method on the instance being constructed.- Returns:
- builder instance
-
fraction
A builder method that invokes thesetFraction
method on the instance being constructed.- Returns:
- builder instance
-
input
A builder method that invokes thesetInput
method on the instance being constructed.- Returns:
- builder instance
-
topOffset
A builder method that invokes thesetTopOffset
method on the instance being constructed.- Returns:
- builder instance
-
topOpacity
A builder method that invokes thesetTopOpacity
method on the instance being constructed.- Returns:
- builder instance
-
bottomOpacityPropertyApply
Applies a function to thebottomOpacityProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.bottomOpacityProperty().bind(anotherProperty)) // Use shorthand form .bottomOpacityPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
fractionPropertyApply
Applies a function to thefractionProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.fractionProperty().bind(anotherProperty)) // Use shorthand form .fractionPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
inputPropertyApply
Applies a function to theinputProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.inputProperty().bind(anotherProperty)) // Use shorthand form .inputPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
topOffsetPropertyApply
Applies a function to thetopOffsetProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.topOffsetProperty().bind(anotherProperty)) // Use shorthand form .topOffsetPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
topOpacityPropertyApply
Applies a function to thetopOpacityProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.topOpacityProperty().bind(anotherProperty)) // Use shorthand form .topOpacityPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-