Class ScrollPane

All Implemented Interfaces:
LayoutMeasurable, LayoutMeasurableMixin, HasBackgroundProperty, HasBlendModeProperty, HasBorderProperty, HasClipProperty, HasEffectProperty, HasHeightProperty, HasLayoutXProperty, HasLayoutYProperty, HasManagedProperty, HasMaxHeightProperty, HasMaxWidthProperty, HasMinHeightProperty, HasMinWidthProperty, HasMouseTransparentProperty, HasOnMouseClickedProperty, HasOpacityProperty, HasPaddingProperty, HasParentProperty, HasPrefHeightProperty, HasPrefWidthProperty, HasSnapToPixelProperty, HasVisibleProperty, HasWidthProperty, Styleable, EventTarget, Skinnable, INode, PreferenceResizableNode

public class ScrollPane extends Control
Author:
Bruno Salmon
  • Property Details

  • Constructor Details

    • ScrollPane

      public ScrollPane()
    • ScrollPane

      public ScrollPane(Node content)
  • Method Details

    • shouldUseLayoutMeasurable

      public boolean shouldUseLayoutMeasurable()
      Overrides:
      shouldUseLayoutMeasurable in class Control
    • computeMinWidth

      protected double computeMinWidth(double height)
      Description copied from class: Control
      Computes the minimum allowable width of the Control, based on the provided height. The minimum width is not calculated within the Control, instead the calculation is delegated to the LayoutMeasurableMixin.minWidth(double) method of the Skin. If the Skin is null, the returned value is 0.
      Overrides:
      computeMinWidth in class Control
      Parameters:
      height - The height of the Control, in case this value might dictate the minimum width.
      Returns:
      A double representing the minimum width of this control.
    • computePrefWidth

      protected double computePrefWidth(double height)
      Description copied from class: Control
      Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.
      Overrides:
      computePrefWidth in class Control
      Parameters:
      height - the height that should be used if preferred width depends on it
      Returns:
      the computed preferred width for this region
    • computeMaxWidth

      protected double computeMaxWidth(double height)
      Description copied from class: Control
      Computes the maximum allowable width of the Control, based on the provided height. The maximum width is not calculated within the Control, instead the calculation is delegated to the LayoutMeasurableMixin.maxWidth(double) method of the Skin. If the Skin is null, the returned value is 0.
      Overrides:
      computeMaxWidth in class Control
      Parameters:
      height - The height of the Control, in case this value might dictate the maximum width.
      Returns:
      A double representing the maximum width of this control.
    • computeMinHeight

      protected double computeMinHeight(double width)
      Description copied from class: Control
      Computes the minimum allowable height of the Control, based on the provided width. The minimum height is not calculated within the Control, instead the calculation is delegated to the LayoutMeasurableMixin.minHeight(double) method of the Skin. If the Skin is null, the returned value is 0.
      Overrides:
      computeMinHeight in class Control
      Parameters:
      width - The width of the Control, in case this value might dictate the minimum height.
      Returns:
      A double representing the minimum height of this control.
    • computePrefHeight

      protected double computePrefHeight(double width)
      Description copied from class: Control
      Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.
      Overrides:
      computePrefHeight in class Control
      Parameters:
      width - the width that should be used if preferred height depends on it
      Returns:
      the computed preferred height for this region
    • computeMaxHeight

      protected double computeMaxHeight(double width)
      Description copied from class: Control
      Computes the maximum allowable height of the Control, based on the provided width. The maximum height is not calculated within the Control, instead the calculation is delegated to the LayoutMeasurableMixin.maxHeight(double) method of the Skin. If the Skin is null, the returned value is 0.
      Overrides:
      computeMaxHeight in class Control
      Parameters:
      width - The width of the Control, in case this value might dictate the maximum height.
      Returns:
      A double representing the maximum height of this control.
    • sceneToLocal

      protected void sceneToLocal(Point2D pt)
      Overrides:
      sceneToLocal in class Node
    • localToScene

      protected void localToScene(Point2D pt)
      Overrides:
      localToScene in class Node
    • hbarPolicyProperty

      public Property<ScrollPane.ScrollBarPolicy> hbarPolicyProperty()
      Returns:
      the hbarPolicy property
      See Also:
    • setHbarPolicy

      public final void setHbarPolicy(ScrollPane.ScrollBarPolicy value)
      Sets the value of the hbarPolicy property.
      Property description:
      Parameters:
      value - the value for the hbarPolicy property
      See Also:
    • getHbarPolicy

      public ScrollPane.ScrollBarPolicy getHbarPolicy()
      Gets the value of the hbarPolicy property.
      Property description:
      Returns:
      the value of the hbarPolicy property
      See Also:
    • vbarPolicyProperty

      public Property<ScrollPane.ScrollBarPolicy> vbarPolicyProperty()
      Returns:
      the vbarPolicy property
    • setvbarPolicy

      public final void setvbarPolicy(ScrollPane.ScrollBarPolicy value)
    • getvbarPolicy

      public ScrollPane.ScrollBarPolicy getvbarPolicy()
    • setContent

      public final void setContent(Node value)
      Sets the value of the content property.
      Property description:
      The node used as the content of this ScrollPane.
      Parameters:
      value - the value for the content property
      See Also:
    • getContent

      public final Node getContent()
      Gets the value of the content property.
      Property description:
      The node used as the content of this ScrollPane.
      Returns:
      the value of the content property
      See Also:
    • contentProperty

      public final ObjectProperty<Node> contentProperty()
      The node used as the content of this ScrollPane.
      Returns:
      the content property
      See Also:
    • setHvalue

      public final void setHvalue(double value)
      Sets the value of the hvalue property.
      Property description:
      The current horizontal scroll position of the ScrollPane. This value may be set by the application to scroll the view programatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of hmin to hmax. When hvalue equals hmin, the contained node is positioned so that its layoutBounds minX is visible. When hvalue equals hmax, the contained node is positioned so that its layoutBounds maxX is visible. When hvalue is between hmin and hmax, the contained node is positioned proportionally between layoutBounds minX and layoutBounds maxX.
      Parameters:
      value - the value for the hvalue property
      See Also:
    • getHvalue

      public final double getHvalue()
      Gets the value of the hvalue property.
      Property description:
      The current horizontal scroll position of the ScrollPane. This value may be set by the application to scroll the view programatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of hmin to hmax. When hvalue equals hmin, the contained node is positioned so that its layoutBounds minX is visible. When hvalue equals hmax, the contained node is positioned so that its layoutBounds maxX is visible. When hvalue is between hmin and hmax, the contained node is positioned proportionally between layoutBounds minX and layoutBounds maxX.
      Returns:
      the value of the hvalue property
      See Also:
    • hvalueProperty

      public final DoubleProperty hvalueProperty()
      The current horizontal scroll position of the ScrollPane. This value may be set by the application to scroll the view programatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of hmin to hmax. When hvalue equals hmin, the contained node is positioned so that its layoutBounds minX is visible. When hvalue equals hmax, the contained node is positioned so that its layoutBounds maxX is visible. When hvalue is between hmin and hmax, the contained node is positioned proportionally between layoutBounds minX and layoutBounds maxX.
      Returns:
      the hvalue property
      See Also:
    • setVvalue

      public final void setVvalue(double value)
      Sets the value of the vvalue property.
      Property description:
      The current vertical scroll position of the ScrollPane. This value may be set by the application to scroll the view programatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of vmin to vmax. When vvalue equals vmin, the contained node is positioned so that its layoutBounds minY is visible. When vvalue equals vmax, the contained node is positioned so that its layoutBounds maxY is visible. When vvalue is between vmin and vmax, the contained node is positioned proportionally between layoutBounds minY and layoutBounds maxY.
      Parameters:
      value - the value for the vvalue property
      See Also:
    • getVvalue

      public final double getVvalue()
      Gets the value of the vvalue property.
      Property description:
      The current vertical scroll position of the ScrollPane. This value may be set by the application to scroll the view programatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of vmin to vmax. When vvalue equals vmin, the contained node is positioned so that its layoutBounds minY is visible. When vvalue equals vmax, the contained node is positioned so that its layoutBounds maxY is visible. When vvalue is between vmin and vmax, the contained node is positioned proportionally between layoutBounds minY and layoutBounds maxY.
      Returns:
      the value of the vvalue property
      See Also:
    • vvalueProperty

      public final DoubleProperty vvalueProperty()
      The current vertical scroll position of the ScrollPane. This value may be set by the application to scroll the view programatically. The ScrollPane will update this value whenever the viewport is scrolled or panned by the user. This value must always be within the range of vmin to vmax. When vvalue equals vmin, the contained node is positioned so that its layoutBounds minY is visible. When vvalue equals vmax, the contained node is positioned so that its layoutBounds maxY is visible. When vvalue is between vmin and vmax, the contained node is positioned proportionally between layoutBounds minY and layoutBounds maxY.
      Returns:
      the vvalue property
      See Also:
    • setHmin

      public final void setHmin(double value)
      Sets the value of the hmin property.
      Property description:
      The minimum allowable hvalue for this ScrollPane. Default value is 0.
      Parameters:
      value - the value for the hmin property
      See Also:
    • getHmin

      public final double getHmin()
      Gets the value of the hmin property.
      Property description:
      The minimum allowable hvalue for this ScrollPane. Default value is 0.
      Returns:
      the value of the hmin property
      See Also:
    • hminProperty

      public final DoubleProperty hminProperty()
      The minimum allowable hvalue for this ScrollPane. Default value is 0.
      Returns:
      the hmin property
      See Also:
    • setVmin

      public final void setVmin(double value)
      Sets the value of the vmin property.
      Property description:
      The minimum allowable vvalue for this ScrollPane. Default value is 0.
      Parameters:
      value - the value for the vmin property
      See Also:
    • getVmin

      public final double getVmin()
      Gets the value of the vmin property.
      Property description:
      The minimum allowable vvalue for this ScrollPane. Default value is 0.
      Returns:
      the value of the vmin property
      See Also:
    • vminProperty

      public final DoubleProperty vminProperty()
      The minimum allowable vvalue for this ScrollPane. Default value is 0.
      Returns:
      the vmin property
      See Also:
    • setHmax

      public final void setHmax(double value)
      Sets the value of the hmax property.
      Property description:
      The maximum allowable hvalue for this ScrollPane. Default value is 1.
      Parameters:
      value - the value for the hmax property
      See Also:
    • getHmax

      public final double getHmax()
      Gets the value of the hmax property.
      Property description:
      The maximum allowable hvalue for this ScrollPane. Default value is 1.
      Returns:
      the value of the hmax property
      See Also:
    • hmaxProperty

      public final DoubleProperty hmaxProperty()
      The maximum allowable hvalue for this ScrollPane. Default value is 1.
      Returns:
      the hmax property
      See Also:
    • setVmax

      public final void setVmax(double value)
      Sets the value of the vmax property.
      Property description:
      The maximum allowable vvalue for this ScrollPane. Default value is 1.
      Parameters:
      value - the value for the vmax property
      See Also:
    • getVmax

      public final double getVmax()
      Gets the value of the vmax property.
      Property description:
      The maximum allowable vvalue for this ScrollPane. Default value is 1.
      Returns:
      the value of the vmax property
      See Also:
    • vmaxProperty

      public final DoubleProperty vmaxProperty()
      The maximum allowable vvalue for this ScrollPane. Default value is 1.
      Returns:
      the vmax property
      See Also:
    • setViewportBounds

      public final void setViewportBounds(Bounds value)
      Sets the value of the viewportBounds property.
      Property description:
      The actual Bounds of the ScrollPane Viewport. This is the Bounds of the content node.
      Parameters:
      value - the value for the viewportBounds property
      See Also:
    • getViewportBounds

      public final Bounds getViewportBounds()
      Gets the value of the viewportBounds property.
      Property description:
      The actual Bounds of the ScrollPane Viewport. This is the Bounds of the content node.
      Returns:
      the value of the viewportBounds property
      See Also:
    • viewportBoundsProperty

      public final ObjectProperty<Bounds> viewportBoundsProperty()
      The actual Bounds of the ScrollPane Viewport. This is the Bounds of the content node.
      Returns:
      the viewportBounds property
      See Also:
    • fitToWidthProperty

      public BooleanProperty fitToWidthProperty()
      Returns:
      the fitToWidth property
      See Also:
    • isFitToWidth

      public boolean isFitToWidth()
      Gets the value of the fitToWidth property.
      Property description:
      Returns:
      the value of the fitToWidth property
      See Also:
    • setFitToWidth

      public void setFitToWidth(boolean fitWidth)
      Sets the value of the fitToWidth property.
      Property description:
      Parameters:
      fitWidth - the value for the fitToWidth property
      See Also:
    • fitToHeightProperty

      public BooleanProperty fitToHeightProperty()
      Returns:
      the fitToHeight property
      See Also:
    • isFitToHeight

      public boolean isFitToHeight()
      Gets the value of the fitToHeight property.
      Property description:
      Returns:
      the value of the fitToHeight property
      See Also:
    • setFitToHeight

      public void setFitToHeight(boolean fitHeight)
      Sets the value of the fitToHeight property.
      Property description:
      Parameters:
      fitHeight - the value for the fitToHeight property
      See Also:
    • layoutChildren

      protected void layoutChildren()
      Description copied from class: Control
      Invoked during the layout pass to layout the children in this Parent. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.

      Subclasses should override this function to layout content as needed.

      Overrides:
      layoutChildren in class Control
    • setOnChildrenLayout

      public void setOnChildrenLayout(Runnable onChildrenLayout)