Class ColumnConstraintsBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.ColumnConstraintsBuilder
The
ColumnConstraintsBuilder class constructs instances of the ColumnConstraints 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 ColumnConstraints constructor
and returns an instance of the ColumnConstraintsBuilder.
You can use method chaining to call the builder methods for configuring the ColumnConstraints.
Finally, invoke the build method to generate an instance of the ColumnConstraints 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<ColumnConstraints> func) Applies a function to the ColumnConstraints instance being constructed.build()Builds and returns an instance of theColumnConstraintsclass.static ColumnConstraintsBuildercreate()Returns an instance of theColumnConstraintsBuilder.static ColumnConstraintsBuildercreate(double width) Accepts the constructor arguments ofColumnConstraints(double)and returns an instance ofColumnConstraintsBuilder.static ColumnConstraintsBuildercreate(double minWidth, double prefWidth, double maxWidth) Accepts the constructor arguments ofColumnConstraints(double, double, double)and returns an instance ofColumnConstraintsBuilder.static ColumnConstraintsBuildercreate(double minWidth, double prefWidth, double maxWidth, Priority hgrow, HPos halignment, boolean fillWidth) Accepts the constructor arguments ofColumnConstraints(double, double, double, Priority, HPos, boolean)and returns an instance ofColumnConstraintsBuilder.fillWidth(boolean value) A builder method that invokes thesetFillWidthmethod on the instance being constructed.Applies a function to thefillWidthPropertyof the instance being constructed.halignment(HPos value) A builder method that invokes thesetHalignmentmethod on the instance being constructed.Applies a function to thehalignmentPropertyof the instance being constructed.A builder method that invokes thesetHgrowmethod on the instance being constructed.Applies a function to thehgrowPropertyof the instance being constructed.maxWidth(double value) A builder method that invokes thesetMaxWidthmethod on the instance being constructed.Applies a function to themaxWidthPropertyof the instance being constructed.minWidth(double value) A builder method that invokes thesetMinWidthmethod on the instance being constructed.Applies a function to theminWidthPropertyof the instance being constructed.percentWidth(double value) A builder method that invokes thesetPercentWidthmethod on the instance being constructed.Applies a function to thepercentWidthPropertyof the instance being constructed.prefWidth(double value) A builder method that invokes thesetPrefWidthmethod on the instance being constructed.Applies a function to theprefWidthPropertyof the instance being constructed.
-
Method Details
-
create
Returns an instance of theColumnConstraintsBuilder.- Returns:
- an instance of the
ColumnConstraintsBuilder.
-
create
Accepts the constructor arguments ofColumnConstraints(double)and returns an instance ofColumnConstraintsBuilder.- Returns:
- an instance of the
ColumnConstraintsBuilder.
-
create
Accepts the constructor arguments ofColumnConstraints(double, double, double)and returns an instance ofColumnConstraintsBuilder.- Returns:
- an instance of the
ColumnConstraintsBuilder.
-
create
public static ColumnConstraintsBuilder create(double minWidth, double prefWidth, double maxWidth, Priority hgrow, HPos halignment, boolean fillWidth) Accepts the constructor arguments ofColumnConstraints(double, double, double, Priority, HPos, boolean)and returns an instance ofColumnConstraintsBuilder.- Returns:
- an instance of the
ColumnConstraintsBuilder.
-
build
Builds and returns an instance of theColumnConstraintsclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
ColumnConstraintsclass
-
apply
Applies a function to the ColumnConstraints instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
fillWidth
A builder method that invokes thesetFillWidthmethod on the instance being constructed.- Returns:
- builder instance
-
halignment
A builder method that invokes thesetHalignmentmethod on the instance being constructed.- Returns:
- builder instance
-
hgrow
A builder method that invokes thesetHgrowmethod on the instance being constructed.- Returns:
- builder instance
-
maxWidth
A builder method that invokes thesetMaxWidthmethod on the instance being constructed.- Returns:
- builder instance
-
minWidth
A builder method that invokes thesetMinWidthmethod on the instance being constructed.- Returns:
- builder instance
-
percentWidth
A builder method that invokes thesetPercentWidthmethod on the instance being constructed.- Returns:
- builder instance
-
prefWidth
A builder method that invokes thesetPrefWidthmethod on the instance being constructed.- Returns:
- builder instance
-
fillWidthPropertyApply
Applies a function to thefillWidthPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.fillWidthProperty().bind(anotherProperty)) // Use shorthand form .fillWidthPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
halignmentPropertyApply
Applies a function to thehalignmentPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.halignmentProperty().bind(anotherProperty)) // Use shorthand form .halignmentPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
hgrowPropertyApply
Applies a function to thehgrowPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.hgrowProperty().bind(anotherProperty)) // Use shorthand form .hgrowPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
maxWidthPropertyApply
Applies a function to themaxWidthPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.maxWidthProperty().bind(anotherProperty)) // Use shorthand form .maxWidthPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
minWidthPropertyApply
Applies a function to theminWidthPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.minWidthProperty().bind(anotherProperty)) // Use shorthand form .minWidthPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
percentWidthPropertyApply
Applies a function to thepercentWidthPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.percentWidthProperty().bind(anotherProperty)) // Use shorthand form .percentWidthPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
prefWidthPropertyApply
Applies a function to theprefWidthPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.prefWidthProperty().bind(anotherProperty)) // Use shorthand form .prefWidthPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-