Class ResizingBehaviour

java.lang.Object
com.dlsc.gemsfx.util.ResizingBehaviour

public class ResizingBehaviour extends Object
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 Details

  • Method Details

    • install

      public static ResizingBehaviour install(javafx.scene.layout.Region region)
      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

      public final BiConsumer<Double,Double> getOnResize()
      Gets the value of the onResize property.
      Property description:
      A callback that will be invoked whenever the region is resized.
      Returns:
      the value of the onResize property
      See Also:
    • onResizeProperty

      public final javafx.beans.property.ObjectProperty<BiConsumer<Double,Double>> onResizeProperty()
      A callback that will be invoked whenever the region is resized.
      Returns:
      the onResize callback
      See Also:
    • setOnResize

      public final void setOnResize(BiConsumer<Double,Double> onResize)
      Sets the value of the onResize property.
      Property description:
      A callback that will be invoked whenever the region is resized.
      Parameters:
      onResize - the value for the onResize property
      See Also:
    • getOffset

      public final double getOffset()
      Gets the value of the offset property.
      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 offset property
      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 offset property
      See Also:
    • setOffset

      public final void setOffset(double offset)
      Sets the value of the offset property.
      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 the offset property
      See Also:
    • isResizable

      public final boolean isResizable()
      Gets the value of the resizable property.
      Property description:
      Determines if the pane can currently be resized or not.

      Default is true.

      Returns:
      the value of the resizable property
      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 the resizable property.
      Property description:
      Determines if the pane can currently be resized or not.

      Default is true.

      Parameters:
      resizable - the value for the resizable property
      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 the supportedOperations property.
      Property description:
      The list of supported operations for resizing the region.

      By default, all operations are supported.

      Returns:
      the value of the supportedOperations property
      See Also:
    • setSupportedOperations

      public final void setSupportedOperations(javafx.collections.ObservableList<ResizingBehaviour.Operation> supportedOperations)
      Sets the value of the supportedOperations property.
      Property description:
      The list of supported operations for resizing the region.

      By default, all operations are supported.

      Parameters:
      supportedOperations - the value for the supportedOperations property
      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.