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 property onResize.
      Property description:
      A callback that will be invoked whenever the region is resized.
    • onResizeProperty

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

      public final void setOnResize(BiConsumer<Double,Double> onResize)
      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.

      See Also:
    • 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.