Spec-Zone .ru
спецификации, руководства, описания, API
|
public class ScrollPane extends Control
The ScrollPane allows the application to set the current, minimum, and
maximum values for positioning the contents in the horizontal and
vertical directions. These values are mapped proportionally onto the
layoutBounds
of the contained node.
ScrollPane layout calculations are based on the layoutBounds rather than the boundsInParent (visual bounds) of the scroll node. If an application wants the scrolling to be based on the visual bounds of the node (for scaled content etc.), they need to wrap the scroll node in a Group.
ScrollPane sets focusTraversable to false.
This example creates a ScrollPane, which contains a Rectangle :
import javafx.scene.control.ScrollPane;
import javafx.scene.shape.Rectangle;
Rectangle rect = new Rectangle(200, 200, Color.RED);
ScrollPane s1 = new ScrollPane();
s1.setPrefSize(120, 120);
s1.setContent(rect);
Implementation of ScrollPane According to JavaFX UI Control API SpecificationType | Property and Description |
---|---|
ObjectProperty<Node> |
content
The node used as the content of this ScrollPane.
|
BooleanProperty |
fitToHeight
If true and if the contained node is a Resizable, then the node will be
kept resized to match the height of the ScrollPane's viewport.
|
BooleanProperty |
fitToWidth
If true and if the contained node is a Resizable, then the node will be
kept resized to match the width of the ScrollPane's viewport.
|
ObjectProperty<ScrollPane.ScrollBarPolicy> |
hbarPolicy
Specifies the policy for showing the horizontal scroll bar.
|
DoubleProperty |
hmax
The maximum allowable
hvalue for this ScrollPane. |
DoubleProperty |
hmin
The minimum allowable
hvalue for this ScrollPane. |
DoubleProperty |
hvalue
The current horizontal scroll position of the ScrollPane.
|
BooleanProperty |
pannable
Specifies whether the user should be able to pan the viewport by using
the mouse.
|
DoubleProperty |
prefViewportHeight
Specify the preferred height of the ScrollPane Viewport.
|
DoubleProperty |
prefViewportWidth
Specify the perferred width of the ScrollPane Viewport.
|
ObjectProperty<ScrollPane.ScrollBarPolicy> |
vbarPolicy
Specifies the policy for showing the vertical scroll bar.
|
ObjectProperty<Bounds> |
viewportBounds
The actual Bounds of the ScrollPane Viewport.
|
DoubleProperty |
vmax
The maximum allowable
vvalue for this ScrollPane. |
DoubleProperty |
vmin
The minimum allowable
vvalue for this ScrollPane. |
DoubleProperty |
vvalue
The current vertical scroll position of the ScrollPane.
|
contextMenuProperty, heightProperty, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, prefHeightProperty, prefWidthProperty, skinProperty, tooltipProperty, widthProperty
needsLayoutProperty
blendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, managedProperty, mouseTransparentProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onScrollProperty, opacityProperty, parentProperty, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty
Modifier and Type | Class and Description |
---|---|
static class |
ScrollPane.ScrollBarPolicy
An enumeration denoting the policy to be used by a scrollable
Control in deciding whether to show a scroll bar.
|
USE_COMPUTED_SIZE, USE_PREF_SIZE
Constructor and Description |
---|
ScrollPane()
Creates a new ScrollPane.
|
Modifier and Type | Method and Description |
---|---|
ObjectProperty<Node> |
contentProperty()
The node used as the content of this ScrollPane.
|
BooleanProperty |
fitToHeightProperty()
If true and if the contained node is a Resizable, then the node will be
kept resized to match the height of the ScrollPane's viewport.
|
BooleanProperty |
fitToWidthProperty()
If true and if the contained node is a Resizable, then the node will be
kept resized to match the width of the ScrollPane's viewport.
|
Node |
getContent()
The node used as the content of this ScrollPane.
|
ScrollPane.ScrollBarPolicy |
getHbarPolicy()
Specifies the policy for showing the horizontal scroll bar.
|
double |
getHmax()
The maximum allowable
hvalue for this ScrollPane. |
double |
getHmin()
The minimum allowable
hvalue for this ScrollPane. |
double |
getHvalue()
The current horizontal scroll position of the ScrollPane.
|
double |
getPrefViewportHeight()
Specify the preferred height of the ScrollPane Viewport.
|
double |
getPrefViewportWidth()
Specify the perferred width of the ScrollPane Viewport.
|
ScrollPane.ScrollBarPolicy |
getVbarPolicy()
Specifies the policy for showing the vertical scroll bar.
|
Bounds |
getViewportBounds()
The actual Bounds of the ScrollPane Viewport.
|
double |
getVmax()
The maximum allowable
vvalue for this ScrollPane. |
double |
getVmin()
The minimum allowable
vvalue for this ScrollPane. |
double |
getVvalue()
The current vertical scroll position of the ScrollPane.
|
ObjectProperty<ScrollPane.ScrollBarPolicy> |
hbarPolicyProperty()
Specifies the policy for showing the horizontal scroll bar.
|
DoubleProperty |
hmaxProperty()
The maximum allowable
hvalue for this ScrollPane. |
DoubleProperty |
hminProperty()
The minimum allowable
hvalue for this ScrollPane. |
DoubleProperty |
hvalueProperty()
The current horizontal scroll position of the ScrollPane.
|
boolean |
isFitToHeight()
If true and if the contained node is a Resizable, then the node will be
kept resized to match the height of the ScrollPane's viewport.
|
boolean |
isFitToWidth()
If true and if the contained node is a Resizable, then the node will be
kept resized to match the width of the ScrollPane's viewport.
|
boolean |
isPannable()
Specifies whether the user should be able to pan the viewport by using
the mouse.
|
BooleanProperty |
pannableProperty()
Specifies whether the user should be able to pan the viewport by using
the mouse.
|
DoubleProperty |
prefViewportHeightProperty()
Specify the preferred height of the ScrollPane Viewport.
|
DoubleProperty |
prefViewportWidthProperty()
Specify the perferred width of the ScrollPane Viewport.
|
void |
setContent(Node value)
The node used as the content of this ScrollPane.
|
void |
setFitToHeight(boolean value)
If true and if the contained node is a Resizable, then the node will be
kept resized to match the height of the ScrollPane's viewport.
|
void |
setFitToWidth(boolean value)
If true and if the contained node is a Resizable, then the node will be
kept resized to match the width of the ScrollPane's viewport.
|
void |
setHbarPolicy(ScrollPane.ScrollBarPolicy value)
Specifies the policy for showing the horizontal scroll bar.
|
void |
setHmax(double value)
The maximum allowable
hvalue for this ScrollPane. |
void |
setHmin(double value)
The minimum allowable
hvalue for this ScrollPane. |
void |
setHvalue(double value)
The current horizontal scroll position of the ScrollPane.
|
void |
setPannable(boolean value)
Specifies whether the user should be able to pan the viewport by using
the mouse.
|
void |
setPrefViewportHeight(double value)
Specify the preferred height of the ScrollPane Viewport.
|
void |
setPrefViewportWidth(double value)
Specify the perferred width of the ScrollPane Viewport.
|
void |
setVbarPolicy(ScrollPane.ScrollBarPolicy value)
Specifies the policy for showing the vertical scroll bar.
|
void |
setViewportBounds(Bounds value)
The actual Bounds of the ScrollPane Viewport.
|
void |
setVmax(double value)
The maximum allowable
vvalue for this ScrollPane. |
void |
setVmin(double value)
The minimum allowable
vvalue for this ScrollPane. |
void |
setVvalue(double value)
The current vertical scroll position of the ScrollPane.
|
ObjectProperty<ScrollPane.ScrollBarPolicy> |
vbarPolicyProperty()
Specifies the policy for showing the vertical scroll bar.
|
ObjectProperty<Bounds> |
viewportBoundsProperty()
The actual Bounds of the ScrollPane Viewport.
|
DoubleProperty |
vmaxProperty()
The maximum allowable
vvalue for this ScrollPane. |
DoubleProperty |
vminProperty()
The minimum allowable
vvalue for this ScrollPane. |
DoubleProperty |
vvalueProperty()
The current vertical scroll position of the ScrollPane.
|
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, getSkin, getTooltip, getUserAgentStylesheet, getWidth, heightProperty, intersects, isResizable, layoutChildren, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, setContextMenu, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setPrefHeight, setPrefSize, setPrefWidth, setSkin, setTooltip, setWidth, skinProperty, tooltipProperty, widthProperty
getChildren, getChildrenUnmodifiable, getManagedChildren, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, setNeedsLayout
addEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOpacity, getParent, getProperties, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScene, lookupAll, managedProperty, mouseTransparentProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onScrollProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, startDragAndDrop, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, visibleProperty
getContent()
,
setContent(Node)
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
.getHvalue()
,
setHvalue(double)
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
.getVvalue()
,
setVvalue(double)
hvalue
for this ScrollPane.getHmin()
,
setHmin(double)
vvalue
for this ScrollPane.getVmin()
,
setVmin(double)
hvalue
for this ScrollPane.getHmax()
,
setHmax(double)
vvalue
for this ScrollPane.getVmax()
,
setVmax(double)
isFitToWidth()
,
setFitToWidth(boolean)
isFitToHeight()
,
setFitToHeight(boolean)
pannable
is consulted to determine if the events should be
used for panning.isPannable()
,
setPannable(boolean)
getViewportBounds()
,
setViewportBounds(Bounds)
public final void setHbarPolicy(ScrollPane.ScrollBarPolicy value)
public final ScrollPane.ScrollBarPolicy getHbarPolicy()
public final ObjectProperty<ScrollPane.ScrollBarPolicy> hbarPolicyProperty()
public final void setVbarPolicy(ScrollPane.ScrollBarPolicy value)
public final ScrollPane.ScrollBarPolicy getVbarPolicy()
public final ObjectProperty<ScrollPane.ScrollBarPolicy> vbarPolicyProperty()
public final void setContent(Node value)
public final Node getContent()
public final ObjectProperty<Node> contentProperty()
getContent()
,
setContent(Node)
public final void setHvalue(double value)
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
.public final double getHvalue()
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
.public final DoubleProperty hvalueProperty()
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
.getHvalue()
,
setHvalue(double)
public final void setVvalue(double value)
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
.public final double getVvalue()
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
.public final DoubleProperty vvalueProperty()
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
.getVvalue()
,
setVvalue(double)
public final void setHmin(double value)
hvalue
for this ScrollPane.public final double getHmin()
hvalue
for this ScrollPane.public final DoubleProperty hminProperty()
hvalue
for this ScrollPane.getHmin()
,
setHmin(double)
public final void setVmin(double value)
vvalue
for this ScrollPane.public final double getVmin()
vvalue
for this ScrollPane.public final DoubleProperty vminProperty()
vvalue
for this ScrollPane.getVmin()
,
setVmin(double)
public final void setHmax(double value)
hvalue
for this ScrollPane.public final double getHmax()
hvalue
for this ScrollPane.public final DoubleProperty hmaxProperty()
hvalue
for this ScrollPane.getHmax()
,
setHmax(double)
public final void setVmax(double value)
vvalue
for this ScrollPane.public final double getVmax()
vvalue
for this ScrollPane.public final DoubleProperty vmaxProperty()
vvalue
for this ScrollPane.getVmax()
,
setVmax(double)
public final void setFitToWidth(boolean value)
public final boolean isFitToWidth()
public final BooleanProperty fitToWidthProperty()
isFitToWidth()
,
setFitToWidth(boolean)
public final void setFitToHeight(boolean value)
public final boolean isFitToHeight()
public final BooleanProperty fitToHeightProperty()
isFitToHeight()
,
setFitToHeight(boolean)
public final void setPannable(boolean value)
pannable
is consulted to determine if the events should be
used for panning.public final boolean isPannable()
pannable
is consulted to determine if the events should be
used for panning.public final BooleanProperty pannableProperty()
pannable
is consulted to determine if the events should be
used for panning.isPannable()
,
setPannable(boolean)
public final void setPrefViewportWidth(double value)
public final double getPrefViewportWidth()
public final DoubleProperty prefViewportWidthProperty()
public final void setPrefViewportHeight(double value)
public final double getPrefViewportHeight()
public final DoubleProperty prefViewportHeightProperty()
public final void setViewportBounds(Bounds value)
public final Bounds getViewportBounds()
public final ObjectProperty<Bounds> viewportBoundsProperty()
getViewportBounds()
,
setViewportBounds(Bounds)
Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to