java.lang.Object
com.dlsc.gemsfx.util.ResizingBehaviour
This class implements interactive resizing behavior for a
Region. It allows
the user to resize the region by pressed and dragging the region's edges. The resizing
behavior can be attached to any Region, modifying its preferred width and height as well
as its layout coordinates based on user interactions.-
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.DoublePropertyThe offset from the edges in pixels where the user will be able to perform a press and drag to resize the pane.final javafx.beans.property.ObjectProperty<BiConsumer<Double,Double>> A callback that will be invoked whenever the region is resized.final javafx.beans.property.BooleanPropertyDetermines if the pane can currently be resized or not.final javafx.beans.property.ListProperty<ResizingBehaviour.Operation>The list of supported operations for resizing the region. -
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal doubleGets the value of the property offset.final BiConsumer<Double,Double> Gets the value of the property onResize.final javafx.collections.ObservableList<ResizingBehaviour.Operation>Gets the value of the property supportedOperations.static ResizingBehaviourinstall(javafx.scene.layout.Region region) Installs the resizing behaviour on the given region.booleanReturns true if this ResizingBehaviour is installed on the region.static booleanisInstalled(javafx.scene.layout.Region region) Checks if a ResizingBehaviour is installed on the provided region.final booleanGets the value of the property resizable.final javafx.beans.property.DoublePropertyThe offset from the edges in pixels where the user will be able to perform a press and drag to resize the pane.final javafx.beans.property.ObjectProperty<BiConsumer<Double,Double>> A callback that will be invoked whenever the region is resized.final javafx.beans.property.BooleanPropertyDetermines if the pane can currently be resized or not.final voidsetOffset(double offset) Sets the value of the property offset.final voidsetOnResize(BiConsumer<Double, Double> onResize) Sets the value of the property onResize.final voidsetResizable(boolean resizable) Sets the value of the property resizable.final voidsetSupportedOperations(javafx.collections.ObservableList<ResizingBehaviour.Operation> supportedOperations) Sets the value of the property supportedOperations.final javafx.beans.property.ListProperty<ResizingBehaviour.Operation>The list of supported operations for resizing the region.voidUninstalls this ResizingBehaviour from the region, cleaning up all event handlers.
-
Property Details
-
onResize
A callback that will be invoked whenever the region is resized.- See Also:
-
offset
public final javafx.beans.property.DoubleProperty offsetPropertyThe offset from the edges in pixels where the user will be able to perform a press and drag to resize the pane. Default is 5.- See Also:
-
resizable
public final javafx.beans.property.BooleanProperty resizablePropertyDetermines if the pane can currently be resized or not.Default is true.
- See Also:
-
supportedOperations
public final javafx.beans.property.ListProperty<ResizingBehaviour.Operation> supportedOperationsPropertyThe list of supported operations for resizing the region.By default, all operations are supported.
-
-
Method Details
-
install
Installs the resizing behaviour on the given region. Once installed the user will be able to resize the given region (depending on the container the region lives in and the layout algorithms used by that container).- Parameters:
region- the region to support resizing- Returns:
- the installed behaviour
-
getOnResize
Gets the value of the property onResize.- Property description:
- A callback that will be invoked whenever the region is resized.
-
onResizeProperty
A callback that will be invoked whenever the region is resized.- See Also:
-
setOnResize
Sets the value of the property onResize.- Property description:
- A callback that will be invoked whenever the region is resized.
-
getOffset
public final double getOffset()Gets the value of the property offset.- Property description:
- The offset from the edges in pixels where the user will be able to perform a press and drag to resize the pane. Default is 5.
-
offsetProperty
public final javafx.beans.property.DoubleProperty offsetProperty()The offset from the edges in pixels where the user will be able to perform a press and drag to resize the pane. Default is 5.- See Also:
-
setOffset
public final void setOffset(double offset) Sets the value of the property offset.- Property description:
- The offset from the edges in pixels where the user will be able to perform a press and drag to resize the pane. Default is 5.
-
isResizable
public final boolean isResizable()Gets the value of the property resizable.- Property description:
- Determines if the pane can currently be resized or not.
Default is true.
-
resizableProperty
public final javafx.beans.property.BooleanProperty resizableProperty()Determines if the pane can currently be resized or not.Default is true.
- See Also:
-
setResizable
public final void setResizable(boolean resizable) Sets the value of the property resizable.- Property description:
- Determines if the pane can currently be resized or not.
Default is true.
-
supportedOperationsProperty
public final javafx.beans.property.ListProperty<ResizingBehaviour.Operation> supportedOperationsProperty()The list of supported operations for resizing the region.By default, all operations are supported.
-
getSupportedOperations
public final javafx.collections.ObservableList<ResizingBehaviour.Operation> getSupportedOperations()Gets the value of the property supportedOperations.- Property description:
- The list of supported operations for resizing the region.
By default, all operations are supported.
-
setSupportedOperations
public final void setSupportedOperations(javafx.collections.ObservableList<ResizingBehaviour.Operation> supportedOperations) Sets the value of the property supportedOperations.- Property description:
- The list of supported operations for resizing the region.
By default, all operations are supported.
-
isInstalled
public static boolean isInstalled(javafx.scene.layout.Region region) Checks if a ResizingBehaviour is installed on the provided region.- Parameters:
region- the region to check for installation- Returns:
- true if the behavior is installed, false otherwise
-
isInstalled
public boolean isInstalled()Returns true if this ResizingBehaviour is installed on the region.- Returns:
- true if installed, false otherwise
-
uninstall
public void uninstall()Uninstalls this ResizingBehaviour from the region, cleaning up all event handlers.
-