Class ResizingBehaviour
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.-
Nested Class Summary
Nested Classes -
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. -
Method Summary
Modifier and TypeMethodDescriptionfinal doubleGets the value of theoffsetproperty.final BiConsumer<Double, Double> Gets the value of theonResizeproperty.final javafx.collections.ObservableList<ResizingBehaviour.Operation> Gets the value of thesupportedOperationsproperty.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 theresizableproperty.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 theoffsetproperty.final voidsetOnResize(BiConsumer<Double, Double> onResize) Sets the value of theonResizeproperty.final voidsetResizable(boolean resizable) Sets the value of theresizableproperty.final voidsetSupportedOperations(javafx.collections.ObservableList<ResizingBehaviour.Operation> supportedOperations) Sets the value of thesupportedOperationsproperty.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.
- See Also:
-
-
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 theonResizeproperty.- Property description:
- A callback that will be invoked whenever the region is resized.
- Returns:
- the value of the
onResizeproperty - See Also:
-
onResizeProperty
A callback that will be invoked whenever the region is resized.- Returns:
- the onResize callback
- See Also:
-
setOnResize
Sets the value of theonResizeproperty.- Property description:
- A callback that will be invoked whenever the region is resized.
- Parameters:
onResize- the value for theonResizeproperty- See Also:
-
getOffset
public final double getOffset()Gets the value of theoffsetproperty.- 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.
- Returns:
- the value of the
offsetproperty - See Also:
-
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.- Returns:
- the
offsetproperty - See Also:
-
setOffset
public final void setOffset(double offset) Sets the value of theoffsetproperty.- 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.
- Parameters:
offset- the value for theoffsetproperty- See Also:
-
isResizable
public final boolean isResizable()Gets the value of theresizableproperty.- Property description:
- Determines if the pane can currently be resized or not.
Default is true.
- Returns:
- the value of the
resizableproperty - See Also:
-
resizableProperty
public final javafx.beans.property.BooleanProperty resizableProperty()Determines if the pane can currently be resized or not.Default is true.
- Returns:
- true if the pane is resizable
- See Also:
-
setResizable
public final void setResizable(boolean resizable) Sets the value of theresizableproperty.- Property description:
- Determines if the pane can currently be resized or not.
Default is true.
- Parameters:
resizable- the value for theresizableproperty- See Also:
-
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.
- Returns:
- the list of supported operations
- See Also:
-
getSupportedOperations
public final javafx.collections.ObservableList<ResizingBehaviour.Operation> getSupportedOperations()Gets the value of thesupportedOperationsproperty.- Property description:
- The list of supported operations for resizing the region.
By default, all operations are supported.
- Returns:
- the value of the
supportedOperationsproperty - See Also:
-
setSupportedOperations
public final void setSupportedOperations(javafx.collections.ObservableList<ResizingBehaviour.Operation> supportedOperations) Sets the value of thesupportedOperationsproperty.- Property description:
- The list of supported operations for resizing the region.
By default, all operations are supported.
- Parameters:
supportedOperations- the value for thesupportedOperationsproperty- See Also:
-
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.
-